From patchwork Fri Dec 1 17:21:40 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "H.J. Lu" X-Patchwork-Id: 172582 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:bcd1:0:b0:403:3b70:6f57 with SMTP id r17csp1285448vqy; Fri, 1 Dec 2023 09:21:53 -0800 (PST) X-Google-Smtp-Source: AGHT+IFnHW/flBjd1baq7u3viPQAW1FeVZbs0wzydw6D1oH80ZiyzpX8swmVA+vksqxh6jK++Oo1 X-Received: by 2002:a05:622a:1c7:b0:423:7f57:8276 with SMTP id t7-20020a05622a01c700b004237f578276mr26617229qtw.65.1701451313164; Fri, 01 Dec 2023 09:21:53 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1701451313; cv=pass; d=google.com; s=arc-20160816; b=krQivAK273pGqcCiFdoeSX86oA5cC9iMULF+ZhOXOMZVZGuDU9EEgQWijhplzgLCa6 AgVc026jXAfBp2RDO4a7weOGydPu5loPMcheGM5uYOzTz2+T56SbAaVmnzDyMBW6UwZu 4N5YVOgfXn+INtA7W8fmVkDfFSmTkiLQFz8Mi6F5Pjbs7yhI8eRg5ZuqNWYV7cl84sNb HQcyeWWuBUq+qFqQIjDH/nM23NqclU0BI19Fj/bPhlLOB3kWpZAAe0CGDghlHxMfs+/3 2lfR0k55flLJ4KNP8TylEhdxxZNZFzPJaTvFoAopG4c8XFTdz/B/me5bMsArz4SUp4Ek oLFg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:message-id:date:subject:to:from:dkim-signature :arc-filter:dmarc-filter:delivered-to; bh=R4pLSzBn+LGaAoyh42L7QBr4ueRP2MRcWj38Ypwh/wg=; fh=NLxAvL/bDfPg4AGOtxqvQlND8vazkZrNzKLY8+LAbBY=; b=U3HrJjB5ZDdcrpl4m4AO4lcI40mrUYnSPR7MUHEUiAyhoOZFOTT+r5rHOLlcT6kYIn 6/MkXVARr6jrOQEZWW77XG5AzXb6HOPlo+3jrU/kaw9DrfjZ2oVODg1xio5GPeYgq1jw cbPTBuEaY0q908OttWebv6q7USAHlkdYx4Qwgpfpv73AVMSdLY4lrs9cYsWRgpBdk9zw slDM9yfHjjnq9IhTSKeblrOSRC61j4oAk0VQC0OTQcJAHPQP2E3hQF4TXIJCjNsIDJ28 nJatdHyorCFFPE7DQuzjla29BmM95/jGXN685/f6QAuUR/E7cmqRtOtmoXF9HONswEfo RHzA== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=IkO2QCJs; arc=pass (i=1); spf=pass (google.com: domain of binutils-bounces+ouuuleilei=gmail.com@sourceware.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) smtp.mailfrom="binutils-bounces+ouuuleilei=gmail.com@sourceware.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from server2.sourceware.org (server2.sourceware.org. [2620:52:3:1:0:246e:9693:128c]) by mx.google.com with ESMTPS id cm6-20020a05622a250600b00423a1258c3bsi3979964qtb.219.2023.12.01.09.21.53 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 01 Dec 2023 09:21:53 -0800 (PST) Received-SPF: pass (google.com: domain of binutils-bounces+ouuuleilei=gmail.com@sourceware.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) client-ip=2620:52:3:1:0:246e:9693:128c; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=IkO2QCJs; arc=pass (i=1); spf=pass (google.com: domain of binutils-bounces+ouuuleilei=gmail.com@sourceware.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) smtp.mailfrom="binutils-bounces+ouuuleilei=gmail.com@sourceware.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 6ACDE385C6C4 for ; Fri, 1 Dec 2023 17:21:52 +0000 (GMT) X-Original-To: binutils@sourceware.org Delivered-To: binutils@sourceware.org Received: from mail-pf1-x433.google.com (mail-pf1-x433.google.com [IPv6:2607:f8b0:4864:20::433]) by sourceware.org (Postfix) with ESMTPS id 459FC3858404 for ; Fri, 1 Dec 2023 17:21:43 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 459FC3858404 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gmail.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 459FC3858404 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2607:f8b0:4864:20::433 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1701451307; cv=none; b=CXW58mKy5Jyg8RjuP0LY+2UzXfhHBIUEznPOb133ReQexRK8x9iCIVLa+S6bXHeu40+ffiwVImHf0ReMbSOHEe1mKtMKyI0v5WgJZ0v0X1H6XLE840fwHXIx1lxzSAldTRzKq2plK3UwpuCoxQyMK8P0e2AC2XWvGlC3D8C/fmE= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1701451307; c=relaxed/simple; bh=U3btX4fgRNAIPM/S9yRh+dDS8IjsYFsiUfbFa3KKQKM=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=WLkBCpo5iJro2E5bKOTkBCbAX1bnt58a9mIvL33cM/JMNzAoiKrMM0vrcldGuXANI7lxTaTgpO0CCzxkkdxCeStZDVh1VAnBIi9IjRK9cIN0Cj2tMhtdMuwkjNBiDMmiOvzrFabTXqcYsY9huvWiM3ROKhS6b8K6LpMgDkleU5U= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-pf1-x433.google.com with SMTP id d2e1a72fcca58-6cdd4aab5f5so2357149b3a.3 for ; Fri, 01 Dec 2023 09:21:43 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1701451302; x=1702056102; darn=sourceware.org; h=content-transfer-encoding:mime-version:message-id:date:subject:to :from:from:to:cc:subject:date:message-id:reply-to; bh=R4pLSzBn+LGaAoyh42L7QBr4ueRP2MRcWj38Ypwh/wg=; b=IkO2QCJsvUTpDk+2DSwWJ6+HTVU/phJs0n05eup2Qzeu2pTAptD7/0spWLrrhoofHG n4v11bEyDv6nNYsiPNxrTmn6gXRi6CHw6/N3MWKS8vNZUPlPxIcZHBoFRsS7bvq4HnNK JScvSiqiER2MmzyGhIRHVnEr0WaRVgLYkHXxnzWSyPqyUbUW6Vf0+ebYqu9Lx3K0/CZM urfi07yj26FzZ5qq3Y7v9zDFh0zshHuyXRs3go8XMHXXbC1q3ROjxF+nqTZE82+wRmf9 XfD5DFu7K5I6N7P6AdURxp6OTe8jCVgJPZq5Kc8yk8gxYwCFL1efIMEo8JJDv72o92G6 NWoQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1701451302; x=1702056102; h=content-transfer-encoding:mime-version:message-id:date:subject:to :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=R4pLSzBn+LGaAoyh42L7QBr4ueRP2MRcWj38Ypwh/wg=; b=XZsl/vaKccmRI0gvB3E6vaC/V48YPTwjpxsAb6g5Q9UaZXsU9H74Aucj987uUU49P7 ZLBqaElkzEzRQzOES55ALhczyYSCbAaCo50ZnDmVl7p3nIKY8AZxngsl5Lu9fpDBcpSD TSjJVj6FkhzbhptwBZ+85RlFo1rxTGpParsCyeRc3aEBoNkXAL5/SpicviqAzGQ1eo6n I9JVWLBfSWDO06dOj3yvQH+MsOlKq7bezwLndZm5r1BIaklGB/1w0I3BtrQQNbDpTtSr Xz7BzQr+Dvcw7izU4mPC4hAsXbtaZj01E79Z3WSROGPxlc+sMFXeCQCqZs1n0Esd/Bbb RhHQ== X-Gm-Message-State: AOJu0YxdI6kTorJoDFTssmccSdcPjwuOy+5YtpHWMj4eI0J8sBtcgQtp idmei6cMW499PxTT/uWd1wtInIbdAc0= X-Received: by 2002:a05:6a00:3a18:b0:6c0:4006:4195 with SMTP id fj24-20020a056a003a1800b006c040064195mr26763846pfb.0.1701451301821; Fri, 01 Dec 2023 09:21:41 -0800 (PST) Received: from gnu-cfl-3.localdomain ([172.59.161.253]) by smtp.gmail.com with ESMTPSA id t14-20020aa7938e000000b006be047268d5sm3356230pfe.174.2023.12.01.09.21.41 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 01 Dec 2023 09:21:41 -0800 (PST) Received: from gnu-cfl-3.. (localhost [IPv6:::1]) by gnu-cfl-3.localdomain (Postfix) with ESMTP id 2195374016D for ; Fri, 1 Dec 2023 09:21:40 -0800 (PST) From: "H.J. Lu" To: binutils@sourceware.org Subject: [PATCH] Fix ld/x86: reduce testsuite dependency on system object files Date: Fri, 1 Dec 2023 09:21:40 -0800 Message-ID: <20231201172140.563656-1-hjl.tools@gmail.com> X-Mailer: git-send-email 2.41.0 MIME-Version: 1.0 X-Spam-Status: No, score=-3025.1 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: binutils@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Binutils mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: binutils-bounces+ouuuleilei=gmail.com@sourceware.org X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1784101012114816338 X-GMAIL-MSGID: 1784101012114816338 commit eab996435fe65a421541f59557c5f1fd427573a3 Author: Jan Beulich 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. --- 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 71ecc92f081..95a2986265b 100644 --- a/ld/testsuite/ld-x86-64/x86-64.exp +++ b/ld/testsuite/ld-x86-64/x86-64.exp @@ -2101,7 +2101,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} \ @@ -2110,7 +2110,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} \ @@ -2119,7 +2119,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} \ @@ -2128,7 +2128,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} \ @@ -2137,7 +2137,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} \ @@ -2146,7 +2146,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} \ @@ -2155,7 +2155,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} \ @@ -2164,7 +2164,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} \ @@ -2173,7 +2173,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} \ @@ -2182,7 +2182,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} \