configure: Deal with OpenBSD/i386 emulation linker
PATCH 1/1 configure: Deal with OpenBSD/i386 emulation linker
OpenBSD/i386 uses elf_i386_obsd for the emulation linker.
configure +3 -3
@@ -5159,9 +5159,9 @@ if test \( "$cpu" = "i386" -o "$cpu" = "x86_64" \) -a \ "$targetos" != "Darwin" -a "$targetos" != "SunOS" -a \ "$softmmu" = yes ; then # Different host OS linkers have different ideas about the name of the ELF - # emulation. Linux and OpenBSD use 'elf_i386'; FreeBSD uses the _fbsd - # variant; and Windows uses i386pe. - for emu in elf_i386 elf_i386_fbsd i386pe; do + # emulation. Linux uses 'elf_i386'; FreeBSD uses the _fbsd variant; + # OpenBSD uses the _obsd variant; and Windows uses i386pe. + for emu in elf_i386 elf_i386_fbsd elf_i386_obsd i386pe; do if "$ld" -verbose 2>&1 | grep -q "^[[:space:]]*$emu[[:space:]]*$"; then ld_i386_emulation="$emu" roms="optionrom"
Quoted 12 lines · Brad Smith
OpenBSD/i386 uses
elf_i386_obsdfor the emulation linker.Signed-off-by Brad Smith <[email protected]>configure +0
-0@@ -5159,9 +5159,9 @@ if test \( "$cpu" = "i386" -o "$cpu" = "x86_64" \) -a \ "$targetos" != "Darwin" -a "$targetos" != "SunOS" -a \ "$softmmu" = yes ; then
configure if test \( "$cpu" = "i386" -o "$cpu" = "x86_64" \) -a \ · line 5167
Quoted 10 lines
configure +3
-3# Different host OS linkers have different ideas about the name of the ELF - # emulation. Linux and OpenBSD use 'elf_i386'; FreeBSD uses the _fbsd - # variant; and Windows uses i386pe. - for emu in elf_i386 elf_i386_fbsd i386pe; do + # emulation. Linux uses 'elf_i386'; FreeBSD uses the _fbsd variant; + # OpenBSD uses the _obsd variant; and Windows uses i386pe. + for emu in elf_i386 elf_i386_fbsd elf_i386_obsd i386pe; do if "$ld" -verbose 2>&1 | grep -q "^[[:space:]]*$emu[[:space:]]*$"; then ld_i386_emulation="$emu" roms="optionrom"
My OpenBSD/x86-64's ld supports both "elf_i386" and "elf_i386_obsd" -- which should we be using in this case? With your change we'll still prefer elf_i386 if the linker handles both.
Do you know what the difference between the two is?
thanks
-- PMM
Quoted 19 lines · Peter Maydell
Quoted 18 lines · Brad Smith
OpenBSD/i386 uses
elf_i386_obsdfor the emulation linker.Signed-off-by Brad Smith <[email protected]>configure +2
-3@@ -5159,9 +5159,9 @@ if test \( "$cpu" = "i386" -o "$cpu" = "x86_64" \) -a \ "$targetos" != "Darwin" -a "$targetos" != "SunOS" -a \ "$softmmu" = yes ; then # Different host OS linkers have different ideas about the name of the ELF - # emulation. Linux and OpenBSD use 'elf_i386'; FreeBSD uses the _fbsd - # variant; and Windows uses i386pe. - for emu in elf_i386 elf_i386_fbsd i386pe; do + # emulation. Linux uses 'elf_i386'; FreeBSD uses the _fbsd variant; + # OpenBSD uses the _obsd variant; and Windows uses i386pe.
Quoted 8 lines
configure if test \( "$cpu" = "i386" -o "$cpu" = "x86_64" \) -a \ · line 5167
Quoted 4 lines
configure +1
-0+ for emu in elf_i386 elf_i386_fbsd elf_i386_obsd i386pe; do if "$ld" -verbose 2>&1 | grep -q "^[[:space:]]*$emu[[:space:]]*$"; then ld_i386_emulation="$emu" roms="optionrom"My OpenBSD/x86-64's ld supports both "
elf_i386" and "elf_i386_obsd" -- which should we be using in this case? With your change we'll still preferelf_i386if the linker handles both.
I sent a second rev of the diff with slightly tweaked comment.
OpenBSD/amd64 uses elf_i386. OpenBSD/i386 uses elf_i386_obsd.
Quoted 1 line
Do you know what the difference between the two is?
No.
Quoted 29 lines · Brad Smith
Quoted 19 lines · Peter Maydell
Quoted 18 lines · Brad Smith
OpenBSD/i386 uses
elf_i386_obsdfor the emulation linker.Signed-off-by Brad Smith <[email protected]>configure +2
-3@@ -5159,9 +5159,9 @@ if test \( "$cpu" = "i386" -o "$cpu" = "x86_64" \) -a \ "$targetos" != "Darwin" -a "$targetos" != "SunOS" -a \ "$softmmu" = yes ; then # Different host OS linkers have different ideas about the name of the ELF - # emulation. Linux and OpenBSD use 'elf_i386'; FreeBSD uses the _fbsd - # variant; and Windows uses i386pe. - for emu in elf_i386 elf_i386_fbsd i386pe; do + # emulation. Linux uses 'elf_i386'; FreeBSD uses the _fbsd variant; + # OpenBSD uses the _obsd variant; and Windows uses i386pe.Quoted 8 lines
configure if test \( "$cpu" = "i386" -o "$cpu" = "x86_64" \) -a \ · line 5167
Quoted 4 lines
configure +1
-0+ for emu in elf_i386 elf_i386_fbsd elf_i386_obsd i386pe; do if "$ld" -verbose 2>&1 | grep -q "^[[:space:]]*$emu[[:space:]]*$"; then ld_i386_emulation="$emu" roms="optionrom"My OpenBSD/x86-64's ld supports both "
elf_i386" and "elf_i386_obsd" -- which should we be using in this case? With your change we'll still preferelf_i386if the linker handles both.
Quoted 7 lines
I sent a second rev of the diff with slightly tweaked comment.
OpenBSD/amd64 uses
elf_i386. OpenBSD/i386 useself_i386_obsd.Quoted 1 line
Do you know what the difference between the two is?
No.
...then how do we know that elf_i386 is the right one to use for 32-bit linking when checking on an OpenBSD/amd64 system?
thanks
-- PMM