PR adds -Wl,--warn-unresolved-symbols to linker flags for Bazel builds of llvm/lib/Support under FreeBSD. This avoids an error on an unresolved reference to environ. As far as I can tell, on FreeBSD, environ is defined as a common symbol in /usr/lib/crt1.o, and won't be resolved during linking. Ref extern char **environ in llvm/lib/Support/Unix/Program.inc.
Details
Details
- Reviewers
- None
Diff Detail
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
Comment Actions
Hmmm I rather suspect this isn't the right fix. Can you provide the error message you're hitting? I don't see any place that the CMake build has --warn-unresolved-symbols, so I suspect we're setting something wrong in the config.
Comment Actions
Completely agree. This is a workaround and the issue appears to be specific to builds in Bazel/FreeBSD. For context, I'm encountering while building libtensorflow on FreeBSD 13.0.
I'll update shortly with the exact error message and additional details.
Comment Actions
Closing. This is a build environment issue; error is ld: error: undefined symbol: environ and is the result of a default invocation of linker flag -z defs one of the tensorflow bazel build rules