public inbox for binutils-cvs@sourceware.org
 help / color / mirror / Atom feed
* [binutils-gdb] LoongArch: Fix ld FAIL test cases
@ 2024-08-01  2:24 liu & zhensong
  0 siblings, 0 replies; only message in thread
From: liu & zhensong @ 2024-08-01  2:24 UTC (permalink / raw)
  To: binutils-cvs

https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=ca5915512b4b20da363c7815ceb24759e9af01c1

commit ca5915512b4b20da363c7815ceb24759e9af01c1
Author: Lulu Cai <cailulu@loongson.cn>
Date:   Wed Jul 17 10:54:46 2024 +0800

    LoongArch: Fix ld FAIL test cases
    
    To avoid differences in C library paths on different systems
    use gcc instead of ld to perform the test.
    
    Problems caused by adding options to different distributions
    will not be fixed.

Diff:
---
 ld/testsuite/ld-loongarch-elf/pic.exp | 41 ++++++++++++++++++++---------------
 1 file changed, 24 insertions(+), 17 deletions(-)

diff --git a/ld/testsuite/ld-loongarch-elf/pic.exp b/ld/testsuite/ld-loongarch-elf/pic.exp
index bcea5a3c153..64c316045d0 100644
--- a/ld/testsuite/ld-loongarch-elf/pic.exp
+++ b/ld/testsuite/ld-loongarch-elf/pic.exp
@@ -92,17 +92,6 @@ set link_tests [list \
       ] \
     "nopic-global" \
   ] \
-  [list \
-    "$testname readelf -s/-r nopic-global-so" \
-    "-L./tmpdir -lnopic-global -L/usr/lib -lc" "" \
-    "" \
-    {nopic-global.s} \
-      [list \
-	[list readelf -s nopic-global-so.sd] \
-	[list readelf -r nopic-global-so.rd] \
-      ] \
-    "nopic-global-so" \
-  ] \
   [list \
     "$testname readelf -s/-x nopic-weak-global" \
     "-T pic.ld" "" \
@@ -114,19 +103,35 @@ set link_tests [list \
       ] \
     "nopic-weak-global" \
   ] \
+]
+
+# Since the c library path may be different in different
+# Distributions, the test program can link to the c library
+# using the gcc instead of ld to avoid system impact.
+run_ld_link_tests $link_tests
+
+
+
+set link_tests_libc [list \
+  [list \
+    "$testname readelf -s/-r nopic-global-so" \
+    "-L./tmpdir -lnopic-global -L/usr/lib -lc" "" \
+    {nopic-global.s} \
+    {{readelf {-s} nopic-global-so.sd} \
+     {readelf {-r} nopic-global-so.rd}} \
+    "nopic-global-so" \
+  ] \
   [list \
     "$testname readelf -s/-x nopic-weak-global-so" \
     "-L./tmpdir -lnopic-global -L/usr/lib -lc" "" \
-    "" \
     {nopic-weak-global.s} \
-      [list \
-	[list readelf -s nopic-weak-global-so.sd] \
-	[list readelf -r nopic-weak-global-so.rd] \
-      ] \
+    {{readelf {-s} nopic-weak-global-so.sd} \
+     {readelf {-r} nopic-weak-global-so.rd}} \
     "nopic-weak-global-so" \
   ] \
 ]
 
+
 #  0:name
 #  1:ld/ar leading options, placed before object files
 #  2:ld/ar trailing options, placed after object files
@@ -135,7 +140,9 @@ set link_tests [list \
 #  5:list of actions, options and expected outputs.
 #  6:name of output file
 #  7:compiler flags (optional)
-run_ld_link_tests $link_tests
+run_cc_link_tests $link_tests_libc
+
+
 
 set testname "nopic link exec test"

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2024-08-01  2:24 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-08-01  2:24 [binutils-gdb] LoongArch: Fix ld FAIL test cases liu & zhensong

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).