valkey-io / valkey

A new project to resume development on the formerly open-source Redis project. We're calling it Valkey, since it's a twist on the key-value datastore.

Home Page:https://valkey.io

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[BUG] 32-bit arch may need linking to libatomic, otherwise build fails

barracuda156 opened this issue · comments

Describe the bug

Nothing checks for support of 8-byte atomics in hardware. So linking to libatomic is not done where required.

To reproduce

Build on ppc or arm.

Expected behavior

-latomic should be passed when needed.

Additional information

/opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_databases_valkey/valkey/work/compwrap/cc/opt/local/bin/gcc-mp-13 -Wl,-headerpad_max_install_names -L/opt/local/lib -lMacportsLegacySupport -arch ppc -O3 -flto -g -ggdb -L/usr/local/opt/openssl/lib -o valkey-benchmark ae.o anet.o valkey-benchmark.o adlist.o dict.o zmalloc.o redisassert.o release.o crcspeed.o crc64.o siphash.o crc16.o monotonic.o cli_common.o mt19937-64.o strl.o ../deps/hiredis/libhiredis.a ../deps/hdr_histogram/libhdrhistogram.a ../deps/jemalloc/lib/libjemalloc.a -lm -ldl ../deps/hiredis/libhiredis_ssl.a -L/opt/local/libexec/openssl3/lib -lssl -L/opt/local/libexec/openssl3/lib -lcrypto 
ld: warning: directory '/usr/local/opt/openssl/lib' following -L not found
Undefined symbols:
  "___atomic_fetch_add_8", referenced from:
      _hdr_record_values_atomic in libhdrhistogram.a(hdr_histogram.o)
      _hdr_record_values_atomic in libhdrhistogram.a(hdr_histogram.o)
  "___atomic_load_8", referenced from:
      _hdr_record_values_atomic in libhdrhistogram.a(hdr_histogram.o)
      _hdr_record_values_atomic in libhdrhistogram.a(hdr_histogram.o)
  "___atomic_compare_exchange_8", referenced from:
      _hdr_record_values_atomic in libhdrhistogram.a(hdr_histogram.o)
      _hdr_record_values_atomic in libhdrhistogram.a(hdr_histogram.o)
ld: symbol(s) not found
collect2: error: ld returned 1 exit status