AIX: Add dg-options to tests that override operator new
David Edelsohn
dje.gcc@gmail.com
Tue Jan 25 23:40:00 GMT 2011
On Mon, Jan 24, 2011 at 3:45 PM, Paolo Carlini <paolo.carlini@oracle.com> wrote:
> Hi,
>
> On 01/24/2011 08:51 PM, Graham Reed wrote:
>> 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.
>
> ... David, can you give us your opinion about this change too?
If you are going to go down this path for AIX linker options, why not
use -Wl,-bsvr4 ?
- David
More information about the Libstdc++
mailing list