Bug 10057 - [Sparc/Solaris 2.6] relocation error when creating libstdc++
Summary: [Sparc/Solaris 2.6] relocation error when creating libstdc++
Status: RESOLVED WORKSFORME
Alias: None
Product: gcc
Classification: Unclassified
Component: bootstrap (show other bugs)
Version: 3.4.0
: P3 normal
Target Milestone: 3.3.1
Assignee: Eric Botcazou
URL:
Keywords:
: 24159 (view as bug list)
Depends on:
Blocks:
 
Reported: 2003-03-13 09:26 UTC by ask
Modified: 2005-10-01 17:27 UTC (History)
5 users (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description ask 2003-03-13 09:26:01 UTC
../gcc/configure --prefix=/usr/local/gcc34 --with-cpu=ultrasparc --enable-languages=c,c++ && make CFLAGS=-O2 'LIBCFLAGS=-g -O2' 'LIBCXXFLAGS=-g -O2 -fno-implicit-templates' bootstrap && make install
[...]
/export/home2/ask/build/gcc-build/gcc/xgcc -shared-libgcc -B/export/home2/ask/build/gcc-build/gcc/ -nostdinc++  -L/export/home2/ask/build/gcc-build/sparc-sun-solaris2.6/libstdc++-v3/sr
c -L/export/home2/ask/build/gcc-build/sparc-sun-solaris2.6/libstdc++-v3/src/.libs -B/usr/local/gcc34/sparc-sun-solaris2.6/bin/ -B/usr/local/gcc34/sparc-sun-solaris2.6/lib/ -isystem /us
r/local/gcc34/sparc-sun-solaris2.6/include -isystem /usr/local/gcc34/sparc-sun-solaris2.6/sys-include -shared -nostdlib  /export/home2/ask/build/gcc-build/gcc/crti.o /usr/ccs/lib/value
s-Xa.o /export/home2/ask/build/gcc-build/gcc/crtbegin.o  .libs/codecvt.o .libs/complex_io.o .libs/concept-inst.o .libs/ctype.o .libs/demangle.o .libs/ext-inst.o .libs/fstream.o .libs/f
stream-inst.o .libs/functexcept.o .libs/globals.o .libs/io-inst.o .libs/ios.o .libs/istream-inst.o .libs/limits.o .libs/locale.o .libs/locale-inst.o .libs/localename.o .libs/misc-inst.
o .libs/ostream-inst.o .libs/sstream-inst.o .libs/stdexcept.o .libs/stl-inst.o .libs/streambuf-inst.o .libs/string-inst.o .libs/strstream.o .libs/valarray-inst.o .libs/wstring-inst.o .
libs/codecvt_members.o .libs/collate_members.o .libs/ctype_members.o .libs/messages_members.o .libs/monetary_members.o .libs/numeric_members.o .libs/time_members.o .libs/basic_file.o .
libs/c++locale.o .libs/libstdc++.lax/libmath.a/stubs.o .libs/libstdc++.lax/libmath.a/nan.o .libs/libstdc++.lax/libmath.a/copysignf.o .libs/libstdc++.lax/libmath.a/signbit.o .libs/libst
dc++.lax/libmath.a/signbitf.o  .libs/libstdc++.lax/libsupc++convenience.a/del_op.o .libs/libstdc++.lax/libsupc++convenience.a/del_opnt.o .libs/libstdc++.lax/libsupc++convenience.a/del_
opv.o .libs/libstdc++.lax/libsupc++convenience.a/del_opvnt.o .libs/libstdc++.lax/libsupc++convenience.a/eh_alloc.o .libs/libstdc++.lax/libsupc++convenience.a/eh_aux_runtime.o .libs/lib
stdc++.lax/libsupc++convenience.a/eh_catch.o .libs/libstdc++.lax/libsupc++convenience.a/eh_exception.o .libs/libstdc++.lax/libsupc++convenience.a/eh_globals.o .libs/libstdc++.lax/libsu
pc++convenience.a/eh_personality.o .libs/libstdc++.lax/libsupc++convenience.a/eh_term_handler.o .libs/libstdc++.lax/libsupc++convenience.a/eh_terminate.o .libs/libstdc++.lax/libsupc++c
onvenience.a/eh_throw.o .libs/libstdc++.lax/libsupc++convenience.a/eh_type.o .libs/libstdc++.lax/libsupc++convenience.a/eh_unex_handler.o .libs/libstdc++.lax/libsupc++convenience.a/gua
rd.o .libs/libstdc++.lax/libsupc++convenience.a/new_handler.o .libs/libstdc++.lax/libsupc++convenience.a/new_op.o .libs/libstdc++.lax/libsupc++convenience.a/new_opnt.o .libs/libstdc++.
lax/libsupc++convenience.a/new_opv.o .libs/libstdc++.lax/libsupc++convenience.a/new_opvnt.o .libs/libstdc++.lax/libsupc++convenience.a/pure.o .libs/libstdc++.lax/libsupc++convenience.a
/tinfo.o .libs/libstdc++.lax/libsupc++convenience.a/tinfo2.o .libs/libstdc++.lax/libsupc++convenience.a/vec.o .libs/libstdc++.lax/libsupc++convenience.a/vterminate.o   -L/export/home2/
ask/build/gcc-build/sparc-sun-solaris2.6/libstdc++-v3/src -L/export/home2/ask/build/gcc-build/sparc-sun-solaris2.6/libstdc++-v3/src/.libs -lm ../libmath/.libs/libmath.a -lm ../libsupc+
+/.libs/libsupc++convenience.a -lm -L/export/home2/ask/build/gcc-build/gcc -L/usr/ccs/bin -L/usr/ccs/lib -lgcc_s -lgcc_s -lm -lgcc_s -lgcc_s   -lc /export/home2/ask/build/gcc-build/gcc
/crtend.o /export/home2/ask/build/gcc-build/gcc/crtn.o  -Wl,-h -Wl,libstdc++.so.6 -o .libs/libstdc++.so.6.0.0
ld: fatal: relocation error: R_SPARC_DISP32: file .libs/codecvt.o: symbol <unknown>: offset 0xed86e739 is non-aligned
ld: fatal: relocation error: R_SPARC_DISP32: file .libs/codecvt.o: symbol <unknown>: offset 0xed86e759 is non-aligned
ld: fatal: relocation error: R_SPARC_DISP32: file .libs/codecvt.o: symbol <unknown>: offset 0xed86e779 is non-aligned
ld: fatal: relocation error: R_SPARC_DISP32: file .libs/codecvt.o: symbol <unknown>: offset 0xed86e799 is non-aligned
ld: fatal: relocation error: R_SPARC_DISP32: file .libs/codecvt.o: symbol <unknown>: offset 0xed86e7b9 is non-aligned
ld: fatal: relocation error: R_SPARC_DISP32: file .libs/complex_io.o: symbol <unknown>: offset 0xed86e815 is non-aligned
ld: fatal: relocation error: R_SPARC_DISP32: file .libs/complex_io.o: symbol <unknown>: offset 0xed86e855 is non-aligned
ld: fatal: relocation error: R_SPARC_DISP32: file .libs/complex_io.o: symbol <unknown>: offset 0xed86e895 is non-aligned
ld: fatal: relocation error: R_SPARC_DISP32: file .libs/ctype.o: symbol <unknown>: offset 0xed86e8d1 is non-aligned
ld: fatal: relocation error: R_SPARC_DISP32: file .libs/ctype.o: symbol <unknown>: offset 0xed86e8f1 is non-aligned
ld: fatal: relocation error: R_SPARC_DISP32: file .libs/ctype.o: symbol <unknown>: offset 0xed86e911 is non-aligned
ld: fatal: relocation error: R_SPARC_DISP32: file .libs/demangle.o: symbol <unknown>: offset 0xed86e94d is non-aligned
ld: fatal: relocation error: R_SPARC_DISP32: file .libs/demangle.o: symbol <unknown>: offset 0xed86e96d is non-aligned
[...]
ld: fatal: relocation error: R_SPARC_DISP32: file .libs/libstdc++.lax/libsupc++convenience.a/vterminate.o: symbol <unknown>: offset 0xed874ff5 is non-aligned
collect2: ld returned 1 exit status
make[4]: *** [libstdc++.la] Error 1
make[4]: Leaving directory `/export/home2/ask/build/gcc-build/sparc-sun-solaris2.6/libstdc++-v3/src'
make[3]: *** [all-recursive] Error 1
make[3]: Leaving directory `/export/home2/ask/build/gcc-build/sparc-sun-solaris2.6/libstdc++-v3'
make[2]: *** [all-recursive-am] Error 2
make[2]: Leaving directory `/export/home2/ask/build/gcc-build/sparc-sun-solaris2.6/libstdc++-v3'
make[1]: *** [all-target-libstdc++-v3] Error 2
make[1]: Leaving directory `/export/home2/ask/build/gcc-build'
make: *** [bootstrap] Error 2

Release:
3.4 20030309

Environment:
SunOS 5.6 Generic_105181-32 sun4u sparc SUNW,Ultra-5_1
GNU ld version 2.13.2.1
Comment 1 Dara Hazeghi 2003-05-16 18:07:45 UTC
From: Dara Hazeghi <dhazeghi@yahoo.com>
To: ask@wisdom.weizmann.ac.il, gcc-gnats@gcc.gnu.org, nobody@gcc.gnu.org
Cc:  
Subject: Re: bootstrap/10057: symbol is non-aligned
Date: Fri, 16 May 2003 18:07:45 -0700

 http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit- 
 trail&database=gcc&pr=10057
 
 Hello,
 
 were you using GNU assembler for this build? Thanks,
 
 Dara
 
Comment 2 Eric Botcazou 2003-05-17 06:50:03 UTC
Responsible-Changed-From-To: unassigned->ebotcazou
Responsible-Changed-Why: Investigating.
Comment 3 Eric Botcazou 2003-05-17 06:50:03 UTC
State-Changed-From-To: open->feedback
State-Changed-Why: I can't reproduce with gcc version 3.4 20030407 (experimental)
    on SunOS beeba 5.6 Generic_105181-31 sun4u sparc SUNW,Ultra-2.
    
    My version of .libs/codecvt.o contains no occurence of the R_SPARC_DISP32
    relocation type. Which assembler do you use? Which version?
Comment 4 ask 2003-05-19 15:48:52 UTC
From: Alexander Klimov <ask@wisdom.weizmann.ac.il>
To: Dara Hazeghi <dhazeghi@yahoo.com>
Cc: gcc-gnats@gcc.gnu.org
Subject: Re: bootstrap/10057: symbol is non-aligned
Date: Mon, 19 May 2003 15:48:52 +0300 (IDT)

 On Fri, 16 May 2003, Dara Hazeghi wrote:
 > were you using GNU assembler for this build? Thanks,
 
 $ as --version
 GNU assembler 2.13.2.1
 [...]
 This assembler was configured for a target of `sparc-sun-solaris2.6'.
 
 Don't know what is the status of the bug, since I can't build the new cvs
 version of gcc due to some other bug (bootstrap/10859)
 
 Regards,
 ASK
 
 
 

Comment 5 Dara Hazeghi 2003-05-20 00:49:13 UTC
From: Dara Hazeghi <dhazeghi@yahoo.com>
To: Alexander Klimov <ask@wisdom.weizmann.ac.il>
Cc: gcc-gnats@gcc.gnu.org, gcc-bugs@gcc.gnu.org
Subject: Re: bootstrap/10057: symbol is non-aligned
Date: Tue, 20 May 2003 00:49:13 -0700 (PDT)

 --- Alexander Klimov <ask@wisdom.weizmann.ac.il>
 wrote:
 > On Fri, 16 May 2003, Dara Hazeghi wrote:
 > > were you using GNU assembler for this build?
 > Thanks,
 > 
 > $ as --version
 > GNU assembler 2.13.2.1
 > [...]
 > This assembler was configured for a target of
 > `sparc-sun-solaris2.6'.
 
 The reason I ask is someone else has reported similar
 issues with the Sun assembler (10805). I guess this
 must be a gcc issue. Sorry not to be able to help
 more.
 
 Dara
 
 __________________________________
 Do you Yahoo!?
 The New Yahoo! Search - Faster. Easier. Bingo.
 http://search.yahoo.com

Comment 6 Eric Botcazou 2003-05-20 14:45:52 UTC
From: Eric Botcazou <ebotcazou@libertysurf.fr>
To: Dara Hazeghi <dhazeghi@yahoo.com>
Cc: Alexander Klimov <ask@wisdom.weizmann.ac.il>,
 gcc-gnats@gcc.gnu.org,
 gcc-bugs@gcc.gnu.org
Subject: Re: bootstrap/10057: symbol is non-aligned
Date: Tue, 20 May 2003 14:45:52 +0200

 > The reason I ask is someone else has reported similar
 > issues with the Sun assembler (10805). I guess this
 > must be a gcc issue. Sorry not to be able to help
 > more.
 
 Yep, that's weird. For the record, I successfully bootstrapped on
 
 SunOS beeba 5.6 Generic_105181-31 sun4u sparc SUNW,Ultra-2
 cc: Sun WorkShop 6 update 2 C 5.3 Patch 111679-08 2002/05/09
 as: WorkShop Compilers 4.X dev 18 Sep 1996
 ld: Software Generation Utilities - Solaris Link Editors: 5.6-1.274
 
 with
 
 gmake 'LIBCXXFLAGS=-g -O2 -fno-implicit-templates' bootstrap
 
 results
 
 beeba% gcc/xgcc -v
 Using built-in specs.
 Configured with: src/configure --prefix=/opt/TWWfsw/gcc34 
 --with-local-prefix=/opt/TWWfsw/gcc34 --with-cpu=ultrasparc 
 --enable-languages=c,c++ --enable-checking=misc,tree,rtlflag --disable-nls
 Thread model: posix
 gcc version 3.4 20030407 (experimental)
 
 -- 
 Eric Botcazou

Comment 7 Eric Botcazou 2003-05-20 15:37:35 UTC
From: Eric Botcazou <ebotcazou@libertysurf.fr>
To: Alexander Klimov <ask@wisdom.weizmann.ac.il>
Cc: Dara Hazeghi <dhazeghi@yahoo.com>,
 <gcc-gnats@gcc.gnu.org>,
 <gcc-bugs@gcc.gnu.org>
Subject: Re: bootstrap/10057: symbol is non-aligned
Date: Tue, 20 May 2003 15:37:35 +0200

 > Any ideas what is wrong with my setup?
 
 Try maybe to not pass CFLAGS=-O2 when bootstrapping. The option is passed to 
 the bootstrap compiler (GCC 2.95.2 for you) and it may be risky to rely on 
 the optimizations of the bootstrap compiler.
 
 Use BOOT_CFLAGS instead.
 
 -- 
 Eric Botcazou
Comment 8 ask 2003-05-20 16:18:53 UTC
From: Alexander Klimov <ask@wisdom.weizmann.ac.il>
To: Eric Botcazou <ebotcazou@libertysurf.fr>
Cc: Dara Hazeghi <dhazeghi@yahoo.com>, <gcc-gnats@gcc.gnu.org>,
        <gcc-bugs@gcc.gnu.org>
Subject: Re: bootstrap/10057: symbol is non-aligned
Date: Tue, 20 May 2003 16:18:53 +0300 (IDT)

 On Tue, 20 May 2003, Eric Botcazou wrote:
 > Yep, that's weird. For the record, I successfully bootstrapped on
 I still have the same error with 3.4 20030520
 
 > SunOS beeba 5.6 Generic_105181-31 sun4u sparc SUNW,Ultra-2
 SunOS iridium 5.6 Generic_105181-32 sun4u sparc SUNW,Ultra-5_10
 
 > cc: Sun WorkShop 6 update 2 C 5.3 Patch 111679-08 2002/05/09
 gcc 2.95.2
 
 > as: WorkShop Compilers 4.X dev 18 Sep 1996
 GNU assembler 2.13.2.1
 
 > ld: Software Generation Utilities - Solaris Link Editors: 5.6-1.274
 GNU ld version 2.13.2.1
 
 > with
 >
 > gmake 'LIBCXXFLAGS=-g -O2 -fno-implicit-templates' bootstrap
 ../gcc/configure --prefix=/usr/local/gcc34 --with-cpu=ultrasparc
 --enable-languages=c,c++ && make CFLAGS=-O2 'LIBCFLAGS=-g -O2'
 'LIBCXXFLAGS=-g -O2 -fno-implicit-templates' bootstrap
 
 > results
 >
 > beeba% gcc/xgcc -v
 > Using built-in specs.
 > Configured with: src/configure --prefix=/opt/TWWfsw/gcc34
 > --with-local-prefix=/opt/TWWfsw/gcc34 --with-cpu=ultrasparc
 > --enable-languages=c,c++ --enable-checking=misc,tree,rtlflag --disable-nls
 > Thread model: posix
 > gcc version 3.4 20030407 (experimental)
 
 Any ideas what is wrong with my setup?
 
 Regards,
 ASK
 

Comment 9 Christian Ehrhardt 2003-05-21 09:02:45 UTC
State-Changed-From-To: feedback->open
State-Changed-Why: Feedback to Dara's question received.
Comment 10 Eric Botcazou 2003-05-21 09:24:32 UTC
State-Changed-From-To: open->feedback
State-Changed-Why: Sure, but I asked Alexander to try without setting CFLAGS.
Comment 11 Eric Botcazou 2003-06-05 08:24:46 UTC
Did you try with BOOT_CFLAGS instead of CFLAGS?
Comment 12 ask 2003-06-08 07:00:47 UTC
Subject: Re:  [Sparc/Solaris 2.6] relocation error when
 creating libstdc++

On 5 Jun 2003, ebotcazou@gcc.gnu.org wrote:
> ------- Additional Comments From ebotcazou@gcc.gnu.org  2003-06-05 08:24 -------
> Did you try with BOOT_CFLAGS instead of CFLAGS?

I tried without any flags:
../gcc/configure --prefix=/usr/local/gcc34 --enable-languages=c,c++ &&
make bootstrap

Do you want me to try some other command?

Regards,
ASK

Comment 13 Eric Botcazou 2003-06-08 08:13:46 UTC
Subject: Re:  [Sparc/Solaris 2.6] relocation error when creating libstdc++

> I tried without any flags:
> ../gcc/configure --prefix=/usr/local/gcc34 --enable-languages=c,c++ &&
> make bootstrap

Still the same error?

> Do you want me to try some other command?

I'm not sure whether this is going to change anything, but at this point we 
need to standardize everything. So could you:
- set

	CONFIG_SHELL=/bin/ksh

in your environment before configuring,

- pass

	--with-as=<path_to_gnu_as> --with-gnu-as

and

	--with-ld=<path_to_gnu_ld> --with-gnu-ld

to the configure script?

Thanks in advance.

Comment 14 ask 2003-06-08 14:12:48 UTC
Subject: Re:  [Sparc/Solaris 2.6] relocation error when
 creating libstdc++

On 8 Jun 2003, ebotcazou@libertysurf.fr wrote:
> > Do you want me to try some other command?
>
> I'm not sure whether this is going to change anything, but at this point we
> need to standardize everything. So could you:
> - set
>
> 	CONFIG_SHELL=/bin/ksh
>
> in your environment before configuring,
>
> - pass
>
> 	--with-as=<path_to_gnu_as> --with-gnu-as
>
> and
>
> 	--with-ld=<path_to_gnu_ld> --with-gnu-ld
>
> to the configure script?

Hmm, it is very strange -- now it works:

$ ../gcc/configure --prefix=/usr/local/gcc34 --enable-languages=c,c++
--with-as=/usr/local/bin/as --with-ld=/usr/local/bin/ld  --with-gnu-as
--with-gnu-ld && make bootstrap && make install

and I get

$ /usr/local/gcc34/bin/gcc --version
gcc (GCC) 3.4 20030520 (experimental)

Regards,
ASK

Comment 15 Eric Botcazou 2003-06-08 15:53:44 UTC
Subject: Re:  [Sparc/Solaris 2.6] relocation error when creating libstdc++

> Hmm, it is very strange -- now it works:
>
> $ ../gcc/configure --prefix=/usr/local/gcc34 --enable-languages=c,c++
> --with-as=/usr/local/bin/as --with-ld=/usr/local/bin/ld  --with-gnu-as
> --with-gnu-ld && make bootstrap && make install
>
> and I get
>
> $ /usr/local/gcc34/bin/gcc --version
> gcc (GCC) 3.4 20030520 (experimental)

Don't be that surprised, configuring on Solaris can fail in very subtle ways.

Thanks for the quick feedback.

Comment 16 Eric Botcazou 2003-06-08 15:57:40 UTC
Problem solved by following the Solaris-specific configuration instructions.
Comment 17 Andrew Pinski 2005-10-01 17:13:20 UTC
*** Bug 24159 has been marked as a duplicate of this bug. ***