mailing list of musl libc
 help / color / mirror / code / Atom feed
From: Rich Felker <dalias@aerifal.cx>
To: musl@lists.openwall.com
Subject: New gcc wrapper to try
Date: Sat, 21 Apr 2012 02:49:33 -0400	[thread overview]
Message-ID: <20120421064933.GF14673@brightrain.aerifal.cx> (raw)

[-- 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


             reply	other threads:[~2012-04-21  6:49 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-04-21  6:49 Rich Felker [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20120421064933.GF14673@brightrain.aerifal.cx \
    --to=dalias@aerifal.cx \
    --cc=musl@lists.openwall.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).