public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug ada/115270] New: gnat doesn't link on 32-bit Linux/sparc
@ 2024-05-29  8:20 ro at gcc dot gnu.org
  2024-05-29  8:34 ` [Bug ada/115270] " ebotcazou at gcc dot gnu.org
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: ro at gcc dot gnu.org @ 2024-05-29  8:20 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115270

            Bug ID: 115270
           Summary: gnat doesn't link on 32-bit Linux/sparc
           Product: gcc
           Version: 15.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: ada
          Assignee: unassigned at gcc dot gnu.org
          Reporter: ro at gcc dot gnu.org
                CC: dkm at gcc dot gnu.org, ebotcazou at gcc dot gnu.org
  Target Milestone: ---
            Target: sparc-unknown-linux-gnu

When trying to build trunk on 32-bit Linux/sparc for comparison with 32-bit
Solaris/SPARC, the build failed because gnat didn't link:

/vol/gcc/bin/sparc/gld-2.42: ../rts/s-atopri.o: in function
`system__atomic_primitives__lock_free_try_write_64':
/var/gcc/regression/master/6.8.9-gcc-gas-gld-32/build/gcc/ada/rts/s-atopri.adb:67:(.text+0x250):
undefined reference to `__atomic_compare_exchange_8'
collect2: error: ld returned 1 exit status
gnatlink: error when calling
/var/gcc/regression/master/6.8.9-gcc-gas-gld-32/build/gcc/xg++
make[3]: *** [../gcc-interface/Makefile:464: common-tools] Error 4
make[3]: Leaving directory
'/var/gcc/regression/master/6.8.9-gcc-gas-gld-32/build/gcc/ada/tools'
make[2]: *** [Makefile:201: gnattools-native] Error 2
make[2]: Leaving directory
'/var/gcc/regression/master/6.8.9-gcc-gas-gld-32/build/gnattools'

This happened both when configuring with --with-cpu-32=ultrasparc and
--with-cpu=v9.

In hindsight, that's obvious because __atomic_compare_exchange_8 requires
-mv8plus, which AFAICS isn't enabled on 32-bit Linux/sparc and I found no
way to do so.  This is unlike 32-bit Solaris/SPARC, where TARGET_DEFAULT
includes MASK_V8PLUS.

While it's clear the Linux/sparc cannot move to the Solaris default since
it still supports the V8 Leon CPUs, I wonder if it wouldn't be possible
to allow for V8+ with --with-cpu=v9?

There are other possible hacks, like explicitly passing -mv8plus for libgnat
or linking with -latomic, but those would be just that: hacks.

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug ada/115270] gnat doesn't link on 32-bit Linux/sparc
  2024-05-29  8:20 [Bug ada/115270] New: gnat doesn't link on 32-bit Linux/sparc ro at gcc dot gnu.org
@ 2024-05-29  8:34 ` ebotcazou at gcc dot gnu.org
  2024-05-29  8:36 ` ebotcazou at gcc dot gnu.org
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: ebotcazou at gcc dot gnu.org @ 2024-05-29  8:34 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115270

Eric Botcazou <ebotcazou at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2024-05-29
     Ever confirmed|0                           |1

--- Comment #1 from Eric Botcazou <ebotcazou at gcc dot gnu.org> ---
That's indeed a known issue.

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug ada/115270] gnat doesn't link on 32-bit Linux/sparc
  2024-05-29  8:20 [Bug ada/115270] New: gnat doesn't link on 32-bit Linux/sparc ro at gcc dot gnu.org
  2024-05-29  8:34 ` [Bug ada/115270] " ebotcazou at gcc dot gnu.org
@ 2024-05-29  8:36 ` ebotcazou at gcc dot gnu.org
  2024-05-29  9:56 ` ro at CeBiTec dot Uni-Bielefeld.DE
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: ebotcazou at gcc dot gnu.org @ 2024-05-29  8:36 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115270

--- Comment #2 from Eric Botcazou <ebotcazou at gcc dot gnu.org> ---
Created attachment 58304
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=58304&action=edit
Tentative fix

Please give it a try when you have a chance.

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug ada/115270] gnat doesn't link on 32-bit Linux/sparc
  2024-05-29  8:20 [Bug ada/115270] New: gnat doesn't link on 32-bit Linux/sparc ro at gcc dot gnu.org
  2024-05-29  8:34 ` [Bug ada/115270] " ebotcazou at gcc dot gnu.org
  2024-05-29  8:36 ` ebotcazou at gcc dot gnu.org
@ 2024-05-29  9:56 ` ro at CeBiTec dot Uni-Bielefeld.DE
  2024-05-29 10:10 ` [Bug ada/115270] GNAT tools do not link on 32-bit SPARC/Linux cvs-commit at gcc dot gnu.org
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: ro at CeBiTec dot Uni-Bielefeld.DE @ 2024-05-29  9:56 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115270

--- Comment #3 from ro at CeBiTec dot Uni-Bielefeld.DE <ro at CeBiTec dot Uni-Bielefeld.DE> ---
> --- Comment #2 from Eric Botcazou <ebotcazou at gcc dot gnu.org> ---
> Created attachment 58304
>   --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=58304&action=edit
> Tentative fix
>
> Please give it a try when you have a chance.

As it happens, I still had the failed build tree around, so I just
dropped in the patch and restarted the build.  It completed successfully
and the following make check-ada only found the expected failures.

Thanks for the quick fix.

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug ada/115270] GNAT tools do not link on 32-bit SPARC/Linux
  2024-05-29  8:20 [Bug ada/115270] New: gnat doesn't link on 32-bit Linux/sparc ro at gcc dot gnu.org
                   ` (2 preceding siblings ...)
  2024-05-29  9:56 ` ro at CeBiTec dot Uni-Bielefeld.DE
@ 2024-05-29 10:10 ` cvs-commit at gcc dot gnu.org
  2024-05-29 10:11 ` cvs-commit at gcc dot gnu.org
  2024-05-29 10:12 ` ebotcazou at gcc dot gnu.org
  5 siblings, 0 replies; 7+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2024-05-29 10:10 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115270

--- Comment #4 from GCC Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Eric Botcazou <ebotcazou@gcc.gnu.org>:

https://gcc.gnu.org/g:9c6e75a6d1cc2858fc945266a5edb700edb44389

commit r15-894-g9c6e75a6d1cc2858fc945266a5edb700edb44389
Author: Eric Botcazou <ebotcazou@adacore.com>
Date:   Wed May 29 12:06:32 2024 +0200

    Fix link failure of GNAT tools on 32-bit SPARC/Linux

    There is an incorrect binding to the 64-bit compare-and-exchange builtin.

    gcc/ada/
            PR ada/115270
            * Makefile.rtl (PowerPC/Linux): Use libgnat/s-atopri__32.ads for
            the 32-bit library.
            (SPARC/Linux): Likewise.

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug ada/115270] GNAT tools do not link on 32-bit SPARC/Linux
  2024-05-29  8:20 [Bug ada/115270] New: gnat doesn't link on 32-bit Linux/sparc ro at gcc dot gnu.org
                   ` (3 preceding siblings ...)
  2024-05-29 10:10 ` [Bug ada/115270] GNAT tools do not link on 32-bit SPARC/Linux cvs-commit at gcc dot gnu.org
@ 2024-05-29 10:11 ` cvs-commit at gcc dot gnu.org
  2024-05-29 10:12 ` ebotcazou at gcc dot gnu.org
  5 siblings, 0 replies; 7+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2024-05-29 10:11 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115270

--- Comment #5 from GCC Commits <cvs-commit at gcc dot gnu.org> ---
The releases/gcc-14 branch has been updated by Eric Botcazou
<ebotcazou@gcc.gnu.org>:

https://gcc.gnu.org/g:fba2843b9b35b9700155677f90555700b6ad4e16

commit r14-10258-gfba2843b9b35b9700155677f90555700b6ad4e16
Author: Eric Botcazou <ebotcazou@adacore.com>
Date:   Wed May 29 12:06:32 2024 +0200

    Fix link failure of GNAT tools on 32-bit SPARC/Linux

    There is an incorrect binding to the 64-bit compare-and-exchange builtin.

    gcc/ada/
            PR ada/115270
            * Makefile.rtl (PowerPC/Linux): Use libgnat/s-atopri__32.ads for
            the 32-bit library.
            (SPARC/Linux): Likewise.

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug ada/115270] GNAT tools do not link on 32-bit SPARC/Linux
  2024-05-29  8:20 [Bug ada/115270] New: gnat doesn't link on 32-bit Linux/sparc ro at gcc dot gnu.org
                   ` (4 preceding siblings ...)
  2024-05-29 10:11 ` cvs-commit at gcc dot gnu.org
@ 2024-05-29 10:12 ` ebotcazou at gcc dot gnu.org
  5 siblings, 0 replies; 7+ messages in thread
From: ebotcazou at gcc dot gnu.org @ 2024-05-29 10:12 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115270

Eric Botcazou <ebotcazou at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Resolution|---                         |FIXED
             Status|NEW                         |RESOLVED

--- Comment #6 from Eric Botcazou <ebotcazou at gcc dot gnu.org> ---
Thanks for reporting the problem and testing the fix.

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2024-05-29 10:12 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-05-29  8:20 [Bug ada/115270] New: gnat doesn't link on 32-bit Linux/sparc ro at gcc dot gnu.org
2024-05-29  8:34 ` [Bug ada/115270] " ebotcazou at gcc dot gnu.org
2024-05-29  8:36 ` ebotcazou at gcc dot gnu.org
2024-05-29  9:56 ` ro at CeBiTec dot Uni-Bielefeld.DE
2024-05-29 10:10 ` [Bug ada/115270] GNAT tools do not link on 32-bit SPARC/Linux cvs-commit at gcc dot gnu.org
2024-05-29 10:11 ` cvs-commit at gcc dot gnu.org
2024-05-29 10:12 ` ebotcazou at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).