Skip to content

Commit 3d31dab

Browse files
ostannarddcandler
authored andcommitted
Fix picolibc C++ test with meson 1.4 (arm#138)
Picolibc contains one C++ test, which is failing for me when building with meson 1.4.1, but not 1.3.1. In the failing case, the test is being compiled and linked using clang++ from my PATH, not the freshly built one. With meson 1.3.1, the same compiler is being used for both C and C++, so this test works correctly. I don't see anything in the meson changelog which could cause this, but setting the c++ compiler in the same way we do for C makes this test work for both meson versions. (cherry picked from commit 48b9ea7)
1 parent 0ec1e2c commit 3d31dab

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

arm-software/embedded/arm-runtimes/CMakeLists.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -369,11 +369,14 @@ if(C_LIBRARY STREQUAL picolibc)
369369
# and flags e.g. 'path/to/clang', '--target=armv6m-none-eabi',
370370
# '-march=armv6m'
371371
set(picolibc_flags "${LLVM_BINARY_DIR}/bin/clang${CMAKE_EXECUTABLE_SUFFIX} ${lib_compile_flags}")
372+
set(picolibcpp_flags "${LLVM_BINARY_DIR}/bin/clang++${CMAKE_EXECUTABLE_SUFFIX} ${lib_compile_flags}")
372373
if(CMAKE_C_COMPILER_LAUNCHER)
373374
set(picolibc_flags "${CMAKE_C_COMPILER_LAUNCHER} ${picolibc_flags}")
374375
endif()
375376
separate_arguments(picolibc_flags)
377+
separate_arguments(picolibcpp_flags)
376378
to_meson_list("${picolibc_flags}" picolibc_meson_flags)
379+
to_meson_list("${picolibcpp_flags}" picolibcpp_meson_flags)
377380

378381
if(ENABLE_LIBC_TESTS)
379382
set(picolibc_test_executor_bin ${CMAKE_CURRENT_SOURCE_DIR}/test-support/picolibc-test-wrapper.py)

arm-software/embedded/arm-runtimes/meson-cross-build.txt.in

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
[binaries]
22
c = [@picolibc_meson_flags@, '-nostdlib']
3+
cpp = [@picolibcpp_meson_flags@, '-nostdlib']
34
ar = '@LLVM_BINARY_DIR@/bin/llvm-ar@CMAKE_EXECUTABLE_SUFFIX@'
45
strip = '@LLVM_BINARY_DIR@/bin/llvm-strip@CMAKE_EXECUTABLE_SUFFIX@'
56
# only needed to run tests

0 commit comments

Comments
 (0)