-
Notifications
You must be signed in to change notification settings - Fork 38
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[WIP] base: linux-lmp: build the kernel with clang
- Tested only on v90 main-next Signed-off-by: Jose Quaresma <[email protected]>
- Loading branch information
1 parent
f7382a9
commit 6d7f542
Showing
2 changed files
with
27 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
# 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" | ||
|
||
# error: taking address of packed member 'xxx' of class or structure 'yyy' may result in an unaligned pointer value [-Werror,-Waddress-of-packed-member] | ||
# because kernel don't use CFLAGS we need to pass it over EXTRA_OEMAKE | ||
EXTRA_OEMAKE += 'CFLAGS="-Wno-address-of-packed-member"' | ||
|
||
# explicitly enable LLVM | ||
# https://docs.kernel.org/kbuild/llvm.html | ||
KERNEL_EXTRA_ARGS += "LLVM=1" | ||
|
||
# verbose build | ||
#KERNEL_EXTRA_ARGS += "V=1" | ||
|
||
# disable pararel make | ||
#PARALLEL_MAKE = "-j1" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters