Hello,
I've looked into the bugzilla, but have not been able to find similar or
the same bug, so I wonder if this is known or not. Anyway, when I compiled
GCC 4.1.0 (release) on OpenBSD 3.9 configured with:
$ c++41x -v
Using built-in specs.
Target: i386-unknown-openbsd3.9
Configured with: /home/karel/build/gcc-4.1.0/configure
--prefix=/home/karel/usr/local --program-suffix=41x --enable-threads
--enable-shared --disable-checking --enable-languages=c,c++
Thread model: posix
gcc version 4.1.0
$
I've got "broken" C++ compiler (or perhaps libstdc++/libgcc), since if I
try compiling simple C++ hello world example I get a lot of POSIX threads
related unresolved symbols coming from libstdc++ and libgcc (see below).
The simple workaround is to add -lpthread for linking phase, but IMHO this
is a bit inconvenient and probably shouldn't be required.
Question is: shall I report this to bugzilla?
Thanks,
Karel
$ c++41x hello.cc
/home/karel/usr/local/lib/gcc/i386-unknown-openbsd3.9/4.1.0/../../../libstdc++.a(locale-misc-inst.o)(.gnu.linkonce.t._ZSt16__convert_from_vIeEiPciPKcT_RKPii+0x65):
In function `int std::__convert_from_v<long double>(char*, int, char
const*, long double, int* const&, int)':
/home/karel/build/obj/i386-unknown-openbsd3.9/libstdc++-v3/include/i386-unknown-openbsd3.9/bits/c++locale.h:67:
warning: strcpy() is almost always misused, please use strlcpy()
/home/karel/usr/local/lib/gcc/i386-unknown-openbsd3.9/4.1.0/../../../libstdc++.a(locale-misc-inst.o)(.gnu.linkonce.t._ZSt16__convert_from_vIeEiPciPKcT_RKPii+0x8c):/home/karel/build/obj/i386-unknown-openbsd3.9/libstdc++-v3/include/i386-unknown-openbsd3.9/bits/c++locale.h:74:
warning: sprintf() is often misused, please use snprintf()
/home/karel/usr/local/lib/gcc/i386-unknown-openbsd3.9/4.1.0/../../../libstdc++.a(cp-demangle.o)(.text+0x3665):
In function `d_demangle':
: warning: strcat() is almost always misused, please use strlcat()
/home/karel/usr/local/lib/gcc/i386-unknown-openbsd3.9/4.1.0/../../../libstdc++.a(locale_init.o)(.text._ZNSt6locale13_S_initializeEv+0x2a):
In function `std::locale::_S_initialize()':
/home/karel/build/gcc-4.1.0/libstdc++-v3/src/locale_init.cc:145: undefined
reference to `pthread_once'
/home/karel/usr/local/lib/gcc/i386-unknown-openbsd3.9/4.1.0/../../../libstdc++.a(eh_globals.o)(.text._Z41__static_initialization_and_destruction_0ii+0x4a):
In function `__static_initialization_and_destruction_0(int, int)':
/home/karel/build/gcc-4.1.0/libstdc++-v3/libsupc++/eh_globals.cc:97:
undefined reference to `pthread_key_create'
/home/karel/usr/local/lib/gcc/i386-unknown-openbsd3.9/4.1.0/../../../libstdc++.a(eh_globals.o)(.text.__cxa_get_globals_fast+0x71):
In function `__cxa_get_globals_fast':
/home/karel/build/gcc-4.1.0/libstdc++-v3/libsupc++/eh_globals.cc:150:
undefined reference to `pthread_getspecific'
/home/karel/usr/local/lib/gcc/i386-unknown-openbsd3.9/4.1.0/../../../libstdc++.a(eh_globals.o)(.text.__cxa_get_globals+0x71):
In function `__cxa_get_globals':
/home/karel/build/gcc-4.1.0/libstdc++-v3/libsupc++/eh_globals.cc:150:
undefined reference to `pthread_getspecific'
/home/karel/usr/local/lib/gcc/i386-unknown-openbsd3.9/4.1.0/../../../libstdc++.a(eh_globals.o)(.text.__cxa_get_globals+0xa9):
In function `__cxa_get_globals':
/home/karel/build/obj/i386-unknown-openbsd3.9/libstdc++-v3/include/i386-unknown-openbsd3.9/bits/gthr-default.h:541:
undefined reference to `pthread_setspecific'
/home/karel/usr/local/lib/gcc/i386-unknown-openbsd3.9/4.1.0/libgcc.a(unwind-sjlj.o)(.text+0xb8):
In function `fc_key_init_once':
/home/karel/build/gcc-4.1.0/gcc/gthr-posix.h:515: undefined reference to
`pthread_once'
/home/karel/usr/local/lib/gcc/i386-unknown-openbsd3.9/4.1.0/libgcc.a(unwind-sjlj.o)(.text+0xe6):
In function `fc_key_init':
/home/karel/build/gcc-4.1.0/gcc/gthr-posix.h:523: undefined reference to
`pthread_key_create'
/home/karel/usr/local/lib/gcc/i386-unknown-openbsd3.9/4.1.0/libgcc.a(unwind-sjlj.o)(.text+0x194):
In function `_Unwind_SjLj_Unregister':
/home/karel/build/gcc-4.1.0/gcc/gthr-posix.h:541: undefined reference to
`pthread_setspecific'
/home/karel/usr/local/lib/gcc/i386-unknown-openbsd3.9/4.1.0/libgcc.a(unwind-sjlj.o)(.text+0x27b):
In function `uw_install_context':
/home/karel/build/gcc-4.1.0/gcc/gthr-posix.h:541: undefined reference to
`pthread_setspecific'
/home/karel/usr/local/lib/gcc/i386-unknown-openbsd3.9/4.1.0/libgcc.a(unwind-sjlj.o)(.text+0x2c5):
In function `_Unwind_SjLj_RaiseException':
/home/karel/build/gcc-4.1.0/gcc/gthr-posix.h:535: undefined reference to
`pthread_getspecific'
/home/karel/usr/local/lib/gcc/i386-unknown-openbsd3.9/4.1.0/libgcc.a(unwind-sjlj.o)(.text+0x37e):
In function `_Unwind_SjLj_Register':
/home/karel/build/gcc-4.1.0/gcc/gthr-posix.h:535: undefined reference to
`pthread_getspecific'
/home/karel/usr/local/lib/gcc/i386-unknown-openbsd3.9/4.1.0/libgcc.a(unwind-sjlj.o)(.text+0x38f):/home/karel/build/gcc-4.1.0/gcc/gthr-posix.h:541:
undefined reference to `pthread_setspecific'
/home/karel/usr/local/lib/gcc/i386-unknown-openbsd3.9/4.1.0/libgcc.a(unwind-sjlj.o)(.text+0x3da):
In function `_Unwind_Backtrace':
/home/karel/build/gcc-4.1.0/gcc/gthr-posix.h:535: undefined reference to
`pthread_getspecific'
/home/karel/usr/local/lib/gcc/i386-unknown-openbsd3.9/4.1.0/libgcc.a(unwind-sjlj.o)(.text+0x455):
In function `_Unwind_SjLj_Resume_or_Rethrow':
/home/karel/build/gcc-4.1.0/gcc/gthr-posix.h:535: undefined reference to
`pthread_getspecific'
/home/karel/usr/local/lib/gcc/i386-unknown-openbsd3.9/4.1.0/libgcc.a(unwind-sjlj.o)(.text+0x4ba):
In function `_Unwind_SjLj_Resume':
/home/karel/build/gcc-4.1.0/gcc/gthr-posix.h:535: undefined reference to
`pthread_getspecific'
/home/karel/usr/local/lib/gcc/i386-unknown-openbsd3.9/4.1.0/libgcc.a(unwind-sjlj.o)(.text+0x521):
In function `_Unwind_SjLj_ForcedUnwind':
/home/karel/build/gcc-4.1.0/gcc/gthr-posix.h:535: undefined reference to
`pthread_getspecific'
collect2: ld returned 1 exit status
$
--
Karel Gardas [EMAIL PROTECTED]
ObjectSecurity Ltd. http://www.objectsecurity.com