Skip to content

gcc does not support "-Wno-error=shorten-64-to-32" #325

@quark-zju

Description

@quark-zju

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions