From f82951a106437d7b75ea9dec0c70ddcdd8056210 Mon Sep 17 00:00:00 2001 From: David Candler Date: Tue, 10 Sep 2024 14:32:20 +0100 Subject: [PATCH] Revert commits for changes that did not make it into LLVM-19 The following changes to LLVM ET were made in response to changes in LLVM which happened after the LLVM 19 branch, and therefore do not need to be on our branch either: Statically link libc++abi into libc++ (#483) e80e2529e09de71cdc48d10cc34dda28f58b72c2 Update a downstream patch for altered context (NFC) d95a4fae46be622554eea4b34a745818645789e8 Fix a patch conflict in libc++ tests. 7616f8ca73e2e3b418ea3fda6d0d7809520075cf Do not default to linking crt0 when using crt0-semihosting (#460) 39523a050620862e779b17cdedc7d3b7f88f7432 Remove patch since llvm sort.pass.cpp is already marked as a long test (#458) 3b32a828d5eef80661ed292332845731aa5e6c37 Update patch file for libc++ tests with picolibc, to mark sort test as long one (#457) 9a53fc97bba7788731151f4c61e0c861f7d747eb --- CMakeLists.txt | 10 ++--- README.md | 4 -- docs/migrating.md | 4 +- packagetest/hello.c | 2 +- packagetest/hello.cpp | 2 +- ...th-picolibc-xfail-one-remaining-test.patch | 26 ----------- ...h-picolibc-xfail-two-remaining-tests.patch | 43 +++++++++++++++++++ ...-picolibc-mark-sort-test-as-long-one.patch | 26 +++++++++++ ...with-picolibc-XFAIL-uses-of-atomics.patch} | 4 +- ...-picolibc-mark-two-more-large-tests.patch} | 0 samples/Makefile.conf | 3 +- .../baremetal-semihosting-aarch64/make.bat | 2 +- samples/src/baremetal-semihosting/make.bat | 2 +- samples/src/baremetal-uart/Makefile | 2 +- samples/src/baremetal-uart/make.bat | 2 +- .../cpp-baremetal-semihosting-cfi/make.bat | 4 +- .../cpp-baremetal-semihosting-prof/make.bat | 2 +- .../cpp-baremetal-semihosting-ubsan/make.bat | 4 +- .../src/cpp-baremetal-semihosting/make.bat | 2 +- test-support/llvm-libc++-picolibc.cfg.in | 2 +- test-support/llvm-libc++abi-picolibc.cfg.in | 2 +- test-support/llvm-libunwind-picolibc.cfg.in | 2 +- 22 files changed, 95 insertions(+), 55 deletions(-) delete mode 100644 patches/llvm-project/0001-libc-tests-with-picolibc-xfail-one-remaining-test.patch create mode 100644 patches/llvm-project/0001-libc-tests-with-picolibc-xfail-two-remaining-tests.patch create mode 100644 patches/llvm-project/0004-libc-tests-with-picolibc-mark-sort-test-as-long-one.patch rename patches/llvm-project/{0004-libc-tests-with-picolibc-XFAIL-uses-of-atomics.patch => 0005-libc-tests-with-picolibc-XFAIL-uses-of-atomics.patch} (98%) rename patches/llvm-project/{0005-libc-tests-with-picolibc-mark-two-more-large-tests.patch => 0006-libc-tests-with-picolibc-mark-two-more-large-tests.patch} (100%) diff --git a/CMakeLists.txt b/CMakeLists.txt index 8e7f7c2a..7ef5571c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -278,11 +278,12 @@ endif() # ed551e0778a35f00ab60f1c80d83ea8274d8d400. set( llvm_project_patches - ${CMAKE_CURRENT_SOURCE_DIR}/patches/llvm-project/0001-libc-tests-with-picolibc-xfail-one-remaining-test.patch + ${CMAKE_CURRENT_SOURCE_DIR}/patches/llvm-project/0001-libc-tests-with-picolibc-xfail-two-remaining-tests.patch ${CMAKE_CURRENT_SOURCE_DIR}/patches/llvm-project/0002-libc-tests-with-picolibc-disable-large-tests.patch ${CMAKE_CURRENT_SOURCE_DIR}/patches/llvm-project/0003-Disable-failing-compiler-rt-test.patch - ${CMAKE_CURRENT_SOURCE_DIR}/patches/llvm-project/0004-libc-tests-with-picolibc-XFAIL-uses-of-atomics.patch - ${CMAKE_CURRENT_SOURCE_DIR}/patches/llvm-project/0005-libc-tests-with-picolibc-mark-two-more-large-tests.patch + ${CMAKE_CURRENT_SOURCE_DIR}/patches/llvm-project/0004-libc-tests-with-picolibc-mark-sort-test-as-long-one.patch + ${CMAKE_CURRENT_SOURCE_DIR}/patches/llvm-project/0005-libc-tests-with-picolibc-XFAIL-uses-of-atomics.patch + ${CMAKE_CURRENT_SOURCE_DIR}/patches/llvm-project/0006-libc-tests-with-picolibc-mark-two-more-large-tests.patch ) FetchContent_Declare(llvmproject GIT_REPOSITORY https://github.com/llvm/llvm-project.git @@ -1074,7 +1075,7 @@ Hard-float library with target triple \"${target_triple}\" must end \"-eabihf\"" get_runtimes_flags("${directory}" "${flags}") - set(compiler_rt_test_flags "${runtimes_flags} -fno-exceptions -fno-rtti -nostartfiles -lcrt0-semihost -lsemihost -T picolibcpp.ld") + set(compiler_rt_test_flags "${runtimes_flags} -fno-exceptions -fno-rtti -lcrt0-semihost -lsemihost -T picolibcpp.ld") if(variant STREQUAL "armv6m_soft_nofp") set(compiler_rt_test_flags "${compiler_rt_test_flags} -fomit-frame-pointer") endif() @@ -1201,7 +1202,6 @@ function( -DLIBCXXABI_TEST_PARAMS=executor=${test_executor} -DLIBCXX_ABI_UNSTABLE=ON -DLIBCXX_CXX_ABI=libcxxabi - -DLIBCXX_STATICALLY_LINK_ABI_IN_STATIC_LIBRARY=ON -DLIBCXX_ENABLE_FILESYSTEM=OFF -DLIBCXX_ENABLE_SHARED=OFF -DLIBCXX_ENABLE_STATIC=ON diff --git a/README.md b/README.md index f3e3e4ee..7b1f372e 100644 --- a/README.md +++ b/README.md @@ -87,8 +87,6 @@ To use the toolchain, on the command line you need to provide the following opti * The FPU to use. * Disabling/enabling C++ exceptions and RTTI. * The C runtime library: either `crt0` or `crt0-semihost`. - `crt0` will be linked automatically, but this can be suppressed - with the `-nostartfiles` option so that `crt0-semihost` can be used. * The semihosting library, if using `crt0-semihost`. * A [linker script]( https://sourceware.org/binutils/docs/ld/Scripts.html) specified with `-T`. @@ -104,7 +102,6 @@ $ clang \ -mfpu=none \ -fno-exceptions \ -fno-rtti \ --nostartfiles \ -lcrt0-semihost \ -lsemihost \ -T picolibc.ld \ @@ -133,7 +130,6 @@ $ clang \ -mfpu=none \ -fno-exceptions \ -fno-rtti \ --nostartfiles \ -lcrt0-semihost \ -lsemihost \ -T picolibc.ld \ diff --git a/docs/migrating.md b/docs/migrating.md index c0f29e53..2971a30c 100644 --- a/docs/migrating.md +++ b/docs/migrating.md @@ -88,8 +88,8 @@ however uses different command line options to control selection of semihosting. |Use case|GNU options|LLVM options| |--------|-----------|------------| -|No semihosting|`--specs=nosys.specs`| -|Semihosting|`--specs=rdimon.specs`|`-nostartfiles -lcrt0-semihost -lsemihost`| +|No semihosting|`--specs=nosys.specs`|`-lcrt0`| +|Semihosting|`--specs=rdimon.specs`|`-lcrt0-semihost -lsemihost`| |Newlib-nano|`--specs=nano.specs`|Not available: `picolibc` is an equivalent of `newlib-nano`. ## Linker diff --git a/packagetest/hello.c b/packagetest/hello.c index f9ee5469..b0bb0ee7 100644 --- a/packagetest/hello.c +++ b/packagetest/hello.c @@ -1,4 +1,4 @@ -// RUN: %clang --target=armv6m-none-eabi -mfloat-abi=soft -march=armv6m -mfpu=none -nostartfiles -lcrt0-semihost -lsemihost -T %S/Inputs/microbit.ld %s -o %t.out +// RUN: %clang --target=armv6m-none-eabi -mfloat-abi=soft -march=armv6m -mfpu=none -lcrt0-semihost -lsemihost -T %S/Inputs/microbit.ld %s -o %t.out // RUN: qemu-system-arm -M microbit -semihosting -nographic -device loader,file=%t.out 2>&1 | FileCheck %s #include diff --git a/packagetest/hello.cpp b/packagetest/hello.cpp index 107c72d0..65b7572e 100644 --- a/packagetest/hello.cpp +++ b/packagetest/hello.cpp @@ -1,4 +1,4 @@ -// RUN: %clangxx --target=armv6m-none-eabi -mfloat-abi=soft -march=armv6m -mfpu=none -nostartfiles -lcrt0-semihost -lsemihost -fno-exceptions -fno-rtti -T %S/Inputs/microbit.ld %s -o %t.out +// RUN: %clangxx --target=armv6m-none-eabi -mfloat-abi=soft -march=armv6m -mfpu=none -lcrt0-semihost -lsemihost -fno-exceptions -fno-rtti -T %S/Inputs/microbit.ld %s -o %t.out // RUN: qemu-system-arm -M microbit -semihosting -nographic -device loader,file=%t.out 2>&1 | FileCheck %s // Include as many C++17 headers as possible. diff --git a/patches/llvm-project/0001-libc-tests-with-picolibc-xfail-one-remaining-test.patch b/patches/llvm-project/0001-libc-tests-with-picolibc-xfail-one-remaining-test.patch deleted file mode 100644 index 3d0a0dc4..00000000 --- a/patches/llvm-project/0001-libc-tests-with-picolibc-xfail-one-remaining-test.patch +++ /dev/null @@ -1,26 +0,0 @@ -From 1db48238bfbc5324dadf828532a4c67524dc471b Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Dominik=20W=C3=B3jt?= -Date: Mon, 16 Oct 2023 11:35:48 +0200 -Subject: [PATCH] [libc++] tests with picolibc: xfail one remaining test - ---- - .../language.support/support.start.term/quick_exit.pass.cpp | 3 +++ - 1 file changed, 3 insertions(+) - -diff --git a/libcxx/test/std/language.support/support.start.term/quick_exit.pass.cpp b/libcxx/test/std/language.support/support.start.term/quick_exit.pass.cpp -index d8eff69cb5..e16048df72 100644 ---- a/libcxx/test/std/language.support/support.start.term/quick_exit.pass.cpp -+++ b/libcxx/test/std/language.support/support.start.term/quick_exit.pass.cpp -@@ -17,6 +17,9 @@ - - // test quick_exit and at_quick_exit - -+// TODO: Find out why the at_quick_exit symbol is not found. -+// XFAIL: LIBCXX-PICOLIBC-FIXME -+ - #include - - void f() {} --- -2.34.1 - diff --git a/patches/llvm-project/0001-libc-tests-with-picolibc-xfail-two-remaining-tests.patch b/patches/llvm-project/0001-libc-tests-with-picolibc-xfail-two-remaining-tests.patch new file mode 100644 index 00000000..3ed11617 --- /dev/null +++ b/patches/llvm-project/0001-libc-tests-with-picolibc-xfail-two-remaining-tests.patch @@ -0,0 +1,43 @@ +From cb6cfe0e5fc29d3867f523900f0d46a4ef5dff1b Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Dominik=20W=C3=B3jt?= +Date: Mon, 16 Oct 2023 11:35:48 +0200 +Subject: [libc++] tests with picolibc: xfail two remaining tests + +--- + .../cmp/cmp.alg/strong_order_long_double.verify.cpp | 5 +++++ + .../language.support/support.start.term/quick_exit.pass.cpp | 3 +++ + 2 files changed, 8 insertions(+) + +diff --git a/libcxx/test/std/language.support/cmp/cmp.alg/strong_order_long_double.verify.cpp b/libcxx/test/std/language.support/cmp/cmp.alg/strong_order_long_double.verify.cpp +index c9c2ba200214..4898a9a06e09 100644 +--- a/libcxx/test/std/language.support/cmp/cmp.alg/strong_order_long_double.verify.cpp ++++ b/libcxx/test/std/language.support/cmp/cmp.alg/strong_order_long_double.verify.cpp +@@ -12,6 +12,11 @@ + // This test does apply to aarch64 where Arm's AAPCS64 is followed. There they are different sizes. + // XFAIL: target={{arm64|arm64e|armv(7|8)(l|m)?|powerpc|powerpc64}}-{{.+}} + ++// In internal LLVM arm BMT tests the target is fixed to "arm-none-eabi", so the ++// "unsupported" cluase above does not work. TODO: find more generic way to ++// detect equal sizes of double and long double ++// XFAIL: LIBCXX-PICOLIBC-FIXME ++ + // MSVC configurations have long double equal to regular double on all + // architectures. + // XFAIL: target={{.+}}-pc-windows-msvc +diff --git a/libcxx/test/std/language.support/support.start.term/quick_exit.pass.cpp b/libcxx/test/std/language.support/support.start.term/quick_exit.pass.cpp +index 5a70ea5bd570..92dfbe8eb1ab 100644 +--- a/libcxx/test/std/language.support/support.start.term/quick_exit.pass.cpp ++++ b/libcxx/test/std/language.support/support.start.term/quick_exit.pass.cpp +@@ -16,6 +16,9 @@ + + // test quick_exit and at_quick_exit + ++// TODO: Find out why the at_quick_exit symbol is not found. ++// XFAIL: LIBCXX-PICOLIBC-FIXME ++ + #include + + void f() {} +-- +2.34.1 + diff --git a/patches/llvm-project/0004-libc-tests-with-picolibc-mark-sort-test-as-long-one.patch b/patches/llvm-project/0004-libc-tests-with-picolibc-mark-sort-test-as-long-one.patch new file mode 100644 index 00000000..7d5c66ba --- /dev/null +++ b/patches/llvm-project/0004-libc-tests-with-picolibc-mark-sort-test-as-long-one.patch @@ -0,0 +1,26 @@ +From ac480df06d78bd7457d2a6333be8578cda88c240 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Dominik=20W=C3=B3jt?= +Date: Thu, 9 Nov 2023 14:14:30 +0100 +Subject: [libc++] tests with picolibc: mark sort test as long one + +--- + .../std/algorithms/alg.sorting/alg.sort/sort/sort.pass.cpp | 3 +-- + 1 file changed, 1 insertion(+), 2 deletions(-) + +diff --git a/libcxx/test/std/algorithms/alg.sorting/alg.sort/sort/sort.pass.cpp b/libcxx/test/std/algorithms/alg.sorting/alg.sort/sort/sort.pass.cpp +index e2581fbf2fa6..99a9e1775513 100644 +--- a/libcxx/test/std/algorithms/alg.sorting/alg.sort/sort/sort.pass.cpp ++++ b/libcxx/test/std/algorithms/alg.sorting/alg.sort/sort/sort.pass.cpp +@@ -6,8 +6,7 @@ + // + //===----------------------------------------------------------------------===// + +-// This test appears to hang with picolibc & qemu. +-// UNSUPPORTED: LIBCXX-PICOLIBC-FIXME ++// REQUIRES: long_test + + // + +-- +2.34.1 + diff --git a/patches/llvm-project/0004-libc-tests-with-picolibc-XFAIL-uses-of-atomics.patch b/patches/llvm-project/0005-libc-tests-with-picolibc-XFAIL-uses-of-atomics.patch similarity index 98% rename from patches/llvm-project/0004-libc-tests-with-picolibc-XFAIL-uses-of-atomics.patch rename to patches/llvm-project/0005-libc-tests-with-picolibc-XFAIL-uses-of-atomics.patch index 48bf4e88..a2d86a18 100644 --- a/patches/llvm-project/0004-libc-tests-with-picolibc-XFAIL-uses-of-atomics.patch +++ b/patches/llvm-project/0005-libc-tests-with-picolibc-XFAIL-uses-of-atomics.patch @@ -39,7 +39,7 @@ index 000000000000..5ecc58f3e385 +if "has-no-atomics" in config.available_features: + config.unsupported = True diff --git a/libcxx/test/libcxx/thread/thread.stoptoken/intrusive_shared_ptr.pass.cpp b/libcxx/test/libcxx/thread/thread.stoptoken/intrusive_shared_ptr.pass.cpp -index 99d4226662a0..243aa21c87b4 100644 +index 47440015f2c5..4350de3dfa65 100644 --- a/libcxx/test/libcxx/thread/thread.stoptoken/intrusive_shared_ptr.pass.cpp +++ b/libcxx/test/libcxx/thread/thread.stoptoken/intrusive_shared_ptr.pass.cpp @@ -7,6 +7,8 @@ @@ -49,8 +49,8 @@ index 99d4226662a0..243aa21c87b4 100644 +// XFAIL: has-no-atomics + // UNSUPPORTED: c++03, c++11, c++14, c++17 - // ADDITIONAL_COMPILE_FLAGS: -Wno-private-header + #include <__stop_token/intrusive_shared_ptr.h> diff --git a/libcxx/test/std/atomics/lit.local.cfg b/libcxx/test/std/atomics/lit.local.cfg new file mode 100644 index 000000000000..5ecc58f3e385 diff --git a/patches/llvm-project/0005-libc-tests-with-picolibc-mark-two-more-large-tests.patch b/patches/llvm-project/0006-libc-tests-with-picolibc-mark-two-more-large-tests.patch similarity index 100% rename from patches/llvm-project/0005-libc-tests-with-picolibc-mark-two-more-large-tests.patch rename to patches/llvm-project/0006-libc-tests-with-picolibc-mark-two-more-large-tests.patch diff --git a/samples/Makefile.conf b/samples/Makefile.conf index 4ccae915..aa65263b 100644 --- a/samples/Makefile.conf +++ b/samples/Makefile.conf @@ -22,6 +22,7 @@ endif MICROBIT_TARGET=--target=armv6m-none-eabi -march=armv6m -mfpu=none -mfloat-abi=soft AARCH64_TARGET=--target=aarch64-none-elf -CRT_SEMIHOST=-nostartfiles -lcrt0-semihost -lsemihost +CRT=-lcrt0 +CRT_SEMIHOST=-lcrt0-semihost -lsemihost CPP_FLAGS=-fno-exceptions -fno-rtti diff --git a/samples/src/baremetal-semihosting-aarch64/make.bat b/samples/src/baremetal-semihosting-aarch64/make.bat index 8264ee3a..b1c3a7f7 100644 --- a/samples/src/baremetal-semihosting-aarch64/make.bat +++ b/samples/src/baremetal-semihosting-aarch64/make.bat @@ -49,6 +49,6 @@ if exist hello.img del /q hello.img @exit /B 1 :build_fn -%BIN_PATH%\clang.exe --target=aarch64-none-elf -nostartfiles -lcrt0-semihost -lsemihost -g -T ..\..\ldscripts\raspi3b.ld -o hello.elf hello.c +%BIN_PATH%\clang.exe --target=aarch64-none-elf -lcrt0-semihost -lsemihost -g -T ..\..\ldscripts\raspi3b.ld -o hello.elf hello.c %BIN_PATH%\llvm-objcopy.exe -O binary hello.elf hello.img @exit /B diff --git a/samples/src/baremetal-semihosting/make.bat b/samples/src/baremetal-semihosting/make.bat index 4b80e42e..826818f1 100644 --- a/samples/src/baremetal-semihosting/make.bat +++ b/samples/src/baremetal-semihosting/make.bat @@ -49,6 +49,6 @@ if exist hello.hex del /q hello.hex @exit /B 1 :build_fn -%BIN_PATH%\clang.exe --target=armv6m-none-eabi -mfloat-abi=soft -march=armv6m -mfpu=none -nostartfiles -lcrt0-semihost -lsemihost -g -T ..\..\ldscripts\microbit.ld -o hello.elf hello.c +%BIN_PATH%\clang.exe --target=armv6m-none-eabi -mfloat-abi=soft -march=armv6m -mfpu=none -lcrt0-semihost -lsemihost -g -T ..\..\ldscripts\microbit.ld -o hello.elf hello.c %BIN_PATH%\llvm-objcopy.exe -O ihex hello.elf hello.hex @exit /B diff --git a/samples/src/baremetal-uart/Makefile b/samples/src/baremetal-uart/Makefile index 14b51b4b..589d5bd0 100644 --- a/samples/src/baremetal-uart/Makefile +++ b/samples/src/baremetal-uart/Makefile @@ -20,7 +20,7 @@ include ../../Makefile.conf build: hello.elf hello.elf: *.c - $(BIN_PATH)/clang $(MICROBIT_TARGET) -g -T ../../ldscripts/microbit.ld -o hello.elf $^ + $(BIN_PATH)/clang $(MICROBIT_TARGET) $(CRT) -g -T ../../ldscripts/microbit.ld -o hello.elf $^ %.hex: %.elf $(BIN_PATH)/llvm-objcopy -O ihex $< $@ diff --git a/samples/src/baremetal-uart/make.bat b/samples/src/baremetal-uart/make.bat index 7b9c3a39..b61dcb71 100644 --- a/samples/src/baremetal-uart/make.bat +++ b/samples/src/baremetal-uart/make.bat @@ -49,6 +49,6 @@ if exist hello.hex del /q hello.hex @exit /B 1 :build_fn -%BIN_PATH%\clang.exe --target=armv6m-none-eabi -mfloat-abi=soft -march=armv6m -mfpu=none -g -T ..\..\ldscripts\microbit.ld -o hello.elf hello.c +%BIN_PATH%\clang.exe --target=armv6m-none-eabi -mfloat-abi=soft -march=armv6m -mfpu=none -lcrt0 -g -T ..\..\ldscripts\microbit.ld -o hello.elf hello.c %BIN_PATH%\llvm-objcopy.exe -O ihex hello.elf hello.hex @exit /B diff --git a/samples/src/cpp-baremetal-semihosting-cfi/make.bat b/samples/src/cpp-baremetal-semihosting-cfi/make.bat index 66b7ccbd..b8d1a4ff 100644 --- a/samples/src/cpp-baremetal-semihosting-cfi/make.bat +++ b/samples/src/cpp-baremetal-semihosting-cfi/make.bat @@ -57,12 +57,12 @@ if exist hello.hex del /q hello.hex :build_fn %BIN_PATH%\clang++.exe --target=armv6m-none-eabi -mfloat-abi=soft -march=armv6m -mfpu=none -fno-exceptions -fno-rtti -flto -fsanitize=cfi -fvisibility=hidden -fno-sanitize-ignorelist -g -c hello.cpp -%BIN_PATH%\clang++.exe --target=armv6m-none-eabi -mfloat-abi=soft -march=armv6m -mfpu=none -nostartfiles -lcrt0-semihost -lsemihost -fno-exceptions -fno-rtti -flto -T ..\..\ldscripts\microbit.ld -g -o hello.elf hello.o +%BIN_PATH%\clang++.exe --target=armv6m-none-eabi -mfloat-abi=soft -march=armv6m -mfpu=none -lcrt0-semihost -lsemihost -fno-exceptions -fno-rtti -flto -T ..\..\ldscripts\microbit.ld -g -o hello.elf hello.o %BIN_PATH%\llvm-objcopy.exe -O ihex hello.elf hello.hex @exit /B :build_no_cfi_fn %BIN_PATH%\clang++.exe --target=armv6m-none-eabi -mfloat-abi=soft -march=armv6m -mfpu=none -fno-exceptions -fno-rtti -flto -g -c hello.cpp -%BIN_PATH%\clang++.exe --target=armv6m-none-eabi -mfloat-abi=soft -march=armv6m -mfpu=none -nostartfiles -lcrt0-semihost -lsemihost -fno-exceptions -fno-rtti -flto -T ..\..\ldscripts\microbit.ld -g -o hello.elf hello.o +%BIN_PATH%\clang++.exe --target=armv6m-none-eabi -mfloat-abi=soft -march=armv6m -mfpu=none -lcrt0-semihost -lsemihost -fno-exceptions -fno-rtti -flto -T ..\..\ldscripts\microbit.ld -g -o hello.elf hello.o %BIN_PATH%\llvm-objcopy.exe -O ihex hello.elf hello.hex @exit /B diff --git a/samples/src/cpp-baremetal-semihosting-prof/make.bat b/samples/src/cpp-baremetal-semihosting-prof/make.bat index cffb9baa..cff03fdf 100644 --- a/samples/src/cpp-baremetal-semihosting-prof/make.bat +++ b/samples/src/cpp-baremetal-semihosting-prof/make.bat @@ -55,6 +55,6 @@ if exist proflib.o del /q proflib.o :build_fn %BIN_PATH%\clang.exe --target=armv6m-none-eabi -mfloat-abi=soft -march=armv6m -mfpu=none -g -c proflib.c -%BIN_PATH%\clang++.exe --target=armv6m-none-eabi -mfloat-abi=soft -march=armv6m -mfpu=none -nostartfiles -lcrt0-semihost -lsemihost -fno-exceptions -fno-rtti -g -T ..\..\ldscripts\microbit.ld -fprofile-instr-generate -fcoverage-mapping -o hello.elf hello.cpp proflib.o +%BIN_PATH%\clang++.exe --target=armv6m-none-eabi -mfloat-abi=soft -march=armv6m -mfpu=none -lcrt0-semihost -lsemihost -fno-exceptions -fno-rtti -g -T ..\..\ldscripts\microbit.ld -fprofile-instr-generate -fcoverage-mapping -o hello.elf hello.cpp proflib.o %BIN_PATH%\llvm-objcopy.exe -O ihex hello.elf hello.hex @exit /B diff --git a/samples/src/cpp-baremetal-semihosting-ubsan/make.bat b/samples/src/cpp-baremetal-semihosting-ubsan/make.bat index cf9493d7..12007fe3 100644 --- a/samples/src/cpp-baremetal-semihosting-ubsan/make.bat +++ b/samples/src/cpp-baremetal-semihosting-ubsan/make.bat @@ -55,11 +55,11 @@ if exist hello.hex del /q hello.hex @exit /B 1 :build_fn -%BIN_PATH%\clang++.exe --target=armv6m-none-eabi -mfloat-abi=soft -march=armv6m -mfpu=none -nostartfiles -lcrt0-semihost -lsemihost -fno-exceptions -fno-rtti --std=c++17 -fsanitize=undefined -fsanitize-minimal-runtime -g -T ../../ldscripts/microbit.ld -o hello.elf *.cpp +%BIN_PATH%\clang++.exe --target=armv6m-none-eabi -mfloat-abi=soft -march=armv6m -mfpu=none -lcrt0-semihost -lsemihost -fno-exceptions -fno-rtti --std=c++17 -fsanitize=undefined -fsanitize-minimal-runtime -g -T ../../ldscripts/microbit.ld -o hello.elf *.cpp %BIN_PATH%\llvm-objcopy.exe -O ihex hello.elf hello.hex @exit /B :build_trap_fn -%BIN_PATH%\clang++.exe --target=armv6m-none-eabi -mfloat-abi=soft -march=armv6m -mfpu=none -nostartfiles -lcrt0-semihost -lsemihost -fno-exceptions -fno-rtti --std=c++17 -fsanitize=undefined -fsanitize-trap=all -g -T ../../ldscripts/microbit.ld -o hello.elf *.cpp +%BIN_PATH%\clang++.exe --target=armv6m-none-eabi -mfloat-abi=soft -march=armv6m -mfpu=none -lcrt0-semihost -lsemihost -fno-exceptions -fno-rtti --std=c++17 -fsanitize=undefined -fsanitize-trap=all -g -T ../../ldscripts/microbit.ld -o hello.elf *.cpp %BIN_PATH%\llvm-objcopy.exe -O ihex hello.elf hello.hex @exit /B diff --git a/samples/src/cpp-baremetal-semihosting/make.bat b/samples/src/cpp-baremetal-semihosting/make.bat index f868a3e8..1e5b9b33 100644 --- a/samples/src/cpp-baremetal-semihosting/make.bat +++ b/samples/src/cpp-baremetal-semihosting/make.bat @@ -49,6 +49,6 @@ if exist hello.hex del /q hello.hex @exit /B 1 :build_fn -%BIN_PATH%\clang++.exe --target=armv6m-none-eabi -mfloat-abi=soft -march=armv6m -mfpu=none -nostartfiles -lcrt0-semihost -lsemihost -fno-exceptions -fno-rtti -g -T ..\..\ldscripts\microbit.ld -o hello.elf hello.cpp +%BIN_PATH%\clang++.exe --target=armv6m-none-eabi -mfloat-abi=soft -march=armv6m -mfpu=none -lcrt0-semihost -lsemihost -fno-exceptions -fno-rtti -g -T ..\..\ldscripts\microbit.ld -o hello.elf hello.cpp %BIN_PATH%\llvm-objcopy.exe -O ihex hello.elf hello.hex @exit /B diff --git a/test-support/llvm-libc++-picolibc.cfg.in b/test-support/llvm-libc++-picolibc.cfg.in index 1041aa5f..2c00fd89 100644 --- a/test-support/llvm-libc++-picolibc.cfg.in +++ b/test-support/llvm-libc++-picolibc.cfg.in @@ -27,7 +27,7 @@ config.substitutions.append(('%{link_flags}', ' -nostdlib++ -L %{lib-dir}' ' -lc++ -lc++abi' ' -nostdlib -L %{libc-lib}' - ' -lc -lm -lclang_rt.builtins -lsemihost -nostartfiles -lcrt0-semihost' + ' -lc -lm -lclang_rt.builtins -lsemihost -lcrt0-semihost' ' -T %{libc-linker-script}' )) config.substitutions.append(('%{exec}', diff --git a/test-support/llvm-libc++abi-picolibc.cfg.in b/test-support/llvm-libc++abi-picolibc.cfg.in index 96b32064..bfe0eb2e 100644 --- a/test-support/llvm-libc++abi-picolibc.cfg.in +++ b/test-support/llvm-libc++abi-picolibc.cfg.in @@ -19,7 +19,7 @@ config.substitutions.append(('%{link_flags}', ' -nostdlib++ -L %{lib}' ' -lc++ -lc++abi' ' -nostdlib -L %{libc-lib}' - ' -lc -lm -lclang_rt.builtins -lsemihost -nostartfiles -lcrt0-semihost' + ' -lc -lm -lclang_rt.builtins -lsemihost -lcrt0-semihost' ' -T %{libc-linker-script}' )) config.substitutions.append(('%{exec}', diff --git a/test-support/llvm-libunwind-picolibc.cfg.in b/test-support/llvm-libunwind-picolibc.cfg.in index 948b2143..d0f00a35 100644 --- a/test-support/llvm-libunwind-picolibc.cfg.in +++ b/test-support/llvm-libunwind-picolibc.cfg.in @@ -32,7 +32,7 @@ config.substitutions.append(('%{link_flags}', ' -nostdlib++ -L %{lib}' ' -lc++ -lc++abi -lunwind' ' -nostdlib -L %{libc-lib}' - ' -lc -lm -lclang_rt.builtins -lsemihost -nostartfiles -lcrt0-semihost' + ' -lc -lm -lclang_rt.builtins -lsemihost -lcrt0-semihost' ' -T %{libc-linker-script}' )) config.substitutions.append(('%{exec}',