Skip to content

Commit

Permalink
base: linux-lmp: build with clang
Browse files Browse the repository at this point in the history
Signed-off-by: Jose Quaresma <[email protected]>
  • Loading branch information
quaresmajose committed May 9, 2023
1 parent 6e74f8c commit bcc457f
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
12 changes: 12 additions & 0 deletions meta-lmp-base/recipes-kernel/linux/linux-lmp-clang.inc
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# https://github.com/kraj/meta-clang#kernel-build-with-clang

TOOLCHAIN:forcevariable = "clang"

DEPENDS:append:toolchain-clang = " clang-cross-${TARGET_ARCH}"
KERNEL_CC:toolchain-clang = "${CCACHE}clang ${HOST_CC_KERNEL_ARCH} ${DEBUG_PREFIX_MAP} -fdebug-prefix-map=${STAGING_KERNEL_DIR}=${KERNEL_SRC_PATH}"
KERNEL_LD:toolchain-clang = "${CCACHE}ld.lld"
KERNEL_AR:toolchain-clang = "${CCACHE}llvm-ar"

# FIXME: hacks
do_kernel_configcheck[noexec] = "1"
CFLAGS:append:toolchain-clang = " -Wno-error=address-of-packed-member"
2 changes: 2 additions & 0 deletions meta-lmp-base/recipes-kernel/linux/linux-lmp.inc
Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,5 @@ do_deploy:append() {
cp -a ${B}/.config ${DEPLOYDIR}/${KERNEL_CONFIG_NAME}
ln -sf ${KERNEL_CONFIG_NAME} ${DEPLOYDIR}/${KERNEL_CONFIG_LINK_NAME}
}

require linux-lmp-clang.inc

0 comments on commit bcc457f

Please sign in to comment.