diff --git a/cmake/zephyr/Kconfig b/cmake/zephyr/Kconfig index 63087602..1c8b8834 100644 --- a/cmake/zephyr/Kconfig +++ b/cmake/zephyr/Kconfig @@ -25,5 +25,5 @@ config PICOLIBC_DEFAULT Zephyr SDK >=0.17.1 always uses Picolibc choice COMPILER_OPTIMIZATIONS - default SPEED_OPTIMIZATIONS if "$(ZEPHYR_TOOLCHAIN_VARIANT)" = "zephyr" && CPP_EXCEPTIONS + default SPEED_OPTIMIZATIONS if ("$(ZEPHYR_TOOLCHAIN_VARIANT)" = "zephyr" || "$(ZEPHYR_TOOLCHAIN_VARIANT)" = "zephyr-gnu") && CPP_EXCEPTIONS endchoice diff --git a/contrib/linux_build_llvm.sh b/contrib/linux_build_llvm.sh new file mode 100755 index 00000000..329ec9fd --- /dev/null +++ b/contrib/linux_build_llvm.sh @@ -0,0 +1,33 @@ +#!/usr/bin/env bash + +# Script to mimic how CI is building llvm toolchain. + +# Default is to use current directory as the working directory. +# SDK is under ${WORKING_ROOT_DIR}/sdk-ng/ +# Build directory is ${WORKING_ROOT_DIR}/build-workspace/ +WORKING_ROOT_DIR="${PWD}" +SDK_DIR="${WORKING_ROOT_DIR}/sdk-ng" +BUILD_DIR="${WORKING_ROOT_DIR}/build-workspace" + +pushd "${BUILD_DIR}" +mkdir -p llvm-build +mkdir -p llvm + +#TEST=echo +cd llvm-build +$TEST cmake \ + -GNinja \ + --install-prefix="${BUILD_DIR}"/llvm \ + -DLLVM_ENABLE_ZSTD=OFF \ + ${LLVM_CMAKE_ARGS} \ + "${SDK_DIR}"/scripts/llvm || exit 1 + +# Build LLVM toolchain +$TEST ninja llvm-toolchain || exit 1 + +# Run LLVM tests +$TEST ninja check-llvm-toolchain || exit 1 + +# Install LLVM toolchain +$TEST ninja install-llvm-toolchain || exit 1 +popd diff --git a/scripts/llvm/test-support/run-picolibc-tests.py b/scripts/llvm/test-support/run-picolibc-tests.py index 90b88534..b4d40f69 100755 --- a/scripts/llvm/test-support/run-picolibc-tests.py +++ b/scripts/llvm/test-support/run-picolibc-tests.py @@ -66,6 +66,18 @@ def run_tests(meson_command, source_dir, build_dir, variant): check=True, ) + # Newer meson doesn't apply new configuration with the above + # operation, so *also* run a regular configure step + subprocess.run( + [ + meson_command, + "configure", + "-Dtests=true", + ], + cwd=build_dir, + check=True, + ) + returncode = subprocess.run( [meson_command, "test", "-t", "20"], cwd=build_dir,