From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/478 Path: news.gmane.org!not-for-mail From: Rich Felker Newsgroups: gmane.linux.lib.musl.general Subject: Re: New gcc wrapper, take 3 Date: Wed, 21 Sep 2011 17:54:24 -0400 Message-ID: <20110921215424.GJ132@brightrain.aerifal.cx> References: <20110921204104.GH132@brightrain.aerifal.cx> Reply-To: musl@lists.openwall.com NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="zaRBsRFn0XYhEU69" X-Trace: dough.gmane.org 1316642401 16838 80.91.229.12 (21 Sep 2011 22:00:01 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Wed, 21 Sep 2011 22:00:01 +0000 (UTC) To: musl@lists.openwall.com Original-X-From: musl-return-479-gllmg-musl=m.gmane.org@lists.openwall.com Wed Sep 21 23:59:57 2011 Return-path: Envelope-to: gllmg-musl@lo.gmane.org Original-Received: from mother.openwall.net ([195.42.179.200]) by lo.gmane.org with smtp (Exim 4.69) (envelope-from ) id 1R6Uph-0002el-H6 for gllmg-musl@lo.gmane.org; Wed, 21 Sep 2011 23:59:57 +0200 Original-Received: (qmail 31937 invoked by uid 550); 21 Sep 2011 21:59:57 -0000 Mailing-List: contact musl-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: Original-Received: (qmail 31927 invoked from network); 21 Sep 2011 21:59:56 -0000 Content-Disposition: inline In-Reply-To: <20110921204104.GH132@brightrain.aerifal.cx> User-Agent: Mutt/1.5.21 (2010-09-15) Xref: news.gmane.org gmane.linux.lib.musl.general:478 Archived-At: --zaRBsRFn0XYhEU69 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Wed, Sep 21, 2011 at 04:41:04PM -0400, Rich Felker wrote: > Now updated to use -specs instead of extra wrapping layers with -B in > order to inhibit the default library paths. This version should be > faster, cleaner, and perhaps even more correct than the previous > attempts. I believe some of the other options could also be integrated > into the specs file passed in, and this might make things even cleaner > still. > > Please test and let me know if there are problems. There were problems... stupid handling of removing the temp file. Try the new version. Rich --zaRBsRFn0XYhEU69 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=my-musl-gcc #!/bin/sh gcc=gcc libc_prefix="/usr/local/musl" ldso_pathname="/lib/ld-musl-i386.so.1" 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" gcc_inc=$libc_inc libgcc="$("$gcc" -print-file-name=libgcc.a)" libgcc=${libgcc%/libgcc.a} gccver=${libgcc##*/} gcctarget=${libgcc%/*} gcctarget=${gcctarget##*/} case "$gccver" in 2.*|3.*|4.[01]*) ;; *) nosp=-fno-stack-protector ;; esac [ "x$1" = "x-V" ] && { printf "%s: -V not supported\n" "$0" ; exit 1 ; } for i ; do case "$skip$i" in -I|-L) skip=--- ; continue ;; -[cSE]|-M*) nolink=1 ;; -*) ;; *) havefile=1 ;; esac skip= done [ "$havefile" ] || nolink=1 [ "$nolink" ] || { tmp_specs=$HOME/.specs.tmp.$$ printf '*link_libgcc:\n\n\n' > "$tmp_specs" || exit 1 exec 3<"$tmp_specs" rm -f "$tmp_specs" set -- -specs=/dev/fd/3 "$libc_start" "$libc_crt" "$@" "$libc_end" \ -Wl,--start-group -lc -lgcc -lgcc_eh -Wl,--end-group \ -Wl,-dynamic-linker,"$ldso_pathname" -Wl,-nostdlib } set -- -std=gnu99 -nostdinc -nostdlib $nosp \ -isystem "$libc_inc" -isystem "$gcc_inc" "$@" \ -L"$libc_lib" -L"$libgcc" exec "$gcc" "$@" --zaRBsRFn0XYhEU69--