[libcxx-commits] [libcxx] [libcxx][ci] In picolib build, ask clang for the normalised triple (PR #90722)
via libcxx-commits
libcxx-commits at lists.llvm.org
Wed May 1 03:54:08 PDT 2024
llvmbot wrote:
<!--LLVM PR SUMMARY COMMENT-->
@llvm/pr-subscribers-libcxx
Author: David Spickett (DavidSpickett)
<details>
<summary>Changes</summary>
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.
https://github.com/llvm/llvm-project/pull/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.
---
Full diff: https://github.com/llvm/llvm-project/pull/90722.diff
1 Files Affected:
- (modified) libcxx/utils/ci/run-buildbot (+13-1)
``````````diff
diff --git a/libcxx/utils/ci/run-buildbot b/libcxx/utils/ci/run-buildbot
index 60307a7d4f350a..132c98486de430 100755
--- a/libcxx/utils/ci/run-buildbot
+++ b/libcxx/utils/ci/run-buildbot
@@ -217,7 +217,19 @@ function test-armv7m-picolibc() {
"${@}"
${NINJA} -vC "${BUILD_DIR}/compiler-rt" install
- mv "${BUILD_DIR}/install/lib/armv7m-none-unknown-eabi"/* "${BUILD_DIR}/install/lib"
+
+ # Prior to clang 19, armv7m-none-eabi normalised to armv7m-none-unknown-eabi.
+ # clang 19 changed this to armv7m-unknown-none-eabi. So for as long as 18.x
+ # is supported, we have to ask clang what the triple will be.
+ if [ ! -z "${CC}" ]
+ then
+ C_COMPILER=${CC};
+ else
+ C_COMPILER=cc;
+ fi
+ NORMALISED_TARGET_TRIPLE=$(${C_COMPILER} --target=armv7m-none-eabi -print-target-triple)
+ # Without this step linking fails later in the build.
+ mv "${BUILD_DIR}/install/lib/${NORMALISED_TARGET_TRIPLE}"/* "${BUILD_DIR}/install/lib"
check-runtimes
}
``````````
</details>
https://github.com/llvm/llvm-project/pull/90722
More information about the libcxx-commits
mailing list