mailing list of musl libc
 help / color / mirror / code / Atom feed
* [rfc] gnuconfig and musl
@ 2012-06-13  5:48 Luca Barbato
  2012-06-13  9:02 ` John Spencer
  0 siblings, 1 reply; 4+ messages in thread
From: Luca Barbato @ 2012-06-13  5:48 UTC (permalink / raw)
  To: musl

gnuconfig[1] is a set of updated config.sub and config.guess file for
autotools.

That had been the first change I needed to get gcc to bootstrap in
cross-compile mode from musl.

--- /usr/share/gnuconfig/config.sub.old	2012-06-13 07:26:51.633062078 +0200
+++ /usr/share/gnuconfig/config.sub	2012-06-13 07:26:38.652062564 +0200
@@ -124,7 +124,7 @@
 case $maybe_os in
   nto-qnx* | linux-gnu* | linux-android* | linux-dietlibc |
linux-newlib* | \
   linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | \
-  knetbsd*-gnu* | netbsd*-gnu* | \
+  knetbsd*-gnu* | netbsd*-gnu* | linux-musl* |\
   kopensolaris*-gnu* | \
   storm-chaos* | os2-emx* | rtmk-nova*)
     os=-$maybe_os
@@ -1372,7 +1372,7 @@
 	      | -chorusos* | -chorusrdb* | -cegcc* \
 	      | -cygwin* | -msys* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
 	      | -mingw32* | -linux-gnu* | -linux-android* \
-	      | -linux-newlib* | -linux-uclibc* \
+	      | -linux-newlib* | -linux-uclibc* | -linux-musl* \
 	      | -uxpv* | -beos* | -mpeix* | -udk* \
 	      | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \
 	      | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \


That bit is enough to get a bare-metal-libc bootstrap of gcc. (so it
expect $sysroot/include and $sysroot/lib instead of $sysroot/usr/lib)

In addition in order to workaround musl incomplete support for
-D_XOPEN_STUFF

The following line should be added to config.site (that also fixes all
the other autotools based programs)

cat /usr/share/config.site

[[ ${CTARGET/-musl/} != $CTARGET ]] && CFLAGS+=" -D_GNU_SOURCE"
[[ ${CHOST/-musl/} != $CHOST ]] && CFLAGS+=" -D_GNU_SOURCE"

I hope it helps.

lu

-- 

Luca Barbato
Gentoo/linux
http://dev.gentoo.org/~lu_zero



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

* Re: [rfc] gnuconfig and musl
  2012-06-13  5:48 [rfc] gnuconfig and musl Luca Barbato
@ 2012-06-13  9:02 ` John Spencer
  2012-06-13  9:05   ` Luca Barbato
  0 siblings, 1 reply; 4+ messages in thread
From: John Spencer @ 2012-06-13  9:02 UTC (permalink / raw)
  To: musl; +Cc: Luca Barbato

On 06/13/2012 07:48 AM, Luca Barbato wrote:
> gnuconfig[1] is a set of updated config.sub and config.guess file for
> autotools.
[1] missing reference...

> That had been the first change I needed to get gcc to bootstrap in
> cross-compile mode from musl.
ah so that is essentially the same as Gregor Richard's patches:
https://github.com/pikhq/bootstrap-linux/blob/master/patches/binutils-2.22-musl.diff
https://github.com/pikhq/bootstrap-linux/blob/master/patches/gcc-4.6.3-musl.diff

except that gnuconfig (or at least the extract you posted) misses the 
dynlinker support bits.



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

* Re: [rfc] gnuconfig and musl
  2012-06-13  9:02 ` John Spencer
@ 2012-06-13  9:05   ` Luca Barbato
  2012-06-13  9:26     ` John Spencer
  0 siblings, 1 reply; 4+ messages in thread
From: Luca Barbato @ 2012-06-13  9:05 UTC (permalink / raw)
  To: John Spencer; +Cc: musl

On 06/13/2012 11:02 AM, John Spencer wrote:
> On 06/13/2012 07:48 AM, Luca Barbato wrote:
>> gnuconfig[1] is a set of updated config.sub and config.guess file for
>> autotools.
> [1] missing reference...

Sorry: http://savannah.gnu.org/projects/config
> 
>> That had been the first change I needed to get gcc to bootstrap in
>> cross-compile mode from musl.
> ah so that is essentially the same as Gregor Richard's patches:
> https://github.com/pikhq/bootstrap-linux/blob/master/patches/binutils-2.22-musl.diff

That is essentially it, but instead of being patched, it gets
overridden. (same thing for config.site)

> https://github.com/pikhq/bootstrap-linux/blob/master/patches/gcc-4.6.3-musl.diff

Those changes are quite interesting, who is trying to upstream them? Am
I missing a link in the website about those?


lu

-- 

Luca Barbato
Gentoo/linux
http://dev.gentoo.org/~lu_zero



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

* Re: [rfc] gnuconfig and musl
  2012-06-13  9:05   ` Luca Barbato
@ 2012-06-13  9:26     ` John Spencer
  0 siblings, 0 replies; 4+ messages in thread
From: John Spencer @ 2012-06-13  9:26 UTC (permalink / raw)
  To: musl; +Cc: Luca Barbato

On 06/13/2012 11:05 AM, Luca Barbato wrote:
>> https://github.com/pikhq/bootstrap-linux/blob/master/patches/gcc-4.6.3-musl.diff
> Those changes are quite interesting, who is trying to upstream them? Am
> I missing a link in the website about those?

afaik nobody tried to upstream them yet. it's quite hard to get gcc patched.
there's no link on the website, but apparently you missed the hints i 
gave you in IRC a week ago.

we were discussing to set up a wiki or an official patch-collection repo 
for this sort of things, but so far this has not been tackled.

however there are a couple of build-it-yourself distros on github, and 
those are currently your best source for patches.



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

end of thread, other threads:[~2012-06-13  9:26 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-06-13  5:48 [rfc] gnuconfig and musl Luca Barbato
2012-06-13  9:02 ` John Spencer
2012-06-13  9:05   ` Luca Barbato
2012-06-13  9:26     ` John Spencer

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