From 47efa60cee9d2cb702b0cd53b71d7ef46cb30735 Mon Sep 17 00:00:00 2001 From: Michael Brown Date: Thu, 14 Dec 2023 12:46:49 +0000 Subject: [PATCH] [build] Fix building with newer binutils Newer versions of the GNU assembler (observed with binutils 2.41) will complain about the ".arch i386" in files assembled with "as --64", with the message "Error: 64bit mode not supported on 'i386'". Fix by moving ".arch i386" below ".code32", so that the assembler is no longer expecting 64-bit instructions to be used by the time that the ".arch i386" directive is encountered. Signed-off-by: Michael Brown --- src/callback.S | 2 +- src/prefix.S | 1 + src/startup.S | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/callback.S b/src/callback.S index c4cb798..feb23f3 100644 --- a/src/callback.S +++ b/src/callback.S @@ -51,8 +51,8 @@ #if defined(__i386__) || defined(__x86_64__) - .arch i386 .code32 + .arch i386 /* Call an arbitrary real-mode function */ .section ".text", "ax", @progbits diff --git a/src/prefix.S b/src/prefix.S index 245bae8..f39b626 100644 --- a/src/prefix.S +++ b/src/prefix.S @@ -68,6 +68,7 @@ _prefix: #if defined(__i386__) || defined(__x86_64__) + .code32 .arch i386 .org 0x1f1 diff --git a/src/startup.S b/src/startup.S index d259232..a72f9b9 100644 --- a/src/startup.S +++ b/src/startup.S @@ -35,8 +35,8 @@ #if defined(__i386__) || defined(__x86_64__) - .arch i386 .code32 + .arch i386 /* Startup code */ .section ".text", "ax", @progbits