Red Hat Bugzilla – Bug 61697
g++ 3.1 in skipjack: -g -O2: undefined reference to `.LC1'
Last modified: 2008-05-01 11:38:01 EDT
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:0.9.9) Gecko/20020311
Description of problem:
g++ 3.1 in skipjack aborts with an internal error when compiling the following
test program if both -g and -O2 options are used. Using either -g or -O2 works;
the combination of two triggers an unresolved symbol in the link phase.
I have isolated a small snippet from a larger code base, containing two small .C
and one .h file, with an autoconf and automake wrapper.
Note that the default configuration for autoconf will use -g and -O2 for
compiling C and C++ code.
Version-Release number of selected component (if applicable): 3.1
Steps to Reproduce:
1. Unpack the .tar.gz from the following attachment.
2. Run ./configure
3. Run ./make
g++ -Wall -g -O2 -o testafxpipe testafxpipe.o libafx.a
testafxpipe.o(.debug_info+0xeab6): undefined reference to `.LC1'
testafxpipe.o(.debug_info+0xeaf5): undefined reference to `.LC2'
libafx.a(afxpipe.o)(.debug_info+0x125d9): undefined reference to `.LC1'
libafx.a(afxpipe.o)(.debug_info+0x12698): undefined reference to `.LC2'
collect2: ld returned 1 exit status
Rerun the configure script and provide the --with-testmode option.
Run 'make clean', then 'make'. This will use only the '-g' option when
compiling the .C file. Or you can manually edit Makefile and drop -g or -O2
from CFLAGS and CXXFLAGS, it doesn't matter.
The test program will now build succesfully.
See the following attachment with two .C and one .h file.
Created attachment 49806 [details]
.tar.gz with the test program.
What do you mean by g++ 3.1 in skipjack.
AFAIK there was none, maybe just in preview.
Certainly I cannot reproduce this with gcc3-c++-3.1-0.23.1 nor gcc-c++-2.96-107.
As you mention above command g++ and version 3.1, I wonder whether you
aren't using some older gcc-c++-3.1-0.* compiler (this was something
which I remember fixing somewhere between 0.21 and 0.23 I think).
I loaded the wrong machine :-(. This is actually gcc-3.1-0.21 from the first beta.