[PATCH] Cross compile?

Lombard, David N dnlombar at ichips.intel.com
Wed May 28 12:47:15 EDT 2008


On Tue, May 27, 2008 at 05:58:11PM -0700, Jamey Sharp wrote:
> On Tue, May 27, 2008 at 7:40 AM, Lombard, David N
> <dnlombar at ichips.intel.com> wrote:
> > ./configure --build=`uname -m`-linux-uclibc \
> >          --host=`uname -m` --prefix=/home/dnl/kboot-11/root \
> >          CC=uclibc-gcc BUILD_CC=host-gcc
> 
> Isn't this backwards? BUILD_CC ought to match --build, and CC ought to
> match --host. If you wanted a kexec binary to put in a uClibc initramfs,
> you should set --host for that, not --build. Right?

Here's util/Makefile, which wants bin/bin-to-hex to run on the build
platform:

  BIN_TO_HEX:= bin/bin-to-hex

  $(BIN_TO_HEX): $(srcdir)/util/bin-to-hex.c
        @$(MKDIR) -p $(@D)
        $(LINK.o) -o $@ $^

  $(BIN_TO_HEX): CC=$(BUILD_CC)
  $(BIN_TO_HEX): CFLAGS=$(BUILD_CFLAGS)

  dist += util/Makefile util/bin-to-hex.c
  clean += util/bin-to-hex.o $(BIN_TO_HEX)

Unless I am mistaken, this uses BUILD_CC and BIULD_CFLAGS for
bin/bin-to-hex, which is run on the build platform. I patched that to:

  BIN_TO_HEX:= bin/bin-to-hex

  $(BIN_TO_HEX): $(srcdir)/util/bin-to-hex.c
        @$(MKDIR) -p $(@D)
        $(BUILD_CC) $(BUILD_CFLAGS) -o $@ $<

  dist += util/Makefile util/bin-to-hex.c
  clean += util/bin-to-hex.o $(BIN_TO_HEX)

otherwise it used the uClibc-based tools, which cannot run on the current
glibc-based platform (F7).

-- 
David N. Lombard, Intel, Irvine, CA
I do not speak for Intel Corporation; all comments are strictly my own.



More information about the kexec mailing list