[PATCH] Fix libstdc++ tests requiring atomic support on hppa-hpux

Jonathan Wakely jwakely@redhat.com
Mon Mar 11 13:54:00 GMT 2019


On 11/03/19 09:27 -0400, John David Anglin wrote:
>On 2019-03-11 9:16 a.m., Jonathan Wakely wrote:
>> On 11/03/19 14:13 +0100, Andreas Schwab wrote:
>>> On Mär 11 2019, Jonathan Wakely <jwakely@redhat.com> wrote:
>>>
>>>> What do you think about adding the following?
>>>>
>>>> --- a/libstdc++-v3/testsuite/lib/dg-options.exp
>>>> +++ b/libstdc++-v3/testsuite/lib/dg-options.exp
>>>> @@ -257,6 +257,15 @@ proc add_options_for_net_ts { flags } {
>>>>     return $flags
>>>> }
>>>>
>>>> +# Add to FLAGS all the target-specific flags to link to libatomic, if required.
>>>> +
>>>> +proc add_options_for_libatomic { flags } {
>>>> +    if { [istarget hppa*-*-hpux*] } {
>>>> +       return "$flags -L../../libatomic/.libs -latomic"
>>>> +    }
>>>> +    return $flags
>>>> +}
>>>
>>> That should probably also be enabled for riscv*-*-*.
>>
>> So all the more reason to do it this way, so the list of targets is
>> only maintained in one place
>Your suggestion looks good to me.  We still need hunk that sets up LD_LIBRARY_PATH.

Right.

>This is what is done in fortran tests:
>! { dg-additional-options "-latomic" { target libatomic_available } }

That adds it for every target that has a libatomic though, right? We
have tests that check certain uses of atomics work without libatomic,
which would no longer check anything if we added that to them :-)

If we use { dg-add-options libatomic } it'll only be added for the
listed targets (hpux and riscv to begin with) and if somebody disables
building libatomic on those targets they probably should get test
failures to say there's something wrong.



More information about the Gcc-patches mailing list