mailing list of musl libc
 help / color / mirror / code / Atom feed
* customizable -lgcc in makefile
@ 2012-07-17 16:37 Szabolcs Nagy
  2012-07-17 17:45 ` Rich Felker
  2012-07-17 21:44 ` Richard Pennington
  0 siblings, 2 replies; 3+ messages in thread
From: Szabolcs Nagy @ 2012-07-17 16:37 UTC (permalink / raw)
  To: musl

the following modification allows config.mak
to override the -lgcc linker flag

this is needed when compiling musl with pcc
(then LIBCC=-Lpath/to/libpcc -lpcc)

i wonder what clang needs there and if there is
any libgcc specific code in musl


diff --git a/Makefile b/Makefile
index 0c13417..ad701c9 100644
--- a/Makefile
+++ b/Makefile
@@ -23,6 +23,7 @@ GENH = include/bits/alltypes.h
 IMPH = src/internal/stdio_impl.h src/internal/pthread_impl.h src/internal/libc.h

 LDFLAGS =
+LIBCC = -lgcc
 CPPFLAGS =
 CFLAGS = -Os -pipe
 CFLAGS_C99FSE = -std=c99 -ffreestanding -nostdinc
@@ -91,7 +92,7 @@ include/bits/alltypes.h: include/bits/alltypes.h.sh
 lib/libc.so: $(LOBJS)
        $(CC) $(CFLAGS_ALL_SHARED) $(LDFLAGS) -nostdlib -shared \
        -Wl,-e,_start -Wl,-Bsymbolic-functions \
-       -Wl,-soname=libc.so -o $@ $(LOBJS) -lgcc
+       -Wl,-soname=libc.so -o $@ $(LOBJS) $(LIBCC)

 lib/libc.a: $(OBJS)
        rm -f $@


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

* Re: customizable -lgcc in makefile
  2012-07-17 16:37 customizable -lgcc in makefile Szabolcs Nagy
@ 2012-07-17 17:45 ` Rich Felker
  2012-07-17 21:44 ` Richard Pennington
  1 sibling, 0 replies; 3+ messages in thread
From: Rich Felker @ 2012-07-17 17:45 UTC (permalink / raw)
  To: musl

On Tue, Jul 17, 2012 at 06:37:28PM +0200, Szabolcs Nagy wrote:
> the following modification allows config.mak
> to override the -lgcc linker flag
> 
> this is needed when compiling musl with pcc
> (then LIBCC=-Lpath/to/libpcc -lpcc)
> 
> i wonder what clang needs there and if there is
> any libgcc specific code in musl

musl itself does not contain any references to libgcc/libpcc/etc. The
references are generated by the compiler when it's too lazy to
actually generate the code it needs for things like 64-bit division
and instead just generates a function call to library code.

> diff --git a/Makefile b/Makefile
> index 0c13417..ad701c9 100644
> --- a/Makefile
> +++ b/Makefile
> @@ -23,6 +23,7 @@ GENH = include/bits/alltypes.h
>  IMPH = src/internal/stdio_impl.h src/internal/pthread_impl.h src/internal/libc.h
> 
>  LDFLAGS =
> +LIBCC = -lgcc
>  CPPFLAGS =
>  CFLAGS = -Os -pipe
>  CFLAGS_C99FSE = -std=c99 -ffreestanding -nostdinc
> @@ -91,7 +92,7 @@ include/bits/alltypes.h: include/bits/alltypes.h.sh
>  lib/libc.so: $(LOBJS)
>         $(CC) $(CFLAGS_ALL_SHARED) $(LDFLAGS) -nostdlib -shared \
>         -Wl,-e,_start -Wl,-Bsymbolic-functions \
> -       -Wl,-soname=libc.so -o $@ $(LOBJS) -lgcc
> +       -Wl,-soname=libc.so -o $@ $(LOBJS) $(LIBCC)

Looks clean. I'll probably apply this soon unless any improvements are
suggested.

Rich


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

* Re: customizable -lgcc in makefile
  2012-07-17 16:37 customizable -lgcc in makefile Szabolcs Nagy
  2012-07-17 17:45 ` Rich Felker
@ 2012-07-17 21:44 ` Richard Pennington
  1 sibling, 0 replies; 3+ messages in thread
From: Richard Pennington @ 2012-07-17 21:44 UTC (permalink / raw)
  To: musl; +Cc: Szabolcs Nagy

On Tuesday, July 17, 2012 06:37:28 PM Szabolcs Nagy wrote:
> i wonder what clang needs there and if there is
> any libgcc specific code in musl

I use compiler-rt with musl and haven't run across any issues.

-Rich2



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

end of thread, other threads:[~2012-07-17 21:44 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-07-17 16:37 customizable -lgcc in makefile Szabolcs Nagy
2012-07-17 17:45 ` Rich Felker
2012-07-17 21:44 ` Richard Pennington

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