Re: 11.0 -r301139: WITH_META_MODE=yes vs. "sh: ./make_keys: Exec format error"? [still true of -r301815]

From: Simon J. Gerraty <sjg_at_juniper.net>
Date: Sun, 12 Jun 2016 05:39:21 -0700
Mark Millard <markmi_at_dsl-only.net> wrote:
> > --- build-tools_lib/ncurses/ncursesw ---
> > Building /usr/obj/clang/arm.armv6/usr/src/lib/ncurses/ncursesw/make_keys

I must have been looking at on of our internal FreeBSD trees last
time...

In FreeBSD lib/ncurses/ncursesw/Makefile and other places I checked
just uses ${CC} for building make_keys - I don't see how that could work
for cross-building. 

If you want cross-building to work, the simple solution is to ensure
that you use HOST_CC rather than CC when building things that need to
run on the build host.

eg. in our internal tree - which cross builds fine:

make_keys: make_keys.c names.c ncurses_def.h ${HEADERS}
        ${HOST_CC} -o $_at_ ${HOST_CFLAGS} ${NCURSES_DIR}/ncurses/tinfo/make_keys.c

make_hash: make_hash.c hashsize.h ncurses_def.h ${HEADERS}
        ${HOST_CC} -o $_at_ ${HOST_CFLAGS} -DMAIN_PROGRAM \
	                ${NCURSES_DIR}/ncurses/tinfo/make_hash.c

and in share/mk/local.init.mk

HOST_CC?= /usr/bin/cc

should do.
Received on Sun Jun 12 2016 - 10:54:53 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:41:05 UTC