Clean-up the instructions for building LTP syscall testcases, as those have become bit stale. Also add some additional details on the required setup.
Signed-off-by: Beata Michalska beata.michalska@arm.com --- Changes available at: https://git.morello-project.org/Bea/morello-linux-ltp/-/tree/morello/dev
README.rst | 47 +++++++++++++++++++++++++++-------------------- 1 file changed, 27 insertions(+), 20 deletions(-)
diff --git a/README.rst b/README.rst index 342901f4d..fc07d3b64 100644 --- a/README.rst +++ b/README.rst @@ -21,7 +21,7 @@ https://op-lists.linaro.org/mailman3/lists/linux-morello-ltp.op-lists.linaro... Building (cross-compiling) & running relevant tests (purecap mode) -------------------------------------------------------------------
-Dependencies/requirements: (additional to what's required to build base LTP): +Dependencies/requirements: (additional to what's required to build base LTP)
- Morello LLVM toolchain (version >= 1.4)
@@ -29,7 +29,7 @@ Dependencies/requirements: (additional to what's required to build base LTP):
Binary releases: https://git.morello-project.org/morello/llvm-project-releases
- - **morello/baremetal-release-1.4** + **morello/linux-aarch64-release-1.4** for Morello + - **morello/baremetal-release-1.*** + **morello/linux-aarch64-release-1.*** for Morello purecap crt objects
@@ -37,6 +37,8 @@ Dependencies/requirements: (additional to what's required to build base LTP):
- Kernel uAPI header files: https://git.morello-project.org/morello/morello-linux-headers
+* All based on the same release/tag version. + Building Musl: --------------
@@ -72,27 +74,24 @@ Assumptions: .. code-block::
clang - Morello Clang (see Dependencies) configured for current environment - KHDR_DIR - kernel uAPI headers - MUSL - Musl build (see above) - MORELLO_CRT_OBJS - as per https://git.morello-project.org/morello/llvm-project-releases/-/tree/morello... - -> $(clang -print-resource-dir)/lib/aarch64-unknown-linux-musl_purecap - + KHDR_DIR - kernel uAPI headers (see Dependencies or alternatively + headers installed for Morello Linux kernel through make headers_install) + MUSL - installed Musl libc for Morello (see section above: Building Musl); + this will serve as a location for --sysroot option + LTP_BUILD - location for the out-of-tree build (generated automatically) + OUTPUT_DIR - pre-existing location where LTP tests are to be installed + TARGETS - build targets, currently only pan and testcases/kernel/syscalls + are supported, it can be further narrowed down for + specific syscall testcases: + TARGETS="pan testcases/kernel/syscalls/${syscall}"
.. code-block::
- CLANG_RES_DIR=$(clang -print-resource-dir) - - CFLAGS_COMMON="--target=aarch64-linux-gnu -integrated-as -g -static -nostdinc -pthread \ - -isystem $KHDR_DIR/usr/include" - - CFLAGS_PURECAP="$CFLAGS_COMMON -march=morello+c64 -mabi=purecap \ - -isystem $CLANG_RES_DIR/include -isystem $MUSL/include -Wall" + CFLAGS="--target=aarch64-linux-musl_purecap -march=morello+c64 --sysroot=${MUSL} \ + -isystem $KHDR_DIR/usr/include -g -pthread -Wall"
- LDFLAGS_COMMON="--target=aarch64-linux-gnu -fuse-ld=lld -static -nostdlib" - - LDFLAGS_PURECAP="$LDFLAGS_COMMON $MUSL/lib/crt1.o $MUSL/lib/crti.o \ - $MORELLO_CRT_OBJS/clang_rt.crtbegin.o $MORELLO_CRT_OBJS/libclang_rt.builtins.a \ - $MORELLO_CRT_OBJS/clang_rt.crtend.o $MUSL/lib/crtn.o -L$MUSL/lib/ -lc -L$LTP_BUILD/lib" + LDFLAGS="--target=aarch64-linux-musl_purecap -rtlib=compiler-rt --sysroot=${MUSL} \ + -fuse-ld=lld -static -L${LTP_BUILD}/lib"
export CC=clang export HOST_CFLAGS="-O2 -Wall" @@ -101,9 +100,17 @@ Assumptions:
MAKE_OPTS="TST_NEWER_64_SYSCALL=no TST_COMPAT_16_SYSCALL=no" \ TARGETS="pan testcases/kernel/syscalls" BUILD_DIR="$LTP_BUILD" \ - CFLAGS="$CFLAGS_PURECAP" LDFLAGS="$LDFLAGS_PURECAP" \ + CFLAGS="$CFLAGS" LDFLAGS="$LDFLAGS" \ ./build.sh -t cross -o out -ip "${OUTPUT_DIR}/opt/ltp"
+This can be split into separate steps for ``configure``, ``build`` and ``install`` by +specifying additional parameter to build.sh detailing each step: + +.. code-block:: + + -r configure - run cunfigure only + -r build - run build only + -r install - run install only
Running tests: --------------