Set default flags for the compiler and the linker. Add default depends, these will have to be removed within the bsp recipes but allow for less typing in the rootfs, which is where the majority of the actual work awaits.
Signed-off-by: Pawel Zalewski pzalewski@thegoodpenguin.co.uk --- .../classes/llvm-morello.bbclass | 47 +++++++++++-------- 1 file changed, 28 insertions(+), 19 deletions(-)
diff --git a/meta-morello-toolchain/classes/llvm-morello.bbclass b/meta-morello-toolchain/classes/llvm-morello.bbclass index 7f69763..d8877cf 100644 --- a/meta-morello-toolchain/classes/llvm-morello.bbclass +++ b/meta-morello-toolchain/classes/llvm-morello.bbclass @@ -18,26 +18,35 @@ TC_DEPENDS:append:toolchain-llvm-morello:class-target = " virtual/llvm-morello-r
DEPENDS:append:toolchain-llvm-morello = "${TC_DEPENDS}"
-# leaving out ${HOST_CC_ARCH}${TOOLCHAIN_OPTIONS} for now; -# -target is set kind off backwards inside the recipes until further notice -CC:toolchain-llvm-morello = "${LLVM_PATH}/clang" -CXX:toolchain-llvm-morello = "${LLVM_PATH}/clang++" -CPP:toolchain-llvm-morello = "${LLVM_PATH}/clang -E" -CCLD:toolchain-llvm-morello = "${LLVM_PATH}/clang" -HOSTCC:toolchain-llvm-morello = "${LLVM_PATH}/clang" -RANLIB:toolchain-llvm-morello = "${LLVM_PATH}/llvm-ranlib" -AR:toolchain-llvm-morello = "${LLVM_PATH}/llvm-ar" -AS:toolchain-llvm-morello = "${LLVM_PATH}/llvm-as" -NM:toolchain-llvm-morello = "${LLVM_PATH}/llvm-nm" -OBJDUMP:toolchain-llvm-morello = "${LLVM_PATH}/llvm-objdump" -OBJCOPY:toolchain-llvm-morello = "${LLVM_PATH}/llvm-objcopy" -STRIP:toolchain-llvm-morello = "${LLVM_PATH}/llvm-strip" -STRINGS:toolchain-llvm-morello = "${LLVM_PATH}/llvm-strings" -READELF:toolchain-llvm-morello = "${LLVM_PATH}/llvm-readelf" -LD:toolchain-llvm-morello = "${LLVM_PATH}/ld.lld" -LTO:toolchain-llvm-morello = "-fuse-ld=lld" -LLVM_CONFIG:toolchain-llvm-morello = "${LLVM_PATH}/llvm-config" +CC:toolchain-llvm-morello ??= "${LLVM_PATH}/clang" +CXX:toolchain-llvm-morello ??= "${LLVM_PATH}/clang++" +CPP:toolchain-llvm-morello ??= "${LLVM_PATH}/clang -E" +CCLD:toolchain-llvm-morello ??= "${LLVM_PATH}/clang" +HOSTCC:toolchain-llvm-morello ??= "${LLVM_PATH}/clang" +RANLIB:toolchain-llvm-morello ??= "${LLVM_PATH}/llvm-ranlib" +AR:toolchain-llvm-morello ??= "${LLVM_PATH}/llvm-ar" +AS:toolchain-llvm-morello ??= "${LLVM_PATH}/llvm-as" +NM:toolchain-llvm-morello ??= "${LLVM_PATH}/llvm-nm" +OBJDUMP:toolchain-llvm-morello ??= "${LLVM_PATH}/llvm-objdump" +OBJCOPY:toolchain-llvm-morello ??= "${LLVM_PATH}/llvm-objcopy" +STRIP:toolchain-llvm-morello ??= "${LLVM_PATH}/llvm-strip" +STRINGS:toolchain-llvm-morello ??= "${LLVM_PATH}/llvm-strings" +READELF:toolchain-llvm-morello ??= "${LLVM_PATH}/llvm-readelf" +LD:toolchain-llvm-morello ??= "${LLVM_PATH}/ld.lld" +LTO:toolchain-llvm-morello ??= "-fuse-ld=lld" +LLVM_CONFIG:toolchain-llvm-morello ??= "${LLVM_PATH}/llvm-config"
export ${LLVM_CONFIG}
+CC_PURECAP_FLAGS = "--target=${GLOBAL_ARCH_TRIPLE} --sysroot ${STAGING_DIR_TARGET}${PURECAP_SYSROOT_DIR} -Wno-cheri-inefficient -march=morello+c64" +CC_PURECAP_FLAGS += "-Werror=implicit-function-declaration -Werror=format -Werror=undefined-internal -Werror=incompatible-pointer-types" + +CC:append:toolchain-llvm-morello:class-target = " ${CC_PURECAP_FLAGS}" +CXX:append:toolchain-llvm-morello:class-target = " ${CC_PURECAP_FLAGS}" + +LD_PURECAP_FLAGS = "-L${STAGING_DIR_TARGET}${PURECAP_SYSROOT_DIR}${libdir} -rtlib=compiler-rt" +LDFLAGS:append:toolchain-llvm-morello:class-target = " ${LD_PURECAP_FLAGS}" + DEPENDS:remove:toolchain-llvm-morello = "libgcc" + +RDEPENDS:${PN}:append:toolchain-llvm-morello = " musl" \ No newline at end of file