mailing list of musl libc
 help / color / mirror / code / Atom feed
* New gcc wrapper to try
@ 2012-04-21  6:49 Rich Felker
  2012-04-21 20:37 ` Rich Felker
  2012-04-21 22:45 ` Isaac Dunham
  0 siblings, 2 replies; 13+ messages in thread
From: Rich Felker @ 2012-04-21  6:49 UTC (permalink / raw)
  To: musl

[-- Attachment #1: Type: text/plain, Size: 466 bytes --]

Hi,
Here's the latest draft of a new concept for the musl-gcc gcc wrapper.
It's almost entirely gcc specfile-based. If it works well, I intend to
move even more of what it does into the specfile, and instead of
generating the specfile at runtime each time it's run, just have it
generated at build time and installed with musl.

Please let me know how it works. (You'll need to edit the first couple
lines to set the paths/arch if you don't use the defaults.)

Rich

[-- Attachment #2: musl-gcc.new --]
[-- Type: text/plain, Size: 728 bytes --]

#!/bin/sh

libc_prefix="/usr/local/musl"
ldso_pathname="/lib/ld-musl-i386.so.1"
gcc=gcc
libc_lib=$libc_prefix/lib
libc_inc=$libc_prefix/include
libc_crt="$libc_lib/crt1.o"
libc_start="$libc_lib/crti.o"
libc_end="$libc_lib/crtn.o"

tmp_specs=$HOME/.specs.tmp.$$
printf '
*link_libgcc:
-L%s

*libgcc:
libgcc.a%%s %%:if-exists(libgcc_eh.a%%s)

*cc1:
%%(cc1_cpu)

*startfile:
%%{!shared: %s} %s crtbegin.o%%s

*endfile:
crtend.o%%s %s

*esp_link:


*esp_options:


*esp_cpp_options:


' \
 "$libc_lib" "$libc_crt" "$libc_start" "$libc_end" > "$tmp_specs" || exit 1

exec 3<"$tmp_specs"
rm -f "$tmp_specs"

exec "$gcc" -specs=/proc/self/fd/3 -nostdinc -isystem "$libc_inc" \
 "$@" -Wl,-dynamic-linker,"$ldso_pathname" -Wl,-nostdlib


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

end of thread, other threads:[~2012-04-25  1:21 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-04-21  6:49 New gcc wrapper to try Rich Felker
2012-04-21 20:37 ` Rich Felker
2012-04-23  5:57   ` Isaac Dunham
2012-04-23  9:19     ` Rich Felker
2012-04-24 19:28       ` Isaac Dunham
2012-04-24 19:45         ` Isaac Dunham
2012-04-24 21:28         ` Solar Designer
2012-04-24 21:41           ` Rich Felker
2012-04-24 22:10             ` Rich Felker
2012-04-24 22:14               ` Solar Designer
2012-04-24 23:53                 ` Szabolcs Nagy
2012-04-25  1:21                   ` Solar Designer
2012-04-21 22:45 ` Isaac Dunham

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