* bringing back 'make symlinks'?
@ 2004-05-25 15:45 Dan Kegel
2004-05-25 21:43 ` Sam Ravnborg
0 siblings, 1 reply; 6+ messages in thread
From: Dan Kegel @ 2004-05-25 15:45 UTC (permalink / raw)
To: linux-kernel
In the 2.4 kernel, 'make symlinks' created the symlinks needed
to use the kernel tree's headers for building a gcc/glibc toolchain.
In the 2.6 kernel, you can do the same thing with 'include include/asm'.
Unless you're trying to build arm or cris, or maybe others, in which case you also need
'include/asm-$(ARCH)/.arch'.
That's fine, but it means that a script (like crosstool) or a book (like LFS)
that's trying to build a gcc/glibc toolchain for both 2.4 and 2.6 ends up
with a section like
case "$KERNEL_VERSION.$KERNEL_PATCHLEVEL.x" in
2.2.x|2.4.x) make ARCH=$ARCH symlinks include/linux/version.h
;;
2.6.x) make ARCH=$ARCH include/asm include/linux/version.h
case $ARCH in
arm*|cris*) make ARCH=$ARCH include/asm-$ARCH/.arch
;;
esac
;;
*) abort "Unsupported kernel version $KERNEL_VERSION.$KERNEL_PATCHLEVEL"
esac
which is a bit ugly. It'd be nice if 'make symlinks' did the neccesary
stuff in 2.6, too. Think a patch to do that would be accepted?
- Dan
--
My technical stuff: http://kegel.com
My politics: see http://www.misleader.org for examples of why I'm for regime change
^ permalink raw reply [flat|nested] 6+ messages in thread* Re: bringing back 'make symlinks'? 2004-05-25 15:45 bringing back 'make symlinks'? Dan Kegel @ 2004-05-25 21:43 ` Sam Ravnborg 2004-05-26 3:47 ` Dan Kegel 0 siblings, 1 reply; 6+ messages in thread From: Sam Ravnborg @ 2004-05-25 21:43 UTC (permalink / raw) To: Dan Kegel; +Cc: linux-kernel On Tue, May 25, 2004 at 08:45:18AM -0700, Dan Kegel wrote: > In the 2.4 kernel, 'make symlinks' created the symlinks needed > to use the kernel tree's headers for building a gcc/glibc toolchain. > > In the 2.6 kernel, you can do the same thing with 'include include/asm'. > Unless you're trying to build arm or cris, or maybe others, in which case > you also need > 'include/asm-$(ARCH)/.arch'. > > That's fine, but it means that a script (like crosstool) or a book (like > LFS) > that's trying to build a gcc/glibc toolchain for both 2.4 and 2.6 ends up > with a section like > > case "$KERNEL_VERSION.$KERNEL_PATCHLEVEL.x" in > 2.2.x|2.4.x) make ARCH=$ARCH symlinks include/linux/version.h > ;; > 2.6.x) make ARCH=$ARCH include/asm include/linux/version.h > case $ARCH in > arm*|cris*) make ARCH=$ARCH include/asm-$ARCH/.arch > ;; > esac > ;; > *) abort "Unsupported kernel version > $KERNEL_VERSION.$KERNEL_PATCHLEVEL" > esac In current 2.6 there exitst a target named: modules_prepare It does a bit more than what symlinks did in 2.4 - actually prepare for building external modules. Sam ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: bringing back 'make symlinks'? 2004-05-25 21:43 ` Sam Ravnborg @ 2004-05-26 3:47 ` Dan Kegel 2004-05-30 10:55 ` Sam Ravnborg 0 siblings, 1 reply; 6+ messages in thread From: Dan Kegel @ 2004-05-26 3:47 UTC (permalink / raw) To: Sam Ravnborg; +Cc: linux-kernel Sam Ravnborg wrote: > On Tue, May 25, 2004 at 08:45:18AM -0700, Dan Kegel wrote: > >>In the 2.4 kernel, 'make symlinks' created the symlinks needed >>to use the kernel tree's headers for building a gcc/glibc toolchain. >> >>In the 2.6 kernel, you can do the same thing with 'include include/asm'. >>Unless you're trying to build arm or cris, or maybe others, in which case >>you also need 'include/asm-$(ARCH)/.arch'. > ... > > In current 2.6 there exitst a target named: modules_prepare > It does a bit more than what symlinks did in 2.4 - actually prepare for > building external modules. Right, and that's a problem, because the 'bit more' it does requires a target compiler -- which isn't available while bootstrapping the target compiler! The way things are now, I can build toolchains for everything except the sh architecture (though my toolchain bootstrap script is ugly as noted due to the lack of 'make symlinks'). I'm not sure if the sh architecture makefile even has targets to make all the needed symlinks in the absense of a working target compiler; I'll look at that and maybe submit a minimal patch when I get a chance. - Dan -- My technical stuff: http://kegel.com My politics: see http://www.misleader.org for examples of why I'm for regime change ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: bringing back 'make symlinks'? 2004-05-26 3:47 ` Dan Kegel @ 2004-05-30 10:55 ` Sam Ravnborg 2004-05-31 18:40 ` Dan Kegel 0 siblings, 1 reply; 6+ messages in thread From: Sam Ravnborg @ 2004-05-30 10:55 UTC (permalink / raw) To: Dan Kegel; +Cc: Sam Ravnborg, linux-kernel On Tue, May 25, 2004 at 08:47:51PM -0700, Dan Kegel wrote: > > The way things are now, I can build toolchains for everything > except the sh architecture (though my toolchain bootstrap script > is ugly as noted due to the lack of 'make symlinks'). Does the following meet the needs of your cross-tool scripts? Sam ===== Makefile 1.492 vs edited ===== --- 1.492/Makefile 2004-05-30 08:24:06 +02:00 +++ edited/Makefile 2004-05-30 12:52:36 +02:00 @@ -632,6 +632,10 @@ # All the preparing.. prepare-all: prepare0 prepare +# symlinks provided for compatibility with 2.4 - this allows boot-strapping +# tool chains to be simpler +symlinks: prepare-all + # Leave this as default for preprocessing vmlinux.lds.S, which is now # done in arch/$(ARCH)/kernel/Makefile ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: bringing back 'make symlinks'? 2004-05-30 10:55 ` Sam Ravnborg @ 2004-05-31 18:40 ` Dan Kegel 2004-05-31 20:16 ` Sam Ravnborg 0 siblings, 1 reply; 6+ messages in thread From: Dan Kegel @ 2004-05-31 18:40 UTC (permalink / raw) To: Sam Ravnborg; +Cc: linux-kernel Sam Ravnborg wrote: >>The way things are now, I can build toolchains for everything >>except the sh architecture (though my toolchain bootstrap script >>is ugly as noted due to the lack of 'make symlinks'). > > Does the following meet the needs of your cross-tool scripts? > > Sam > > ===== Makefile 1.492 vs edited ===== > --- 1.492/Makefile 2004-05-30 08:24:06 +02:00 > +++ edited/Makefile 2004-05-30 12:52:36 +02:00 > @@ -632,6 +632,10 @@ > # All the preparing.. > prepare-all: prepare0 prepare > > +# symlinks provided for compatibility with 2.4 - this allows boot-strapping > +# tool chains to be simpler > +symlinks: prepare-all > + > # Leave this as default for preprocessing vmlinux.lds.S, which is now > # done in arch/$(ARCH)/kernel/Makefile Well, let's try it: $ make ARCH=sh prepare Making asm-sh/cpu -> asm-sh/ link Making asm-sh/mach -> asm-sh/ link Generating include/asm-sh/machtypes.h So far so good (excellent, in fact, since there is no other way at the moment to create those two links). $ make ARCH=ppc prepare HOSTCC scripts/conmakehash HOSTCC scripts/kallsyms CC scripts/empty.o cc1: invalid option `multiple' cc1: invalid option `string' cc1: warning: unknown register name: r2 make[1]: *** [scripts/empty.o] Error 1 Whoops, bad luck. Let's try another: $ make ARCH=arm prepare SPLIT include/linux/autoconf.h -> include/config/* HOSTCC scripts/conmakehash HOSTCC scripts/kallsyms CC scripts/empty.o cc1: invalid option `apcs' cc1: invalid option `no-sched-prolog' cc1: invalid option `little-endian' cc1: invalid option `apcs-32' cc1: invalid option `short-load-bytes' make[1]: *** [scripts/empty.o] Error 1 make: *** [scripts] Error 2 Bad luck again. Your change works for some architectures, but for those that try to build something with the target compilers, it fails because at this point in the bootstrap process, there *is* no target compiler. (That's the next step. We have to install the kernel headers to build the target compiler...) By the way, the mips architecture doesn't even make symlinks anymore, preferring instead to use -I's. This makes emulating 'make symlinks' a bit more challenging. For what it's worth, here's my current workaround. I'm up and happy on all architectures with this, I think. (Well, happy but ugly and afraid of future breakage, I guess. And maybe not so happy on mips.) case "$KERNEL_VERSION.$KERNEL_PATCHLEVEL.x" in 2.2.x|2.4.x) make ARCH=$ARCH symlinks include/linux/version.h ;; 2.6.x) case $ARCH in sh*) # sh does secret stuff in 'make prepare' that can't be triggered separately, # but happily, it doesn't use target gcc, so we can use it make ARCH=$ARCH prepare ;; arm*|cris*) make ARCH=$ARCH include/asm include/linux/version.h include/asm-$ARCH/.arch ;; mips*) # for linux-2.6, 'make prepare' for mips doesn't # actually create any symlinks. Hope generic is ok. # Note that glibc ignores all -I flags passed in CFLAGS, # so you have to use -isystem. make ARCH=$ARCH include/asm include/linux/version.h TARGET_CFLAGS="$TARGET_CFLAGS -isystem $LINUX_DIR/include/asm-mips/mach-generic" ;; *) make ARCH=$ARCH include/asm include/linux/version.h ;; esac ;; *) abort "Unsupported kernel version $KERNEL_VERSION.$KERNEL_PATCHLEVEL" esac - Dan -- My technical stuff: http://kegel.com My politics: see http://www.misleader.org for examples of why I'm for regime change ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: bringing back 'make symlinks'? 2004-05-31 18:40 ` Dan Kegel @ 2004-05-31 20:16 ` Sam Ravnborg 0 siblings, 0 replies; 6+ messages in thread From: Sam Ravnborg @ 2004-05-31 20:16 UTC (permalink / raw) To: Dan Kegel; +Cc: Sam Ravnborg, linux-kernel On Mon, May 31, 2004 at 11:40:18AM -0700, Dan Kegel wrote: > $ make ARCH=ppc prepare > HOSTCC scripts/conmakehash > HOSTCC scripts/kallsyms > CC scripts/empty.o > cc1: invalid option `multiple' > cc1: invalid option `string' > cc1: warning: unknown register name: r2 > make[1]: *** [scripts/empty.o] Error 1 > > Whoops, bad luck. Let's try another: OK - now I got the picture. For 2.6 I'm not prepared to make a change that would allow what you need. I know for 2.7 we will start to take a new approach with the kernel headers, so I hope we do do it right there. For 2.6 you have to live with the ugly workaround. Sam ^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2004-05-31 20:13 UTC | newest] Thread overview: 6+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2004-05-25 15:45 bringing back 'make symlinks'? Dan Kegel 2004-05-25 21:43 ` Sam Ravnborg 2004-05-26 3:47 ` Dan Kegel 2004-05-30 10:55 ` Sam Ravnborg 2004-05-31 18:40 ` Dan Kegel 2004-05-31 20:16 ` Sam Ravnborg
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox