mailing list of musl libc
 help / color / mirror / code / Atom feed
* [PATCH] fix unresolved symbol issues on ARMv7 due to raise/divmod dependency
@ 2016-02-23 20:21 Dima Krasner
  2016-02-23 20:43 ` Szabolcs Nagy
  0 siblings, 1 reply; 4+ messages in thread
From: Dima Krasner @ 2016-02-23 20:21 UTC (permalink / raw)
  To: musl

Similar to https://gcc.gnu.org/bugzilla/show_bug.cgi?id=31798

Signed-off-by: Dima Krasner <dima@dimakrasner.com>
---
 tools/ld.musl-clang.in | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/tools/ld.musl-clang.in b/tools/ld.musl-clang.in
index 93763d6..bb6cbaf 100644
--- a/tools/ld.musl-clang.in
+++ b/tools/ld.musl-clang.in
@@ -48,4 +48,5 @@ for x ; do
     esac
 done
 
-exec $($cc -print-prog-name=ld) -nostdlib "$@" -lc -dynamic-linker "$ldso"
+lgcc=$($cc -print-file-name=libgcc.a)
+exec $($cc -print-prog-name=ld) -nostdlib "$@" --as-needed $lgcc --no-as-needed -lc --as-needed $lgcc --no-as-needed -dynamic-linker "$ldso"
-- 
2.1.4

-- 
Dima Krasner <dima@dimakrasner.com>



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

* Re: [PATCH] fix unresolved symbol issues on ARMv7 due to raise/divmod dependency
  2016-02-23 20:21 [PATCH] fix unresolved symbol issues on ARMv7 due to raise/divmod dependency Dima Krasner
@ 2016-02-23 20:43 ` Szabolcs Nagy
  2016-02-23 20:45   ` Rich Felker
  0 siblings, 1 reply; 4+ messages in thread
From: Szabolcs Nagy @ 2016-02-23 20:43 UTC (permalink / raw)
  To: musl

* Dima Krasner <dima@dimakrasner.com> [2016-02-23 22:21:20 +0200]:
> Similar to https://gcc.gnu.org/bugzilla/show_bug.cgi?id=31798
> 
> Signed-off-by: Dima Krasner <dima@dimakrasner.com>
> ---
>  tools/ld.musl-clang.in | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/tools/ld.musl-clang.in b/tools/ld.musl-clang.in
> index 93763d6..bb6cbaf 100644
> --- a/tools/ld.musl-clang.in
> +++ b/tools/ld.musl-clang.in
> @@ -48,4 +48,5 @@ for x ; do
>      esac
>  done
>  
> -exec $($cc -print-prog-name=ld) -nostdlib "$@" -lc -dynamic-linker "$ldso"
> +lgcc=$($cc -print-file-name=libgcc.a)
> +exec $($cc -print-prog-name=ld) -nostdlib "$@" --as-needed $lgcc --no-as-needed -lc --as-needed $lgcc --no-as-needed -dynamic-linker "$ldso"

this workaround should be only done if clang uses libgcc
(and not compiler_rt)


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

* Re: [PATCH] fix unresolved symbol issues on ARMv7 due to raise/divmod dependency
  2016-02-23 20:43 ` Szabolcs Nagy
@ 2016-02-23 20:45   ` Rich Felker
  2016-02-23 21:06     ` Shiz
  0 siblings, 1 reply; 4+ messages in thread
From: Rich Felker @ 2016-02-23 20:45 UTC (permalink / raw)
  To: musl

On Tue, Feb 23, 2016 at 09:43:37PM +0100, Szabolcs Nagy wrote:
> * Dima Krasner <dima@dimakrasner.com> [2016-02-23 22:21:20 +0200]:
> > Similar to https://gcc.gnu.org/bugzilla/show_bug.cgi?id=31798
> > 
> > Signed-off-by: Dima Krasner <dima@dimakrasner.com>
> > ---
> >  tools/ld.musl-clang.in | 3 ++-
> >  1 file changed, 2 insertions(+), 1 deletion(-)
> > 
> > diff --git a/tools/ld.musl-clang.in b/tools/ld.musl-clang.in
> > index 93763d6..bb6cbaf 100644
> > --- a/tools/ld.musl-clang.in
> > +++ b/tools/ld.musl-clang.in
> > @@ -48,4 +48,5 @@ for x ; do
> >      esac
> >  done
> >  
> > -exec $($cc -print-prog-name=ld) -nostdlib "$@" -lc -dynamic-linker "$ldso"
> > +lgcc=$($cc -print-file-name=libgcc.a)
> > +exec $($cc -print-prog-name=ld) -nostdlib "$@" --as-needed $lgcc --no-as-needed -lc --as-needed $lgcc --no-as-needed -dynamic-linker "$ldso"
> 
> this workaround should be only done if clang uses libgcc
> (and not compiler_rt)

The --as-needed stuff is also not needed; it's a nop for static
libraries, which -lgcc always is. But I'm unclear why this patch is
needed to begin with, and why -lc was there already. The compiler
should be passing in the right -l options.

Rich


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

* Re: [PATCH] fix unresolved symbol issues on ARMv7 due to raise/divmod dependency
  2016-02-23 20:45   ` Rich Felker
@ 2016-02-23 21:06     ` Shiz
  0 siblings, 0 replies; 4+ messages in thread
From: Shiz @ 2016-02-23 21:06 UTC (permalink / raw)
  To: musl


> On 23 Feb 2016, at 21:45, Rich Felker <dalias@libc.org> wrote:
> 
> The --as-needed stuff is also not needed; it's a nop for static
> libraries, which -lgcc always is. But I'm unclear why this patch is
> needed to begin with, and why -lc was there already. The compiler
> should be passing in the right -l options.

These are filtered out in the musl-clang front-end; only user-given
-l flags are passed to the linker.
This is to prevent implementation-specific library segmentation,
which the compiler may have knowledge about, from leaking into the linking.

- Shiz


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

end of thread, other threads:[~2016-02-23 21:06 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-02-23 20:21 [PATCH] fix unresolved symbol issues on ARMv7 due to raise/divmod dependency Dima Krasner
2016-02-23 20:43 ` Szabolcs Nagy
2016-02-23 20:45   ` Rich Felker
2016-02-23 21:06     ` Shiz

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