Skip to content

Commit 167b506

Browse files
[libcxx][ci] In picolib build, ask clang for the normalised triple (#90722)
This is needed for a workaround to make sure the link later succeeds. I don't know the reason for that but it is definitely needed. #89234 will/wants to correct the triple normalisation for -none- and this means that clang prior to 19, and clang 19 and above will have different answers and therefore different library paths. I don't want to bootstrap a clang just for libcxx CI, or require that anyone building for Arm do the same, so ask the compiler what the triple should be. This will be compatible with 17 and 19 when we do update to that version. I'm assuming $CC is what anyone locally would set to override the compiler, and `cc` is the binary name in our CI containers. It's not perfect but it should cover most use cases.
1 parent e312f07 commit 167b506

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

libcxx/utils/ci/run-buildbot

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,13 @@ function test-armv7m-picolibc() {
217217
"${@}"
218218

219219
${NINJA} -vC "${BUILD_DIR}/compiler-rt" install
220-
mv "${BUILD_DIR}/install/lib/armv7m-none-unknown-eabi"/* "${BUILD_DIR}/install/lib"
220+
221+
# Prior to clang 19, armv7m-none-eabi normalised to armv7m-none-unknown-eabi.
222+
# clang 19 changed this to armv7m-unknown-none-eabi. So for as long as 18.x
223+
# is supported, we have to ask clang what the triple will be.
224+
NORMALISED_TARGET_TRIPLE=$(${CC-cc} --target=armv7m-none-eabi -print-target-triple)
225+
# Without this step linking fails later in the build.
226+
mv "${BUILD_DIR}/install/lib/${NORMALISED_TARGET_TRIPLE}"/* "${BUILD_DIR}/install/lib"
221227

222228
check-runtimes
223229
}

0 commit comments

Comments
 (0)