Commit: Fix for compiling commit d774bf9b3623239a1cfa729afcf048a15da657d3 with non-ELF targets

Jan Beulich jbeulich@suse.com
Mon Sep 23 11:37:36 GMT 2024


Nick,

On 23.09.2024 13:26, Nick Clifton wrote:
> Hi Cui,
> 
>   Your commit d774bf9b3623239a1cfa729afcf048a15da657d3 "[PATCH] x86: Add
>   tls check in gas" has triggered a couple of compile time failures when
>   building for non-ELF based x86 targets (eg x86_64-pc-mingw64).  For
>   example:
> 
> gas/config/tc-i386.c: In function 'x86_check_tls_relocation':
> gas/config/tc-i386.c:6600:11: error: 'x86_elf_abi' undeclared (first use in this function)
>  6600 |       if (x86_elf_abi == X86_64_ABI)
>       |           ^~~~~~~~~~~
> gas/config/tc-i386.c:6600:11: note: each undeclared identifier is reported only once for each function it appears in
> gas/config/tc-i386.c:6600:26: error: 'X86_64_ABI' undeclared (first use in this function)
>  6600 |       if (x86_elf_abi == X86_64_ABI)
>       |                          ^~~~~~~~~~
> 
>   Since the fix is easy, I am going to apply the attached patch to
>   resolve the problem.  But I thought that you might want to know and
>   possibly check it over in case my naive solution is incorrect.

along with the #if-s it's further necessary to also make use of IS_ELF.
Until (as discussed in Prague, and hopefully soon) I'll get around to
purge the gas emulations for x86 (at which point OBJ_MAYBE_ELF will no
longer be a thing on x86, I expect).

And then your patch contains quite a few seemingly unrelated changes.

Jan


More information about the Binutils mailing list