Yes, the makefile works fine. But not as advertised. Instead, it builds for the host, not the target.

I'm asking about how to build for my /target/.

The eldk toolchain isn't capable of working from CROSS_COMPILE alone. It requires setting a number of other variables as well. The current build system doesn't appear to be capable of supporting this for tools/env.

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?

--rich

On 5/15/15 23:04 , Stefano Babic wrote:
Hi Richard,

On 16/05/2015 00:30, K Richard Pixley wrote:
I've just upgraded to a more recent version of u-boot for one of my
targets.  And now I'm thoroughly stumped on how to build fw_printenv.

The README says to use CROSS_COMPILE, but that doesn't include all the
other environment variables from sourcing my eldk environment file.
This because it has nothing to do with ELDK. You can build u-boot even
with other toolchains. How you set ELDK, it is not part of U-Boot.
U-Boot needs only to have set the CROSS_COMPILE variable. Of course,
toolchain must already works.

  It
also doesn't work.  Attempting to build hides /everything/ so I can't
even tell what compiler is being used.  It /says/ HOSTCC, which is
wrong, and it should know better.  And neither setting HOSTCC nor CC on
the command line produces anything useful, (of course, it's hidden, so I
can't tell if it's really taking effect anyway).
Why do you do that ? README does not tell to do this.

Shouldn't this thing just be a simple "$(CC) -o fw_printenv *.c"?
Why do you think so ? When a Makefile and/or a build system is provide,
we expect to have a "make <target>", instead of calling the compiler
from command line.

  I
tried that, and tried adding -I options to find the headers, but
apparently some of the u-boot headers are intended to replace standard
system library headers.  I suppose that might make sense for standalone
u-boot, but not for fw_printenv that runs inside a running linux.
You have of course to configure your target:

make <your_target_defconfig>

Example:

make P2020RDB-PC_36BIT_defconfig

Then simply:

$ make env
   HOSTCC  tools/env/fw_env.o
   HOSTCC  tools/env/fw_env_main.o
   HOSTCC  tools/env/crc32.o
   HOSTCC  tools/env/ctype.o
   HOSTCC  tools/env/linux_string.o
   HOSTCC  tools/env/env_attr.o
   HOSTCC  tools/env/env_flags.o
   HOSTCC  tools/env/aes.o
   HOSTLD  tools/env/fw_printenv
   STRIP   tools/env/fw_printenv


This is the most opaque Makefile I've seen in years, btw.  Kudos.
Well, maybe you have to take a look at how Kbuild works.

*sigh*

How do I build fw_printenv for my target, (ie, in a cross
configuration), using my eldk toolchain?  What's the secret?

I checked top-of-tree in git and it looks like the same arrangement in
the code I was handed by a vendor that's marked 2014.07.  So whatever
the secret is, I'm guessing that it's the same secret as is used for
top-of-tree.
No secret, call make.

Best regards,
Stefano Babic

_______________________________________________
eldk mailing list
[email protected]
http://lists.denx.de/mailman/listinfo/eldk

Reply via email to