[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'".

In files such as stack.S that contain no instructions to be assembled,
the ".arch i386" is redundant and may be removed entirely.

In the remaining files, fix by moving ".arch i386" below the relevant
".code16" or ".code32" directive, so that the assembler is no longer
expecting 64-bit instructions to be used by the time that the ".arch
i386" directive is encountered.

Reported-by: Ali Mustakim <alim@forwardcomputers.com>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
pull/118/head
Michael Brown 2024-01-14 12:12:18 +00:00
parent e66552eeed
commit 6ca597eee9
24 changed files with 22 additions and 19 deletions

View File

@ -2,8 +2,8 @@ FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL )
.section ".note.GNU-stack", "", @progbits .section ".note.GNU-stack", "", @progbits
.text .text
.arch i386
.code32 .code32
.arch i386
/* Must match jmp_buf structure layout */ /* Must match jmp_buf structure layout */
.struct 0 .struct 0

View File

@ -1,4 +1,5 @@
.section ".note.GNU-stack", "", @progbits .section ".note.GNU-stack", "", @progbits
.code32
.arch i386 .arch i386
.section ".data", "aw", @progbits .section ".data", "aw", @progbits

View File

@ -23,8 +23,8 @@
FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL ) FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL )
.section ".note.GNU-stack", "", @progbits .section ".note.GNU-stack", "", @progbits
.arch i386
.code16 .code16
.arch i386
/**************************************************************************** /****************************************************************************
* Set/clear CF on the stack as appropriate, assumes stack is as it should * Set/clear CF on the stack as appropriate, assumes stack is as it should

View File

@ -1,7 +1,6 @@
FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL ) FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL )
.section ".note.GNU-stack", "", @progbits .section ".note.GNU-stack", "", @progbits
.arch i386
#ifdef __x86_64__ #ifdef __x86_64__
#define STACK_SIZE 8192 #define STACK_SIZE 8192

View File

@ -1,7 +1,6 @@
FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL ) FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL )
.section ".note.GNU-stack", "", @progbits .section ".note.GNU-stack", "", @progbits
.arch i386
/**************************************************************************** /****************************************************************************
* Internal stack * Internal stack

View File

@ -11,8 +11,8 @@ FILE_LICENCE ( GPL2_OR_LATER )
#define PIC2_ICR 0xa0 #define PIC2_ICR 0xa0
.section ".note.GNU-stack", "", @progbits .section ".note.GNU-stack", "", @progbits
.arch i386
.code16 .code16
.arch i386
.section ".text16", "ax", @progbits .section ".text16", "ax", @progbits
.globl undiisr .globl undiisr

View File

@ -24,8 +24,8 @@
FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL ) FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL )
.section ".note.GNU-stack", "", @progbits .section ".note.GNU-stack", "", @progbits
.arch i386
.code16 .code16
.arch i386
#define SMAP 0x534d4150 #define SMAP 0x534d4150

View File

@ -27,6 +27,7 @@ FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL )
#include <librm.h> #include <librm.h>
.section ".note.GNU-stack", "", @progbits .section ".note.GNU-stack", "", @progbits
.code16
.arch i386 .arch i386
/**************************************************************************** /****************************************************************************

View File

@ -6,9 +6,9 @@ FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL )
#define STACK_SIZE 0x2000 #define STACK_SIZE 0x2000
.section ".note.GNU-stack", "", @progbits .section ".note.GNU-stack", "", @progbits
.code16
.arch i386 .arch i386
.section ".prefix", "awx", @progbits .section ".prefix", "awx", @progbits
.code16
/* /*
* Find active partition * Find active partition

View File

@ -26,9 +26,9 @@ FILE_LICENCE ( GPL2_ONLY )
.section ".note.GNU-stack", "", @progbits .section ".note.GNU-stack", "", @progbits
.org 0 .org 0
.code16
.arch i386 .arch i386
.section ".prefix", "ax", @progbits .section ".prefix", "ax", @progbits
.code16
.globl _dsk_start .globl _dsk_start
_dsk_start: _dsk_start:

View File

@ -37,9 +37,9 @@ FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL )
#define PSP_CMDLINE_START 0x81 #define PSP_CMDLINE_START 0x81
.section ".note.GNU-stack", "", @progbits .section ".note.GNU-stack", "", @progbits
.code16
.arch i386 .arch i386
.org 0 .org 0
.code16
.section ".prefix", "awx", @progbits .section ".prefix", "awx", @progbits
signature: signature:

View File

@ -3,9 +3,9 @@ FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL )
#include <librm.h> #include <librm.h>
.section ".note.GNU-stack", "", @progbits .section ".note.GNU-stack", "", @progbits
.code16
.arch i386 .arch i386
.section ".prefix", "awx", @progbits .section ".prefix", "awx", @progbits
.code16
.org 0 .org 0
.globl _hd_start .globl _hd_start
_hd_start: _hd_start:

View File

@ -27,6 +27,7 @@ FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL )
#include <librm.h> #include <librm.h>
.section ".note.GNU-stack", "", @progbits .section ".note.GNU-stack", "", @progbits
.code16
.arch i386 .arch i386
/* Image compression enabled */ /* Image compression enabled */

View File

@ -5,8 +5,8 @@ FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL )
#define BZI_LOAD_HIGH_ADDR 0x100000 #define BZI_LOAD_HIGH_ADDR 0x100000
.section ".note.GNU-stack", "", @progbits .section ".note.GNU-stack", "", @progbits
.arch i386
.code16 .code16
.arch i386
.section ".prefix", "ax", @progbits .section ".prefix", "ax", @progbits
.globl _lkrn_start .globl _lkrn_start
_lkrn_start: _lkrn_start:

View File

@ -1,9 +1,9 @@
FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL ) FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL )
.section ".note.GNU-stack", "", @progbits .section ".note.GNU-stack", "", @progbits
.code16
.arch i386 .arch i386
.section ".prefix", "awx", @progbits .section ".prefix", "awx", @progbits
.code16
.org 0 .org 0
.globl mbr .globl mbr

View File

@ -42,8 +42,8 @@ FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL )
#include "pciromprefix.S" #include "pciromprefix.S"
.section ".note.GNU-stack", "", @progbits .section ".note.GNU-stack", "", @progbits
.arch i386
.code16 .code16
.arch i386
/* Obtain access to payload by exposing the expansion ROM BAR at the /* Obtain access to payload by exposing the expansion ROM BAR at the
* address currently used by a suitably large memory BAR on the same * address currently used by a suitably large memory BAR on the same

View File

@ -3,8 +3,8 @@ FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL )
#include <librm.h> #include <librm.h>
.section ".note.GNU-stack", "", @progbits .section ".note.GNU-stack", "", @progbits
.arch i386
.code16 .code16
.arch i386
.section ".prefix", "ax", @progbits .section ".prefix", "ax", @progbits
.org 0 .org 0

View File

@ -2,10 +2,10 @@ FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL )
.section ".note.GNU-stack", "", @progbits .section ".note.GNU-stack", "", @progbits
.org 0 .org 0
.code16
.arch i386 .arch i386
.section ".prefix", "ax", @progbits .section ".prefix", "ax", @progbits
.code16
_prefix: _prefix:
.section ".text16", "ax", @progbits .section ".text16", "ax", @progbits

View File

@ -12,9 +12,9 @@ FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL )
#define PXE_HACK_EB54 0x0001 #define PXE_HACK_EB54 0x0001
.section ".note.GNU-stack", "", @progbits .section ".note.GNU-stack", "", @progbits
.code16
.arch i386 .arch i386
.org 0 .org 0
.code16
#include <librm.h> #include <librm.h>
#include <undi.h> #include <undi.h>

View File

@ -9,9 +9,9 @@
FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL ) FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL )
.section ".note.GNU-stack", "", @progbits .section ".note.GNU-stack", "", @progbits
.code16
.arch i386 .arch i386
.org 0 .org 0
.code16
#include <librm.h> #include <librm.h>

View File

@ -44,6 +44,7 @@ FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL );
*/ */
.section ".note.GNU-stack", "", @progbits .section ".note.GNU-stack", "", @progbits
.code32
.arch i486 .arch i486
.section ".prefix.lib", "ax", @progbits .section ".prefix.lib", "ax", @progbits

View File

@ -3,9 +3,9 @@ FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL )
#include <config/console.h> #include <config/console.h>
.section ".note.GNU-stack", "", @progbits .section ".note.GNU-stack", "", @progbits
.code16
.arch i386 .arch i386
.section ".prefix", "awx", @progbits .section ".prefix", "awx", @progbits
.code16
.org 0 .org 0
#include "mbr.S" #include "mbr.S"

View File

@ -25,6 +25,7 @@
FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL ) FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL )
.section ".note.GNU-stack", "", @progbits .section ".note.GNU-stack", "", @progbits
.code16
.arch i386 .arch i386
/**************************************************************************** /****************************************************************************

View File

@ -32,9 +32,9 @@ FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL )
#define BOCHSBP xchgw %bx, %bx #define BOCHSBP xchgw %bx, %bx
.section ".note.GNU-stack", "", @progbits .section ".note.GNU-stack", "", @progbits
.code16
.arch i386 .arch i386
.section ".text16", "awx", @progbits .section ".text16", "awx", @progbits
.code16
/**************************************************************************** /****************************************************************************
* init_libkir (real-mode or 16:xx protected-mode far call) * init_libkir (real-mode or 16:xx protected-mode far call)