Project

General

Profile

Bug #8268

ruby 2.0.0 incorrectly detects debugflags on SmartOS / gcc 4.7

Added by Matt Connolly over 3 years ago. Updated over 3 years ago.

Status:
Closed
Priority:
Normal
ruby -v:
2.0.0-p0
Backport:
[ruby-core:54277]

Description

When compiling ruby from source on Smart OS, which uses gcc-4.7, the configure script fails to correctly detect a compatible debug flag. It chooses "-ggdb3" which doesn't work, and this causes all of the conftest.c compilations to fail at build without executing.

Running configure like "./configure ac_cv_func_dl_iterate_phdr=no" fails to complete the configure script.

Running configure like this: ./configure ac_cv_func_dl_iterate_phdr=no debugflags="-ggdb" works. Configure completes and ruby compiles and runs fine.

I'm not sure if this is a SmartOS specific problem, or gcc 4.7, so I'm writing it here to see if others have seen the same thing.


Related issues

Related to Ruby trunk - Bug #5384: Ruby 1.9.3-RC1 Fails to Compile on Illumos (OpenSolaris) Third Party's Issue 10/01/2011

Associated revisions

Revision 40364
Added by Nobuyoshi Nakada over 3 years ago

configure.in: -g and -fstack-protector flags can't work

together on SmartOS
* configure.in (stack_protector): control use of -fstack-protector.
* configure.in (debugflags): let -fstack-protector precede and disable
debugflags, because they can't work together on SmartOS. [Bug #8268]

Revision 40364
Added by Nobuyoshi Nakada over 3 years ago

configure.in: -g and -fstack-protector flags can't work

together on SmartOS
* configure.in (stack_protector): control use of -fstack-protector.
* configure.in (debugflags): let -fstack-protector precede and disable
debugflags, because they can't work together on SmartOS. [Bug #8268]

Revision 40364
Added by Nobuyoshi Nakada over 3 years ago

configure.in: -g and -fstack-protector flags can't work

together on SmartOS
* configure.in (stack_protector): control use of -fstack-protector.
* configure.in (debugflags): let -fstack-protector precede and disable
debugflags, because they can't work together on SmartOS. [Bug #8268]

History

#1 [ruby-core:54304] Updated by Yui NARUSE over 3 years ago

What is $target_os in configure on SmartOS?

#2 [ruby-core:54310] Updated by Nobuyoshi Nakada over 3 years ago

Could you show your config.log?

#3 [ruby-core:54311] Updated by Nobuyoshi Nakada over 3 years ago

At least, gcc 4.7 on Debian 7 and MacPorts work fine with -ggdb3, so it's not gcc 4.7 specific.

#4 [ruby-core:54429] Updated by Matt Connolly over 3 years ago

Hello naruse and nobu, thank you for looking into this issue.

I have recorded a log of attempting to build ruby-2.0.0-p0 in a clean SmartOS instance at this gist: https://gist.github.com/mattconnolly/5411998

This includes config.log. At the end I've tried a very simple .c program to check gcc.

The target os is 'solaris2.11'

I'm really not an expert at configure scripts and using autoconf, etc. I will help as much as I can.

#5 [ruby-core:54430] Updated by Matt Connolly over 3 years ago

Actually, I just found this page: http://docs.oracle.com/cd/E19082-01/819-0690/chapter4-29405/index.html

It appears that using CFLAGS="-R -fPIC" might help...

That makes configure succeed, but make fails with missing symbol "signbit". Possibly a separate issue.

Are there any other systems that use "-R" or "-fPIC" compiler flags?

#6 [ruby-core:54431] Updated by Matt Connolly over 3 years ago

I can add "rb_cv_have_signbit=no" to workaround the make error for now.

#7 Updated by Nobuyoshi Nakada over 3 years ago

  • Status changed from Open to Closed
  • % Done changed from 0 to 100

This issue was solved with changeset r40364.
Matt, thank you for reporting this issue.
Your contribution to Ruby is greatly appreciated.
May Ruby be with you.


configure.in: -g and -fstack-protector flags can't work

together on SmartOS
* configure.in (stack_protector): control use of -fstack-protector.
* configure.in (debugflags): let -fstack-protector precede and disable
debugflags, because they can't work together on SmartOS. [Bug #8268]

#8 [ruby-core:54449] Updated by Nobuyoshi Nakada over 3 years ago

Seems failing with -ggdb3 and -fstack-protector.
Setting CFLAGS excludes $debugflags from it.
Try r40364.

Also available in: Atom PDF