crust build fails when cc link is missing (e.g. minimal Ubuntu 20.04)
use host-gcc from the toolchain instead.
addition of the patch fixes the following error.
BUILD crust (target)
TOOLCHAIN manual
...
HOSTCC build/3rdparty/kconfig/conf.o
/bin/sh: 1: exec: cc: not found
make[1]: *** [Makefile:170: build/3rdparty/kconfig/conf.o] Error 127
...
Without defining HOSTCC Makefile.host was defaulting to the operating
system cc. In the minimal docker image (focal) - cc is not available.
BUILD u-boot (target)
TOOLCHAIN make (auto-detect)
make[1]: Entering directory
HOSTCC scripts/basic/fixdep
/bin/sh: 1: cc: not found
make[2]: *** [scripts/Makefile.host:95: scripts/basic/fixdep] Error 127
make[1]: *** [Makefile:488: scripts_basic] Error 2
make[1]: Leaving directory
FAILURE: scripts/build u-boot:target during make_target (package.mk)
*********** FAILED COMMAND ***********
DEBUG=${PKG_DEBUG} CROSS_COMPILE="${TARGET_KERNEL_PREFIX}" LDFLAGS="" ARCH=arm make $(${ROOT}/${SCRIPTS}/uboot_helper ${PROJECT} ${DEVICE} ${UBOOT_SYSTEM} config)
*********** FAILED COMMAND ***********
Without defining HOSTCC Makefile.host was defaulting to the operating
system cc. In the minimal docker image (focal) - cc is not available.
PROJECT=Amlogic ARCH=aarch64 DEVICE=AMLGX UBOOT_SYSTEM=odroid-n2 scripts/build u-boot-tools:host
BUILD u-boot-tools (host)
TOOLCHAIN make (auto-detect)
PKG_NAME="u-boot-tools"
HOSTCC scripts/basic/fixdep
/bin/sh: 1: cc: not found
make[1]: *** [scripts/Makefile.host:95: scripts/basic/fixdep] Error 127
make: *** [Makefile:488: scripts_basic] Error 2
FAILURE: s/build u-boot-tools:host during make_host (package.mk)
*********** FAILED COMMAND ***********
make qemu-x86_64_defconfig
**************************************
u-boot requires openssl includes and libs on host, add the missing
dependencies and set HOSTCFLAGS so the build can pick up openssl from
the LE toolchain.
Also fix HOSTLDFLAGS to use HOST_LDFLAGS which adds an rpath to
toolchain/lib so the dynamic linker uses our openssl libs, not those
from the host.
Signed-off-by: Matthias Reichl <hias@horus.com>
u-boot requires openssl includes and libs on host, add the missing
dependencies and set HOSTCC, HOSTCFLAGS and HOSTLDFLAGS so the build
can pick up openssl from the LE toolchain
Signed-off-by: Matthias Reichl <hias@horus.com>
Issue was that pkg-config picks wrong include folders. That is because
in u-boot case, pkg-config is configured to pick up target (ARM)
includes and libraries, because it's called from make_target(). Simple
solution to avoid patching sources and adding CONFIG_TOOLS_LIBCRYPTO
line to each and every config file is to add setup_pkg_config_host at
the beginning of make_target(). Include the dependency to
openssl:host.