Hello everyone,

commit c9098af41e3246586a30f4f0bdb0ee4367e9a5e7 kind of broke support for FreeBSD on SPARC64. Back then old cruft (a.out and coff support) were removed for that architecture. As no other executable formats remained, a simplification for the gas targets was made at the same time, combining the former separate targets for NetBSD and OpenBSD. However the new target (sparc-*-*bsd*) also matches FreeBSD, leading to a definition of "fmt=elf em=nbsd".

This seems to work in most cases, but there are obviously subtle differences in "em=nbsd" and "em=freebsd" which leads to an assertion when linking FreeBSD's libc during a system build from source.

The attached patch differentiates those targets. I tested it on FreeBSD and it solves the linking issue. Gas should still work on NetBSD/OpenBSD, too.

Thanks for maintaining these critical programs!
--- gas/configure.tgt.orig	2020-01-07 16:52:58.735417000 +0100
+++ gas/configure.tgt	2020-01-07 16:54:02.168703000 +0100
@@ -392,7 +392,8 @@
 
   sparc-*-linux-*)			fmt=elf em=linux ;;
   sparc-*-solaris*)			fmt=elf em=solaris ;;
-  sparc-*-*bsd*)			fmt=elf em=nbsd ;;
+  sparc-*-freebsd*)                     fmt=elf em=freebsd ;;
+  sparc-*-netbsd* | sparc-*-openbsd*)   fmt=elf em=nbsd ;;
 
   spu-*-elf)				fmt=elf ;;
 

Reply via email to