Skip to content

Switch from old sync* built-ins to modern atomic* ones: Undefined symbols for architecture ppc: "___sync_add_and_fetch_8" #2836

@barracuda156

Description

@barracuda156

Current code is broken on 32-bit, since it uses old sync_* built-ins, not supported by libatomic:

/opt/local/bin/gcc-mp-14 -O2 -DSYSCONFDIR=\"/opt/local/etc\" -Wall -Wextra -Wnested-externs -Wformat=2 -g -Wmissing-prototypes -Wstrict-prototypes -Wmissing-declarations -Wwrite-strings -Wshadow -Wpointer-arith -Wsign-compare -Wbad-function-cast -Wcast-align -Wdeclaration-after-statement -Wshadow -Wold-style-definition  -pipe -I/opt/local/libexec/openssl3/include -Os -arch ppc -pthread  -L/opt/local/libexec/openssl3/lib -Wl,-headerpad_max_install_names -L/opt/local/lib -lMacportsLegacySupport -arch ppc -o goaccess src/base64.o src/browsers.o src/color.o src/commons.o src/csv.o src/error.o src/gdashboard.o src/gdns.o src/gholder.o src/gkhash.o src/gkmhash.o src/gmenu.o src/goaccess.o src/gslist.o src/gstorage.o src/gwsocket.o src/json.o src/opesys.o src/options.o src/output.o src/parser.o src/persistence.o src/pdjson.o src/settings.o src/sort.o src/tpl.o src/ui.o src/util.o src/websocket.o src/xmalloc.o src/wsauth.o src/sha1.o   src/geoip2.o  -lncurses -lmaxminddb -lcrypto -lssl -lpthread -lintl -lintl 
Undefined symbols for architecture ppc:
  "___sync_add_and_fetch_8", referenced from:
      _count_process in gstorage.o
  "___sync_bool_compare_and_swap_8", referenced from:
      _parse_line in parser.o
ld: symbol(s) not found for architecture ppc
collect2: error: ld returned 1 exit status

While 32-bit platforms may not be a high concern, it is preferable to use modern atomic_* built-ins anyway.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions