From patchwork Tue Aug 15 17:02:25 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Tremer X-Patchwork-Id: 7097 Return-Path: Received: from mail01.ipfire.org (mail01.haj.ipfire.org [172.28.1.202]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) client-signature ECDSA (secp384r1)) (Client CN "mail01.haj.ipfire.org", Issuer "R3" (verified OK)) by web04.haj.ipfire.org (Postfix) with ESMTPS id 4RQHdS2189z3wk0 for ; Tue, 15 Aug 2023 17:02:52 +0000 (UTC) Received: from mail02.haj.ipfire.org (mail02.haj.ipfire.org [172.28.1.201]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) client-signature ECDSA (secp384r1)) (Client CN "mail02.haj.ipfire.org", Issuer "R3" (verified OK)) by mail01.ipfire.org (Postfix) with ESMTPS id 4RQHdF24s5zjM; Tue, 15 Aug 2023 17:02:41 +0000 (UTC) Received: from mail02.haj.ipfire.org (localhost [127.0.0.1]) by mail02.haj.ipfire.org (Postfix) with ESMTP id 4RQHdF1Hxzz306y; Tue, 15 Aug 2023 17:02:41 +0000 (UTC) Received: from mail01.ipfire.org (mail01.haj.ipfire.org [172.28.1.202]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) client-signature ECDSA (P-384)) (Client CN "mail01.haj.ipfire.org", Issuer "R3" (verified OK)) by mail02.haj.ipfire.org (Postfix) with ESMTPS id 4RQHdC57Xcz2xQl for ; Tue, 15 Aug 2023 17:02:39 +0000 (UTC) Received: from michael.haj.ipfire.org (michael.haj.ipfire.org [172.28.1.242]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) client-signature ECDSA (secp384r1)) (Client CN "michael.haj.ipfire.org", Issuer "R3" (verified OK)) by mail01.ipfire.org (Postfix) with ESMTPS id 4RQHdC0bzmzj5; Tue, 15 Aug 2023 17:02:39 +0000 (UTC) Received: by michael.haj.ipfire.org (Postfix, from userid 0) id 4RQHdB5wN3zTgF9; Tue, 15 Aug 2023 17:02:38 +0000 (UTC) From: Michael Tremer To: development@lists.ipfire.org Subject: [PATCH 2/7] ipfire-netboot: Fix build with binutils 2.41 Date: Tue, 15 Aug 2023 17:02:25 +0000 Message-Id: <20230815170230.306397-2-michael.tremer@ipfire.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230815170230.306397-1-michael.tremer@ipfire.org> References: <20230815170230.306397-1-michael.tremer@ipfire.org> MIME-Version: 1.0 X-BeenThere: development@lists.ipfire.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: IPFire development talk List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Michael Tremer Errors-To: development-bounces@lists.ipfire.org Sender: "Development" Signed-off-by: Michael Tremer --- lfs/ipfire-netboot | 1 + ...se-the-right-sized-register-for-push.patch | 44 +++++++++++++++++++ 2 files changed, 45 insertions(+) create mode 100644 src/patches/ipxe-use-the-right-sized-register-for-push.patch diff --git a/lfs/ipfire-netboot b/lfs/ipfire-netboot index 1fd37e9eb..e7ba44af9 100644 --- a/lfs/ipfire-netboot +++ b/lfs/ipfire-netboot @@ -80,6 +80,7 @@ $(TARGET) : $(patsubst %,$(DIR_DL)/%,$(objects)) cd $(DIR_APP)/ipxe-$(PXE_VER) && patch -Np1 < $(DIR_SRC)/src/patches/ipxe-fix-stringop-truncation-warning-with-gcc-8-x.patch cd $(DIR_APP)/ipxe-$(PXE_VER) && patch -Np1 < $(DIR_SRC)/src/patches/ipxe-handle-R_X86_64_PLT32.patch cd $(DIR_APP)/ipxe-$(PXE_VER) && patch -Np1 < $(DIR_SRC)/src/patches/ipxe-1b67a05-be-explicit-about-fcommon-compiler-directive.patch + cd $(DIR_APP)/ipxe-$(PXE_VER) && patch -Np1 < $(DIR_SRC)/src/patches/ipxe-use-the-right-sized-register-for-push.patch cd $(DIR_APP) && rm -rfv ipxe && ln -s ipxe-$(PXE_VER) ipxe cd $(DIR_APP) && make $(MAKETUNING) bin/ipxe.lkrn ifeq "$(BUILD_ARCH)" "x86_64" diff --git a/src/patches/ipxe-use-the-right-sized-register-for-push.patch b/src/patches/ipxe-use-the-right-sized-register-for-push.patch new file mode 100644 index 000000000..99b76de66 --- /dev/null +++ b/src/patches/ipxe-use-the-right-sized-register-for-push.patch @@ -0,0 +1,44 @@ +From 08caa8be3a143d6f33782f398b7937efb39ff283 Mon Sep 17 00:00:00 2001 +From: Justin Cano <5184128+jstncno@users.noreply.github.com> +Date: Thu, 3 Aug 2023 09:58:11 -0700 +Subject: [PATCH] Use the right sized register for the push operand based on + the size of the value being pushed + +Fixes https://github.com/ipxe/ipxe/issues/997 +--- + src/arch/x86/include/librm.h | 6 ++++-- + 1 file changed, 4 insertions(+), 2 deletions(-) + +diff --git a/src/arch/x86/include/librm.h b/src/arch/x86/include/librm.h +index 5196d390fa..d9e748adfc 100644 +--- a/src/arch/x86/include/librm.h ++++ b/src/arch/x86/include/librm.h +@@ -250,8 +250,10 @@ extern void remove_user_from_rm_stack ( userptr_t data, size_t size ); + /* CODE_DEFAULT: restore default .code32/.code64 directive */ + #ifdef __x86_64__ + #define CODE_DEFAULT ".code64" ++#define PUSH "pushq" + #else + #define CODE_DEFAULT ".code32" ++#define PUSH "pushl" + #endif + + /* LINE_SYMBOL: declare a symbol for the current source code line */ +@@ -268,7 +270,7 @@ extern void remove_user_from_rm_stack ( userptr_t data, size_t size ); + + /* REAL_CODE: declare a fragment of code that executes in real mode */ + #define REAL_CODE( asm_code_str ) \ +- "push $1f\n\t" \ ++ PUSH " $1f\n\t" \ + "call real_call\n\t" \ + TEXT16_CODE ( "\n1:\n\t" \ + asm_code_str \ +@@ -277,7 +279,7 @@ extern void remove_user_from_rm_stack ( userptr_t data, size_t size ); + + /* PHYS_CODE: declare a fragment of code that executes in flat physical mode */ + #define PHYS_CODE( asm_code_str ) \ +- "push $1f\n\t" \ ++ PUSH " $1f\n\t" \ + "call phys_call\n\t" \ + ".section \".text.phys\", \"ax\", @progbits\n\t"\ + "\n" LINE_SYMBOL "\n\t" \