mailing list of musl libc
 help / color / mirror / code / Atom feed
* [musl] [PATCH] make __getauxval a public ABI symbol
@ 2023-10-12 18:31 Szabolcs Nagy
  2023-11-06 18:49 ` Rich Felker
  0 siblings, 1 reply; 3+ messages in thread
From: Szabolcs Nagy @ 2023-10-12 18:31 UTC (permalink / raw)
  To: musl

This is needed so that libgcc can access AT_HWCAP without violating
link namespace rules.

Internally musl already used __getauxval symbol for the same reason,
we just remove the hidden marking.

Currently libgcc only uses __getauxval on aarch64 for outline atomics
and only on glibc, but there is plan to add more usage (this time in
the unwinder) which may cause link failure on musl in the future.
(libgcc cannot easily check for libc symbols due to bootstrap order,
the feature could be unconditionally disabled for *-linux-musl, but
it's probably more future proof to provide the symbol.)
---
 src/include/sys/auxv.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/include/sys/auxv.h b/src/include/sys/auxv.h
index 9358a4a5..63c5bfe9 100644
--- a/src/include/sys/auxv.h
+++ b/src/include/sys/auxv.h
@@ -5,6 +5,6 @@
 
 #include <features.h>
 
-hidden unsigned long __getauxval(unsigned long);
+unsigned long __getauxval(unsigned long);
 
 #endif
-- 
2.41.0


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

* Re: [musl] [PATCH] make __getauxval a public ABI symbol
  2023-10-12 18:31 [musl] [PATCH] make __getauxval a public ABI symbol Szabolcs Nagy
@ 2023-11-06 18:49 ` Rich Felker
  2023-11-06 21:51   ` Szabolcs Nagy
  0 siblings, 1 reply; 3+ messages in thread
From: Rich Felker @ 2023-11-06 18:49 UTC (permalink / raw)
  To: musl

On Thu, Oct 12, 2023 at 08:31:48PM +0200, Szabolcs Nagy wrote:
> This is needed so that libgcc can access AT_HWCAP without violating
> link namespace rules.
> 
> Internally musl already used __getauxval symbol for the same reason,
> we just remove the hidden marking.
> 
> Currently libgcc only uses __getauxval on aarch64 for outline atomics
> and only on glibc, but there is plan to add more usage (this time in
> the unwinder) which may cause link failure on musl in the future.
> (libgcc cannot easily check for libc symbols due to bootstrap order,
> the feature could be unconditionally disabled for *-linux-musl, but
> it's probably more future proof to provide the symbol.)
> ---
>  src/include/sys/auxv.h | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/src/include/sys/auxv.h b/src/include/sys/auxv.h
> index 9358a4a5..63c5bfe9 100644
> --- a/src/include/sys/auxv.h
> +++ b/src/include/sys/auxv.h
> @@ -5,6 +5,6 @@
>  
>  #include <features.h>
>  
> -hidden unsigned long __getauxval(unsigned long);
> +unsigned long __getauxval(unsigned long);
>  
>  #endif
> -- 
> 2.41.0

This is probably okay. Are error/errno semantics expected to be the
same as the public getauxval? IIRC this was a topic of confusion at
one point in the past.

Rich

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

* Re: [musl] [PATCH] make __getauxval a public ABI symbol
  2023-11-06 18:49 ` Rich Felker
@ 2023-11-06 21:51   ` Szabolcs Nagy
  0 siblings, 0 replies; 3+ messages in thread
From: Szabolcs Nagy @ 2023-11-06 21:51 UTC (permalink / raw)
  To: Rich Felker; +Cc: musl

* Rich Felker <dalias@libc.org> [2023-11-06 13:49:33 -0500]:
> On Thu, Oct 12, 2023 at 08:31:48PM +0200, Szabolcs Nagy wrote:
> > This is needed so that libgcc can access AT_HWCAP without violating
> > link namespace rules.
> > 
> > Internally musl already used __getauxval symbol for the same reason,
> > we just remove the hidden marking.
> > 
> > Currently libgcc only uses __getauxval on aarch64 for outline atomics
> > and only on glibc, but there is plan to add more usage (this time in
> > the unwinder) which may cause link failure on musl in the future.
> > (libgcc cannot easily check for libc symbols due to bootstrap order,
> > the feature could be unconditionally disabled for *-linux-musl, but
> > it's probably more future proof to provide the symbol.)
> > ---
> >  src/include/sys/auxv.h | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> > 
> > diff --git a/src/include/sys/auxv.h b/src/include/sys/auxv.h
> > index 9358a4a5..63c5bfe9 100644
> > --- a/src/include/sys/auxv.h
> > +++ b/src/include/sys/auxv.h
> > @@ -5,6 +5,6 @@
> >  
> >  #include <features.h>
> >  
> > -hidden unsigned long __getauxval(unsigned long);
> > +unsigned long __getauxval(unsigned long);
> >  
> >  #endif
> > -- 
> > 2.41.0
> 
> This is probably okay. Are error/errno semantics expected to be the
> same as the public getauxval? IIRC this was a topic of confusion at
> one point in the past.

this is not documented or publicly declared symbol, but in glibc
it is an alias of getauxval so has the exact same semantics.
(it is an abi symbol so won't change)

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

end of thread, other threads:[~2023-11-06 22:00 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-10-12 18:31 [musl] [PATCH] make __getauxval a public ABI symbol Szabolcs Nagy
2023-11-06 18:49 ` Rich Felker
2023-11-06 21:51   ` Szabolcs Nagy

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/musl/

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 NNTP newsgroup(s).