sabotage-linux / netbsd-curses

libcurses and dependencies taken from netbsd and brought into a portable shape (at least to musl or glibc)
Other
147 stars 14 forks source link

Cross-compiling issues #36

Closed ghost closed 5 years ago

ghost commented 5 years ago

When cross-compiling netbsd-curses for aarch64 the following happens:

[...]
Generating terminfo hash
TERMINFODIR=./terminfo TOOL_AWK=awk TOOL_NBPERF=nbperf/nbperf TOOL_SED=sed TOOL_SORT=sort TOOL_TIC=tic/host_tic /bin/sh libterminfo/genhash libterminfo/term.h nbperf/nbperf > libterminfo/hash.c
libterminfo/genhash: 60: libterminfo/genhash: nbperf/nbperf: Exec format error
make[1]: *** [GNUmakefile:478: libterminfo/hash.c] Error 2
make[1]: Leaving directory '/mnt/build/tools/tools-src/curses/netbsd-curses-0.3.1'
make: *** [Makefile:8: all] Error 2

The "Exec format error" is obvious since nbperf was built for aarch64, and the host machine is x86_64.

make(1) is called with the following flags:

CC = cc
HOSTCC = /mnt/build/tools/aarch64/bin/clang
CFLAGS_HOST = -B/mnt/build/tools/aarch64/bin   # it contains ld, a symlink to ld.lld

Was something done incorrectly or incompletely?

rofl0r commented 5 years ago

see README:

  • CC - the C compiler
  • HOSTCC - the C compiler used for host programs when crosscompiling.

you got it the wrong way round