Valgrind fails to build on FreeBSD 13.0 with llvm-devel (15.0.0) paulf> /usr/local/bin/clang-devel --version clang version 15.0.0 Target: x86_64-portbld-freebsd13.0 Thread model: posix InstalledDir: /usr/local/llvm-devel/bin ../coregrind/link_tool_exe_freebsd 0x38000000 clang-devel -o memcheck-x86-freebsd -B/usr/lib32 -m32 -O2 -g -Wall -Wmissing-prototypes -Wshadow -Wpointer-arith -Wstrict-prototypes -Wmissing-declarations -Wcast-align -Wcast-qual -Wwrite-strings -Wempty-body -Wformat -Wformat-security -Wignored-qualifiers -Wenum-conversion -finline-functions -fno-stack-protector -fno-strict-aliasing -fno-builtin -Wno-cast-align -Wno-self-assign -Wno-tautological-compare -Wno-expansion-to-defined -fomit-frame-pointer -O2 -static -nodefaultlibs -nostartfiles -Wl,-u,_start -B/usr/lib32 -m32 memcheck_x86_freebsd-mc_leakcheck.o memcheck_x86_freebsd-mc_malloc_wrappers.o memcheck_x86_freebsd-mc_main.o memcheck_x86_freebsd-mc_main_asm.o memcheck_x86_freebsd-mc_translate.o memcheck_x86_freebsd-mc_machine.o memcheck_x86_freebsd-mc_errors.o ../coregrind/libcoregrind-x86-freebsd.a ../VEX/libvex-x86-freebsd.a -lgcc ../coregrind/libgcc-sup-amd64-freebsd.a If I change the last library to the x86 version and link manually it works
I've pushed a change that fixes building. I'll probably make a second change to add libgcc-sup and -lgcc when the compiler is not clang.
Removing -lgcc breaks things on FreeBSD with clang. It looks like it contains a few primitives that aren't available elsewhere.
To ssh://sourceware.org/git/valgrind.git 8b2cf214a..6af21da95 master -> master
(In reply to Paul Floyd from comment #1) > I've pushed a change that fixes building. > > I'll probably make a second change to add libgcc-sup and -lgcc when the > compiler is not clang. Did you have a chance to do this? It looks like Chimera Linux (a pure LLVM Linux distro) is doing it at the moment: https://github.com/chimera-linux/cports/blob/382e497f40f80e5528d714e6075a00b225459dfa/experimental/valgrind/patches/rtlib.patch. (Ended up hitting the same issue in Gentoo just now: https://bugs.gentoo.org/870028).
(In reply to Sam James from comment #4) > (In reply to Paul Floyd from comment #1) > > I've pushed a change that fixes building. > > > > I'll probably make a second change to add libgcc-sup and -lgcc when the > > compiler is not clang. > > Did you have a chance to do this? It looks like Chimera Linux (a pure LLVM > Linux distro) is doing it at the moment: > https://github.com/chimera-linux/cports/blob/ > 382e497f40f80e5528d714e6075a00b225459dfa/experimental/valgrind/patches/rtlib. > patch. > > (Ended up hitting the same issue in Gentoo just now: > https://bugs.gentoo.org/870028). No. As I said in comment 2 removing -lgcc breaks things. I'll check on the missing primitives.