sparc g++ fails "Hello world!"
Sean Callanan
sc843@bard.edu
Sun Dec 16 00:42:00 GMT 2001
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
More information about the Gcc
mailing list