This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
gcc-3.0.4 -static broken!
- From: nbecker at hns dot com (Neal D. Becker)
- To: gcc-bugs at gcc dot gnu dot org
- Date: 27 Mar 2002 14:38:32 -0500
- Subject: gcc-3.0.4 -static broken!
It looks like all static link with gcc-3.0.4 on Linux is now broken.
Even hello world will segfault. Here's what happens:
#include <iostream>
#include <stdexcept>
using std::cout;
main() {
cout << "hello world\n";
}
g++3 -v -o Hello Hello.cc -static
Reading specs from /usr/lib/gcc-lib/i386-redhat-linux/3.0.4/specs
Configured with: ../configure --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --enable-shared --enable-threads=posix --disable-checking --host=i386-redhat-linux --with-system-zlib
Thread model: posix
gcc version 3.0.4 (Red Hat Linux 7.2 3.0.4-1)
/usr/lib/gcc-lib/i386-redhat-linux/3.0.4/cc1plus -v -D__GNUC__=3 -D__GNUC_MINOR__=0 -D__GNUC_PATCHLEVEL__=4 -D__ELF__ -Dunix -Dlinux -D__ELF__ -D__unix__ -D__linux__ -D__unix -D__linux -Asystem=posix -D__NO_INLINE__ -D__STDC_HOSTED__=1 -D_GNU_SOURCE -Acpu=i386 -Amachine=i386 -Di386 -D__i386 -D__i386__ -D__tune_i386__ Hello.cc -D__GNUG__=3 -D__GXX_DEPRECATED -D__EXCEPTIONS -D__GXX_ABI_VERSION=100 -quiet -dumpbase Hello.cc -version -o /tmp/ccTdhBmz.s
GNU CPP version 3.0.4 (Red Hat Linux 7.2 3.0.4-1) (cpplib) (i386 Linux/ELF)
GNU C++ version 3.0.4 (Red Hat Linux 7.2 3.0.4-1) (i386-redhat-linux)
compiled by GNU C version 3.0.4 (Red Hat Linux 7.2 3.0.4-1).
ignoring nonexistent directory "/usr/i386-redhat-linux/include"
#include "..." search starts here:
#include <...> search starts here:
/usr/include/g++-v3
/usr/include/g++-v3/i386-redhat-linux
/usr/include/g++-v3/backward
/usr/local/include
/usr/lib/gcc-lib/i386-redhat-linux/3.0.4/include
/usr/include
End of search list.
as -V -Qy -o /tmp/ccGmnPIw.o /tmp/ccTdhBmz.s
GNU assembler version 2.11.90.0.8 (i386-redhat-linux) using BFD version 2.11.90.0.8
/usr/lib/gcc-lib/i386-redhat-linux/3.0.4/collect2 -m elf_i386 -static -o Hello /usr/lib/gcc-lib/i386-redhat-linux/3.0.4/../../../crt1.o /usr/lib/gcc-lib/i386-redhat-linux/3.0.4/../../../crti.o /usr/lib/gcc-lib/i386-redhat-linux/3.0.4/crtbegin.o -L/usr/lib/gcc-lib/i386-redhat-linux/3.0.4 -L/usr/lib/gcc-lib/i386-redhat-linux/3.0.4/../../.. /tmp/ccGmnPIw.o -lstdc++ -lm -lgcc -lc -lgcc /usr/lib/gcc-lib/i386-redhat-linux/3.0.4/crtend.o /usr/lib/gcc-lib/i386-redhat-linux/3.0.4/../../../crtn.o
[nbecker@rpppc1 ~]$ ./Hello
Segmentation fault
Program received signal SIGSEGV, Segmentation fault.
__wcslen (s=0x0) at wcslen.c:30
30 wcslen.c: No such file or directory.
in wcslen.c
(gdb) where
#0 __wcslen (s=0x0) at wcslen.c:30
#1 0x0809c797 in std::numpunct<wchar_t>::_M_initialize_numpunct(int*) (
this=0x80f3650)
at /usr/src/build/75527-i386/BUILD/gcc-3.0.4-20020221/obj-i386-redhat-linux/i386-redhat-linux/libstdc++-v3/include/bits/char_traits.h:227
#2 0x08099467 in std::locale::_Impl::_Impl(std::string, unsigned) (
this=0x80f3068, __str=0xbfffd9f0, __refs=2)
at /usr/src/build/75527-i386/BUILD/gcc-3.0.4-20020221/obj-i386-redhat-linux/i386-redhat-linux/libstdc++-v3/include/bits/locale_facets.h:850
#3 0x080950c1 in std::locale::classic() ()
at /usr/src/build/75527-i386/BUILD/gcc-3.0.4-20020221/obj-i386-redhat-linux/i386-redhat-linux/libstdc++-v3/include/bits/stl_alloc.h:571
#4 0x08094745 in std::locale::locale() (this=0x80ed6d0)
at /usr/src/build/75527-i386/BUILD/gcc-3.0.4-20020221/obj-i386-redhat-linux/i386-redhat-linux/libstdc++-v3/include/bits/localefwd.h:324
#5 0x080ad613 in std::basic_streambuf<char, std::char_traits<char> >::basic_streambuf() (this=0x80ed6a0)
at /usr/src/build/75527-i386/BUILD/gcc-3.0.4-20020221/obj-i386-redhat-linux/i386-redhat-linux/libstdc++-v3/include/bits/std_streambuf.h:382
#6 0x080afd28 in std::basic_filebuf<char, std::char_traits<char> >::basic_filebuf(_IO_FILE*, std::_Ios_Openmode, int) (this=0x80ed6a0, __f=0x80daec0,
__mode=16, __s=0)
at /usr/src/build/75527-i386/BUILD/gcc-3.0.4-20020221/obj-i386-redhat-linux/---Type <return> to continue, or q <return> to quit---
i386-redhat-linux/libstdc++-v3/include/bits/fstream.tcc:122
#7 0x080939e8 in std::ios_base::Init::_S_ios_create(bool) (__sync=1)
at ../../../../libstdc++-v3/libsupc++/new:86
#8 0x08093fb9 in std::ios_base::Init::Init() (this=0x80ed41c)
at ../../../../libstdc++-v3/src/ios.cc:203
#9 0x08048222 in __static_initialization_and_destruction_0(int, int) ()
#10 0x08048325 in _GLOBAL__I_main ()
#11 0x08092c3b in __do_global_ctors_aux ()
at ../../../../libstdc++-v3/libsupc++/eh_aux_runtime.cc:39
#12 0x080480ca in _init ()
#13 0x0804b942 in __libc_start_main (main=0x80481d8 <main>, argc=1,
ubp_av=0xbfffdb84, init=0x80480b4 <_init>, fini=0x80c6140 <_fini>,
rtld_fini=0, stack_end=0xbfffdb7c) at ../sysdeps/generic/libc-start.c:122
(gdb)