mailing list of musl libc
 help / color / mirror / code / Atom feed
From: Isaac Dunham <idunham@lavabit.com>
To: musl@lists.openwall.com
Subject: Re: New gcc wrapper to try
Date: Tue, 24 Apr 2012 12:28:28 -0700	[thread overview]
Message-ID: <20120424122828.50cdc737@newbook> (raw)
In-Reply-To: <20120423091905.GM14673@brightrain.aerifal.cx>

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

On Mon, 23 Apr 2012 05:19:05 -0400
Rich Felker <dalias@aerifal.cx> wrote:

> On Sun, Apr 22, 2012 at 10:57:04PM -0700, Isaac Dunham wrote:
> > On Sat, 21 Apr 2012 16:37:51 -0400
> > Rich Felker <dalias@aerifal.cx> wrote:
> > 
> > > Here's an updated version which fixes some issues with the
> > > previous (wrong crtbegin/end files when -shared is used, etc.)
> > > 
> > Doesn't fix building wireless-tools (I've changed the target
> > directory to fit my install; no other changes)
> > In fact, where the old musl-gcc can link the object-file statically,
> > this one cannot link it at all, under any circumstances.
> > (This version is saved as muslcc, if you want to examine the
> > logs...) Using make iwmulticall
> 
> Somebody has enabled stack protector. Either your distro (what distro
> are you using) has hacked gcc in a way different from what musl-gcc
> expects, or wireless-tools' makefile is adding -fstack-protector...

There's no -fstack-protector, so it's Ubuntu's fault.
Now (as hacked) builds iwmulticall.
Attached is my version, with manual disable for stack protector (and
also -V support, in case I want to use both gcc-4.1 and 4.4 )

Isaac Dunham

[-- Attachment #2: muslcc --]
[-- Type: application/octet-stream, Size: 1011 bytes --]

#!/bin/sh

libc_prefix="/opt/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"

if [ "-V" == "$1" ]
	then
		gcc="$gcc $1 $2"
		shift 2
	fi

tmp_specs=$HOME/.specs.tmp.$$
printf '
%%rename cpp_options old_cpp_options

*cpp_options:
-nostdinc -isystem %s %%(old_cpp_options)

*cc1:
%%(cc1_cpu) -nostdinc -isystem %s 

*link_libgcc:
-L%s

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

*startfile:
%%{!shared: %s} %s %%{shared|pie:crtbeginS.o%%s;:crtbegin.o%%s}

*endfile:
%%{shared|pie:crtendS.o%%s;:crtend.o%%s} %s

%%rename link old_link

*link:
%%(old_link) -dynamic-linker %s -nostdlib

*esp_link:


*esp_options:


*esp_cpp_options:


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

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

exec "$gcc" -specs=/proc/self/fd/3 -fno-stack-protector "$@"


  reply	other threads:[~2012-04-24 19:28 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-04-21  6:49 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 [this message]
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=20120424122828.50cdc737@newbook \
    --to=idunham@lavabit.com \
    --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).