From 47e508cc6458b85a35a3962601c33ea0787ad6f9 Mon Sep 17 00:00:00 2001
From: "H.J. Lu" <hjl.tools@gmail.com>
Date: Thu, 23 Apr 2026 09:23:33 +0800
Subject: [PATCH 2/2] ld: Limit PR ld/34088 test to Linux/x86-64 and
 Linux/aarch64

Since PR ld/34088 test requires libm.a, which has feclearexcept, as a
linker script like

GROUP ( /usr/lib64/libm-2.42.a /usr/lib64/libmvec.a )

which is implemented for Linux/x86-64 and Linux/aarch64, limit such test
to Linux/x86-64 and Linux/aarch64.

	PR ld/34088
	* testsuite/ld-plugin/lto.exp: Limit PR ld/34088 test to
	Linux/x86-64 and Linux/aarch64.

Signed-off-by: H.J. Lu <hjl.tools@gmail.com>
(cherry picked from commit 4d11bf8cc73a1f56d2ffc5af7334ae2c251584b6)
---
 ld/testsuite/ld-plugin/lto.exp | 28 ++++++++++++++++++----------
 1 file changed, 18 insertions(+), 10 deletions(-)

diff --git a/ld/testsuite/ld-plugin/lto.exp b/ld/testsuite/ld-plugin/lto.exp
index 62cca45f42b..4504fd4be01 100644
--- a/ld/testsuite/ld-plugin/lto.exp
+++ b/ld/testsuite/ld-plugin/lto.exp
@@ -929,16 +929,6 @@ set lto_run_elf_shared_tests [list \
    {-Wl,-R,tmpdir} {} \
    {pr31644a.c} {pr31644b.exe} {pass.out} {-flto} {c} {} \
    {-Wl,--as-needed tmpdir/pr31644b.a tmpdir/pr31644c.so}] \
-  [list {PR ld/34088} \
-   {-static -flto -fuse-linker-plugin} \
-   {} \
-   {pr34088.c} \
-   {pr34088.exe} \
-   {pass.out} \
-   {-flto -O0} \
-   {c} \
-   {} \
-   {-lm}] \
 ]
 
 # LTO run-time tests for ELF
@@ -1222,6 +1212,24 @@ if { [is_elf_format] } {
 	    "pr22983" \
 	] \
     ]
+
+    if { [istarget "aarch64*-*-linux"]
+	 || [istarget "x86_64-*-linux*"] } {
+	run_ld_link_exec_tests [list \
+	    [list \
+		{PR ld/34088} \
+		{-static -flto -fuse-linker-plugin} \
+		{} \
+		{pr34088.c} \
+		{pr34088.exe} \
+		{pass.out} \
+		{-flto -O0} \
+		{c} \
+		{} \
+		{-lm}] \
+	   ] \
+	]
+    }
 }
 
 if { [is_elf_format] && [check_lto_shared_available] } {
-- 
2.54.0

