Hello,
Im unable to build rspamd 2.2 on slackware 15 with gcc 9.2.0
$ gcc -v
Reading specs from /usr/lib64/gcc/x86_64-slackware-linux/9.2.0/specs
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/libexec/gcc/x86_64-slackware-linux/9.2.0/lto-wrapper
Target: x86_64-slackware-linux
Configured with: ../configure --prefix=/usr --libdir=/usr/lib64 --mandir=/usr/man --infodir=/usr/info --enable-shared --enable-bootstrap --enable-languages=ada,brig,c,c++,d,fortran,go,lto,objc,obj-c++ --enable-threads=posix --enable-checking=release --enable-objc-gc --with-system-zlib --enable-libstdcxx-dual-abi --with-default-libstdcxx-abi=new --disable-libstdcxx-pch --disable-libunwind-exceptions --enable-__cxa_atexit --disable-libssp --enable-gnu-unique-object --enable-plugin --enable-lto --disable-install-libiberty --disable-werror --with-gnu-ld --with-isl --verbose --with-arch-directory=amd64 --disable-gtktest --enable-clocale=gnu --disable-multilib --target=x86_64-slackware-linux --build=x86_64-slackware-linux --host=x86_64-slackware-linux
Thread model: posix
gcc version 9.2.0 (GCC)
[ 15%] Building C object contrib/snowball/CMakeFiles/snowball.dir/compiler/generator_java.c.o
[ 15%] Linking C executable snowball
ld.lld: error: undefined symbol: main
referenced by start.S:110 (../sysdeps/x86_64/start.S:110)
/usr/lib64/gcc/x86_64-slackware-linux/9.2.0/../../../../lib64/crt1.o:(_start)
collect2: error: ld returned 1 exit status
make[2]: * [contrib/snowball/CMakeFiles/snowball.dir/build.make:159: contrib/snowball/snowball] Error 1
make[1]: [CMakeFiles/Makefile2:1031: contrib/snowball/CMakeFiles/snowball.dir/all] Error 2
make: ** [Makefile:130: all] Error 2
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
The question is why it uses the LLVM linker at all. 2.3 builds with the gold linker.
Switch LLD_PATH and GOLD_PATH conditions in cmake/Toolset.cmake, so it looks like:
if(NOT LINKER_NAME)
if(GOLD_PATH)
set(LINKER_NAME "gold")
elseif(LLD_PATH)
set(LINKER_NAME "lld")
else()
message(STATUS "Use generic 'ld' as a linker")
endif()
endif()
Well it builds if I pass LDFLAGS='-fuse-ld=lld' to the cmake environment with some weird errors in CMakeLTOTest (doesn't seem to be critical). But honestly, I would just patch Toolset.cmake and change the linker when building with GCC.
Probably switching the compiler to clang as well, would do the job too.
Hello,
changing cmake/Toolset.cmake work and project now compile successful.
Most helpful comment
The question is why it uses the LLVM linker at all. 2.3 builds with the gold linker.
Switch LLD_PATH and GOLD_PATH conditions in
cmake/Toolset.cmake, so it looks like: