Skip to contentSkip to conversation

xen-tools: fix COMPATIBLE_HOST restriction for i686

PATCH Martin Jansa 2 participants 4 messages Mar 4, 2020 – Mar 12, 2020 1 message not in the archive

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

#1 lore raw
Quoted 12 lines · Martin Jansa via Lists.Yoctoproject.Org

* let TARGET_VENDOR to be set to something else than the default:
meta/conf/bitbake.conf:TARGET_VENDOR = "-oe"
like other architectures use

---
 recipes-extended/xen/xen-tools.inc | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
recipes-extended/xen/xen-tools.inc +0 -0
index 8bdbfec..8b86f7b 100644

recipes-extended/xen/xen-tools.inc line 7

Quoted 8 lines
recipes-extended/xen/xen-tools.inc +1 -1
@@ -1,7 +1,7 @@
 SUMMARY = "Xen hypervisor tools"
 DESCRIPTION = "Tools and utility software for the Xen hypervisor"
 
-COMPATIBLE_HOST = 'i686-oe-linux|(x86_64.*).*-linux|aarch64.*-linux|arm-.*-linux-gnueabi'
+COMPATIBLE_HOST = 'i686-.*-linux|(x86_64.*).*-linux|aarch64.*-linux|arm-.*-linux-gnueabi'
 
 inherit setuptools3 update-rc.d systemd deploy
 require xen-blktap.inc

Not really caused by this change, but now when the build can be started it fails for me with:
error: mapfile-GNU:1:9: invalid use of VERSION in input file Makefile:52: recipe for target 'libxenfsimage.so.4.12.0' failed

Anyone else seeing this? It's actually raspberrypi4 world build, so the COMPATIBLE_HOST above isn't related at all in this case.

Quoted 5 lines
Signature · 1 line
2.20.1
#2 lore raw
Quoted 28 lines · Martin Jansa
Quoted 12 lines · Martin Jansa via Lists.Yoctoproject.Org

* let TARGET_VENDOR to be set to something else than the default:
meta/conf/bitbake.conf:TARGET_VENDOR = "-oe"
like other architectures use

---
 recipes-extended/xen/xen-tools.inc | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
recipes-extended/xen/xen-tools.inc +0 -0
index 8bdbfec..8b86f7b 100644

recipes-extended/xen/xen-tools.inc line 7

Quoted 8 lines
recipes-extended/xen/xen-tools.inc +1 -1
@@ -1,7 +1,7 @@
 SUMMARY = "Xen hypervisor tools"
 DESCRIPTION = "Tools and utility software for the Xen hypervisor"
 
-COMPATIBLE_HOST = 'i686-oe-linux|(x86_64.*).*-linux|aarch64.*-linux|arm-.*-linux-gnueabi'
+COMPATIBLE_HOST = 'i686-.*-linux|(x86_64.*).*-linux|aarch64.*-linux|arm-.*-linux-gnueabi'
 
 inherit setuptools3 update-rc.d systemd deploy
 require xen-blktap.inc

Not really caused by this change, but now when the build can be started it fails for me with:
error: mapfile-GNU:1:9: invalid use of VERSION in input file Makefile:52: recipe for target 'libxenfsimage.so.4.12.0' failed

Quoted 2 lines

Anyone else seeing this? It's actually raspberrypi4 world build, so the COMPATIBLE_HOST above isn't related at all in this case.

Thanks for the report, Martin. My first pass at repro'ing this did not encounter this failure; but this is my first build with raspberrypi4 MACHINE, so it's possible that my config is different in some way. Are you able to give any more guidance on your build configuration to reproduce this? (MACHINE, layers and branches, conf file settings - eg. enabling reproducible builds)

Christopher

Quoted 8 lines
Quoted 6 lines

--
2.20.1

#3 lore raw
Quoted 32 lines · Christopher Clark
Quoted 28 lines · Martin Jansa
Quoted 12 lines · Martin Jansa via Lists.Yoctoproject.Org

* let TARGET_VENDOR to be set to something else than the default:
meta/conf/bitbake.conf:TARGET_VENDOR = "-oe"
like other architectures use

---
 recipes-extended/xen/xen-tools.inc | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
recipes-extended/xen/xen-tools.inc +0 -0
index 8bdbfec..8b86f7b 100644

recipes-extended/xen/xen-tools.inc line 7

Quoted 8 lines
recipes-extended/xen/xen-tools.inc +1 -1
@@ -1,7 +1,7 @@
 SUMMARY = "Xen hypervisor tools"
 DESCRIPTION = "Tools and utility software for the Xen hypervisor"
 
-COMPATIBLE_HOST = 'i686-oe-linux|(x86_64.*).*-linux|aarch64.*-linux|arm-.*-linux-gnueabi'
+COMPATIBLE_HOST = 'i686-.*-linux|(x86_64.*).*-linux|aarch64.*-linux|arm-.*-linux-gnueabi'
 
 inherit setuptools3 update-rc.d systemd deploy
 require xen-blktap.inc

Not really caused by this change, but now when the build can be started it fails for me with:
error: mapfile-GNU:1:9: invalid use of VERSION in input file Makefile:52: recipe for target 'libxenfsimage.so.4.12.0' failed

Quoted 2 lines

Anyone else seeing this? It's actually raspberrypi4 world build, so the COMPATIBLE_HOST above isn't related at all in this case.

Quoted 6 lines

Thanks for the report, Martin. My first pass at repro'ing this did not encounter this failure; but this is my first build with raspberrypi4 MACHINE, so it's possible that my config is different in some way. Are you able to give any more guidance on your build configuration to reproduce this? (MACHINE, layers and branches, conf file settings - eg. enabling reproducible builds)

It's reproducible only with gold, so:
DISTRO_FEATURES_append = " ld-is-gold"
in your local.conf should be able to reproduce it for any MACHINE (I see it with qemux86 as well).

Easiest work around would be to add -fuse-ld=bfd when building xen-tools if nobody is interested to fix it properly.

The issue is this file:
http://xenbits.xen.org/gitweb/?p=xen.git;a=blob;f=tools/libfsimage/common/mapfile-GNU;h=26d4d7a69ec7bbd0f7f5e48c61ea7eb61c32a2f6;hb=HEAD

BFD seems to accept slightly different format when the version script is provided "as just another input file to the linker" mentioned in older documentation:
https://ftp.gnu.org/old-gnu/Manuals/ld-2.9.1/html_node/ld_25.html
https://sourceware.org/binutils/docs/ld/VERSION.html

and when passed with --version-script, when bfd complains about the syntax exactly like gold does:

with gold:
WORKDIR/xen-tools/4.12+gitAUTOINC+a5fcafbfbe-r0/git/tools/libfsimage/common$ arm-oe-linux-gnueabi-gcc -mthumb -mfpu=neon-vfpv4 -mfloat-abi=hard -mcpu=cortex-a7 --sysroot=/WORKDIR/xen-tools/4.12+gitAUTOINC+a5fcafbfbe-r0/recipe-sysroot -L../common/ -Wl,--version-script=mapfile-GNU -pthread -Wl,-soname -Wl,libxenfsimage.so.4.12 -shared -o libxenfsimage.so.4.12.0 fsimage.opic fsimage_plugin.opic fsimage_grub.opic
/WORKDIR/xen-tools/4.12+gitAUTOINC+a5fcafbfbe-r0/recipe-sysroot-native/usr/bin/arm-oe-linux-gnueabi/../../libexec/arm-oe-linux-gnueabi/gcc/arm-oe-linux-gnueabi/9.2.0/ld: error: mapfile-GNU:2:20: syntax error, unexpected '{', expecting ';' /WORKDIR/xen-tools/4.12+gitAUTOINC+a5fcafbfbe-r0/recipe-sysroot-native/usr/bin/arm-oe-linux-gnueabi/../../libexec/arm-oe-linux-gnueabi/gcc/arm-oe-linux-gnueabi/9.2.0/ld: fatal error: unable to parse version script file mapfile-GNU
collect2: error: ld returned 1 exit status

WORKDIR/xen-tools/4.12+gitAUTOINC+a5fcafbfbe-r0/git/tools/libfsimage/common$ arm-oe-linux-gnueabi-gcc -mthumb -mfpu=neon-vfpv4 -mfloat-abi=hard -mcpu=cortex-a7 --sysroot=/WORKDIR/xen-tools/4.12+gitAUTOINC+a5fcafbfbe-r0/recipe-sysroot -L../common/ -Wl,mapfile-GNU -pthread -Wl,-soname -Wl,libxenfsimage.so.4.12 -shared -o libxenfsimage.so.4.12.0 fsimage.opic fsimage_plugin.opic fsimage_grub.opic
/WORKDIR/xen-tools/4.12+gitAUTOINC+a5fcafbfbe-r0/recipe-sysroot-native/usr/bin/arm-oe-linux-gnueabi/../../libexec/arm-oe-linux-gnueabi/gcc/arm-oe-linux-gnueabi/9.2.0/ld: error: mapfile-GNU:1:9: invalid use of VERSION in input file
collect2: error: ld returned 1 exit status

with -fuse-ld=bfd:
WORKDIR/xen-tools/4.12+gitAUTOINC+a5fcafbfbe-r0/git/tools/libfsimage/common$ arm-oe-linux-gnueabi-gcc -mthumb -mfpu=neon-vfpv4 -mfloat-abi=hard -mcpu=cortex-a7 --sysroot=/WORKDIR/xen-tools/4.12+gitAUTOINC+a5fcafbfbe-r0/recipe-sysroot -L../common/ -Wl,mapfile-GNU -pthread -Wl,-soname -Wl,libxenfsimage.so.4.12 -shared -o libxenfsimage.so.4.12.0 fsimage.opic fsimage_plugin.opic fsimage_grub.opic -fuse-ld=bfd

WORKDIR/xen-tools/4.12+gitAUTOINC+a5fcafbfbe-r0/git/tools/libfsimage/common$ arm-oe-linux-gnueabi-gcc -mthumb -mfpu=neon-vfpv4 -mfloat-abi=hard -mcpu=cortex-a7 --sysroot=/WORKDIR/xen-tools/4.12+gitAUTOINC+a5fcafbfbe-r0/recipe-sysroot -L../common/ -Wl,--version-script=mapfile-GNU -pthread -Wl,-soname -Wl,libxenfsimage.so.4.12 -shared -o libxenfsimage.so.4.12.0 fsimage.opic fsimage_plugin.opic fsimage_grub.opic -fuse-ld=bfd
/WORKDIR/xen-tools/4.12+gitAUTOINC+a5fcafbfbe-r0/recipe-sysroot-native/usr/bin/arm-oe-linux-gnueabi/../../libexec/arm-oe-linux-gnueabi/gcc/arm-oe-linux-gnueabi/9.2.0/ld.bfd:mapfile-GNU:2: syntax error in VERSION script
collect2: error: ld returned 1 exit status

both bfd and gold will happily accept the mapfile-SunOS version of this file:
http://xenbits.xen.org/gitweb/?p=xen.git;a=blob;f=tools/libfsimage/common/mapfile-SunOS;h=e99b90b65077f9e0e6082e7d2d1fa5aa55e3af7b;hb=HEAD
in --version-script param:

WORKDIR/xen-tools/4.12+gitAUTOINC+a5fcafbfbe-r0/git/tools/libfsimage/common$ arm-oe-linux-gnueabi-gcc  -mthumb -mfpu=neon-vfpv4 -mfloat-abi=hard -mcpu=cortex-a7  --sysroot=/WORKDIR/xen-tools/4.12+gitAUTOINC+a5fcafbfbe-r0/recipe-sysroot                             -L../common/ -Wl,--version-script=mapfile-SunOS -pthread -Wl,-soname -Wl,libxenfsimage.so.4.12 -shared -o libxenfsimage.so.4.12.0 fsimage.opic fsimage_plugin.opic fsimage_grub.opic
WORKDIR/xen-tools/4.12+gitAUTOINC+a5fcafbfbe-r0/git/tools/libfsimage/common$ arm-oe-linux-gnueabi-gcc  -mthumb -mfpu=neon-vfpv4 -mfloat-abi=hard -mcpu=cortex-a7  --sysroot=/WORKDIR/xen-tools/4.12+gitAUTOINC+a5fcafbfbe-r0/recipe-sysroot                             -L../common/ -Wl,--version-script=mapfile-SunOS -pthread -Wl,-soname -Wl,libxenfsimage.so.4.12 -shared -o libxenfsimage.so.4.12.0 fsimage.opic fsimage_plugin.opic fsimage_grub.opic -fuse-ld=bfd

and both will fail without --version-script:
WORKDIR/xen-tools/4.12+gitAUTOINC+a5fcafbfbe-r0/git/tools/libfsimage/common$ arm-oe-linux-gnueabi-gcc -mthumb -mfpu=neon-vfpv4 -mfloat-abi=hard -mcpu=cortex-a7 --sysroot=/WORKDIR/xen-tools/4.12+gitAUTOINC+a5fcafbfbe-r0/recipe-sysroot -L../common/ -Wl,mapfile-SunOS -pthread -Wl,-soname -Wl,libxenfsimage.so.4.12 -shared -o libxenfsimage.so.4.12.0 fsimage.opic fsimage_plugin.opic fsimage_grub.opic -fuse-ld=bfd
/WORKDIR/xen-tools/4.12+gitAUTOINC+a5fcafbfbe-r0/recipe-sysroot-native/usr/bin/arm-oe-linux-gnueabi/../../libexec/arm-oe-linux-gnueabi/gcc/arm-oe-linux-gnueabi/9.2.0/ld.bfd:mapfile-SunOS: file format not recognized; treating as linker script /WORKDIR/xen-tools/4.12+gitAUTOINC+a5fcafbfbe-r0/recipe-sysroot-native/usr/bin/arm-oe-linux-gnueabi/../../libexec/arm-oe-linux-gnueabi/gcc/arm-oe-linux-gnueabi/9.2.0/ld.bfd:mapfile-SunOS:1: syntax error
collect2: error: ld returned 1 exit status
WORKDIR/xen-tools/4.12+gitAUTOINC+a5fcafbfbe-r0/git/tools/libfsimage/common$ arm-oe-linux-gnueabi-gcc -mthumb -mfpu=neon-vfpv4 -mfloat-abi=hard -mcpu=cortex-a7 --sysroot=/WORKDIR/xen-tools/4.12+gitAUTOINC+a5fcafbfbe-r0/recipe-sysroot -L../common/ -Wl,mapfile-SunOS -pthread -Wl,-soname -Wl,libxenfsimage.so.4.12 -shared -o libxenfsimage.so.4.12.0 fsimage.opic fsimage_plugin.opic fsimage_grub.opic
/WORKDIR/xen-tools/4.12+gitAUTOINC+a5fcafbfbe-r0/recipe-sysroot-native/usr/bin/arm-oe-linux-gnueabi/../../libexec/arm-oe-linux-gnueabi/gcc/arm-oe-linux-gnueabi/9.2.0/ld: error: mapfile-SunOS:1:19: syntax error, unexpected '{' /WORKDIR/xen-tools/4.12+gitAUTOINC+a5fcafbfbe-r0/recipe-sysroot-native/usr/bin/arm-oe-linux-gnueabi/../../libexec/arm-oe-linux-gnueabi/gcc/arm-oe-linux-gnueabi/9.2.0/ld: error: mapfile-SunOS: not an object or archive
collect2: error: ld returned 1 exit status

Unfortunatelly this isn't the only issue with gold in xen-tools, for qemux86-64 it still fails with:

x86_64-oe-linux-ld --sysroot=/WORKDIR/xen-tools/4.12+gitAUTOINC+a5fcafbfbe-r0/recipe-sysroot -melf_x86_64 -melf_x86_64 -melf_x86_64 -T xen.lds -N prelink.o --build-id=sha1 \
/WORKDIR/xen-tools/4.12+gitAUTOINC+a5fcafbfbe-r0/git/tools/firmware/xen-dir/xen-root/xen/common/symbols-dummy.o -o /WORKDIR/xen-tools/4.12+gitAUTOINC+a5fcafbfbe-r0/git/tools/firmware/xen-dir/xen-root/xen/.xen-syms.0
x86_64-oe-linux-ld: error: xen.lds:66:47: syntax error, unexpected '-', expecting ')'
x86_64-oe-linux-ld: fatal error: unable to parse script file xen.lds

Which is also reproducible only with gold and bfd is happy:
WORKDIR/xen-tools/4.12+gitAUTOINC+a5fcafbfbe-r0/git/tools/firmware/xen-dir/xen-root/xen/arch/x86$ x86_64-oe-linux-ld.bfd --sysroot=/WORKDIR/xen-tools/4.12+gitAUTOINC+a5fcafbfbe-r0/recipe-sysroot -melf_x86_64 -melf_x86_64 -melf_x86_64 -T xen.lds -N prelink.o --build-id=sha1 /WORKDIR/xen-tools/4.12+gitAUTOINC+a5fcafbfbe-r0/git/tools/firmware/xen-dir/xen-root/xen/common/symbols-dummy.o -o /WORKDIR/xen-tools/4.12+gitAUTOINC+a5fcafbfbe-r0/git/tools/firmware/xen-dir/xen-root/xen/.xen-syms.0

adding:
echo 'LDFLAGS += "-fuse-ld=bfd"' >> "${S}/tools/libfsimage/Rules.mk" in xen-tools.inc:do_configure works for qemux86, but not for qemux86-64.

Feel free to improve it or fix it properly (but with linux kernel also preventing to use gold now it might not be worth spending extra time on gold).

Cheers,

#4 lore raw
Quoted 102 lines · Martin Jansa
Quoted 32 lines · Christopher Clark
Quoted 28 lines · Martin Jansa
Quoted 12 lines · Martin Jansa via Lists.Yoctoproject.Org

* let TARGET_VENDOR to be set to something else than the default:
meta/conf/bitbake.conf:TARGET_VENDOR = "-oe"
like other architectures use

---
 recipes-extended/xen/xen-tools.inc | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
recipes-extended/xen/xen-tools.inc +0 -0
index 8bdbfec..8b86f7b 100644

recipes-extended/xen/xen-tools.inc line 7

Quoted 8 lines
recipes-extended/xen/xen-tools.inc +1 -1
@@ -1,7 +1,7 @@
 SUMMARY = "Xen hypervisor tools"
 DESCRIPTION = "Tools and utility software for the Xen hypervisor"
 
-COMPATIBLE_HOST = 'i686-oe-linux|(x86_64.*).*-linux|aarch64.*-linux|arm-.*-linux-gnueabi'
+COMPATIBLE_HOST = 'i686-.*-linux|(x86_64.*).*-linux|aarch64.*-linux|arm-.*-linux-gnueabi'
 
 inherit setuptools3 update-rc.d systemd deploy
 require xen-blktap.inc

Not really caused by this change, but now when the build can be started it fails for me with:
error: mapfile-GNU:1:9: invalid use of VERSION in input file Makefile:52: recipe for target 'libxenfsimage.so.4.12.0' failed

Quoted 2 lines

Anyone else seeing this? It's actually raspberrypi4 world build, so the COMPATIBLE_HOST above isn't related at all in this case.

Quoted 6 lines

Thanks for the report, Martin. My first pass at repro'ing this did not encounter this failure; but this is my first build with raspberrypi4 MACHINE, so it's possible that my config is different in some way. Are you able to give any more guidance on your build configuration to reproduce this? (MACHINE, layers and branches, conf file settings - eg. enabling reproducible builds)

It's reproducible only with gold, so:
DISTRO_FEATURES_append = " ld-is-gold"
in your local.conf should be able to reproduce it for any MACHINE (I see it with qemux86 as well).

Easiest work around would be to add -fuse-ld=bfd when building xen-tools if nobody is interested to fix it properly.

The issue is this file:
http://xenbits.xen.org/gitweb/?p=xen.git;a=blob;f=tools/libfsimage/common/mapfile-GNU;h=26d4d7a69ec7bbd0f7f5e48c61ea7eb61c32a2f6;hb=HEAD

BFD seems to accept slightly different format when the version script is provided "as just another input file to the linker" mentioned in older documentation:
https://ftp.gnu.org/old-gnu/Manuals/ld-2.9.1/html_node/ld_25.html
https://sourceware.org/binutils/docs/ld/VERSION.html

and when passed with --version-script, when bfd complains about the syntax exactly like gold does:

with gold:
WORKDIR/xen-tools/4.12+gitAUTOINC+a5fcafbfbe-r0/git/tools/libfsimage/common$ arm-oe-linux-gnueabi-gcc -mthumb -mfpu=neon-vfpv4 -mfloat-abi=hard -mcpu=cortex-a7 --sysroot=/WORKDIR/xen-tools/4.12+gitAUTOINC+a5fcafbfbe-r0/recipe-sysroot -L../common/ -Wl,--version-script=mapfile-GNU -pthread -Wl,-soname -Wl,libxenfsimage.so.4.12 -shared -o libxenfsimage.so.4.12.0 fsimage.opic fsimage_plugin.opic fsimage_grub.opic
/WORKDIR/xen-tools/4.12+gitAUTOINC+a5fcafbfbe-r0/recipe-sysroot-native/usr/bin/arm-oe-linux-gnueabi/../../libexec/arm-oe-linux-gnueabi/gcc/arm-oe-linux-gnueabi/9.2.0/ld: error: mapfile-GNU:2:20: syntax error, unexpected '{', expecting ';' /WORKDIR/xen-tools/4.12+gitAUTOINC+a5fcafbfbe-r0/recipe-sysroot-native/usr/bin/arm-oe-linux-gnueabi/../../libexec/arm-oe-linux-gnueabi/gcc/arm-oe-linux-gnueabi/9.2.0/ld: fatal error: unable to parse version script file mapfile-GNU
collect2: error: ld returned 1 exit status

WORKDIR/xen-tools/4.12+gitAUTOINC+a5fcafbfbe-r0/git/tools/libfsimage/common$ arm-oe-linux-gnueabi-gcc -mthumb -mfpu=neon-vfpv4 -mfloat-abi=hard -mcpu=cortex-a7 --sysroot=/WORKDIR/xen-tools/4.12+gitAUTOINC+a5fcafbfbe-r0/recipe-sysroot -L../common/ -Wl,mapfile-GNU -pthread -Wl,-soname -Wl,libxenfsimage.so.4.12 -shared -o libxenfsimage.so.4.12.0 fsimage.opic fsimage_plugin.opic fsimage_grub.opic
/WORKDIR/xen-tools/4.12+gitAUTOINC+a5fcafbfbe-r0/recipe-sysroot-native/usr/bin/arm-oe-linux-gnueabi/../../libexec/arm-oe-linux-gnueabi/gcc/arm-oe-linux-gnueabi/9.2.0/ld: error: mapfile-GNU:1:9: invalid use of VERSION in input file
collect2: error: ld returned 1 exit status

with -fuse-ld=bfd:
WORKDIR/xen-tools/4.12+gitAUTOINC+a5fcafbfbe-r0/git/tools/libfsimage/common$ arm-oe-linux-gnueabi-gcc -mthumb -mfpu=neon-vfpv4 -mfloat-abi=hard -mcpu=cortex-a7 --sysroot=/WORKDIR/xen-tools/4.12+gitAUTOINC+a5fcafbfbe-r0/recipe-sysroot -L../common/ -Wl,mapfile-GNU -pthread -Wl,-soname -Wl,libxenfsimage.so.4.12 -shared -o libxenfsimage.so.4.12.0 fsimage.opic fsimage_plugin.opic fsimage_grub.opic -fuse-ld=bfd

WORKDIR/xen-tools/4.12+gitAUTOINC+a5fcafbfbe-r0/git/tools/libfsimage/common$ arm-oe-linux-gnueabi-gcc -mthumb -mfpu=neon-vfpv4 -mfloat-abi=hard -mcpu=cortex-a7 --sysroot=/WORKDIR/xen-tools/4.12+gitAUTOINC+a5fcafbfbe-r0/recipe-sysroot -L../common/ -Wl,--version-script=mapfile-GNU -pthread -Wl,-soname -Wl,libxenfsimage.so.4.12 -shared -o libxenfsimage.so.4.12.0 fsimage.opic fsimage_plugin.opic fsimage_grub.opic -fuse-ld=bfd
/WORKDIR/xen-tools/4.12+gitAUTOINC+a5fcafbfbe-r0/recipe-sysroot-native/usr/bin/arm-oe-linux-gnueabi/../../libexec/arm-oe-linux-gnueabi/gcc/arm-oe-linux-gnueabi/9.2.0/ld.bfd:mapfile-GNU:2: syntax error in VERSION script
collect2: error: ld returned 1 exit status

both bfd and gold will happily accept the mapfile-SunOS version of this file:
http://xenbits.xen.org/gitweb/?p=xen.git;a=blob;f=tools/libfsimage/common/mapfile-SunOS;h=e99b90b65077f9e0e6082e7d2d1fa5aa55e3af7b;hb=HEAD
in --version-script param:

WORKDIR/xen-tools/4.12+gitAUTOINC+a5fcafbfbe-r0/git/tools/libfsimage/common$ arm-oe-linux-gnueabi-gcc  -mthumb -mfpu=neon-vfpv4 -mfloat-abi=hard -mcpu=cortex-a7  --sysroot=/WORKDIR/xen-tools/4.12+gitAUTOINC+a5fcafbfbe-r0/recipe-sysroot                             -L../common/ -Wl,--version-script=mapfile-SunOS -pthread -Wl,-soname -Wl,libxenfsimage.so.4.12 -shared -o libxenfsimage.so.4.12.0 fsimage.opic fsimage_plugin.opic fsimage_grub.opic
WORKDIR/xen-tools/4.12+gitAUTOINC+a5fcafbfbe-r0/git/tools/libfsimage/common$ arm-oe-linux-gnueabi-gcc  -mthumb -mfpu=neon-vfpv4 -mfloat-abi=hard -mcpu=cortex-a7  --sysroot=/WORKDIR/xen-tools/4.12+gitAUTOINC+a5fcafbfbe-r0/recipe-sysroot                             -L../common/ -Wl,--version-script=mapfile-SunOS -pthread -Wl,-soname -Wl,libxenfsimage.so.4.12 -shared -o libxenfsimage.so.4.12.0 fsimage.opic fsimage_plugin.opic fsimage_grub.opic -fuse-ld=bfd

and both will fail without --version-script:
WORKDIR/xen-tools/4.12+gitAUTOINC+a5fcafbfbe-r0/git/tools/libfsimage/common$ arm-oe-linux-gnueabi-gcc -mthumb -mfpu=neon-vfpv4 -mfloat-abi=hard -mcpu=cortex-a7 --sysroot=/WORKDIR/xen-tools/4.12+gitAUTOINC+a5fcafbfbe-r0/recipe-sysroot -L../common/ -Wl,mapfile-SunOS -pthread -Wl,-soname -Wl,libxenfsimage.so.4.12 -shared -o libxenfsimage.so.4.12.0 fsimage.opic fsimage_plugin.opic fsimage_grub.opic -fuse-ld=bfd
/WORKDIR/xen-tools/4.12+gitAUTOINC+a5fcafbfbe-r0/recipe-sysroot-native/usr/bin/arm-oe-linux-gnueabi/../../libexec/arm-oe-linux-gnueabi/gcc/arm-oe-linux-gnueabi/9.2.0/ld.bfd:mapfile-SunOS: file format not recognized; treating as linker script /WORKDIR/xen-tools/4.12+gitAUTOINC+a5fcafbfbe-r0/recipe-sysroot-native/usr/bin/arm-oe-linux-gnueabi/../../libexec/arm-oe-linux-gnueabi/gcc/arm-oe-linux-gnueabi/9.2.0/ld.bfd:mapfile-SunOS:1: syntax error
collect2: error: ld returned 1 exit status
WORKDIR/xen-tools/4.12+gitAUTOINC+a5fcafbfbe-r0/git/tools/libfsimage/common$ arm-oe-linux-gnueabi-gcc -mthumb -mfpu=neon-vfpv4 -mfloat-abi=hard -mcpu=cortex-a7 --sysroot=/WORKDIR/xen-tools/4.12+gitAUTOINC+a5fcafbfbe-r0/recipe-sysroot -L../common/ -Wl,mapfile-SunOS -pthread -Wl,-soname -Wl,libxenfsimage.so.4.12 -shared -o libxenfsimage.so.4.12.0 fsimage.opic fsimage_plugin.opic fsimage_grub.opic
/WORKDIR/xen-tools/4.12+gitAUTOINC+a5fcafbfbe-r0/recipe-sysroot-native/usr/bin/arm-oe-linux-gnueabi/../../libexec/arm-oe-linux-gnueabi/gcc/arm-oe-linux-gnueabi/9.2.0/ld: error: mapfile-SunOS:1:19: syntax error, unexpected '{' /WORKDIR/xen-tools/4.12+gitAUTOINC+a5fcafbfbe-r0/recipe-sysroot-native/usr/bin/arm-oe-linux-gnueabi/../../libexec/arm-oe-linux-gnueabi/gcc/arm-oe-linux-gnueabi/9.2.0/ld: error: mapfile-SunOS: not an object or archive
collect2: error: ld returned 1 exit status

Unfortunatelly this isn't the only issue with gold in xen-tools, for qemux86-64 it still fails with:

x86_64-oe-linux-ld --sysroot=/WORKDIR/xen-tools/4.12+gitAUTOINC+a5fcafbfbe-r0/recipe-sysroot -melf_x86_64 -melf_x86_64 -melf_x86_64 -T xen.lds -N prelink.o --build-id=sha1 \
/WORKDIR/xen-tools/4.12+gitAUTOINC+a5fcafbfbe-r0/git/tools/firmware/xen-dir/xen-root/xen/common/symbols-dummy.o -o /WORKDIR/xen-tools/4.12+gitAUTOINC+a5fcafbfbe-r0/git/tools/firmware/xen-dir/xen-root/xen/.xen-syms.0
x86_64-oe-linux-ld: error: xen.lds:66:47: syntax error, unexpected '-', expecting ')'
x86_64-oe-linux-ld: fatal error: unable to parse script file xen.lds

Quoted 8 lines

Which is also reproducible only with gold and bfd is happy:
WORKDIR/xen-tools/4.12+gitAUTOINC+a5fcafbfbe-r0/git/tools/firmware/xen-dir/xen-root/xen/arch/x86$ x86_64-oe-linux-ld.bfd --sysroot=/WORKDIR/xen-tools/4.12+gitAUTOINC+a5fcafbfbe-r0/recipe-sysroot -melf_x86_64 -melf_x86_64 -melf_x86_64 -T xen.lds -N prelink.o --build-id=sha1 /WORKDIR/xen-tools/4.12+gitAUTOINC+a5fcafbfbe-r0/git/tools/firmware/xen-dir/xen-root/xen/common/symbols-dummy.o -o /WORKDIR/xen-tools/4.12+gitAUTOINC+a5fcafbfbe-r0/git/tools/firmware/xen-dir/xen-root/xen/.xen-syms.0

adding:
echo 'LDFLAGS += "-fuse-ld=bfd"' >> "${S}/tools/libfsimage/Rules.mk" in xen-tools.inc:do_configure works for qemux86, but not for qemux86-64.

Feel free to improve it or fix it properly (but with linux kernel also preventing to use gold now it might not be worth spending extra time on gold).

Thanks for the extended details on this. I am interested in pursuing the full fix but am unclear on my timing for being able to get to it, so will be looking at your suggestions for the more expedient workarounds first.

Christopher