Opened 5 years ago

Closed 5 years ago

Last modified 5 years ago

#58569 closed defect (fixed)

bazel @0.26.1 build failure: unrecognized command line option '-fobjc-link-runtime'

Reported by: dbl001 (dbl) Owned by: cjones051073 (Chris Jones)
Priority: Normal Milestone:
Component: ports Version: 2.5.4
Keywords: Cc: RootFunction
Port: bazel

Description (last modified by ryandesign (Ryan Carsten Schmidt))

debug:sysinfo OS X 10.11 (darwin/15.6.0) arch i386
:debug:sysinfo MacPorts 2.5.4
:debug:sysinfo Xcode 8.2
:debug:sysinfo SDK 10.11
:debug:sysinfo MACOSX_DEPLOYMENT_TARGET: 10.11
$ gcc --version
Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/usr/include/c++/4.2.1
Apple LLVM version 8.0.0 (clang-800.0.42.1)
Target: x86_64-apple-darwin15.6.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin
info:build ^M^[[1A^[[Kgcc: error: unrecognized command line option '-fobjc-link-runtime'
$ sudo port upgrade outdated
--->  Computing dependencies for bazel
--->  Fetching archive for bazel
--->  Attempting to fetch bazel-0.26.1_0.darwin_15.x86_64.tbz2 from https://packages.macports.org/bazel
--->  Attempting to fetch bazel-0.26.1_0.darwin_15.x86_64.tbz2 from http://sea.us.packages.macports.org/macports/packages/bazel
--->  Attempting to fetch bazel-0.26.1_0.darwin_15.x86_64.tbz2 from http://ywg.ca.packages.macports.org/mirror/macports/packages/bazel
--->  Fetching distfiles for bazel
--->  Attempting to fetch bazel-0.26.1-dist.zip from https://distfiles.macports.org/bazel
--->  Verifying checksums for bazel                                             
--->  Extracting bazel
--->  Configuring bazel
--->  Building bazel
Error: Failed to build bazel: command execution failed
Error: See /opt/local/var/macports/logs/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_devel_bazel/bazel/main.log for details.
Error: Follow https://guide.macports.org/#project.tickets to report a bug.

Attachments (2)

main.log (961.9 KB) - added by dbl001 (dbl) 5 years ago.
osx_cc_wrapper.sh (3.2 KB) - added by dbl001 (dbl) 5 years ago.

Download all attachments as: .zip

Change History (13)

Changed 5 years ago by dbl001 (dbl)

Attachment: main.log added

comment:1 Changed 5 years ago by jmroot (Joshua Root)

Cc: RootFunction added
Keywords: bazel removed
Owner: set to cjones051073
Status: newassigned
Summary: Error: Failed to build bazel: command execution failedbazel @0.26.1 build failure: unrecognized command line option '-fobjc-link-runtime'

comment:2 Changed 5 years ago by jmroot (Joshua Root)

Seems to be the same as #56598 though that was said to be fixed at one point.

comment:3 Changed 5 years ago by cjones051073 (Chris Jones)

Built just fine in the buildbots, as can bee seen from

http://packages.macports.org/bazel/

as the tarballs are all there, for darwin14+.

Are you intentionally not using the prebuilt binaries ?

comment:4 Changed 5 years ago by cjones051073 (Chris Jones)

Also, what does

which gcc

give you ?

comment:5 Changed 5 years ago by cjones051073 (Chris Jones)

One other thing. Please run the build again, let it fail, then from the port work area ('port work bazel') dig out the file external/local_config_cc/cc_wrapper.sh and post it here. That script is auto-generated, so I need to see what *you* have in it... it is seemingly this script that is trying to run gcc

:info:build   external/local_config_cc/cc_wrapper.sh -lc++ -fobjc-link-runtime -Wl,-S -o bazel-out/host/bin/third_party/protobuf/3.6.1/protoc bazel-out/host/bin/third_party/protobuf/3.6.1/_objs/protoc/main.o bazel-out/host/bin/third_party/protobuf/3.6.1/libprotoc_lib.a bazel-out/host/bin/third_party/protobuf/3.6.1/libprotobuf.a bazel-out/host/bin/third_party/protobuf/3.6.1/libprotobuf_lite.a -headerpad_max_install_names -lpthread -lm -lpthread -lm -lpthread -lm -lpthread -lm -no-canonical-prefixes '-mmacosx-version-min=10.12')

which fails with

error: unrecognized command line option '-fobjc-link-runtime'

as that is a clang-only option...

I also need to see what which gcc gives for you, as I have a suspicion you might have port selected a gcc version, which means for you this is a real gcc compiler, rather than the clang wrapper the system provides.

Last edited 5 years ago by ryandesign (Ryan Carsten Schmidt) (previous) (diff)

comment:6 Changed 5 years ago by cjones051073 (Chris Jones)

Ok, I was able to reproduce the problem, and indeed it occurs when the user has a 'port select' for gcc active.

Controlling the bazel build is tough, and at this point I don't know how to stop this, so the simplest fix is to detect when this situation occurs and issue an error message, telling the user to deactivate it, at least for the duration of the build.

comment:7 Changed 5 years ago by Chris Jones <jonesc@…>

Resolution: fixed
Status: assignedclosed

In 3f548181baf52f1fa241c93cd645208ef91fa5c7/macports-ports (master):

bazel: Detect when a gcc port select is active and issue a build error.

Closes:#58569

Changed 5 years ago by dbl001 (dbl)

Attachment: osx_cc_wrapper.sh added

comment:8 Changed 5 years ago by dbl001 (dbl)

$ which gcc
/usr/bin/gcc
Last edited 5 years ago by ryandesign (Ryan Carsten Schmidt) (previous) (diff)

comment:9 Changed 5 years ago by dbl001 (dbl)

$ sudo port select gcc
Available versions for gcc:
	mp-gcc49
	mp-gcc5 (active)
	mp-gcc6
	mp-gcc7
	mp-gcc8
	none
Last edited 5 years ago by ryandesign (Ryan Carsten Schmidt) (previous) (diff)

comment:10 Changed 5 years ago by dbl001 (dbl)

$ sudo port deactivate gcc5
--->  Deactivating gcc5 @5.5.0_4
--->  Cleaning gcc5
MacBook-Pro:lda2vec davidlaxer$ sudo port upgrade outdated
Portfile changed since last build; discarding previous state.
--->  Computing dependencies for bazel
--->  Fetching archive for bazel
--->  Attempting to fetch bazel-0.26.1_0.darwin_15.x86_64.tbz2 from https://packages.macports.org/bazel
--->  Attempting to fetch bazel-0.26.1_0.darwin_15.x86_64.tbz2.rmd160 from https://packages.macports.org/bazel
--->  Installing bazel @0.26.1_0
--->  Cleaning bazel
--->  Computing dependencies for bazel
--->  Deactivating bazel @0.26.0_0
--->  Cleaning bazel
--->  Activating bazel @0.26.1_0
--->  Cleaning bazel
--->  Fetching archive for curl-ca-bundle
--->  Attempting to fetch curl-ca-bundle-7.65.1_0.darwin_15.noarch.tbz2 from https://packages.macports.org/curl-ca-bundle
--->  Attempting to fetch curl-ca-bundle-7.65.1_0.darwin_15.noarch.tbz2.rmd160 from https://packages.macports.org/curl-ca-bundle
--->  Installing curl-ca-bundle @7.65.1_0
--->  Cleaning curl-ca-bundle
--->  Deactivating curl-ca-bundle @7.64.1_0
--->  Cleaning curl-ca-bundle
--->  Activating curl-ca-bundle @7.65.1_0
--->  Cleaning curl-ca-bundle
--->  Computing dependencies for curl
--->  Fetching archive for curl
--->  Attempting to fetch curl-7.65.1_0+ssl.darwin_15.x86_64.tbz2 from https://packages.macports.org/curl
--->  Attempting to fetch curl-7.65.1_0+ssl.darwin_15.x86_64.tbz2.rmd160 from https://packages.macports.org/curl
--->  Installing curl @7.65.1_0+ssl
--->  Cleaning curl
--->  Computing dependencies for curl
--->  Deactivating curl @7.64.1_0+ssl
--->  Cleaning curl
--->  Activating curl @7.65.1_0+ssl
--->  Cleaning curl
--->  Computing dependencies for py27-mako
--->  Fetching archive for py27-mako
--->  Attempting to fetch py27-mako-1.0.12_0.darwin_15.noarch.tbz2 from https://packages.macports.org/py27-mako
--->  Attempting to fetch py27-mako-1.0.12_0.darwin_15.noarch.tbz2.rmd160 from https://packages.macports.org/py27-mako
--->  Installing py27-mako @1.0.12_0
--->  Cleaning py27-mako
--->  Computing dependencies for py27-mako
--->  Deactivating py27-mako @1.0.11_0
--->  Cleaning py27-mako
--->  Activating py27-mako @1.0.12_0
--->  Cleaning py27-mako
--->  Updating database of binaries
--->  Scanning binaries for linking errors
--->  No broken files found.                             
--->  No broken ports found.
--->  Some of the ports you installed have notes:
  bazel has the following notes:
    See http://bazel.build/docs/getting-started.html to start a new project!

comment:11 Changed 5 years ago by ryandesign (Ryan Carsten Schmidt)

Description: modified (diff)
Note: See TracTickets for help on using tickets.