]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
Avoid -latomic for amdgcn offloading
authorRichard Biener <rguenther@suse.de>
Wed, 21 Apr 2021 12:54:05 +0000 (14:54 +0200)
committerRichard Biener <rguenther@suse.de>
Thu, 22 Apr 2021 06:30:10 +0000 (08:30 +0200)
libatomic isn't built for amdgcn but reduction-16.c adds it
via -foffload=-latomic when offloading for nvptx is enabled.
The following avoids linker errors when offloading to amdgcn is enabled
as well.

2021-04-21  Richard Biener  <rguenther@suse.de>

libgomp/
* testsuite/libgomp.c-c++-common/reduction-16.c: Use -latomic
only on nvptx-none.

(cherry picked from commit d42088e453042f4f8ba9190a7e29efd937ea2181)

libgomp/testsuite/libgomp.c-c++-common/reduction-16.c

index e60fe3664edeb6115261b85ed029b8dc3884fe1d..0eea73b144b283c2e1af7867c85619f0c36903eb 100644 (file)
@@ -1,5 +1,5 @@
 /* { dg-do run } */
-/* { dg-additional-options "-foffload=-latomic" { target offload_target_nvptx } } */
+/* { dg-additional-options "-foffload=nvptx-none=-latomic" { target offload_target_nvptx } } */
 
 #include <stdlib.h>