public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [libstdc++] [testsuite] no libatomic for vxworks
@ 2024-06-24 18:03 Alexandre Oliva
  2024-06-24 21:51 ` Jonathan Wakely
  0 siblings, 1 reply; 2+ messages in thread
From: Alexandre Oliva @ 2024-06-24 18:03 UTC (permalink / raw)
  To: libstdc++, gcc-patches; +Cc: hainque, poulhies


libatomic hasn't been ported to vxworks.  Most of the stdatomic.h and
<atomic> underlying requirements are provided by builtins and libgcc,
and the vxworks libc already provides remaining __atomic symbols, so
porting libatomic doesn't seem to make sense.

However, some of the target arch-only tests in
add_options_for_libatomic cover vxworks targets, so we end up
attempting to link libatomic in, even though it's not there.
Preempt those too-broad tests.

We've long been using a workaround very similar to this on ppc, and now
that we've made sure there's nothing in libatomic that we'd need on any
vxworks targets, we're ready to contribute this change.  Regstrapping on
x86_64-linux-gnu, just to be sure.  Ok to install?


Co-Authored-By: Marc Poulhiès <poulhies@adacore.com>

for  libstdc++-v3/ChangeLog

	* testsuite/lib/dg-options.exp (add_options_for_libatomic):
	None for *-*-vxworks*.
---
 libstdc++-v3/testsuite/lib/dg-options.exp |    5 +++++
 1 file changed, 5 insertions(+)

diff --git a/libstdc++-v3/testsuite/lib/dg-options.exp b/libstdc++-v3/testsuite/lib/dg-options.exp
index 84f9e3ebc730c..0d77fb029b09b 100644
--- a/libstdc++-v3/testsuite/lib/dg-options.exp
+++ b/libstdc++-v3/testsuite/lib/dg-options.exp
@@ -338,6 +338,11 @@ proc atomic_link_flags { paths } {
 }
 
 proc add_options_for_libatomic { flags } {
+    # We don't (need to) build libatomic for vxworks.  Don't try to
+    # link it in, even on arches that support libatomic.
+    if { [istarget *-*-vxworks*] } {
+	return $flags
+    }
     if { [istarget hppa*-*-hpux*]
 	 || ([istarget powerpc*-*-*] && [check_effective_target_ilp32])
 	 || [istarget riscv*-*-*]

-- 
Alexandre Oliva, happy hacker            https://FSFLA.org/blogs/lxo/
   Free Software Activist                   GNU Toolchain Engineer
More tolerance and less prejudice are key for inclusion and diversity
Excluding neuro-others for not behaving ""normal"" is *not* inclusive

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

* Re: [libstdc++] [testsuite] no libatomic for vxworks
  2024-06-24 18:03 [libstdc++] [testsuite] no libatomic for vxworks Alexandre Oliva
@ 2024-06-24 21:51 ` Jonathan Wakely
  0 siblings, 0 replies; 2+ messages in thread
From: Jonathan Wakely @ 2024-06-24 21:51 UTC (permalink / raw)
  To: Alexandre Oliva; +Cc: libstdc++, gcc-patches, hainque, poulhies

On Mon, 24 Jun 2024 at 21:33, Alexandre Oliva <oliva@adacore.com> wrote:
>
>
> libatomic hasn't been ported to vxworks.  Most of the stdatomic.h and
> <atomic> underlying requirements are provided by builtins and libgcc,
> and the vxworks libc already provides remaining __atomic symbols, so
> porting libatomic doesn't seem to make sense.
>
> However, some of the target arch-only tests in
> add_options_for_libatomic cover vxworks targets, so we end up
> attempting to link libatomic in, even though it's not there.
> Preempt those too-broad tests.
>
> We've long been using a workaround very similar to this on ppc, and now
> that we've made sure there's nothing in libatomic that we'd need on any
> vxworks targets, we're ready to contribute this change.  Regstrapping on
> x86_64-linux-gnu, just to be sure.  Ok to install?

OK, thanks.


>
>
> Co-Authored-By: Marc Poulhiès <poulhies@adacore.com>
>
> for  libstdc++-v3/ChangeLog
>
>         * testsuite/lib/dg-options.exp (add_options_for_libatomic):
>         None for *-*-vxworks*.
> ---
>  libstdc++-v3/testsuite/lib/dg-options.exp |    5 +++++
>  1 file changed, 5 insertions(+)
>
> diff --git a/libstdc++-v3/testsuite/lib/dg-options.exp b/libstdc++-v3/testsuite/lib/dg-options.exp
> index 84f9e3ebc730c..0d77fb029b09b 100644
> --- a/libstdc++-v3/testsuite/lib/dg-options.exp
> +++ b/libstdc++-v3/testsuite/lib/dg-options.exp
> @@ -338,6 +338,11 @@ proc atomic_link_flags { paths } {
>  }
>
>  proc add_options_for_libatomic { flags } {
> +    # We don't (need to) build libatomic for vxworks.  Don't try to
> +    # link it in, even on arches that support libatomic.
> +    if { [istarget *-*-vxworks*] } {
> +       return $flags
> +    }
>      if { [istarget hppa*-*-hpux*]
>          || ([istarget powerpc*-*-*] && [check_effective_target_ilp32])
>          || [istarget riscv*-*-*]
>
> --
> Alexandre Oliva, happy hacker            https://FSFLA.org/blogs/lxo/
>    Free Software Activist                   GNU Toolchain Engineer
> More tolerance and less prejudice are key for inclusion and diversity
> Excluding neuro-others for not behaving ""normal"" is *not* inclusive
>


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

end of thread, other threads:[~2024-06-24 21:51 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-06-24 18:03 [libstdc++] [testsuite] no libatomic for vxworks Alexandre Oliva
2024-06-24 21:51 ` Jonathan Wakely

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).