ruby-build: gcc does not support "-Wno-error=shorten-64-to-32"
ruby-build script contains following workaround for clang:
# Work around warnings building Ruby 2.0 on Clang 2.x
if type clang &>/dev/null; then
if "${CC:-clang}" -x c /dev/null -E -Wno-error=shorten-64-to-32 &>/dev/null; then
RUBY_CFLAGS="$RUBY_CFLAGS -Wno-error=shorten-64-to-32"
fi
fi
If both gcc and clang installed and cc
is gcc
, the above workaround will be triggered wrongly and result in failing to compile anything:
configure:3741: checking whether the C compiler works
configure:3763: gcc -Wno-error=shorten-64-to-32 -I'/home/quark/.rbenv/versions/2.0.0-p0/include' -L'/home/quark/.rbenv/versions/2.0.0-p0/lib' conftest.c >&5
cc1: error: -Werror=shorten-64-to-32: no option -Wshorten-64-to-32
configure:3767: $? = 1
configure:3805: result: no
configure: failed program was:
| /* confdefs.h */
| #define PACKAGE_NAME ""
| #define PACKAGE_TARNAME ""
| #define PACKAGE_VERSION ""
| #define PACKAGE_STRING ""
| #define PACKAGE_BUGREPORT ""
| #define PACKAGE_URL ""
| #define CANONICALIZATION_FOR_MATHN 1
| #define RUBY_BASE_NAME "ruby" !<verconf>!
| #define RUBY_VERSION_NAME RUBY_BASE_NAME"-"RUBY_LIB_VERSION !<verconf>!
| /* end confdefs.h. */
|
| int
| main ()
| {
|
| ;
| return 0;
| }
configure:3810: error: in `/tmp/ruby-build.20130310154119.10022/ruby-2.0.0-p0':
configure:3812: error: C compiler cannot create executables
See `config.log' for more details
How about changing ${CC:-clang}
to ${CC:-cc}
in the workaround script?
About this issue
- Original URL
- State: closed
- Created 11 years ago
- Comments: 19 (4 by maintainers)
Commits related to this issue
- Better target the shorten-64-to-32 workaround (#325) 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 f... — committed to gnprice/ruby-build by gnprice 11 years ago
- Better target the shorten-64-to-32 workaround (#325, #319) 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... — committed to gnprice/ruby-build by gnprice 11 years ago
@glaszig @NuLL3rr0r I’m on Mac OSX with Homebrew. My solution was centered around my $PATH variable to use my system defaults loading /usr/bin/* first If I loaded /usr/local/bin first, that’s when all would fail.
Not sure if that helps but hopefully it sheds some kind of light.