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

make check fails on OSX #10811

Closed
dwrensha opened this issue Dec 5, 2013 · 10 comments · Fixed by #10970
Closed

make check fails on OSX #10811

dwrensha opened this issue Dec 5, 2013 · 10 comments · Fixed by #10970
Labels
O-macos Operating system: macOS

Comments

@dwrensha
Copy link
Contributor

dwrensha commented Dec 5, 2013

I get this error:

...
maketest: c-static-dylib
----- /Users/davidrenshaw/Code/rust/src/test/run-make/c-static-dylib/ --------------------
------ stdout ---------------------------------------------
gcc -Wall -Werror -g -fPIC -m64 -arch x86_64 -L /Users/davidrenshaw/Code/rust/x86_64-apple-darwin/test/run-make/c-static-dylib -c -o /Users/davidrenshaw/Code/rust/x86_64-apple-darwin/test/run-make/c-static-dylib/libcfoo.o cfoo.c

------ stderr ---------------------------------------------
clang: error: argument unused during compilation: '-L/Users/davidrenshaw/Code/rust/x86_64-apple-darwin/test/run-make/c-static-dylib'
make[1]: *** [/Users/davidrenshaw/Code/rust/x86_64-apple-darwin/test/run-make/c-static-dylib/libcfoo.o] Error 1

This patch seems to fix the problem for me: dwrensha@1693b81

@alexcrichton
Copy link
Member

This should have been fixed by #10771. Are you using an older version of rust?

@dwrensha
Copy link
Contributor Author

dwrensha commented Dec 5, 2013

I'm using a version from a few hours ago, and I've tried clobbering any local state with git clean -fdx. The error still happens. :/

@alexcrichton
Copy link
Member

What revision are you using?

@dwrensha
Copy link
Contributor Author

dwrensha commented Dec 5, 2013

ad58e2c

@erickt
Copy link
Contributor

erickt commented Dec 13, 2013

@alexcrichton: I am also running into this error on OSX 10.9, on 1b12dca.

@metajack
Copy link
Contributor

This is a 10.9 error. You can work around it by removing -L $(TMPDIR) from tools.mk. However this is likely to break the build on other platforms.

@metajack
Copy link
Contributor

I think it's caused by Clang implicitly including the current directory as a link argument. Since there is no gcc on 10.9 anymore, this has started happening.

@erickt
Copy link
Contributor

erickt commented Dec 13, 2013

@metajack: I think I found a proper fix. If you change config.mk to have CFG_C_COMPILER=clang, I managed to get passed this build issue with c-static-dylib. So we should change configure to use clang by default if it detects we are on 10.9.

@cadencemarseille
Copy link
Contributor

Another option is to add -Qunused-arguments to the CC := ... line in src/test/run-make/tools.mk:

--- a/src/test/run-make/tools.mk
+++ b/src/test/run-make/tools.mk
@@ -1,5 +1,5 @@
 RUSTC := $(RUSTC) --out-dir $(TMPDIR) -L $(TMPDIR)
-CC := $(CC) -L $(TMPDIR)
+CC := $(CC) -Qunused-arguments -L $(TMPDIR)
 
 RUN = $(TMPDIR)/$(1)
 FAILS = $(TMPDIR)/$(1) && exit 1 || exit 0

See: http://stackoverflow.com/questions/13238511/xcode-clang-clang-warning-argument-unused-during-compilation-fcheck-new

@metajack
Copy link
Contributor

This is probably not quite enough since this option doesn't seem to exist in gcc. Do we have a CFG variable that detects whether we're using clang or gcc?

bors added a commit that referenced this issue Dec 15, 2013
This modifies the `configure` to set `CFG_ENABLE_CLANG=1` if `gcc` is actually `clang`. This is needed because OS X's clang enables warning on unused command line arguments. Our build system suppresses this by default, but when `CFG_ENABLE_CLANGE=0`, we do not. This causes one of the tests to fail. This patch changes rust to directly use clang, which fixes the build failure.

Closes #10811
@erickt erickt closed this as completed in 460a966 Dec 15, 2013
flip1995 pushed a commit to flip1995/rust that referenced this issue Jun 2, 2023
[`match_wild_err_arm`]: do not lint in const contexts

Fixes rust-lang#10635.

changelog: [`match_wild_err_arm`]: do not lint in const contexts as `Result::{unwrap, expect}` is not const-stable
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
O-macos Operating system: macOS
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants