-
Notifications
You must be signed in to change notification settings - Fork 349
Open
Labels
Description
building ffi fails on FreeBSD 15 with the following error message:
>>> referenced by Program.cpp
>>> Program.cpp.o:(Execute(llvm::sys::ProcessInfo&, llvm::StringRef,
llvm::ArrayRef<llvm::StringRef>, std::__1::optional<llvm::ArrayRef<llvm::StringRef>>,
llvm::ArrayRef<std::__1::optional<llvm::StringRef>>, unsigned int, std::__1::basic_string<char,
std::__1::char_traits<char>, std::__1::allocator<char>>*, llvm::BitVector*, bool)) in archive
/usr/local/llvm20/lib/libLLVMSupport.a
c++: error: linker command failed with exit code 1 (use -v to see invocation)
which breaks installation when attempting to build the wheel.
the root cause for this seems to be that the environ symbol is not available from libc when building a library, and instead is resolved when linking the application. there seem to have been a number of similar build issues reported for other projects over the years, where the typical fix seems to have been to add -Wl,--warn-unresolved-symbols to the linker flags.
in the case of ffi, the appropriate spot seems to be FORCED_LINK_FLAGS for non-apple UNIXes in CMakeLists.txt