Skip to content

Bazel calls strip with invalid -R option under OS X #3838

@zuercher

Description

@zuercher

Tested with bazel-0.6.0. This is basically a variation on #209, but with a different flag.

This issue continues to cause problems for https://github.com/envoyproxy/envoy. We currently have a workaround for #209 that works with 0.5.4 but not 0.6.0.

The bug is trivially reproducible with the bazelbuild examples repository:

$ git clone https://github.com/bazelbuild/examples
$ cd examples/cpp-tutorial/stage1
$ bazel build //main:hello-world.stripped
INFO: Found 1 target...
ERROR: /Users/stephan/workspace/examples/cpp-tutorial/stage1/main/BUILD:1:1: Stripping main/hello-world.stripped for //main:hello-world failed (Exit 1).
fatal error: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/strip: only one -R option allowed
Target //main:hello-world.stripped failed to build
Use --verbose_failures to see the command lines of failed build steps.
INFO: Elapsed time: 6.078s, Critical Path: 0.40s

Using --verbose_failures shows that strip command is

/usr/bin/strip -S -o bazel-out/darwin_x86_64-fastbuild/bin/main/hello-world.stripped -R .gnu.switches.text.quote_paths -R .gnu.switches.text.bracket_paths -R .gnu.switches.text.system_paths -R .gnu.switches.text.cpp_defines -R .gnu.switches.text.cpp_includes -R .gnu.switches.text.cl_args -R .gnu.switches.text.lipo_info -R .gnu.switches.text.annotation bazel-out/darwin_x86_64-fastbuild/bin/main/hello-world

Xcode's strip command does not accept section names for the -R flag. It's a flag for specifying a file containing symbol names to be stripped.

Environment info

Metadata

Metadata

Assignees

Labels

P2We'll consider working on this in future. (Assignee optional)type: bug

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions