# ./configure doesn't like CFLAGS='-ggdb'

**URL:** <https://www.ruby-forum.com/t/configure-doesnt-like-cflags-ggdb/56083>\
**Category:** Ruby\
**Created:** [March 28, 2006, 1:14am UTC](https://www.ruby-forum.com/t/configure-doesnt-like-cflags-ggdb/56083 "2006-03-28T01:14:29Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![daveh](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/85e7bf/32.png) [@daveh](https://www.ruby-forum.com/u/daveh)\
**Post date:** [March 28, 2006, 1:14am UTC](https://www.ruby-forum.com/t/configure-doesnt-like-cflags-ggdb/56083/1 "2006-03-28T01:14:29Z")

</div>

My RubyCocoa app has started exploding with “BUS ERROR,” or perhaps  
more precisely,  
Program received signal: “EXC\_BAD\_ACCESS”.

Asking the debugger to help told me that it was caused as a result of  
something going wrong with an Event running down the chain and then  
something bad happening, but that was about all I could figure out. I’m  
not even sure what kind of event it was.

I found the following info on how to make Ruby and RubyCocoa more  
“debuggable” at  
[http://www.rubycocoa.com/an-introduction-to-rubycocoa/6:](http://www.rubycocoa.com/an-introduction-to-rubycocoa/6:)

```
First, build a debuggable version of Ruby.
In your ruby source directory, run the following
commands from the bash shell:
	$ CFLAGS='-g -ggdb -fno-common' ./configure
	$ make
	$ sudo make install

```

Except that configure is very unhappy about that “-ggdb” flag. ☹  
“checking for C compiler default output file name… configure: error:  
C compiler cannot create executables”

I also tried the form that the ./configure --help output suggested:  
./configure CFLAGS=‘-g -ggdb -fno-common’

It continues past that spot without a problem if I leave out the  
“-ggdb” part.

From config.log:

```
configure:2000: checking for C compiler default output file name
configure:2003: gcc -g -ggdb -fno-common conftest.c >&5
/var/tmp//cc0knt2z.s:1:Expected comma after segment-name
/var/tmp//cc0knt2z.s:1:Rest of line ignored. 1st junk character valued

```

76 (L).  
/var/tmp//cc0knt2z.s:2:Expected comma after segment-name  
/var/tmp//cc0knt2z.s:2:Rest of line ignored. 1st junk character valued  
76 (L).  
/var/tmp//cc0knt2z.s:3:Expected comma after segment-name  
/var/tmp//cc0knt2z.s:3:Rest of line ignored. 1st junk character valued  
76 (L).  
/var/tmp//cc0knt2z.s:25:Expected comma after segment-name  
/var/tmp//cc0knt2z.s:25:Rest of line ignored. 1st junk character  
valued 95 (\_).  
/var/tmp//cc0knt2z.s:69:Expected comma after segment-name  
/var/tmp//cc0knt2z.s:69:Rest of line ignored. 1st junk character  
valued 32 ( ).  
/var/tmp//cc0knt2z.s:120:Expected comma after segment-name  
/var/tmp//cc0knt2z.s:120:Rest of line ignored. 1st junk character  
valued 32 ( ).  
/var/tmp//cc0knt2z.s:147:Expected comma after segment-name  
/var/tmp//cc0knt2z.s:147:Rest of line ignored. 1st junk character  
valued 32 ( ).  
/var/tmp//cc0knt2z.s:199:Expected comma after segment-name  
/var/tmp//cc0knt2z.s:199:Rest of line ignored. 1st junk character  
valued 32 ( ).  
/var/tmp//cc0knt2z.s:206:Expected comma after segment-name  
/var/tmp//cc0knt2z.s:206:Rest of line ignored. 1st junk character  
valued 32 ( ).  
configure:2006: $? = 1  
configure: failed program was:  
| /\* confdefs.h. _/  
|  
| #define PACKAGE\_NAME “”  
| #define PACKAGE\_TARNAME “”  
| #define PACKAGE\_VERSION “”  
| #define PACKAGE\_STRING “”  
| #define PACKAGE\_BUGREPORT “”  
| /_ end confdefs.h. \*/  
|  
| int  
| main ()  
| {  
|  
| ;  
| return 0;  
| }  
configure:2045: error: C compiler cannot create executables  
See `config.log’ for more details.

Can anybody fill me in on what I need to do differently to compile Ruby  
with the “-ggdb” flag?

---

<div class="post-metadata">

**Author:** ![daveh](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/85e7bf/32.png) [@daveh](https://www.ruby-forum.com/u/daveh)\
**Post date:** [March 29, 2006, 11:15pm UTC](https://www.ruby-forum.com/t/configure-doesnt-like-cflags-ggdb/56083/2 "2006-03-29T23:15:16Z")

</div>

On Mar 27, 2006, at 15:13, Dave H. wrote:

> Can anybody fill me in on what I need to do differently to compile  
> Ruby with the “-ggdb” flag?

Is this a harder question than I thought, or maybe I asked this in the  
wrong place?

---

<div class="post-metadata">

**Author:** ![daveh](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/85e7bf/32.png) [@daveh](https://www.ruby-forum.com/u/daveh)\
**Post date:** [March 30, 2006, 5:57am UTC](https://www.ruby-forum.com/t/configure-doesnt-like-cflags-ggdb/56083/3 "2006-03-30T05:57:43Z")

</div>

On 3/29/06, Dave H. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> 

I’ve just compiled the Ruby last cvs version with -ggdb and “make  
test” succeeded.

---

<div class="post-metadata">

**Author:** ![daveh](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/85e7bf/32.png) [@daveh](https://www.ruby-forum.com/u/daveh)\
**Post date:** [April 1, 2006, 3:53am UTC](https://www.ruby-forum.com/t/configure-doesnt-like-cflags-ggdb/56083/4 "2006-04-01T03:53:43Z")

</div>

On Mar 29, 2006, at 19:56, Nicolas Desprès wrote:

> > 
> 
> I’ve just compiled the Ruby last cvs version with -ggdb and “make  
> test” succeeded.

I’m not getting that far. “configure” won’t let me try to actually  
compile, because it declares that the compiler isn’t working right when  
I add that flag.

Maybe it’s something that “got fixed” in the current version . . . .

---

<div class="post-metadata">

**Author:** ![daveh](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/85e7bf/32.png) [@daveh](https://www.ruby-forum.com/u/daveh)\
**Post date:** [April 1, 2006, 5:48pm UTC](https://www.ruby-forum.com/t/configure-doesnt-like-cflags-ggdb/56083/5 "2006-04-01T17:48:17Z")

</div>

On 4/1/06, Dave H. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> > > Is this a harder question than I thought, or maybe I asked this in the  
> > > I add that flag.
> 
> Maybe it’s something that “got fixed” in the current version . . . .

I too can build both the latest CVS version and the 1.8.4 release with  
-ggdb. But I’m on a x86 Debian GNU/Linux machine, while I guess you’re  
on a Mac (and probably a PowerPC) since you’re using RubyCocoa.  
Perhaps the installed version of gcc or as or some other surrounding  
tools are broken with the -ggdb flag? You could try upgrading gcc (I  
successfully built ruby with gcc 4.0.3) to see if that helps.

But before you go to all that trouble, just try running configure  
without -ggdb and instead hand-edit Makefile after this step, changing  
the line which contains CFLAGS= to include -ggdb, and then  
continue building ruby (but you will probably get the same error in  
the next step instead…)

---

<div class="post-metadata">

**Author:** ![daveh](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/85e7bf/32.png) [@daveh](https://www.ruby-forum.com/u/daveh)\
**Post date:** [April 2, 2006, 1:52am UTC](https://www.ruby-forum.com/t/configure-doesnt-like-cflags-ggdb/56083/6 "2006-04-02T01:52:45Z")

</div>

On Apr 1, 2006, at 7:45, Olof Sivertsson wrote:

> continue building ruby (but you will probably get the same error in  
> the next step instead…)

You are correct on all counts. I found the line you described with no  
problem, changed it, and started getting error messages immediately. I  
also took another close look at the man pages for “gcc” which warned me  
that OSX gcc had some bonus Apple commands but is also missing some  
things, and that under OSX it’s actually a link to gcc-3.3.

Except it’s not. Last time I tried to compile Ruby, I couldn’t get it  
to run until I replaced the “/user/bin/gcc” link with a simple copy of  
the “gcc3” file in my /user/bin directory.

So I went back to the make file, and changed the CC= to be CC=gcc-3.3

And hocus-pocus-in-focus, the makefile is now merrily pouring page  
after page of utterly mystifying yet somehow reassuring text across my  
screen.

Thanks!
