[ELDK] compiling u-boot/tools/env
K Richard Pixley
rpixley at graphitesystems.com
Sun May 17 22:49:42 CEST 2015
Note the "HOSTCC" here is incorrect.
rpixley at victory> cd u-boot-2014.07/
rpixley at victory> .
/opt/eldk-5.6/powerpc-e500v2/environment-setup-ppce500v2-linux
rpixley at victory> echo $CROSS_COMPILE
powerpc-linux-
rpixley at victory> make env CROSS_COMPILE=powerpc-linux-
Makefile:516: *** "System not configured - see README". Stop.
rpixley at victory> less ../Makefile
rpixley at victory> make EP2020XS_config
Configuring for EP2020XS - Board: EP2020XS, Options: P2020,36BIT
rpixley at victory> make env CROSS_COMPILE=powerpc-linux-
GEN include/autoconf.mk.dep
GEN include/autoconf.mk
HOSTCC scripts/basic/fixdep <--- note that HOSTCC is wrong here.
HOSTCC tools/env/aes.o
In file included from tools/env/aes.c:1:0:
tools/env/../../lib/aes.c:28:20: fatal error: string.h: No such file or
directory
#include <string.h>
^
compilation terminated.
make[1]: *** [tools/env/aes.o] Error 1
make: *** [env] Error 2
rpixley at victory> cd ..
rpixley at victory> rm -rf u-boot-2014.07/
rpixley at victory> tar xfj ep2020xs_u-boot-2014.07_20150513.tar.bz2
rpixley at victory> cd u-boot-2014.07/
rpixley at victory> make EP2020XS_config
Configuring for EP2020XS - Board: EP2020XS, Options: P2020,36BIT
rpixley at victory> make env CROSS_COMPILE=powerpc-linux- CC=gcc STRIP=strip
gcc: error: unrecognized command line option â
gcc: error: unrecognized command line option â
gcc: error: unrecognized command line option â
GEN include/autoconf.mk.dep
gcc: error: unrecognized command line option â
gcc: error: unrecognized command line option â
gcc: error: unrecognized command line option â
GEN include/autoconf.mk
gcc: error: unrecognized command line option â
gcc: error: unrecognized command line option â
gcc: error: unrecognized command line option â
HOSTCC scripts/basic/fixdep
HOSTCC tools/env/aes.o
HOSTCC tools/env/crc32.o
HOSTCC tools/env/ctype.o
HOSTCC tools/env/env_attr.o
HOSTCC tools/env/env_flags.o
HOSTCC tools/env/fw_env.o
HOSTCC tools/env/fw_env_main.o
HOSTCC tools/env/linux_string.o
HOSTLD tools/env/fw_printenv_unstripped
STRIP tools/env/fw_printenv
rpixley at victory> file tools/env/fw_printenv
tools/env/fw_printenv: ELF 64-bit LSB executable, x86-64, version 1
(SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.32,
BuildID[sha1]=5c46d295030eb98c3aaf92c665982e8142f8b03c, stripped
rpixley at victory> uname -a
Linux victory 3.10.0-229.4.2.el7.x86_64 #1 SMP Fri Apr 24 15:26:38 EDT
2015 x86_64 x86_64 x86_64 GNU/Linux
Here are some other attempts without the eldk environment.
rpixley at victory> cd ..
rpixley at victory> rm -rf u-boot-2014.07/
rpixley at victory> tar xfj ep2020xs_u-boot-2014.07_20150513.tar.bz2
rpixley at victory> cd u-boot-2014.07/
rpixley at victory> make EP2020XS_config
Configuring for EP2020XS - Board: EP2020XS, Options: P2020,36BIT
rpixley at victory> time make env HOSTCC=gcc STRIP=strip
make: ppc_8xx-gcc: Command not found
/bin/sh: ppc_8xx-gcc: command not found
dirname: missing operand
Try 'dirname --help' for more information.
GEN include/autoconf.mk.dep
/bin/sh: ppc_8xx-gcc: command not found
GEN include/autoconf.mk
/bin/sh: ppc_8xx-gcc: command not found
HOSTCC scripts/basic/fixdep
HOSTCC tools/env/aes.o
HOSTCC tools/env/crc32.o
HOSTCC tools/env/ctype.o
HOSTCC tools/env/env_attr.o
HOSTCC tools/env/env_flags.o
HOSTCC tools/env/fw_env.o
HOSTCC tools/env/fw_env_main.o
HOSTCC tools/env/linux_string.o
HOSTLD tools/env/fw_printenv_unstripped
STRIP tools/env/fw_printenv
real 0m0.571s
user 0m0.454s
sys 0m0.123s
rpixley at victory> file tools/env/fw_printenv
tools/env/fw_printenv: ELF 64-bit LSB executable, x86-64, version 1
(SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.32,
BuildID[sha1]=0x95d2465c8cb90e03c692af3a812e98653cb0f842, stripped
So I can get host binaries produced by setting either CC or HOSTCC. But
no combination that I've yet found will produce target binaries.
--rich
On 5/17/15 12:45 , Stefano Babic wrote:
> Hi Richard,
>
> On 17/05/2015 19:26, K Richard Pixley wrote:
>> Yes, the makefile works fine. But not as advertised. Instead, it
>> builds for the host, not the target.
>>
> No, it is not.
>
>> I'm asking about how to build for my /target/.
>>
> This is what I showed you:
>
> file tools/env/fw_printenv
> tools/env/fw_printenv: ELF 32-bit MSB executable, PowerPC or cisco
> 4500, version 1 (SYSV), dynamically linked (uses shared libs), for
> GNU/Linux 2.6.16,
> BuildID[sha1]=594378892413a38849d6ae219b8ca8527e0c50be, stripped
>
> I build for powerpc, fw_printenv is for powerpc (target).
>
>> The eldk toolchain isn't capable of working from CROSS_COMPILE alone.
>> It requires setting a number of other variables as well.
> No, this is not correct. Please try as I show you and check the result.
> It is for target.
>
>> The current
>> build system doesn't appear to be capable of supporting this for tools/env.
>>
> Sorry, it is.
>
>> If I'm understanding you, what you're saying here is that
>> tools/env/README is in error and that the directory has now lost the
>> ability to cross compile and can now /only/ build native. Is that correct?
> No, it is not.
>
> Best regards,
> Stefano Babic
>
More information about the eldk
mailing list