Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Atomics check is wrong: HAVE_CXX_ATOMICS_WITHOUT_LIB succeeds on a platform where 8-byte atomics are not supported without libatomic #139

Open
barracuda156 opened this issue Jun 8, 2024 · 0 comments

Comments

@barracuda156
Copy link

There is something wrong with the check. It must fail on ppc, but it succeeds:

--->  Configuring fizz
Executing:  cd "/opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_devel_fizz/fizz/work/build" && /opt/local/bin/cmake -G "Ninja" -DCMAKE_BUILD_TYPE=MacPorts -DCMAKE_INSTALL_PREFIX="/opt/local" -DCMAKE_INSTALL_NAME_DIR="/opt/local/lib" -DCMAKE_SYSTEM_PREFIX_PATH="/opt/local;/usr" -DCMAKE_C_COMPILER="$CC" -DCMAKE_CXX_COMPILER="$CXX" -DCMAKE_OBJC_COMPILER="$CC" -DCMAKE_OBJCXX_COMPILER="$CXX" -DCMAKE_POLICY_DEFAULT_CMP0025=NEW -DCMAKE_POLICY_DEFAULT_CMP0060=NEW -DCMAKE_VERBOSE_MAKEFILE=ON -DCMAKE_COLOR_MAKEFILE=ON -DCMAKE_FIND_FRAMEWORK=LAST -DCMAKE_EXPORT_COMPILE_COMMANDS=ON -DCMAKE_MAKE_PROGRAM=ninja -DCMAKE_MODULE_PATH="/opt/local/share/cmake/Modules;/opt/local/lib/libfmt10/cmake" -DCMAKE_PREFIX_PATH="/opt/local/share/cmake/Modules;/opt/local/lib/libfmt10/cmake" -DCMAKE_BUILD_WITH_INSTALL_RPATH:BOOL=ON -DCMAKE_INSTALL_RPATH="/opt/local/lib" -Wno-dev -DBUILD_TESTS=OFF -DBUILD_SHARED_LIBS=ON -DBOOST_ROOT=/opt/local/libexec/boost/1.81 -DBOOSTROOT=/opt/local/libexec/boost/1.81 -DBOOST_INCLUDEDIR=/opt/local/libexec/boost/1.81/include -DBOOST_LIBRARYDIR=/opt/local/libexec/boost/1.81/lib -DBOOST_INCLUDE_DIR=/opt/local/libexec/boost/1.81/include -DBOOST_LIBRARY_DIR=/opt/local/libexec/boost/1.81/lib -DBOOST_LIB_DIR=/opt/local/libexec/boost/1.81/lib -DBoost_NO_SYSTEM_PATHS=ON -DBoost_INCLUDE_DIR=/opt/local/libexec/boost/1.81/include -DBoost_DIR=/opt/local/libexec/boost/1.81 -DOPENSSL_ROOT_DIR=/opt/local/libexec/openssl3 -DOPENSSL_INCLUDE_DIR=/opt/local/libexec/openssl3/include -DWITH_SSL=/opt/local/libexec/openssl3 -DCMAKE_OSX_ARCHITECTURES="ppc" -DCMAKE_OSX_DEPLOYMENT_TARGET="10.6" -DCMAKE_OSX_SYSROOT="/" /opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_devel_fizz/fizz/work/fizz-v2024.06.03.00/fizz 
-- The CXX compiler identification is GNU 13.2.1
-- The C compiler identification is GNU 13.2.1
-- Checking whether CXX compiler has -isysroot
-- Checking whether CXX compiler has -isysroot - yes
-- Checking whether CXX compiler supports OSX deployment target flag
-- Checking whether CXX compiler supports OSX deployment target flag - yes
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /opt/local/bin/g++-mp-powerpc - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Checking whether C compiler has -isysroot
-- Checking whether C compiler has -isysroot - yes
-- Checking whether C compiler supports OSX deployment target flag
-- Checking whether C compiler supports OSX deployment target flag - yes
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /opt/local/bin/gcc-mp-powerpc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Success
-- Found Threads: TRUE
-- Found Boost: /opt/local/libexec/boost/1.81/include (found suitable version "1.81.0", minimum required is "1.51.0") found components: context filesystem program_options regex system thread chrono atomic
-- Found folly: /opt/local
-- Found OpenSSL: /opt/local/libexec/openssl3/lib/libcrypto.dylib (found version "3.1.5")
-- Found Glog: /opt/local/lib/libglog.dylib
-- Found gflags from package config /opt/local/lib/cmake/gflags/gflags-config.cmake
-- Found gflags as a dependency of glog::glog, include=/opt/local/include, libs=gflags_shared
-- Found LIBUNWIND: /opt/local/lib/libunwind.dylib
-- Found LibUnwind as a dependency of glog::glog, include=/opt/local/include, libs=/opt/local/lib/libunwind.dylib
-- Found DoubleConversion: /opt/local/lib/libdouble-conversion.dylib
-- Found ZSTD: /opt/local/lib/libzstd.dylib
-- Found Zstd: /opt/local/lib/libzstd.dylib
-- Performing Test HAVE_CXX_ATOMICS_WITHOUT_LIB
-- Performing Test HAVE_CXX_ATOMICS_WITHOUT_LIB - Success
-- Found Sodium: /opt/local/lib/libsodium.dylib
-- Found gflags from package config
-- Found ZLIB: /opt/local/lib/libz.dylib (found version "1.3.1")
-- Found libevent: /opt/local/lib/libevent.dylib
-- Could NOT find liboqs (missing: liboqs_DIR)
-- Configuring done (11.2s)
-- Generating done (0.1s)

Subsequently, that breaks linking, since -latomic is not passed.

FAILED: bin/fizz 
: && /opt/local/bin/g++-mp-powerpc -pipe -I/opt/local/libexec/openssl3/include -I/opt/local/libexec/boost/1.81/include -Os -DNDEBUG -I/opt/local/libexec/openssl3/include -isystem/opt/local/include/LegacySupport -I/opt/local/libexec/boost/1.81/include -isystem/opt/local/include -D_GLIBCXX_USE_CXX11_ABI=0 -arch ppc -mmacosx-version-min=10.6 -Wl,-search_paths_first -Wl,-headerpad_max_install_names -L/opt/local/libexec/openssl3/lib -L/opt/local/libexec/boost/1.81/lib -Wl,-headerpad_max_install_names -L/opt/local/lib -lMacportsLegacySupport CMakeFiles/FizzTool.dir/tool/Main.cpp.o CMakeFiles/FizzTool.dir/tool/FizzClientCommand.cpp.o CMakeFiles/FizzTool.dir/tool/FizzClientLoadGenCommand.cpp.o CMakeFiles/FizzTool.dir/tool/FizzCommandCommon.cpp.o CMakeFiles/FizzTool.dir/tool/FizzGenerateDelegatedCredentialCommand.cpp.o CMakeFiles/FizzTool.dir/tool/FizzServerBenchmarkCommand.cpp.o CMakeFiles/FizzTool.dir/tool/FizzServerCommand.cpp.o -o bin/fizz  -Wl,-rpath,/opt/local/lib  lib/libfizz.1.0.0.dylib  /opt/local/lib/libsodium.dylib  /opt/local/lib/libfolly.0.58.0-dev.dylib  /opt/local/lib/libfmt10/libfmt.10.2.1.dylib  /opt/local/libexec/boost/1.81/lib/libboost_context-mt.dylib  /opt/local/libexec/boost/1.81/lib/libboost_filesystem-mt.dylib  /opt/local/libexec/boost/1.81/lib/libboost_program_options-mt.dylib  /opt/local/libexec/boost/1.81/lib/libboost_regex-mt.dylib  /opt/local/libexec/boost/1.81/lib/libboost_system-mt.dylib  /opt/local/libexec/boost/1.81/lib/libboost_thread-mt.dylib  /opt/local/libexec/boost/1.81/lib/libboost_chrono-mt.dylib  /opt/local/libexec/boost/1.81/lib/libboost_atomic-mt.dylib  /opt/local/lib/libdouble-conversion.dylib  /opt/local/lib/libglog.dylib  /opt/local/lib/libevent.dylib  /opt/local/lib/libz.dylib  /opt/local/lib/libbz2.dylib  /opt/local/lib/liblzma.dylib  /opt/local/lib/liblz4.dylib  /opt/local/lib/libsnappy.dylib  /opt/local/lib/libsodium.dylib  /opt/local/lib/libunwind.dylib  /opt/local/libexec/openssl3/lib/libssl.dylib  /opt/local/libexec/openssl3/lib/libcrypto.dylib  /opt/local/lib/libz.dylib  /opt/local/lib/libzstd.dylib  /opt/local/lib/libgflags.2.2.2.dylib && :
Undefined symbols:
  "___atomic_fetch_add_8", referenced from:
      __ZN5folly18NamedThreadFactory9newThreadEONS_8FunctionIFvvEEE in FizzClientLoadGenCommand.cpp.o
      __ZN5folly18NamedThreadFactory9newThreadEONS_8FunctionIFvvEEE in FizzServerBenchmarkCommand.cpp.o
ld: symbol(s) not found
collect2: error: ld returned 1 exit status
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant