meaning of supports_gnu_unique

Alan Modra amodra@gmail.com
Wed Apr 1 08:17:41 GMT 2026


On Tue, Mar 31, 2026 at 03:22:54PM +0200, Jan Beulich wrote:
> testsuite: supports_gnu_osabi vs Arm
> 
> Arm is yet more special than the function presently expresses: Even
> targets with "gnu" in the name (e.g. arm-unknown-linux-gnu) aren't
> ELFOSABI_GNU. Handle Arm first, and drop other Arm special casing in
> exchange.
> 
> --- a/binutils/testsuite/lib/binutils-common.exp
> +++ b/binutils/testsuite/lib/binutils-common.exp
> @@ -234,11 +234,17 @@ proc match_target { target } {
>  # testcases will generally need to exclude tic6x or use a -m option.)
>  #
>  proc supports_gnu_osabi {} {
> +    if { [istarget arm*-*-*] } {
> +	if { [istarget arm*-*-*eabi*] } {
> +	    return 1
> +	}
> +	return 0
> +    }
>      if { [istarget *-*-gnu*]
>  	 || [istarget *-*-linux*]
> -	 || ( [istarget *-*-*bsd*] && ![istarget arm*-*-netbsd*] )
> +	 || [istarget *-*-*bsd*]
>  	 || [istarget *-*-lynxos]
> -	 || ( [istarget *-*-nto*] && ![istarget arm*-*-*] )
> +	 || [istarget *-*-nto*]
>  	 || [istarget *-*-irix*]
>  	 || [istarget *-*-*eabi*]
>  	 || [istarget *-*-rtems*] } {
> @@ -250,8 +256,7 @@ proc supports_gnu_osabi {} {
>      if { ![istarget "*-*-elf*"] } {
>  	return 0
>      }
> -    if { [istarget "arm*-*-*"]
> -	 || [istarget "msp430-*-*"]
> +    if { [istarget "msp430-*-*"]
>  	 || [istarget "hppa-unknown-elf"]
>  	 || [istarget "kvx*-*-*"]
>  	 || [istarget "visium-*-*"] } {

Going by what is in gas/configure.tgt, I think other arm targets
should be included, specifically freebsd and rtems.

Perhaps the following?  I'm not an arm maintainer though...

    remove arm-linux-gnu from supports_gnu_osabi
    
    arm-linux-gnueabi allows OS/ABI to be set to ELFOSABI_GNU, but plain
    arm-linux-gnu like arm-elf is ELFOSABI_ARM.

diff --git a/binutils/testsuite/lib/binutils-common.exp b/binutils/testsuite/lib/binutils-common.exp
index 5026c0c0a9a..fb6129d13aa 100644
--- a/binutils/testsuite/lib/binutils-common.exp
+++ b/binutils/testsuite/lib/binutils-common.exp
@@ -234,27 +234,32 @@ proc match_target { target } {
 # testcases will generally need to exclude tic6x or use a -m option.)
 #
 proc supports_gnu_osabi {} {
-    if { [istarget *-*-gnu*]
+    if { [istarget *-*-*eabi*]
+	 || [istarget *-*-freebsd*]
+	 || [istarget *-*-rtems*] } {
+	return 1
+    }
+    if { [istarget arm*-*-*] } {
+	return 0
+    }
+    if { [istarget *-*-*bsd*]
+	 || [istarget *-*-gnu*]
+	 || [istarget *-*-irix*]
 	 || [istarget *-*-linux*]
-	 || ( [istarget *-*-*bsd*] && ![istarget arm*-*-netbsd*] )
 	 || [istarget *-*-lynxos]
-	 || ( [istarget *-*-nto*] && ![istarget arm*-*-*] )
-	 || [istarget *-*-irix*]
-	 || [istarget *-*-*eabi*]
-	 || [istarget *-*-rtems*] } {
+	 || [istarget *-*-nto*] } {
 	return 1
     }
-    if { [istarget "wasm32*-*-*"] } {
+    if { [istarget wasm32*-*-*] } {
 	return 1
     }
-    if { ![istarget "*-*-elf*"] } {
+    if { ![istarget *-*-elf*] } {
 	return 0
     }
-    if { [istarget "arm*-*-*"]
-	 || [istarget "msp430-*-*"]
-	 || [istarget "hppa-unknown-elf"]
-	 || [istarget "kvx*-*-*"]
-	 || [istarget "visium-*-*"] } {
+    if { [istarget hppa-*-*]
+	 || [istarget kvx*-*-*]
+	 || [istarget msp430-*-*]
+	 || [istarget visium-*-*] } {
 	return 0
     }
     return 1

-- 
Alan Modra


More information about the Binutils mailing list