Skip to content

Commit

Permalink
[build] Fix building with newer binutils
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
mcb30 committed Dec 14, 2023
1 parent 8cb141e commit 47efa60
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/callback.S
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions src/prefix.S
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ _prefix:

#if defined(__i386__) || defined(__x86_64__)

.code32
.arch i386

.org 0x1f1
Expand Down
2 changes: 1 addition & 1 deletion src/startup.S
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@

#if defined(__i386__) || defined(__x86_64__)

.arch i386
.code32
.arch i386

/* Startup code */
.section ".text", "ax", @progbits
Expand Down

0 comments on commit 47efa60

Please sign in to comment.