public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
From: Sam James <sam@gentoo.org>
To: binutils@sourceware.org
Cc: nickc@redhat.com, "H.J. Lu" <hjl.tools@gmail.com>
Subject: [2.41 PATCH 09/10] Fix ld/x86: reduce testsuite dependency on system object files
Date: Sat, 16 Dec 2023 04:01:32 +0000	[thread overview]
Message-ID: <20231216040239.1981071-10-sam@gentoo.org> (raw)
In-Reply-To: <20231216040239.1981071-1-sam@gentoo.org>

From: "H.J. Lu" <hjl.tools@gmail.com>

commit eab996435fe65a421541f59557c5f1fd427573a3
Author: Jan Beulich <jbeulich@suse.com>
Date:   Tue Nov 7 13:58:32 2023 +0100

    ld/x86: reduce testsuite dependency on system object files

changed some C compiler tests to assembler/linker tests which introduced
2 problems:

1. It broke x32 binutils tests since --64 was passed to assembler, but
-m elf_x86_64 wasn't passed to linker.
2. -nostdlib was passed to C compiler driver to exclude standard run-time
files which should be avoided with -r option for linker tests.

Fix them by passing -m elf_x86_64 to linker and removing -nostdlib for
linker tests with -r.

	PR ld/30722
	* testsuite/ld-x86-64/x86-64.exp: Pass -m elf_x86_64 to linker
	for tests with --64.  Remove -nostdlib for tests with -r.

(cherry picked from commit 260aa570edcf120332daefb4a102a08c90e4d9b4)
---
 ld/testsuite/ld-x86-64/x86-64.exp | 20 ++++++++++----------
 1 file changed, 10 insertions(+), 10 deletions(-)

diff --git a/ld/testsuite/ld-x86-64/x86-64.exp b/ld/testsuite/ld-x86-64/x86-64.exp
index 123152df5b0..bc736696cd0 100644
--- a/ld/testsuite/ld-x86-64/x86-64.exp
+++ b/ld/testsuite/ld-x86-64/x86-64.exp
@@ -2100,7 +2100,7 @@ run_ld_link_tests [list \
     ] \
     [list \
 	"Build property 3" \
-	"" \
+	"-m elf_x86_64" \
 	"" \
 	"--64 -defsym __64_bit__=1 -mx86-used-note=yes" \
 	{property-stk.s property-x86-1.s} \
@@ -2109,7 +2109,7 @@ run_ld_link_tests [list \
     ] \
     [list \
 	"Build property 3 (.o)" \
-	"-r -nostdlib" \
+	"-m elf_x86_64 -r" \
 	"" \
 	"--64 -defsym __64_bit__=1 -mx86-used-note=yes" \
 	{property-x86-1.s property-stk.s} \
@@ -2118,7 +2118,7 @@ run_ld_link_tests [list \
     ] \
     [list \
 	"Build property 3 (.so)" \
-	"-shared" \
+	"-m elf_x86_64 -shared" \
 	"" \
 	"--64 -defsym __64_bit__=1 -mx86-used-note=yes" \
 	{property-x86-1.s property-stk.s} \
@@ -2127,7 +2127,7 @@ run_ld_link_tests [list \
     ] \
     [list \
 	"Build property 4" \
-	"" \
+	"-m elf_x86_64" \
 	"" \
 	"--64 -defsym __64_bit__=1 -mx86-used-note=yes" \
 	{property-stk.s property-x86-1.s property-x86-2.s} \
@@ -2136,7 +2136,7 @@ run_ld_link_tests [list \
     ] \
     [list \
 	"Build property 4 (.o)" \
-	"-r -nostdlib" \
+	"-m elf_x86_64 -r" \
 	"" \
 	"--64 -defsym __64_bit__=1 -mx86-used-note=yes" \
 	{property-x86-2.s property-x86-1.s property-stk.s} \
@@ -2145,7 +2145,7 @@ run_ld_link_tests [list \
     ] \
     [list \
 	"Build property 4 (.so)" \
-	"-shared" \
+	"-m elf_x86_64 -shared" \
 	"" \
 	"--64 -defsym __64_bit__=1 -mx86-used-note=yes" \
 	{property-x86-2.s property-x86-1.s property-stk.s} \
@@ -2154,7 +2154,7 @@ run_ld_link_tests [list \
     ] \
     [list \
 	"Build property 4 (-z stack-size=0)" \
-	"-z stack-size=0" \
+	"-m elf_x86_64 -z stack-size=0" \
 	"" \
 	"--64 -defsym __64_bit__=1 -mx86-used-note=yes" \
 	{property-stk.s property-x86-1.s property-x86-2.s} \
@@ -2163,7 +2163,7 @@ run_ld_link_tests [list \
     ] \
     [list \
 	"Build property 5" \
-	"-z stack-size=0x900000" \
+	"-m elf_x86_64 -z stack-size=0x900000" \
 	"" \
 	"--64 -defsym __64_bit__=1 -mx86-used-note=yes" \
 	{property-stk.s property-x86-1.s property-x86-2.s} \
@@ -2172,7 +2172,7 @@ run_ld_link_tests [list \
     ] \
     [list \
 	"Build property 5 (.o)" \
-	"-r -nostdlib -z stack-size=0x900000" \
+	"-m elf_x86_64 -r -z stack-size=0x900000" \
 	"" \
 	"--64 -defsym __64_bit__=1 -mx86-used-note=yes" \
 	{property-x86-2.s property-x86-1.s property-stk.s} \
@@ -2181,7 +2181,7 @@ run_ld_link_tests [list \
     ] \
     [list \
 	"Build property 5 (.so)" \
-	"-shared -z stack-size=0x900000" \
+	"-m elf_x86_64 -shared -z stack-size=0x900000" \
 	"" \
 	"--64 -defsym __64_bit__=1 -mx86-used-note=yes" \
 	{property-x86-2.s property-x86-1.s property-stk.s} \
-- 
2.43.0


  parent reply	other threads:[~2023-12-16  4:03 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-12-16  4:01 [2.41 PATCH 00/10] Misc binutils-2.41 test fixes Sam James
2023-12-16  4:01 ` [2.41 PATCH 01/10] gprofng: 30700 tmpdir/gp-collect-app_F test fails Sam James
2023-12-16  4:01 ` [2.41 PATCH 02/10] Fix "--only-keep-debug for ELF relocatables" binutils test for compilers which add .debug_macro sections to object files Sam James
2023-12-16  4:01 ` [2.41 PATCH 03/10] ld: Build libpr23169a.so with -z lazy Sam James
2023-12-16  4:01 ` [2.41 PATCH 04/10] ld: Fix relocatable.d XFAIL/notarget entry for hppa Sam James
2023-12-16  4:01 ` [2.41 PATCH 05/10] ld: Fix retain7a.d " Sam James
2023-12-16  4:01 ` [2.41 PATCH 06/10] ld: fix relocatable, retain7a target pattens for HPPA Sam James
2023-12-16  4:01 ` [2.41 PATCH 07/10] ld: ld-lib.exp: log failed dump.out contents for debugging Sam James
2023-12-16  4:01 ` [2.41 PATCH 08/10] ld/x86: reduce testsuite dependency on system object files Sam James
2023-12-16  4:01 ` Sam James [this message]
2023-12-16  4:01 ` [2.41 PATCH 10/10] Fix 30808 gprofng tests failed Sam James
2023-12-20 10:59 ` [2.41 PATCH 00/10] Misc binutils-2.41 test fixes Sam James

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20231216040239.1981071-10-sam@gentoo.org \
    --to=sam@gentoo.org \
    --cc=binutils@sourceware.org \
    --cc=hjl.tools@gmail.com \
    --cc=nickc@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).