Build failure on mipsel architecture (undefined reference to symbol '__atomic_load_8@@LIBATOMIC_1.0')

Get help for specific problems
Posts: 44
Joined: 14 Aug 2022

daviank

Hello Zenju & all,

I'm having this error when building freefilesync on mipsel architecture:
undefined reference to symbol '__atomic_load_8@@LIBATOMIC_1.0'
mkdir -p ../Build/Bin/
g++ -o ../Build/Bin/FreeFileSync /tmp/FreeFileSync_Make/ffs/src/application.cpp.o /tmp/FreeFileSync_Make/ffs/src/base_tools.cpp.o /tmp/FreeFileSync_Make/ffs/src/config.cpp.o /tmp/FreeFileSync_Make/ffs/src/ffs_paths.cpp.o /tmp/FreeFileSync_Make/ffs/src/icon_buffer.cpp.o /tmp/FreeFileSync_Make/ffs/src/localization.cpp.o /tmp/FreeFileSync_Make/ffs/src/log_file.cpp.o /tmp/FreeFileSync_Make/ffs/src/status_handler.cpp.o /tmp/FreeFileSync_Make/ffs/src/base/algorithm.cpp.o /tmp/FreeFileSync_Make/ffs/src/base/binary.cpp.o /tmp/FreeFileSync_Make/ffs/src/base/comparison.cpp.o /tmp/FreeFileSync_Make/ffs/src/base/db_file.cpp.o /tmp/FreeFileSync_Make/ffs/src/base/dir_lock.cpp.o /tmp/FreeFileSync_Make/ffs/src/base/file_hierarchy.cpp.o /tmp/FreeFileSync_Make/ffs/src/base/icon_loader.cpp.o /tmp/FreeFileSync_Make/ffs/src/base/parallel_scan.cpp.o /tmp/FreeFileSync_Make/ffs/src/base/path_filter.cpp.o /tmp/FreeFileSync_Make/ffs/src/base/speed_test.cpp.o /tmp/FreeFileSync_Make/ffs/src/base/structures.cpp.o /tmp/FreeFileSync_Make/ffs/src/base/synchronization.cpp.o /tmp/FreeFileSync_Make/ffs/src/base/versioning.cpp.o /tmp/FreeFileSync_Make/ffs/src/afs/abstract.cpp.o /tmp/FreeFileSync_Make/ffs/src/afs/concrete.cpp.o /tmp/FreeFileSync_Make/ffs/src/afs/ftp.cpp.o /tmp/FreeFileSync_Make/ffs/src/afs/gdrive.cpp.o /tmp/FreeFileSync_Make/ffs/src/afs/init_curl_libssh2.cpp.o /tmp/FreeFileSync_Make/ffs/src/afs/native.cpp.o /tmp/FreeFileSync_Make/ffs/src/afs/sftp.cpp.o /tmp/FreeFileSync_Make/ffs/src/ui/batch_config.cpp.o /tmp/FreeFileSync_Make/ffs/src/ui/abstract_folder_picker.cpp.o /tmp/FreeFileSync_Make/ffs/src/ui/batch_status_handler.cpp.o /tmp/FreeFileSync_Make/ffs/src/ui/cfg_grid.cpp.o /tmp/FreeFileSync_Make/ffs/src/ui/command_box.cpp.o /tmp/FreeFileSync_Make/ffs/src/ui/folder_history_box.cpp.o /tmp/FreeFileSync_Make/ffs/src/ui/folder_selector.cpp.o /tmp/FreeFileSync_Make/ffs/src/ui/file_grid.cpp.o /tmp/FreeFileSync_Make/ffs/src/ui/file_view.cpp.o /tmp/FreeFileSync_Make/ffs/src/ui/log_panel.cpp.o /tmp/FreeFileSync_Make/ffs/src/ui/tree_grid.cpp.o /tmp/FreeFileSync_Make/ffs/src/ui/gui_generated.cpp.o /tmp/FreeFileSync_Make/ffs/src/ui/gui_status_handler.cpp.o /tmp/FreeFileSync_Make/ffs/src/ui/main_dlg.cpp.o /tmp/FreeFileSync_Make/ffs/src/ui/progress_indicator.cpp.o /tmp/FreeFileSync_Make/ffs/src/ui/search_grid.cpp.o /tmp/FreeFileSync_Make/ffs/src/ui/small_dlgs.cpp.o /tmp/FreeFileSync_Make/ffs/src/ui/sync_cfg.cpp.o /tmp/FreeFileSync_Make/ffs/src/ui/tray_icon.cpp.o /tmp/FreeFileSync_Make/ffs/src/ui/triple_splitter.cpp.o /tmp/FreeFileSync_Make/ffs/src/../../libcurl/curl_wrap.cpp.o /tmp/FreeFileSync_Make/ffs/src/../../zen/file_access.cpp.o /tmp/FreeFileSync_Make/ffs/src/../../zen/file_io.cpp.o /tmp/FreeFileSync_Make/ffs/src/../../zen/file_path.cpp.o /tmp/FreeFileSync_Make/ffs/src/../../zen/file_traverser.cpp.o /tmp/FreeFileSync_Make/ffs/src/../../zen/http.cpp.o /tmp/FreeFileSync_Make/ffs/src/../../zen/zstring.cpp.o /tmp/FreeFileSync_Make/ffs/src/../../zen/format_unit.cpp.o /tmp/FreeFileSync_Make/ffs/src/../../zen/legacy_compiler.cpp.o /tmp/FreeFileSync_Make/ffs/src/../../zen/open_ssl.cpp.o /tmp/FreeFileSync_Make/ffs/src/../../zen/process_priority.cpp.o /tmp/FreeFileSync_Make/ffs/src/../../zen/recycler.cpp.o /tmp/FreeFileSync_Make/ffs/src/../../zen/resolve_path.cpp.o /tmp/FreeFileSync_Make/ffs/src/../../zen/process_exec.cpp.o /tmp/FreeFileSync_Make/ffs/src/../../zen/shutdown.cpp.o /tmp/FreeFileSync_Make/ffs/src/../../zen/sys_error.cpp.o /tmp/FreeFileSync_Make/ffs/src/../../zen/sys_info.cpp.o /tmp/FreeFileSync_Make/ffs/src/../../zen/sys_version.cpp.o /tmp/FreeFileSync_Make/ffs/src/../../zen/thread.cpp.o /tmp/FreeFileSync_Make/ffs/src/../../zen/zlib_wrap.cpp.o /tmp/FreeFileSync_Make/ffs/src/../../wx+/file_drop.cpp.o /tmp/FreeFileSync_Make/ffs/src/../../wx+/grid.cpp.o /tmp/FreeFileSync_Make/ffs/src/../../wx+/image_tools.cpp.o /tmp/FreeFileSync_Make/ffs/src/../../wx+/graph.cpp.o /tmp/FreeFileSync_Make/ffs/src/../../wx+/taskbar.cpp.o /tmp/FreeFileSync_Make/ffs/src/../../wx+/tooltip.cpp.o /tmp/FreeFileSync_Make/ffs/src/../../wx+/image_resources.cpp.o /tmp/FreeFileSync_Make/ffs/src/../../wx+/popup_dlg.cpp.o /tmp/FreeFileSync_Make/ffs/src/../../wx+/popup_dlg_generated.cpp.o /tmp/FreeFileSync_Make/ffs/src/../../xBRZ/src/xbrz.cpp.o -Wl,-z,relro -Wl,-z,now `wx-config --version=3.2 --libs std, aui, richtext --debug=no` -pthread -lz `pkg-config --libs   openssl` `pkg-config --libs   libcurl` `pkg-config --libs   libssh2` `pkg-config --libs   gtk+-3.0` `pkg-config --libs libselinux`
/usr/bin/ld: /tmp/FreeFileSync_Make/ffs/src/base/comparison.cpp.o: undefined reference to symbol '__atomic_load_8@@LIBATOMIC_1.0'
/usr/bin/ld: /usr/lib/mipsel-linux-gnu/libatomic.so.1: error adding symbols: DSO missing from command line
collect2: error: ld returned 1 exit status
make[1]: *** [Makefile:135: ../Build/Bin/FreeFileSync] Error 1
make[1]: Leaving directory '/<<PKGBUILDDIR>>/FreeFileSync/Source'
dh_auto_build: error: cd FreeFileSync/Source && make -j4 "INSTALL=install --strip-program=true" returned exit code 2
Could you please help? How can I fix this?
Posts: 44
Joined: 14 Aug 2022

daviank

Looks like this one can be fixed by adding -latomic to the LDFLAGS on mipsel architecture.
Not sure if this is the correct way to fix this though.
Posts: 309
Joined: 7 Jan 2018

bgstack15

Not an expert either, but if merely linking to an additional library gets you want you need, it sounds fine. There's probably a set of default libraries that are always linked to, and that list of defaults is probably different for each compiler * compiler version * architecture * distro!