Bazel picking up -D_FORTIFY_SOURCE somehow.

283 views
Skip to first unread message

Adam Langley

unread,
Sep 28, 2016, 8:36:42 PM9/28/16
to bazel-...@googlegroups.com
On some Linux platforms (Arch, for one) compiling C++ code picks up -D_FORTIFY_SOURCE. I have no idea where from, however. (It's not mentioned in any BUILD files.)

This causes problems because Fortify requires building with optimisations enabled. Otherwise the compiler errors out with "_FORTIFY_SOURCE requires compiling with optimization"

Currently I'm passing --copt=-U_FORTIFY_SOURCE to "fix" this but I'd love to know where the argument is coming from so that I can fix it correctly.


Cheers

AGL

Brian Silverman

unread,
Sep 28, 2016, 8:39:34 PM9/28/16
to Adam Langley, bazel-discuss
It's probably coming via the CROSSTOOL file generated by tools/cpp/cc_configure.bzl in the bazel source tree.

Annoying messages by default with some compilers is worth filing a bug about, but I'm not sure what the best alternative is.

--
You received this message because you are subscribed to the Google Groups "bazel-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to bazel-discuss+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/bazel-discuss/CAL9PXLyCQevoy5gbPyMR2%3DoQMSJ%3DvfwV_Y9ERqEV7Aj0Cxx6zQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Adam Langley

unread,
Sep 29, 2016, 12:31:36 PM9/29/16
to Brian Silverman, bazel-discuss
On Wed, Sep 28, 2016 at 5:39 PM, Brian Silverman <bsilve...@gmail.com> wrote:
It's probably coming via the CROSSTOOL file generated by tools/cpp/cc_configure.bzl in the bazel source tree.

Annoying messages by default with some compilers is worth filing a bug about, but I'm not sure what the best alternative is.

Thank you. That does look like it. I found https://github.com/bazelbuild/bazel/issues/1762 when I thought to look in GitHub so the bug already exists.


Cheers

AGL
Reply all
Reply to author
Forward
0 new messages