meaning of supports_gnu_unique

Jan Beulich jbeulich@suse.com
Wed Apr 1 08:42:27 GMT 2026


On 01.04.2026 10:17, Alan Modra wrote:
> 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.

I was wondering, but I went from gas/config/tc-arm.c:meabi_flags handling.
Without a command line option, it would be different from
EF_ARM_EABI_UNKNOWN only when te-arm*eabi.h is in use. And
bfd/elf32-arm.c:elf32_arm_init_file_header() simply goes from what was put
there, using ELFOSABI_ARM only when the eabi version still is
EF_ARM_EABI_UNKNOWN.

Hmm, then neither mine nor your ...

> 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.
> 
> --- 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*]

... logic here looks correct. arm{,eb}-*-freebsd[89].* use te-freebsd.h,
only other (presumably newer) arm*-*-freebsd* use te-armfbsdeabi.h

> +	 || [istarget *-*-rtems*] } {

Along with this arm-*-genode* would then also look to need including.

Jan


More information about the Binutils mailing list