-
Notifications
You must be signed in to change notification settings - Fork 785
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
configure: error: C compiler cannot create executables #319
Comments
Fails on 06d7994 as well. |
@sstephenson The only relevant changes between 84820db1c0793239ad20a36a10ac3e74c1a73a0d and master at the moment are the CFLAGS changes you made yesterday. Any idea why those may be causing this issue? |
@jrgifford It sounds like you have both clang and gcc installed. ruby-build detects clang and adds You can work around this error by running The question is, why does Ruby's configure pick gcc instead of clang? /cc @jeremy |
@sstephenson This is because Ruby does the gcc-4.2/clang/gcc/cc check on darwin only. On other platforms, So if clang is available on Ubuntu, we'll break unless the user passed Argh. Sounds better to limit our test to darwin. |
Correct that I can run I do have both clang and gcc installed. James Gifford On Thu, Feb 28, 2013 at 9:42 PM, Jeremy Kemper [email protected]:
|
Just got bit by this one today. Sam's workaround was successful though. |
This should get fixed soon, I was playing with a potential fix last week. James Gifford
|
The previous version of this logic was causing us to pass the flag when * clang is on the PATH, and * $CC, or 'clang' if CC unset, accepts the flag. But this is totally wrong if we have clang installed, haven't set $CC, and are going to end up using gcc. We end up passing the flag to gcc, which rejects it. The real fix is to put this in the autoconf goo in MRI upstream -- the only correct way to decide whether to pass this flag is after we know exactly what compiler we're using and can test if that compiler accepts the flag. But we can do better than before by approximating autoconf's choice of compiler as $CC if set, 'cc' otherwise (which will typically be a symlink to gcc or clang or another.) Fixes: rbenv#319 and rbenv#325, which is a dupe.
Just submitted a fix as #339. @jeremy, @sstephenson, I don't think that explanation of why MRI's configure script picks gcc is right. The case statement mentioning gcc-4.2, gcc, cc, and clang doesn't affect the C compiler used -- it's only reading Later on, the script invokes the standard Autoconf macro
So GCC will be chosen because it's the preference embedded into Autoconf. The environment variable This highlights how tough it is to accurately guess from the outside what |
Fixed by #339 |
Yay! 😄 |
Despite this issue is two years old I had to do this patch manually a month ago.
|
I see this with any version of the C ruby family.
https://gist.github.com/jrgifford/5057327
However, when I revert ruby-build to 84820db, it works.
OS: Ubuntu 12.10, 32 bit.
The text was updated successfully, but these errors were encountered: