libstdc++: Use libatomic for tests on all 32-bit powerpc targets
authorJonathan Wakely <jwakely@redhat.com>
Wed, 2 Dec 2020 16:37:56 +0000 (16:37 +0000)
committerJonathan Wakely <jwakely@redhat.com>
Wed, 2 Dec 2020 16:37:56 +0000 (16:37 +0000)
In addition to the existing powerpc targets, powerpc64 needs libatomic
for 64-bit atomics when testing the 32-bit multilib with -m32. Adjust
the existing target checks to match all 32-bit powerpc targets, but not
64-bit ones.

libstdc++-v3/ChangeLog:

* testsuite/lib/dg-options.exp (add_options_for_libatomic):
Replace powerpc-ibm-aix* and powerpc*-*-darwin* with check for
powerpc && ilp32.

libstdc++-v3/testsuite/lib/dg-options.exp

index d3f61cb52671593c58b0c72a74748e3dc0492c2f..0102acf65a282e6283eacdedee460f8fb4cc3cb3 100644 (file)
@@ -257,13 +257,14 @@ proc add_options_for_net_ts { flags } {
     return $flags
 }
 
-# Add to FLAGS all the target-specific flags to link to libatomic, if required.
+# Add to FLAGS all the target-specific flags to link to libatomic,
+# if required for atomics on pointers and 64-bit types.
 
 proc add_options_for_libatomic { flags } {
     if { [istarget hppa*-*-hpux*]
-        || [istarget powerpc-ibm-aix*]
-        || [istarget powerpc*-*-darwin*]
-        || [istarget riscv*-*-*] } {
+        || ([istarget powerpc*-*-*] && [check_effective_target_ilp32])
+        || [istarget riscv*-*-*]
+       } {
        return "$flags -L../../libatomic/.libs -latomic"
     }
     return $flags