[ELDK] Need help compiling u-boot for Lite5200
Detlev Zundel
dzu at denx.de
Fri Oct 21 11:52:56 CEST 2011
Hi Alexej,
> I just deleted the ELDK folder and installed the 5.0 version as
> described on this manual page:
> http://www.denx.de/wiki/view/ELDK-5/WebHome#Installation
> I ran the shell script with default parameters and it was successfull.
> (I don't have to build it, do I?)
No, you don't have to build it. This would add a rather long coffee
pause to your workflow ;)
> As the next step I wanted to export PATH and CROSS_COMPILE like it's
> decribed on this page:
> http://www.denx.de/wiki/view/DULG/ELDKUsage
Sorry, but this page does not apply to ELDK 5 anymore. Usage of the new
ELDK is not yet up to what it should be, so please bear with me. Inside
the installed ELDK you will find a script that sets up the environment
as needed. If your installation lives below /opt/eldk-5.0, this will be
/opt/eldk-5.0/powerpc/environment-setup-powerpc-linux
To only build u-boot, we reall y only need the PATH setting, so for the
example here I copy that manually:
[dzu at pollux ~]$ export PATH=/opt/eldk-5.0/powerpc/sysroots/i686-oesdk-linux/usr/bin:/opt/eldk-5.0/powerpc/sysroots/i686-oesdk-linux/usr/bin/powerpc-linux:$PATH
Now CROSS_COMPILE needs to sync up with the names of the cross
toolchain, in our case that is what TARGET_PREFIX is set to in this
script. Again I will do this manually:
[dzu at pollux ~]$ export CROSS_COMPILE=powerpc-linux-
That's as much as we need to compile U-Boot, so let's do that:
[dzu at pollux ~]$ wget ftp://ftp.denx.de/pub/u-boot/u-boot-2011.09.tar.bz2
[...]
[dzu at pollux dzu]$ tar jxf u-boot-2011.09.tar.bz2
[dzu at pollux dzu]$ cd u-boot-2011.09
[dzu at pollux u-boot-2011.09]$ make Lite5200_LOWBOOT
awk '(NF && $1 !~ /^#/) { print $1 ": " $1 "_config; $(MAKE)" }' boards.cfg > .boards.depend
Configuring for Lite5200_LOWBOOT - Board: IceCube, Options: SYS_TEXT_BASE=0xFF000000
make
make[1]: Entering directory `/tmp/dzu/u-boot-2011.09'
Generating include/autoconf.mk
cc1: error: Do not use -Os option if --enable-target-optspace is not set.
Generating include/autoconf.mk.dep
cc1: error: Do not use -Os option if --enable-target-optspace is not set.
make[1]: Leaving directory `/tmp/dzu/u-boot-2011.09'
make[1]: Entering directory `/tmp/dzu/u-boot-2011.09'
powerpc-gcc -DDO_DEPS_ONLY \
-g -Os -fpic -mrelocatable -ffunction-sections -fdata-sections -meabi -D__KERNEL__ -I/tmp/dzu/u-boot-2011.09/include -fno-builtin -ffreestanding -nostdinc -isystem /opt/eldk-5.0/powerpc/sysroots/i686-oesdk-linux/usr/lib/powerpc-linux/gcc/powerpc-linux/4.5.1/include -pipe -DCONFIG_PPC -D__powerpc__ -DCONFIG_MPC5xxx -ffixed-r2 -mstring -mcpu=603e -mmultiple -Wall -Wstrict-prototypes \
-o lib/asm-offsets.s lib/asm-offsets.c -c -S
cc1: error: Do not use -Os option if --enable-target-optspace is not set.
make[1]: *** [lib/asm-offsets.s] Error 1
make[1]: Leaving directory `/tmp/dzu/u-boot-2011.09'
make: *** [Lite5200_LOWBOOT] Error 2
[dzu at pollux u-boot-2011.09]$
Ah, too bad. I forgot to say that we underwent much pain as recent
toolchains dropped support for the "-Os" for the Power architecture. A
fix for this is only in mainline for a short while and will be included
in our 5.1 release due in the next weeks.
So for the current ELDK, we need to remove this option:
dzu at pollux u-boot-2011.09]$ perl -pi.bak -e 's/^OPTFLAGS=.*$/OPTFLAGS=-O2/' config.mk
[Note that we need -O2, compiling without optimization will fail. This
is something we inherit from the Linux kernel]
[dzu at pollux u-boot-2011.09]$ make Lite5200_LOWBOOT
Configuring for Lite5200_LOWBOOT - Board: IceCube, Options: SYS_TEXT_BASE=0xFF000000
make
make[1]: Entering directory `/tmp/dzu/u-boot-2011.09'
Generating include/autoconf.mk
[...]
powerpc-objcopy -O srec u-boot u-boot.srec
powerpc-objcopy --gap-fill=0xff -O binary u-boot u-boot.bin
make[1]: Leaving directory `/tmp/dzu/u-boot-2011.09'
[dzu at pollux u-boot-2011.09]$
> What I did:
>
> $ export CROSS_COMPILE=ppc_6xx-
> $ PATH=$PATH:/opt/eldk-5.0/usr/bin:/opt/eldk/bin
> $ export PATH
>
> (actually there are no such directories in the 5.0 version of ELDK, is
> this command still valid?)
No, this is not valid any more. ELDK 5.0 is not a further development
of ELDK 4.2 but a "completely different beast under the hoods".
Cheers
Detlev
--
I've been examining the existing [linux] kernel configuration system, and I
have about concluded that the best favor we could do everybody involved with
it is to take it out behind the barn and shoot it through the head.
-- Eric S. Raymond on linux-kbuild Mar 2000
--
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-40 Fax: (+49)-8142-66989-80 Email: dzu at denx.de
More information about the eldk
mailing list