mailing list of musl libc
 help / color / mirror / code / Atom feed
From: idunham@lavabit.com
To: musl@lists.openwall.com
Subject: Re: musl-gcc question
Date: Thu, 20 Sep 2012 19:39:46 -0400 (EDT)	[thread overview]
Message-ID: <61640.132.241.44.49.1348184386.squirrel@lavabit.com> (raw)
In-Reply-To: <20120920220406.GQ254@brightrain.aerifal.cx>

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

> On Thu, Sep 20, 2012 at 05:53:45PM -0400, idunham@lavabit.com wrote:
>> Rich, what would you think of changing from a hardcoded "gcc" to using
>> something along these lines:
>>
>> [ -z "$REALGCC" ] && REALGCC=gcc
>> $REALGCC <the current parameters>
>>
>> By setting REALGCC to rawgcc, Landley's toolchain could easily be used.
>> This would also help for using other cross-toolchains.
>> (note: I'm not particular about the variable, but $GCC might be a bad
>> choice: ISTR seeing one or two Makefiles that set that.)
>
> Have you tested if this works okay? If it's known to work, send a
> clean patch and I think it should be okay to apply.

That was off the top of my head, but it works.
Patch has been tested by building musl, then building my patched netbsd m4.
(I modified musl-gcc after installation to echo REALGCC).

Usage:
REALGCC=rawgcc make CC=musl-gcc

Isaac Dunham

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: realgcc.diff --]
[-- Type: text/x-patch; name="realgcc.diff", Size: 702 bytes --]

commit 01c16bf8f4e68c838994716e77bd254b86a989bc
Author: Isaac Dunham <idunham@lavabit.com>
Date:   Thu Sep 20 16:30:00 2012 -0700

    Allow REALGCC to set the compiler for musl-gcc to use

diff --git a/Makefile b/Makefile
index 10c174c..f62635d 100644
--- a/Makefile
+++ b/Makefile
@@ -112,7 +112,7 @@ lib/musl-gcc.specs: tools/musl-gcc.specs.sh config.mak
 	sh $< "$(includedir)" "$(libdir)" "$(LDSO_PATHNAME)" > $@
 
 tools/musl-gcc: config.mak
-	printf '#!/bin/sh\nexec gcc "$$@" -specs "%s/musl-gcc.specs"\n' "$(libdir)" > $@
+	printf '#!/bin/sh\n[ -z "$$REALGCC" ] && REALGCC=gcc\nexec $$REALGCC "$$@" -specs "%s/musl-gcc.specs"\n' "$(libdir)" > $@
 	chmod +x $@
 
 $(DESTDIR)$(bindir)/%: tools/%

  reply	other threads:[~2012-09-20 23:39 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-09-20 14:50 Jens
2012-09-20 16:00 ` Szabolcs Nagy
2012-09-20 16:34   ` Jens
2012-09-20 17:52 ` Szabolcs Nagy
2012-09-20 18:14 ` Rich Felker
2012-09-20 21:53   ` idunham
2012-09-20 22:04     ` Rich Felker
2012-09-20 23:39       ` idunham [this message]
2012-09-21  4:54         ` Rich Felker
2012-09-21 10:51   ` Jens

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=61640.132.241.44.49.1348184386.squirrel@lavabit.com \
    --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).