public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
* sparc g++ fails "Hello world!"
@ 2001-12-16  0:42 Sean Callanan
  2001-12-16  9:01 ` Jeff Sturm
       [not found] ` <Pine.LNX.4.10.10112161150490.22736-100000@mars.deadcafe.or g>
  0 siblings, 2 replies; 5+ messages in thread
From: Sean Callanan @ 2001-12-16  0:42 UTC (permalink / raw)
  To: gcc

Dear mailing list:

The short version of this story is that a carefully bootstrapped g++ on a 
new LFS partition (g++ 3.0.2, glibc 2.2.4) creates binaries that have bus 
errors. If you are interested, here's the legend that goes along with it.
-
In the reign of

GNU C Library stable release version 2.1.3
Compiled by GNU CC version 2.95.2.19991024 (release)
Compiled on a Linux 2.2.16 system on 2000-08-08

there was created by Root (through his prophet RPM) the righteous

GNU binutils version 2.9.5 (sparc-suse-linux) using BFD version 2.9.5.0.24

and there was also Root's misbegotten offspring by a mistaken "make 
install" pass:

gcc version 3.0.2
Configured with ../gcc-3.0.2/configure --prefix=/usr --exec-prefix=/usr 
--enable-languages=c,c++ --disable-nls --disable-shared --host=sparc-linux 
--target=sparc-linux --program-prefix=sparc-linux-

which was a static binary. They begat

GNU binutils 2.11

which was a most righteous static binary, and

gcc version 3.0.2
Configured with ../gcc-3.0.2/configure --prefix=/usr 
--enable-languages=c,c++ --disable-nls --disable-shared 
--enable-threads=posix --program-prefix=sparc-linux-

which was also static, having at birth been "make bootstrap"ped most 
carefully. This binary was perfect save that the ruler (glibc 2.1.3) 
forbade inclusions of stdio-limits.h and therefore libstdc++ could not be built.

These two were "make install"ed by Root into a new Partition, and Root 
said, "Grow, multiply, may your compiled offspring cover the new Partition" 
for this was a Linux-from-Scratch partition.

Now they begat a new ruler:

GNU C Library stable release version 2.2.4
Compiled by GNU CC version 3.0.2
Compiled on a Linux 2.4.16 system on 2001-12-13

and under his reign there was born a "bootstrap"ping baby,

gcc version 3.0.2
Configured width ../gcc-3.0.2/configure --prefix=/usr 
--enable-languages=c,c++,objc,java --enable-threads=posix 
--program-prefix=sparc-linux- --host=sparc-linux

But all was not well in the new Partition, for Root came and issued the 
following Commands:

# cat test.cc

#include <iostream.h>
int main()
{
   cout << "Hello world!" << endl;
   return(0);
}

# sparc-linux-g++ -o test-c++ test.cc
# ./test-c++
Bus error
#

And there was much suffering among the people, for g++ was a necessity. And 
one rose up from the mass and cried, "Lord Root, if thou canst not help us, 
then call upon the gods of far gcc@gcc.gnu.org for among them are sages of 
wisdom who may be of help!"
-
And that's the legend. Does GCC make any modifications to the libstdc++ 
header files during compilation? I think I installed the header files for 
the static binary that wouldn't compile the library properly, and perhaps 
that inhibited the installation of proper headers when the good dynamic 
binary was built. Any ideas?

Sincerely,
Sean Callanan

Sincerely,
Sean Callanan 

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: sparc g++ fails "Hello world!"
  2001-12-16  0:42 sparc g++ fails "Hello world!" Sean Callanan
@ 2001-12-16  9:01 ` Jeff Sturm
       [not found] ` <Pine.LNX.4.10.10112161150490.22736-100000@mars.deadcafe.or g>
  1 sibling, 0 replies; 5+ messages in thread
From: Jeff Sturm @ 2001-12-16  9:01 UTC (permalink / raw)
  To: Sean Callanan; +Cc: gcc



On Sun, 16 Dec 2001, Sean Callanan wrote:
> The short version of this story is that a carefully bootstrapped g++ on a 
> new LFS partition (g++ 3.0.2, glibc 2.2.4) creates binaries that have bus 
> errors. If you are interested, here's the legend that goes along with it.

What binutils?

> # sparc-linux-g++ -o test-c++ test.cc
> # ./test-c++
> Bus error
> #

This is sympomatic of either a) an assembler that does not correctly
generate R_SPARC_UA32 relocs, or b) a glibc that does not correctly
intepret them.

Since you have glibc 2.2.4 I'd guess the former.  Try binutils 2.11.2.  (A
more thorough diagnosis can be gotten from "readelf -r" on a failing
executable.)

(And for the record, I think this requirement is clearly stated in 
http://gcc.gnu.org/install/specific.html#sparc-*-linux*
though that doc may not have made it into the 3.0.2 release.)

Jeff

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: sparc g++ fails "Hello world!"
       [not found] ` <Pine.LNX.4.10.10112161150490.22736-100000@mars.deadcafe.or g>
@ 2001-12-16 12:42   ` Sean Callanan
  2001-12-16 19:49     ` Jeff Sturm
  0 siblings, 1 reply; 5+ messages in thread
From: Sean Callanan @ 2001-12-16 12:42 UTC (permalink / raw)
  To: Jeff Sturm; +Cc: gcc


>What binutils?
>
> > # sparc-linux-g++ -o test-c++ test.cc
> > # ./test-c++
> > Bus error
> > #

Binutils 2.11 is the version I used to compile GCC and glibc. I just 
upgraded to 2.11.2 with no effect on the bus error. Do I need to recompile 
my entire toolchain with the new binutils?
Do I ned a binutils from CVS?

Sincerely,
Sean Callanan



^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: sparc g++ fails "Hello world!"
  2001-12-16 12:42   ` Sean Callanan
@ 2001-12-16 19:49     ` Jeff Sturm
  2001-12-17  1:58       ` sc843
  0 siblings, 1 reply; 5+ messages in thread
From: Jeff Sturm @ 2001-12-16 19:49 UTC (permalink / raw)
  To: Sean Callanan; +Cc: gcc



On Sun, 16 Dec 2001, Sean Callanan wrote:
> Binutils 2.11 is the version I used to compile GCC and glibc. I just 
> upgraded to 2.11.2 with no effect on the bus error. Do I need to recompile 
> my entire toolchain with the new binutils?

You'll need to recompile at least libstdc++-v3 with the upgraded binutils.

> Do I ned a binutils from CVS?

No.

Jeff

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: sparc g++ fails "Hello world!"
  2001-12-16 19:49     ` Jeff Sturm
@ 2001-12-17  1:58       ` sc843
  0 siblings, 0 replies; 5+ messages in thread
From: sc843 @ 2001-12-17  1:58 UTC (permalink / raw)
  To: Jeff Sturm; +Cc: gcc

> You'll need to recompile at least libstdc++-v3 with the upgraded binutils.

To sum up, I have compiled binutils 2.11.2 (then recompiled GCC-3.0.2) and now 
simple C++ test programs work great!

Thank you very much, Jeff. This is really a huge relief.

Sean

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2001-12-17  8:28 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-12-16  0:42 sparc g++ fails "Hello world!" Sean Callanan
2001-12-16  9:01 ` Jeff Sturm
     [not found] ` <Pine.LNX.4.10.10112161150490.22736-100000@mars.deadcafe.or g>
2001-12-16 12:42   ` Sean Callanan
2001-12-16 19:49     ` Jeff Sturm
2001-12-17  1:58       ` sc843

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).