FreeBSD 13.3-RELEASE LLVM gives errors where F13.2 didn't

Hi, I have poudriere and port tree that is frozen in time for while now. That is done because I want a stable system without breakage till EOL. After moving from F13.2 -> F13.3 some stuff is no longer possible to compile. Linker errors apparently. Adding llvm=14 to DEFAULT_VERSIONS+= in make.conf did help. The same error after using linker from the new release:

Code:
--- whirlpool_sbox.o ---
cc -c -DOPENSSL_RUNTIME -DNDEBUG -pipe -ffunction-sections -fdata-sections -fomit-frame-pointer -Wall -W -Wstrict-prototypes -Wnested-externs -Winline -Wpointer-arith -Wbad-function-cast -Wmissing-prototypes -Wmissing-declarations -O2 -pipe -fstack-protector-strong -isystem /usr/local/include -fno-strict-aliasing whirlpool_sbox.c -o whirlpool_sbox.o
--- librhash.a ---
rm -f librhash.a
ar -cqs librhash.a algorithms.o byte_order.o plug_openssl.o rhash.o rhash_timing.o rhash_torrent.o aich.o blake2b.o blake2s.o crc32.o ed2k.o edonr.o hex.o md4.o md5.o sha1.o sha256.o sha512.o sha3.o ripemd-160.o gost12.o gost94.o has160.o snefru.o tiger.o tiger_sbox.o tth.o torrent.o util.o whirlpool.o whirlpool_sbox.o
--- librhash/librhash.so.0 ---
ld: error: version script assignment of 'global' to symbol 'rhash_wfile' failed: symbol not defined
cc: error: linker command failed with exit code 1 (use -v to see invocation)
*** [librhash.so.0] Error code 1

make[2]: stopped in /wrkdirs/usr/ports/security/rhash/work/RHash-1.4.3/librhash
1 error

make[2]: stopped in /wrkdirs/usr/ports/security/rhash/work/RHash-1.4.3/librhash
*** [librhash/librhash.so.0] Error code 2

make[1]: stopped in /wrkdirs/usr/ports/security/rhash/work/RHash-1.4.3
1 error

make[1]: stopped in /wrkdirs/usr/ports/security/rhash/work/RHash-1.4.3
===> Compilation failed unexpectedly.
Try to set MAKE_JOBS_UNSAFE=yes and rebuild before reporting the failure to
the maintainer.
*** Error code 1

Stop.
make: stopped in /usr/ports/security/rhash
=>> Cleaning up wrkdir
===>  Cleaning for rhash-1.4.3
build of security/rhash | rhash-1.4.3 ended at Sun Mar 17 02:28:43 +07 2024

At the moment the base version of LLVM is used for some reason

Code:
===>  Configuring for rhash-1.4.3
Checking for target OS ... FreeBSD
Checking for cc version ... clang 17.0.6

Any help, how to force llvm version and build failed packages with it?
 
In llvm17, the linker option --no-allow-shlib-undefined became default. If there are any symbol not present in the library specified in the version script, the linker exits with error.
The proper fix would be either change the version script to contain only the symbols which exists in the library or patch to add the lacking symbol in the library. However, passing --undefined-version option makes the linker back to old behavior. So, if you just want the port to be built, place Makefile.local with the following line:
Code:
LDFLAGS+= -Wl,--undefined-version
 
Thanks, Hiroo! Just this moment I've got to this myself. Thanks a lot for clear explanation anyway.
 
In llvm17, the linker option --no-allow-shlib-undefined became default. If there are any symbol not present in the library specified in the version script, the linker exits with error.
The proper fix would be either change the version script to contain only the symbols which exists in the library or patch to add the lacking symbol in the library. However, passing --undefined-version option makes the linker back to old behavior. So, if you just want the port to be built, place Makefile.local with the following line:
Code:
LDFLAGS+= -Wl,--undefined-version
for some reason this trick doesn't work, when I'm building llvm 15

Code:
FAILED: lib/libomp.so
: && /usr/bin/cc -fPIC -O2 -pipe -Wno-register  -DNDEBUG -fstack-protector-strong -isystem /usr/local/include -fno-strict-aliasing -fPIC -fno-semantic-interposition -Werror=date-time -Werror=unguarded-availability-new -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wmissing-field-initializers -pedantic -Wno-long-long -Wc++98-compat-extra-semi -Wimplicit-fallthrough -Wcovered-switch-default -Wstring-conversion -Wmisleading-indentation -fdiagnostics-color -ffunction-sections -fdata-sections -Wall -Wcast-qual -Wformat-pedantic -Wimplicit-fallthrough -Wsign-compare -Wno-extra -Wno-pedantic -O2 -pipe -Wno-register  -DNDEBUG -fstack-protector-strong -isystem /usr/local/include -fno-strict-aliasing  -DNDEBUG  -Wl,--undefined-version -fstack-protector-strong -Wl,--color-diagnostics  -Wl,--warn-shared-textrel -Wl,--as-needed -static-libgcc -Wl,-z,noexecstack -shared -Wl,-soname,libomp.so -o lib/libomp.so projects/openmp/runtime/src/CMakeFiles/omp.dir/kmp_alloc.cpp.o projects/openmp/runtime/src/CMakeFiles/omp.dir/kmp_atomic.cpp.o projects/openmp/runtime/src/CMakeFiles/omp.dir/kmp_csupport.cpp.o projects/openmp/runtime/src/CMakeFiles/omp.dir/kmp_debug.cpp.o projects/openmp/runtime/src/CMakeFiles/omp.dir/kmp_itt.cpp.o projects/openmp/runtime/src/CMakeFiles/omp.dir/kmp_environment.cpp.o projects/openmp/runtime/src/CMakeFiles/omp.dir/kmp_error.cpp.o projects/openmp/runtime/src/CMakeFiles/omp.dir/kmp_global.cpp.o projects/openmp/runtime/src/CMakeFiles/omp.dir/kmp_i18n.cpp.o projects/openmp/runtime/src/CMakeFiles/omp.dir/kmp_io.cpp.o projects/openmp/runtime/src/CMakeFiles/omp.dir/kmp_runtime.cpp.o projects/openmp/runtime/src/CMakeFiles/omp.dir/kmp_settings.cpp.o projects/openmp/runtime/src/CMakeFiles/omp.dir/kmp_str.cpp.o projects/openmp/runtime/src/CMakeFiles/omp.dir/kmp_tasking.cpp.o projects/openmp/runtime/src/CMakeFiles/omp.dir/kmp_threadprivate.cpp.o projects/openmp/runtime/src/CMakeFiles/omp.dir/kmp_utility.cpp.o projects/openmp/runtime/src/CMakeFiles/omp.dir/kmp_barrier.cpp.o projects/openmp/runtime/src/CMakeFiles/omp.dir/kmp_wait_release.cpp.o projects/openmp/runtime/src/CMakeFiles/omp.dir/kmp_affinity.cpp.o projects/openmp/runtime/src/CMakeFiles/omp.dir/kmp_dispatch.cpp.o projects/openmp/runtime/src/CMakeFiles/omp.dir/kmp_lock.cpp.o projects/openmp/runtime/src/CMakeFiles/omp.dir/kmp_sched.cpp.o projects/openmp/runtime/src/CMakeFiles/omp.dir/z_Linux_util.cpp.o projects/openmp/runtime/src/CMakeFiles/omp.dir/kmp_gsupport.cpp.o projects/openmp/runtime/src/CMakeFiles/omp.dir/thirdparty/ittnotify/ittnotify_static.cpp.o projects/openmp/runtime/src/CMakeFiles/omp.dir/kmp_taskdeps.cpp.o projects/openmp/runtime/src/CMakeFiles/omp.dir/kmp_cancel.cpp.o projects/openmp/runtime/src/CMakeFiles/omp.dir/kmp_ftn_cdecl.cpp.o projects/openmp/runtime/src/CMakeFiles/omp.dir/kmp_ftn_extra.cpp.o projects/openmp/runtime/src/CMakeFiles/omp.dir/kmp_version.cpp.o projects/openmp/runtime/src/CMakeFiles/omp.dir/ompt-general.cpp.o projects/openmp/runtime/src/CMakeFiles/omp.dir/z_Linux_asm.S.o  -lpthread  -Wl,--no-as-needed  -lm  -Wl,--as-needed && cd /wrkdirs/usr/ports/devel/llvm15/work/.build/lib && /usr/local/bin/cmake -E create_symlink libomp.so libgomp.so && /usr/local/bin/cmake -E create_symlink libomp.so libiomp5.so
cc: warning: argument unused during compilation: '-static-libgcc' [-Wunused-command-line-argument]
ld: error: projects/openmp/runtime/src/CMakeFiles/omp.dir/kmp_csupport.cpp.o: symbol ompc_set_affinity_format@@VERSION has undefined version VERSION
ld: error: projects/openmp/runtime/src/CMakeFiles/omp.dir/kmp_csupport.cpp.o: symbol omp_set_affinity_format@OMP_5.0 has undefined version OMP_5.0
ld: error: projects/openmp/runtime/src/CMakeFiles/omp.dir/kmp_csupport.cpp.o: symbol ompc_get_affinity_format@@VERSION has undefined version VERSION
ld: error: projects/openmp/runtime/src/CMakeFiles/omp.dir/kmp_csupport.cpp.o: symbol omp_get_affinity_format@OMP_5.0 has undefined version OMP_5.0
ld: error: projects/openmp/runtime/src/CMakeFiles/omp.dir/kmp_csupport.cpp.o: symbol ompc_display_affinity@@VERSION has undefined version VERSION
ld: error: projects/openmp/runtime/src/CMakeFiles/omp.dir/kmp_csupport.cpp.o: symbol omp_display_affinity@OMP_5.0 has undefined version OMP_5.0
ld: error: projects/openmp/runtime/src/CMakeFiles/omp.dir/kmp_csupport.cpp.o: symbol ompc_capture_affinity@@VERSION has undefined version VERSION
ld: error: projects/openmp/runtime/src/CMakeFiles/omp.dir/kmp_csupport.cpp.o: symbol omp_capture_affinity@OMP_5.0 has undefined version OMP_5.0
ld: error: projects/openmp/runtime/src/CMakeFiles/omp.dir/kmp_gsupport.cpp.o: symbol GOMP_atomic_end@GOMP_1.0 has undefined version GOMP_1.0
ld: error: projects/openmp/runtime/src/CMakeFiles/omp.dir/kmp_gsupport.cpp.o: symbol GOMP_atomic_end@@VERSION has undefined version VERSION
ld: error: projects/openmp/runtime/src/CMakeFiles/omp.dir/kmp_gsupport.cpp.o: symbol GOMP_atomic_start@GOMP_1.0 has undefined version GOMP_1.0
ld: error: projects/openmp/runtime/src/CMakeFiles/omp.dir/kmp_gsupport.cpp.o: symbol GOMP_atomic_start@@VERSION has undefined version VERSION
ld: error: projects/openmp/runtime/src/CMakeFiles/omp.dir/kmp_gsupport.cpp.o: symbol GOMP_barrier@GOMP_1.0 has undefined version GOMP_1.0
ld: error: projects/openmp/runtime/src/CMakeFiles/omp.dir/kmp_gsupport.cpp.o: symbol GOMP_barrier@@VERSION has undefined version VERSION
ld: error: projects/openmp/runtime/src/CMakeFiles/omp.dir/kmp_gsupport.cpp.o: symbol GOMP_critical_end@GOMP_1.0 has undefined version GOMP_1.0
ld: error: projects/openmp/runtime/src/CMakeFiles/omp.dir/kmp_gsupport.cpp.o: symbol GOMP_critical_end@@VERSION has undefined version VERSION
ld: error: projects/openmp/runtime/src/CMakeFiles/omp.dir/kmp_gsupport.cpp.o: symbol GOMP_critical_name_end@GOMP_1.0 has undefined version GOMP_1.0
ld: error: projects/openmp/runtime/src/CMakeFiles/omp.dir/kmp_gsupport.cpp.o: symbol GOMP_critical_name_end@@VERSION has undefined version VERSION
ld: error: projects/openmp/runtime/src/CMakeFiles/omp.dir/kmp_gsupport.cpp.o: symbol GOMP_critical_name_start@GOMP_1.0 has undefined version GOMP_1.0
ld: error: projects/openmp/runtime/src/CMakeFiles/omp.dir/kmp_gsupport.cpp.o: symbol GOMP_critical_name_start@@VERSION has undefined version VERSION
ld: error: too many errors emitted, stopping now (use --error-limit=0 to see all errors)
cc: error: linker command failed with exit code 1 (use -v to see invocation)
ninja: build stopped: subcommand failed.
*** Error code 1
 
Back
Top