We are working and nearly done on a layer that would live on top of meta-morello and that contains purecap user space libraries that live in a purecap sysroot in parallel to the usual c64 packages. Adding rpath the the compiler flags simplifies that work.
Further more user space recipes shall inherit yet another class that will override the $libdir $prefix etc. variables found in bibtake.conf to reduce the amount of hoops one has to jump through when doing the above sysroot trick and working with Yocto.
For that to work, two of the paths in the llvm class need to be hardcoded until a more elegant solution is found (possibly moving overriding of all paths into the llvm-class itself, as the BSP does not care about user space paths anyway).
Pawel Zalewski (2): classes: add rpath to the compiler flags and fix paths config: fix path for purecap sysroot, drop c64 flag
meta-morello-toolchain/classes/llvm-morello.bbclass | 8 ++++++-- meta-morello-toolchain/conf/layer.conf | 4 ++-- 2 files changed, 8 insertions(+), 4 deletions(-)
Use rpath to aid the development of the user space recipes.
Hard code /usr instead of using $prefix and $libdir as theese will be very likely overwritten becasue we use a custom sysroot path for purecap. If we do not hardcode the paths then we might end up with a recursion.
Signed-off-by: Pawel Zalewski pzalewski@thegoodpenguin.co.uk --- meta-morello-toolchain/classes/llvm-morello.bbclass | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/meta-morello-toolchain/classes/llvm-morello.bbclass b/meta-morello-toolchain/classes/llvm-morello.bbclass index ee5d872..72e3bb4 100644 --- a/meta-morello-toolchain/classes/llvm-morello.bbclass +++ b/meta-morello-toolchain/classes/llvm-morello.bbclass @@ -8,6 +8,9 @@ LLVM_CONFIG ??= "" LIBCPLUSPLUS ??= "" TC_DEPENDS ??= ""
+# /usr/lib /usr/bin etc. are used here explicitly in case this class +# would be combined with other classes that could overwrite these variables + LLVM_VERSION:toolchain-llvm-morello = "13.0.0" LLVM_PATH:toolchain-llvm-morello = "${STAGING_DIR_NATIVE}/usr/bin"
@@ -50,12 +53,13 @@ CC_PURECAP_FLAGS += "\ -Werror=cheri-bitwise-operations \ "
-CC_PURECAP_FLAGS += "-isystem ${STAGING_DIR_TARGET}${PURECAP_SYSROOT_DIR}${prefix}/src/linux-headers-morello/include" +CC_PURECAP_FLAGS += "-isystem ${STAGING_DIR_TARGET}${PURECAP_SYSROOT_DIR}/usr/src/linux-headers-morello/include"
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" +LD_PURECAP_FLAGS = "-L${STAGING_DIR_TARGET}${PURECAP_SYSROOT_DIR}/usr/lib -rtlib=compiler-rt -Wl,-rpath=${PURECAP_SYSROOT_DIR}/usr/lib " + LDFLAGS:append:toolchain-llvm-morello:class-target = " ${LD_PURECAP_FLAGS}"
DEPENDS:remove:toolchain-llvm-morello = "libgcc"
Hard code the path to /usr/lib as $libdir shall be overwritten, given that we use a custom sysroot path for purecap.
Signed-off-by: Pawel Zalewski pzalewski@thegoodpenguin.co.uk --- meta-morello-toolchain/conf/layer.conf | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/meta-morello-toolchain/conf/layer.conf b/meta-morello-toolchain/conf/layer.conf index cb4c909..907f1f4 100644 --- a/meta-morello-toolchain/conf/layer.conf +++ b/meta-morello-toolchain/conf/layer.conf @@ -12,7 +12,7 @@ LAYERDEPENDS_meta-morello-toolchain = " \ " LAYERSERIES_COMPAT_meta-morello-toolchain = "kirkstone"
-PURECAP_SYSROOT_DIR ??= "${libdir}/${GLOBAL_ARCH_TRIPLE}" +PURECAP_SYSROOT_DIR ??= "/usr/lib/${GLOBAL_ARCH_TRIPLE}"
C64_ARCH_TRIPLE ??= "aarch64-linux-musl_purecap" A64_ARCH_TRIPLE ??= "aarch64-linux-gnu" @@ -21,7 +21,7 @@ A64_LIB_TRIPLE ??= "aarch64-unknown-linux-gnu" C64_LIB_TRIPLE ??= "aarch64-unknown-linux-musl_purecap"
A64_ARCH_FLAGS ??= "-march=armv8" -C64_ARCH_FLAGS ??= "-march=morello+c64 -mabi=purecap" +C64_ARCH_FLAGS ??= "-march=morello -mabi=purecap"
GLOBAL_ARCH_TRIPLE ??= "${C64_ARCH_TRIPLE}" GLOBAL_LIB_TRIPLE ??= "${C64_LIB_TRIPLE}"
linux-morello-distros@op-lists.linaro.org