]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
libgomp: Fix offload_target with additional sources
authorAndrew Stubbs <ams@baylibre.com>
Wed, 3 Dec 2025 14:34:59 +0000 (14:34 +0000)
committerAndrew Stubbs <ams@baylibre.com>
Wed, 3 Dec 2025 16:29:32 +0000 (16:29 +0000)
The offload_target_* effective target checks called libgomp_target_compile in a
way that altered global state if additional sources were configured.

This patch ignores additional sources if the compile check uses no sources (a
compiler probe, only), thus fixing the problem.

libgomp/ChangeLog:

* testsuite/lib/libgomp.exp (libgomp_target_compile): Don't use
additional sources if there are no primary sources.

libgomp/testsuite/lib/libgomp.exp

index f5683b50725a86f845fed84f35ece71e7528a379..2fc811d91c64b28b8d7c9860fc126d0d7657211f 100644 (file)
@@ -295,7 +295,9 @@ proc libgomp_target_compile { source dest type options } {
        set options [concat "$ALWAYS_CFLAGS" $options]
     }
 
-    set options [dg-additional-files-options $options $source $dest $type]
+    if { $source != "" } {
+        set options [dg-additional-files-options $options $source $dest $type]
+    }
 
     set result [target_compile $source $dest $type $options]