Open yesudeep opened 4 years ago
I think fixing this problem would allow quite a few C++ libraries to compile cleanly on FreeBSD/OpenBSD.
Thank you for contributing to the Bazel repository! This issue has been marked as stale since it has not had any activity in the last 2+ years. It will be closed in the next 14 days unless any other activity occurs or one of the following labels is added: "not stale", "awaiting-bazeler". Please reach out to the triage team (@bazelbuild/triage
) if you think this issue is still relevant or you are interested in getting the issue resolved.
This issue has been automatically closed due to inactivity. If you're still interested in pursuing this, please reach out to the triage team (@bazelbuild/triage
). Thanks!
@bazelbuild/triage Can you look at this for google/flatbuffers? https://github.com/google/flatbuffers/blob/master/src/BUILD.bazel#L23-L28
@bazelbuild/triage Would you consider re-opening this auto-closed issue? I'm not going to say Bazel is dead in the water on FreeBSD due to this issue but it does break a lot of stuff on FreeBSD...
IMHO, the most appropriate fix for this is to have 2 sets of rules: 1. cc_library, cc_binary, etc. (using clang++) and 2. c_binary, c_library, etc. (using clang)
Thank you for contributing to the Bazel repository! This issue has been marked as stale since it has not had any activity in the last 1+ years. It will be closed in the next 90 days unless any other activity occurs. If you think this issue is still relevant and should stay open, please post any comment here and the issue will no longer be marked as stale.
Description of the problem / feature request:
Apparently, Bazel uses
/usr/bin/clang
instead of/usr/bin/clang++
to compile/link C++ code. I'm not sure whether this is intentional, but the behavior forclang
is different fromclang++
resulting in subtle problems at compile/link time:The first command is what Bazel uses for purely C++ code on my FreeBSD system and the latter is what it should use. The only difference is
clang++
instead ofclang
.Feature requests: what underlying problem are you trying to solve with this feature?
cc_library
for C++ andc_library
for C code.Bugs: what's the simplest, easiest way to reproduce this bug? Please provide a minimal example if possible.
What operating system are you running Bazel on?
and
What's the output of
bazel info release
?FreeBSD
and
GhostBSD (FreeBSD 12.0-RELEASE based)
What's the output of
git remote get-url origin ; git rev-parse master ; git rev-parse HEAD
?Have you found anything relevant by searching the web?
Yes, apparently, everybody including me was getting around this by adding
-lm
linker flags until it was noticed that/usr/bin/clang
is being used instead of/usr/bin/clang++
to link C++ code. Here's an example from the Bazel source tree.Any other information, logs, or outputs that you want to share?
I think the above should include the logs, but please ask if you need anything else.