[PATCH] Cleanup bfd target vectors and ld emulations on Solaris
Jan Beulich
jbeulich@suse.com
Fri Dec 12 06:57:06 GMT 2025
On 12.12.2025 05:40, Alan Modra wrote:
> On Thu, Dec 11, 2025 at 03:51:39PM +0100, Rainer Orth wrote:
>> Hi Jan,
>>
>>> On 11.12.2025 14:58, Rainer Orth wrote:
>>>>> On 01.12.2025 14:31, Rainer Orth wrote:
>>>>>> Ok for trunk?
>>>>>
>>>>> Yes, albeit ideally with a few small adjustments:
>>>>> - The "want64=true" looks bogus for i[3-7]86-*-solaris2.1[01]*, i.e. likely
>>>>> wants removing while bringing things into consistent shape.
>>>>
>>>> IIUC, want64=true is needed whenever a configuration includes 64-bit
>>>> target vectors, which is true in this case (gcc is always bi-arch if the
>>>> OS supports it, so expects the same from gld). The Solaris 10+/i386
>>>> case is identical to what's done for Solaris 7+/sparc in this regard.
>>>
>>> Not quite: There's targ_selvecs and targ64_selvecs. The latter are included
>>> _if_ BFD64 is enabled anyway. "want64" aiui should be set only if
>>> targ_selvecs includes any 64-bit arch.
>>
>> I see, thanks. I'll have a look.
>>
>> However, I find myself constantly confused by both want64 and BFD64,
>> neither of which is documented in config.bfd. Maybe you can fix that?
>
> The BFD64 lines in config.bfd are of course just comments as far as
> the shell is concerned. They are used to generate a list of target
> vectors. See targmatch.sed and targmatch.h in targets.c.
>
> Regarding the solaris cleanup, I've been testing these two cross
> targets as part of my regression runs: "amd64-pc-solaris2.11" and
> "sparc-sun-solaris2". The latter config slips past the obsolescence
> check in config.bfd and matches sparc*-*-*, and results in
> "Fatal error: selected target format 'elf32-sparc-sol2' unknown"
> from gas.
>
> Here's what I propose to tidy this. I'll commit it on your OK.
But weren't *-*-solaris2 supposed to continue to work, kind of as a
wildcard for *-*-solaris2.1* ? I'm, too, having
targets of that form in my set used for "global" testing.
Jan
> commit 211f1c2f96c84b8af8596ab9d8798c063214e127
> Author: Alan Modra <amodra@gmail.com>
> Date: Fri Dec 12 15:00:25 2025 +1030
>
> more solaris tidies
>
> Don't overspecify the obsolete solaris targets: match solaris* rather
> than solaris2.[0-9]*. Move the sparc-*-solaris2.[0-6]* match later,
> and make it sparc*-*-solaris* so that it catches sparcv9 and sparc64.
>
> diff --git a/bfd/config.bfd b/bfd/config.bfd
> index a9f5f457f45..b180382d7f4 100644
> --- a/bfd/config.bfd
> +++ b/bfd/config.bfd
> @@ -51,7 +51,7 @@ case $targ in
> *-*-solaris2.1[01]*)
> # Only Solaris 10+ is not obsolete.
> ;;
> - *-*-solaris2.[0-9]* | \
> + *-*-solaris* | \
> null)
> if test "x$enable_obsolete" != xyes; then
> echo "*** Configuration $targ is obsolete." >&2
> @@ -600,7 +600,7 @@ case "${targ}" in
> targ64_selvecs=x86_64_elf64_sol2_vec
> want64=true
> ;;
> - i[3-7]86-*-solaris2.[0-9]*)
> + i[3-7]86-*-solaris*)
> # PR 27666: Do not include i386_elf32_vec here.
> targ_defvec=i386_elf32_sol2_vec
> ;;
> @@ -1341,10 +1341,6 @@ case "${targ}" in
> targ64_selvecs=sparc_elf64_sol2_vec
> want64=true
> ;;
> - sparc-*-solaris2.[0-6]*)
> - # PR 27666: Do not include sparc_elf32_vec here.
> - targ_defvec=sparc_elf32_sol2_vec
> - ;;
> #ifdef BFD64
> sparcv9-*-solaris2.[7-9]* | sparcv9-*-solaris2.1[01]* | \
> sparc64-*-solaris2.[7-9]* | sparc64-*-solaris2.1[01]*)
> @@ -1376,6 +1372,10 @@ case "${targ}" in
> targ_defvec=sparc_elf32_vxworks_vec
> targ_selvecs="sparc_elf32_vec"
> ;;
> + sparc*-*-solaris*)
> + # PR 27666: Do not include sparc_elf32_vec here.
> + targ_defvec=sparc_elf32_sol2_vec
> + ;;
> sparc*-*-*)
> targ_defvec=sparc_elf32_vec
> ;;
> diff --git a/ld/po/BLD-POTFILES.in b/ld/po/BLD-POTFILES.in
> index 94bd7b0d2a8..d7d0c517307 100644
> --- a/ld/po/BLD-POTFILES.in
> +++ b/ld/po/BLD-POTFILES.in
> @@ -204,7 +204,6 @@ eelf_i386.c
> eelf_i386_be.c
> eelf_i386_fbsd.c
> eelf_i386_haiku.c
> -eelf_i386_ldso.c
> eelf_i386_sol2.c
> eelf_i386_vxworks.c
> eelf_iamcu.c
>
More information about the Binutils
mailing list