Skip to content
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

Rustc master (commit 8780d9c) won't compile on OS X Yosemite #17214

Closed
burtonageo opened this issue Sep 12, 2014 · 17 comments
Closed

Rustc master (commit 8780d9c) won't compile on OS X Yosemite #17214

burtonageo opened this issue Sep 12, 2014 · 17 comments

Comments

@burtonageo
Copy link
Contributor

Fails with

rustc: x86_64-apple-darwin/stage1/lib/rustlib/x86_64-apple-darwin/lib/liballoc
rustc: x86_64-apple-darwin/stage1/lib/rustlib/x86_64-apple-darwin/lib/libunicode
rustc: x86_64-apple-darwin/stage1/lib/rustlib/x86_64-apple-darwin/lib/libcollections
rustc: x86_64-apple-darwin/stage1/lib/rustlib/x86_64-apple-darwin/lib/librustrt
error: linking with `cc` failed: exit code: 1
note: cc '-m64' '-L' '/Users/georgeburton/Downloads/rust/x86_64-apple-darwin/stage1/lib/rustlib/x86_64-apple-darwin/lib' '-o' 'x86_64-apple-darwin/stage1/lib/rustlib/x86_64-apple-darwin/lib/librustrt-4e7c5e5c.dylib' 'x86_64-apple-darwin/stage1/lib/rustlib/x86_64-apple-darwin/lib/rustrt-4e7c5e5c.o' '-Wl,-force_load,/Users/georgeburton/Downloads/rust/x86_64-apple-darwin/stage1/lib/rustlib/x86_64-apple-darwin/lib/libmorestack.a' 'x86_64-apple-darwin/stage1/lib/rustlib/x86_64-apple-darwin/lib/rustrt-4e7c5e5c.metadata.o' '-nodefaultlibs' '-fno-lto' '-fno-use-linker-plugin' '-Wl,-dead_strip'  '/Users/georgeburton/Downloads/rust/x86_64-apple-darwin/stage1/lib/rustlib/x86_64-apple-darwin/lib/libcollections-4e7c5e5c.rlib' '/Users/georgeburton/Downloads/rust/x86_64-apple-darwin/stage1/lib/rustlib/x86_64-apple-darwin/lib/libunicode-4e7c5e5c.rlib' '/Users/georgeburton/Downloads/rust/x86_64-apple-darwin/stage1/lib/rustlib/x86_64-apple-darwin/lib/liballoc-4e7c5e5c.rlib' '/Users/georgeburton/Downloads/rust/x86_64-apple-darwin/stage1/lib/rustlib/x86_64-apple-darwin/lib/liblibc-4e7c5e5c.rlib' '/Users/georgeburton/Downloads/rust/x86_64-apple-darwin/stage1/lib/rustlib/x86_64-apple-darwin/lib/libcore-4e7c5e5c.rlib' '-L' 'x86_64-apple-darwin/rt' '-L' '/Users/georgeburton/Downloads/rust/x86_64-apple-darwin/llvm/Release+Asserts/lib' '-L' '.' '-L' '/Users/georgeburton/Projects/Rust' '-L' '.' '-L' '/Users/georgeburton/Downloads/rust/.rust' '-L'     '/Users/georgeburton/Downloads/rust' '-Wl,-force_load,x86_64-apple-darwin/rt/librustrt_native.a' '-    lpthread' '-lc' '-lm' '-dynamiclib' '-Wl,-dylib' '-lcompiler-rt'
note: clang: error: unknown argument: '-fno-use-linker-plugin'

error: aborting due to previous error
make: *** [x86_64-apple-darwin/stage1/lib/rustlib/x86_64-apple-darwin/lib/stamp.rustrt] Error 101
@burtonageo burtonageo changed the title Rustc master (commit 8780d9c) won't compile on Yosemite Rustc master (commit 8780d9c) won't compile on OS X Yosemite Sep 12, 2014
@pnkfelix
Copy link
Member

cc me

@pnkfelix
Copy link
Member

See also #17192 which proposes one fix but needs adjustment.

pnkfelix added a commit to pnkfelix/rust that referenced this issue Sep 14, 2014
The detected categorization is memoized in the Session object.

The link.rs backend then uses this information when choosing options
to add to the `cc` command line arguments (currently it just affects a
single option that will cause a hard error in clang in the future).

This is meant to be, in part, a more robust version of PR rust-lang#17192.

As drive-bys:

  * fix an english grammar mistake in a comment.

  * replace the use of `String` with `&str` for the program names
    corresponding `cc` and `ar`, avoiding unnecessary string copies
    but more importantly making the code overall look nicer.  :)

Fix rust-lang#17214.

(Addressed review nits from nrc and acrichto.)
@aturon
Copy link
Member

aturon commented Sep 14, 2014

Seeing the same problem on Mavericks (10.9.4)

@aturon
Copy link
Member

aturon commented Sep 15, 2014

FWIW, it's possible to work around this by installing gcc and making sure that gcc and cc are aliased to it.

@pnkfelix
Copy link
Member

This should be fixed now that PR #17192 has landed.

@alexcrichton
Copy link
Member

Feel free to reopen if this is still an issue though!

@shadowmint
Copy link

I ran rustup an hour ago:

rustc 0.12.0-pre-nightly (21d1f4d7c 2014-09-14 10:36:08 +0000)

And I still get:

error: linking with `cc` failed: exit code: 1
note: cc '-m64' '-L' '/usr/local/lib/rustlib/x86_64-apple-darwin/lib' '-o' '/Users/doug/dev/rust-fixture-tests/target/deps/libfixture-a07679ff6112e436.dylib' '/Users/doug/dev/rust-fi
note: clang: error: unknown argument: '-fno-use-linker-plugin' [-Wunused-command-line-argument-hard-error-in-future]
clang: note: this will be a hard error (cannot be downgraded to a warning) in the future

error: aborting due to previous error

Possibly the nightly build hasn't got this fix yet?

@thestinger
Copy link
Contributor

It's fixed on master and will be in the next nightly.

@shadowmint
Copy link

bors merged 1 commit into rust-lang:master from skade:fix-osx-linking about 15 hours ago

Guess it depends when the nightlies get built.

@tobyhede
Copy link

This is still breaking atm

@shadowmint
Copy link

@tobyhede No, it really is fixed. It's just that the nightly build bot for osx is broken. see #17328

If you build rust manually it works fine.

@tobyhede
Copy link

Ah. Right! Thanks.

@tobyhede
Copy link

I get the same error building the source d/l from https://static.rust-lang.org/dist/rust-nightly.tar.gz

@thestinger
Copy link
Contributor

Use master and it will work fine.

@kovek
Copy link

kovek commented Sep 17, 2014

I tried https://static.rust-lang.org/dist/rust-nightly-x86_64-apple-darwin.pkg , https://static.rust-lang.org/dist/rust-nightly-x86_64-apple-darwin.tar.gz and I tried building from a clone of the repo (I'm not sure the compiling processes completed, they seemed to get stuck) . None worked. Also:
$ rustc --version
rustc 0.12.0-pre-nightly (21d1f4d 2014-09-14 10:36:08 +0000)

@thestinger
Copy link
Contributor

and I tried building from a clone of the repo (I'm not sure the compiling processes completed, they seemed to get stuck)

Try again and wait for it to finish. It takes ~15 minutes for the Rust part (after LLVM is compiled) and won't continuously produce output. Using master rather than the nightlies will work fine.

@JoelOtter
Copy link

I could be wrong, but I think the fix for this issue has now made it to the OSX nightly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

9 participants