-
Notifications
You must be signed in to change notification settings - Fork 2.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to tell absl's bazel script which compiler (gcc/clang) #1263
Comments
Bazel should default to using gcc flags, so I'm not sure why it isn't. What OS are you using and how is your compiler setup/installed? But to answer your question, there are environment variables you can use to override these things. Try something like |
Using Ubuntu 20.04. We have custom gcc rules, so we use a "gcc toolchain" even though it's the system gcc. It's a large project... it could well be something woolly that we've done. One curious thing: the error happens when build
(This doesn't work |
When you say you are using a "gcc toolchain", does that mean you are using a toolchain config file? That would explain why the command I gave doesn't work, but unfortunately I can't offer anymore help without a full reproduction that I can try myself. The start point for how we select compiler flags is here: abseil-cpp/absl/copts/configure_copts.bzl Lines 24 to 29 in 92fdbfb
|
Yes, we have our own |
If you are curious, this may be the bug: bazelbuild/bazel#12707 |
If that's actually the issue then I think this can be fixed in a backwards compatible way by adding an additional case to the selectors. I'll give that a try. |
@aaron-michaux - Please re-open if this your issue isn't fixed. |
… to "gcc", instead of just detecting Bazel's default "compiler" string. When Bazel auto-configures GCC, it sets the compiler string to "compiler", probably for backwards compatibility. Some users manually set the string to "gcc". This should address the backwards compatibility issues described in bazelbuild/bazel#12707 and hopefully fix abseil#1263 PiperOrigin-RevId: 473069817 Change-Id: I8a24721f63f9d61447b22b3b05b06a9dde7d34d8
Hi,
I've got an interesting problem, where I've specified my own (gcc based) toolchain, and this is preventing me from using absl's bazel integration. In particular, absl is detecting that I'm using gcc, and starts passing clang-only flags, and... kBOOM!
How does absl figure which compiler I'm using, and how do I tell it to assume gcc?
Thanks
The text was updated successfully, but these errors were encountered: