AIX: Add dg-options to tests that override operator new
Graham Reed
greed@pobox.com
Mon Jan 24 19:51:00 GMT 2011
Unlike [many] ELF-based systems, AIX ld/bind does not export symbols
from the main program by default. Consequently, attempts to replace
operator new() and friends, per 18.4.1, will fail. It isn't sufficient
to engage the runtime linker (-Wl,-brtl); the symbols must also be
exported from the defining module.
Exporting could be done with an export list. I am not, however, fluent
enough in DejaGnu in general and the GCC use of it in particular to do
that--in particular, how to specify the right relative path. I did
figure out how to use the -Wl,-bexpfull option, which will export all
symbols from the main program. (The -Wl,-bexpall option will not export
symbols starting with underscore.)
The attached patch changes three testcases which require this symbol
replacement behaviour, so that the -Wl,-bexpful,-brtl option sequence is
added on AIX (all architectures).
As a result, the existing testcases ext/mt_allocator/check_new.cc,
ext/pool_allocator/check_new.cc and 27_io/ios_base/storage/11584.cc will
now pass execution test on AIX.
* testsuite/ext/mt_allocator/check_new.cc: Add dg-options
-Wl,-bexpfull,-brtl on *-*-aix*
* testsuite/ext/pool_allocator/check_new.cc: Likewise
* testsuite/27_io/ios_base/storage/11584.cc: Likewise
I have run these 3 testcases on powerpc-ibm-aix5.3.0.0, verifying 4
multilib combinations: '', 'ppc64', 'pthread', and 'pthread/ppc64' in
the 4.5.2 release code. (The 3 files are unchanged in the trunk as of
r169055.)
I propose this change for the trunk only.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: gcc-4.5.2-libstdc++-test-aix-export.patch
Type: text/x-patch
Size: 1340 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/libstdc++/attachments/20110124/9cf9fde1/attachment.bin>
More information about the Libstdc++
mailing list