Skip to content

Commit

Permalink
Do not add a build id to C++ binaries by default.
Browse files Browse the repository at this point in the history
Fixes bazelbuild#2805.

RELNOTES: None.
PiperOrigin-RevId: 153039178
lberki authored and buchgr committed Apr 13, 2017
1 parent ac08077 commit 724706b
Showing 5 changed files with 1 addition and 19 deletions.
2 changes: 1 addition & 1 deletion site/versions/master/docs/bazel-user-manual.html
Original file line number Diff line number Diff line change
@@ -2310,7 +2310,7 @@ <h4 id='flag--subcommands'><code class='flag'>--subcommands</code> (<code>-s</co
&gt;&gt;&gt;&gt;&gt; # //examples/cpp:hello-world [action 'Linking examples/cpp/hello-world']
(cd /home/jrluser/.cache/bazel/_bazel_jrluser/4c084335afceb392cfbe7c31afee3a9f/bazel && \
exec env - \
/usr/bin/gcc -o bazel-out/local_linux-fastbuild/bin/examples/cpp/hello-world -B/usr/bin/ -Wl,-z,relro,-z,now -no-canonical-prefixes -pass-exit-codes '-Wl,--build-id=md5' '-Wl,--hash-style=gnu' -Wl,-S -Wl,@bazel-out/local_linux-fastbuild/bin/examples/cpp/hello-world-2.params)
/usr/bin/gcc -o bazel-out/local_linux-fastbuild/bin/examples/cpp/hello-world -B/usr/bin/ -Wl,-z,relro,-z,now -no-canonical-prefixes -pass-exit-codes -Wl,-S -Wl,@bazel-out/local_linux-fastbuild/bin/examples/cpp/hello-world-2.params)
</pre>
<p>
Where possible, commands are printed in a Bourne shell compatible syntax,
Original file line number Diff line number Diff line change
@@ -119,9 +119,6 @@ toolchain {
linker_flag: "-no-canonical-prefixes"
# Have gcc return the exit code from ld.
linker_flag: "-pass-exit-codes"
# Stamp the binary with a unique identifier.
linker_flag: "-Wl,--build-id=md5"
linker_flag: "-Wl,--hash-style=gnu"
# Gold linker only? Can we enable this by default?
# linker_flag: "-Wl,--warn-execstack"
# linker_flag: "-Wl,--detect-odr-violations"
Original file line number Diff line number Diff line change
@@ -127,10 +127,6 @@ toolchain {
# Keep stack frames for debugging, even in opt mode.
compiler_flag: "-fno-omit-frame-pointer"

# Stamp the binary with a unique identifier.
linker_flag: "-Wl,--build-id=md5"
linker_flag: "-Wl,--hash-style=gnu"

compilation_mode_flags {
mode: DBG
# Enable debug symbols.
@@ -191,8 +187,6 @@ toolchain {
linker_flag: "-B/usr/bin"
linker_flag: "-B/usr/bin"
linker_flag: "-pass-exit-codes"
linker_flag: "-Wl,--build-id=md5"
linker_flag: "-Wl,--hash-style=gnu"
needsPic: true
objcopy_embed_flag: "-I"
objcopy_embed_flag: "binary"
@@ -237,4 +231,3 @@ toolchain {
}
linking_mode_flags { mode: DYNAMIC }
}

5 changes: 0 additions & 5 deletions tools/cpp/CROSSTOOL
Original file line number Diff line number Diff line change
@@ -168,9 +168,6 @@ toolchain {
linker_flag: "-no-canonical-prefixes"
# Have gcc return the exit code from ld.
linker_flag: "-pass-exit-codes"
# Stamp the binary with a unique identifier.
linker_flag: "-Wl,--build-id=md5"
linker_flag: "-Wl,--hash-style=gnu"
# Gold linker only? Can we enable this by default?
# linker_flag: "-Wl,--warn-execstack"
# linker_flag: "-Wl,--detect-odr-violations"
@@ -386,8 +383,6 @@ toolchain {
# Have gcc return the exit code from ld.
#linker_flag: "-pass-exit-codes"
# Stamp the binary with a unique identifier.
#linker_flag: "-Wl,--build-id=md5"
linker_flag: "-Wl,--hash-style=gnu"
# Gold linker only? Can we enable this by default?
# linker_flag: "-Wl,--warn-execstack"
# linker_flag: "-Wl,--detect-odr-violations"
3 changes: 0 additions & 3 deletions tools/cpp/cc_configure.bzl
Original file line number Diff line number Diff line change
@@ -261,9 +261,6 @@ def _crosstool_content(repository_ctx, cc, cpu_value, darwin):
"-B" + str(repository_ctx.path(cc).dirname),
# Always have -B/usr/bin, see https://github.com/bazelbuild/bazel/issues/760.
"-B/usr/bin",
# Stamp the binary with a unique identifier.
"-Wl,--build-id=md5",
"-Wl,--hash-style=gnu"
# Gold linker only? Can we enable this by default?
# "-Wl,--warn-execstack",
# "-Wl,--detect-odr-violations"

0 comments on commit 724706b

Please sign in to comment.