mirror of
https://git.yoctoproject.org/poky
synced 2026-01-29 21:08:42 +01:00
This helps in switching toolchains cleanly for kernel build between gcc and clang Currently, some kernels allow building with clang but not all the distro might use clang as default system compiler but kernel may demand gcc which is provided via KERNEL_* variables, however kernel does use OBJCOPY at places during build and it maybe set to use llvm objcopy when using clang. That should be a deliberate setting when clang is used for kernel as well, otherwise it should use binutils provided objcopy (From OE-Core rev: 17b409f2fd97894e0943d13c2cb0d52abde647e3) Signed-off-by: Khem Raj <raj.khem@gmail.com> Cc: Bruce Ashfield <bruce.ashfield@gmail.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
35 lines
1.2 KiB
BlitzBasic
35 lines
1.2 KiB
BlitzBasic
SUMMARY = "Build tools needed by external modules"
|
|
HOMEPAGE = "https://www.yoctoproject.org/"
|
|
LICENSE = "GPL-2.0-only"
|
|
LIC_FILES_CHKSUM = "file://${COREBASE}/meta/files/common-licenses/GPL-2.0-only;md5=801f80980d171dd6425610833a22dbe6"
|
|
|
|
inherit kernel-arch linux-kernel-base
|
|
inherit pkgconfig
|
|
|
|
PACKAGE_ARCH = "${MACHINE_ARCH}"
|
|
|
|
S = "${WORKDIR}"
|
|
|
|
do_configure[depends] += "virtual/kernel:do_shared_workdir openssl-native:do_populate_sysroot"
|
|
do_compile[depends] += "virtual/kernel:do_compile_kernelmodules"
|
|
|
|
DEV_PKG_DEPENDENCY = ""
|
|
|
|
DEPENDS += "bc-native bison-native"
|
|
DEPENDS += "gmp-native"
|
|
|
|
EXTRA_OEMAKE = " HOSTCC="${BUILD_CC} ${BUILD_CFLAGS} ${BUILD_LDFLAGS}" HOSTCPP="${BUILD_CPP}""
|
|
EXTRA_OEMAKE += " HOSTCXX="${BUILD_CXX} ${BUILD_CXXFLAGS} ${BUILD_LDFLAGS}" CROSS_COMPILE=${TARGET_PREFIX}"
|
|
|
|
# Build some host tools under work-shared. CC, LD, and AR are probably
|
|
# not used, but this is the historical way of invoking "make scripts".
|
|
#
|
|
do_configure() {
|
|
unset CFLAGS CPPFLAGS CXXFLAGS LDFLAGS
|
|
for t in prepare scripts_basic scripts; do
|
|
oe_runmake CC="${KERNEL_CC}" LD="${KERNEL_LD}" \
|
|
AR="${KERNEL_AR}" OBJCOPY="${KERNEL_OBJCOPY}" \
|
|
-C ${STAGING_KERNEL_DIR} O=${STAGING_KERNEL_BUILDDIR} $t
|
|
done
|
|
}
|