Libstdc++.sl and exceptions handling on HP-UX 11 (gcc-2.95.2)
Greg M
greg__m__@hotmail.com
Wed Dec 15 16:07:00 GMT 1999
I compiled gcc-2.95.2 on HP-UX 11 using
configure --with-gnu-as --enable-shared --enable-threads
make install placed libstdc++.a.2.10.0 and libstdc++.sl into
/usr/local/bin
I am trying to compile a simple exception handling test:
cat conftest.C
class Ex { };
int main ()
{
try {
throw Ex();
return 1;
} catch (Ex &ex) {
return 0;
} catch (...) {
return 1;
}
}
the binary produced by
c++ -o conftest -g -fexceptions conftest.C -L/usr/local/lib -Wl,-B,deferred
produces a core dump doing __eh_alloc();
I also noticed that __eh_alloc is defined in libgcc.a and
(duplicated ?) in libstc++.sl (three times).
The chatr shows that I linked with libstc++.sl :
chatr conftest
conftest:
shared executable
shared library dynamic path search:
SHLIB_PATH disabled second
embedded path disabled first Not Defined
shared library list:
dynamic /usr/local/lib/libstdc++.sl
dynamic /usr/lib/libm.2
dynamic /usr/lib/libc.2
shared library binding:
deferred
global hash table disabled
plabel caching disabled
global hash array size:1103
global hash array nbuckets:3
shared vtable support disabled
static branch prediction disabled
executable from stack: D (default)
kernel assisted branch prediction enabled
lazy swap allocation disabled
text segment locking disabled
data segment locking disabled
data page size: D (default)
instruction page size: D (default)
If I link with the static library like:
c++ -o conftest -g -fexceptions conftest.C -Wl,-B,deferred
chatr conftest
conftest:
shared executable
shared library dynamic path search:
SHLIB_PATH disabled second
embedded path disabled first Not Defined
shared library list:
dynamic /usr/lib/libm.2
dynamic /usr/lib/libc.2
shared library binding:
deferred
global hash table disabled
plabel caching disabled
global hash array size:1103
global hash array nbuckets:3
shared vtable support disabled
static branch prediction disabled
executable from stack: D (default)
kernel assisted branch prediction enabled
lazy swap allocation disabled
text segment locking disabled
data segment locking disabled
data page size: D (default)
instruction page size: D (default)
the binary works OK.
I also noticed that the HP Software Archive binaries are built and
distributed without libstdc++.sl
I have not seen any references to the problems with libstdc++.sl
and exceprion handling on HP.
I would appreciate any advise on what am I doing wrong.
Thanks,
Greg M
______________________________________________________
Get Your Private, Free Email at http://www.hotmail.com
More information about the Gcc-help
mailing list