<table border="1" cellspacing="0" cellpadding="8">
    <tr>
        <th>Issue</th>
        <td>
            <a href=https://github.com/llvm/llvm-project/issues/63899>63899</a>
        </td>
    </tr>

    <tr>
        <th>Summary</th>
        <td>
            compiler-rt can't build on mipsel `Cannot find builtins library for the target architecture`
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            compiler-rt,
            backend:MIPS,
            build-problem
      </td>
    </tr>

    <tr>
      <th>Assignees</th>
      <td>
      </td>
    </tr>

    <tr>
      <th>Reporter</th>
      <td>
          sylvestre
      </td>
    </tr>
</table>

<pre>
    With 16.0.6

Working on a fix for
https://buildd.debian.org/status/fetch.php?pkg=llvm-toolchain-16&arch=mips64el&ver=1%3A16.0.6-4&stamp=1689111818&raw=0

After https://reviews.llvm.org/D155409
it fails with:
```
-- Building with -fPIC
-- LLVM host triple: mipsel-unknown-linux-gnu
-- LLVM default target triple: mipsel-unknown-linux-gnu
-- Using libc++abi testing configuration: /home/sylvestre/llvm-toolchain-16-16.0.6/libcxxabi/test/configs/llvm-libc++abi-shared.cfg.in
-- Could not find ParallelSTL, libc++abi will not attempt to use it but the build may fail if the libc++ in use needs it to be available.
-- Using libc++ testing configuration: /home/sylvestre/llvm-toolchain-16-16.0.6/libcxx/test/configs/llvm-libc++-shared.cfg.in
-- ABI list file not generated for configuration mipsel-unknown-linux-gnu.libcxxabi.v1.stable.exceptions.nonew, `check-cxx-abilist` will not be available.
-- Performing Test -ftrivial-auto-var-init=pattern
-- Performing Test -ftrivial-auto-var-init=pattern - Failed
-- Compiler-RT supported architectures: mipsel;mips64el
-- Supported architectures for crt:
CMake Error at /home/sylvestre/llvm-toolchain-16-16.0.6/compiler-rt/cmake/Modules/AddCompilerRT.cmake:292 (message):
  Cannot find builtins library for the target architecture
Call Stack (most recent call first):
 /home/sylvestre/llvm-toolchain-16-16.0.6/compiler-rt/lib/stats/CMakeLists.txt:23 (add_compiler_rt_runtime)
```

the cmake command:`
cd /home/sylvestre/llvm-toolchain-16-16.0.6/build-llvm/runtimes/runtimes-bins && /usr/bin/cmake "-DCMAKE_C_FLAGS=-fstack-protector-strong -Wformat -Werror=format-security -Wno-unused-command-line-argument -Wdate-time -D_FORTIFY_SOURCE=2" "-DCMAKE_CXX_FLAGS=-fstack-protector-strong -Wformat -Werror=format-security -Wno-unused-command-line-argument -Wdate-time -D_FORTIFY_SOURCE=2" "-DCMAKE_EXE_LINKER_FLAGS=-Wl,-z,relro -Wl,--build-id -latomic" "-DCMAKE_SHARED_LINKER_FLAGS=-Wl,-z,relro -Wl,--build-id -latomic" "-DCMAKE_MODULE_LINKER_FLAGS=-Wl,-z,relro -Wl,--build-id -latomic" -DCMAKE_BUILD_TYPE=Release -DLLVM_ENABLE_PER_TARGET_RUNTIME_DIR=OFF -DCMAKE_C_COMPILER=/home/sylvestre/llvm-toolchain-16-16.0.6/build-llvm/./bin/clang -DCMAKE_CXX_COMPILER=/home/sylvestre/llvm-toolchain-16-16.0.6/build-llvm/./bin/clang++ -DCMAKE_ASM_COMPILER=/home/sylvestre/llvm-toolchain-16-16.0.6/build-llvm/./bin/clang -DCMAKE_LINKER=/home/sylvestre/llvm-toolchain-16-16.0.6/build-llvm/./bin/ld.lld -DCMAKE_AR=/home/sylvestre/llvm-toolchain-16-16.0.6/build-llvm/./bin/llvm-ar -DCMAKE_RANLIB=/home/sylvestre/llvm-toolchain-16-16.0.6/build-llvm/./bin/llvm-ranlib -DCMAKE_NM=/home/sylvestre/llvm-toolchain-16-16.0.6/build-llvm/./bin/llvm-nm -DCMAKE_OBJDUMP=/home/sylvestre/llvm-toolchain-16-16.0.6/build-llvm/./bin/llvm-objdump -DCMAKE_OBJCOPY=/home/sylvestre/llvm-toolchain-16-16.0.6/build-llvm/./bin/llvm-objcopy -DCMAKE_STRIP=/home/sylvestre/llvm-toolchain-16-16.0.6/build-llvm/./bin/llvm-strip -DCMAKE_READELF=/home/sylvestre/llvm-toolchain-16-16.0.6/build-llvm/./bin/llvm-readelf -DCMAKE_C_COMPILER_TARGET=mipsel-unknown-linux-gnu -DCMAKE_CXX_COMPILER_TARGET=mipsel-unknown-linux-gnu -DCMAKE_ASM_COMPILER_TARGET=mipsel-unknown-linux-gnu -DCMAKE_INSTALL_PREFIX=/usr/lib/llvm-16 -DLLVM_BINARY_DIR=/home/sylvestre/llvm-toolchain-16-16.0.6/build-llvm -DLLVM_CONFIG_PATH=/home/sylvestre/llvm-toolchain-16-16.0.6/build-llvm/bin/llvm-config -DLLVM_ENABLE_WERROR=OFF -DLLVM_HOST_TRIPLE=mipsel-unknown-linux-gnu -DLLVM_HAVE_LINK_VERSION_SCRIPT=1 -DLLVM_USE_RELATIVE_PATHS_IN_DEBUG_INFO=ON -DLLVM_USE_RELATIVE_PATHS_IN_FILES=ON -DLLVM_LIT_ARGS=-sv -DLLVM_SOURCE_PREFIX= -DPACKAGE_VERSION=16.0.6 -DCMAKE_BUILD_TYPE=Release -DCMAKE_MAKE_PROGRAM=/usr/bin/ninja -DCMAKE_C_COMPILER_LAUNCHER= -DCMAKE_CXX_COMPILER_LAUNCHER= -DCMAKE_EXPORT_COMPILE_COMMANDS=1 -DCOMPILER_RT_BUILD_BUILTINS=Off -DLLVM_INCLUDE_TESTS=ON -DLLVM_DEFAULT_TARGET_TRIPLE=mipsel-unknown-linux-gnu -DLLVM_ENABLE_PROJECTS_USED=ON -DLLVM_ENABLE_PER_TARGET_RUNTIME_DIR=ON -DLLVM_BUILD_TOOLS=ON -DCMAKE_SYSTEM_PROCESSOR=mips -DCMAKE_C_COMPILER_WORKS=ON -DCMAKE_CXX_COMPILER_WORKS=ON -DCMAKE_ASM_COMPILER_WORKS=ON -DHAVE_LLVM_LIT=ON "-DCMAKE_C_FLAGS=-fstack-protector-strong -Wformat -Werror=format-security -Wno-unused-command-line-argument -Wdate-time -D_FORTIFY_SOURCE=2" "-DCMAKE_CXX_FLAGS=-fstack-protector-strong -Wformat -Werror=format-security -Wno-unused-command-line-argument -Wdate-time -D_FORTIFY_SOURCE=2" "-DCMAKE_EXE_LINKER_FLAGS=-Wl,-z,relro -Wl,--build-id -latomic" "-DCMAKE_SHARED_LINKER_FLAGS=-Wl,-z,relro -Wl,--build-id -latomic" "-DCMAKE_MODULE_LINKER_FLAGS=-Wl,-z,relro -Wl,--build-id -latomic" -DCMAKE_BUILD_TYPE=Release -DLLVM_ENABLE_PER_TARGET_RUNTIME_DIR=OFF "-DLLVM_ENABLE_RUNTIMES=compiler-rt;libcxx;libcxxabi" -DCOMPILER_RT_BUILD_XRAY=OFF -DCOMPILER_RT_INCLUDE_TESTS=OFF -DCOMPILER_RT_USE_BUILTINS_LIBRARY=ON -DCOMPILER_RT_USE_LIBCXX=OFF -DLIBCXXABI_ENABLE_EXCEPTIONS=ON -DLIBCXXABI_INSTALL_LIBRARY=OFF -DLIBCXXABI_USE_COMPILER_RT=OFF-DLIBCXX_ENABLE_EXCEPTIONS=ON -DLIBCXX_ENABLE_STATIC_ABI_LIBRARY=ON -DLIBCXX_INSTALL_LIBRARY=OFF -DLIBCXX_STATICALLY_LINK_ABI_IN_SHARED_LIBRARY=OFF -DLIBCXX_STATICALLY_LINK_ABI_IN_STATIC_LIBRARY=ON -DLIBCXX_USE_COMPILER_RT=OFF -DLIBCXXABI_ENABLE_EXCEPTIONS=ON -DLIBCXXABI_INSTALL_LIBRARY=OFF -DLIBCXXABI_USE_COMPILER_RT=OFF -DRUNTIMES_BUILD_BUILTINS=ON "-DRUNTIMES_CMAKE_ARGS=-DCMAKE_C_FLAGS=-fstack-protector-strong -Wformat -Werror=format-security -Wno-unused-command-line-argument -Wdate-time -D_FORTIFY_SOURCE=2;-DCMAKE_CXX_FLAGS=-fstack-protector-strong -Wformat -Werror=format-security -Wno-unused-command-line-argument -Wdate-time -D_FORTIFY_SOURCE=2;-DCMAKE_EXE_LINKER_FLAGS=-Wl,-z,relro -Wl,--build-id -latomic;-DCMAKE_SHARED_LINKER_FLAGS=-Wl,-z,relro -Wl,--build-id -latomic;-DCMAKE_MODULE_LINKER_FLAGS=-Wl,-z,relro -Wl,--build-id -latomic;-DCMAKE_BUILD_TYPE=Release;-DLLVM_ENABLE_PER_TARGET_RUNTIME_DIR=OFF" -GNinja -S /home/sylvestre/llvm-toolchain-16-16.0.6/llvm/runtimes/../../runtimes -B /home/sylvestre/llvm-toolchain-16-16.0.6/build-llvm/runtimes/runtimes-bins && /usr/bin/cmake -E touch /home/sylvestre/llvm-toolchain-16-16.0.6/build-llvm/runtimes/runtimes-stamps/runtimes-configure
`

@MaskRay @phosek rings a bell ?

</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJzsWVlzm74W_zTKi0YeWzhO_OAHzJLyL14GcJM8MQKErUYGjySy3E9_RyxeUndJk97bh_9Mh8bSWX7nd46OhCBSsnVB6QRcTsGlfUEqtSnFRL7wRyqVoBdJmb1MbpnawMGo1--NQN8GfbN53pbigRVrWBaQwJw9w7wUzcxGqZ0EhgmwC7CbVIxnWS-jCSNFrxRrgF2piKokwG5OVbrp7TY7YLi7hzUwbM4ft0iVJU83hBVoMAJ4RES6AYa9ZTs5GlIO8OiRCmDYA4AvDbOBhoYAj6Qi252eGF2PB4PB9eAa4JEgT8Cw-8fYzVxRAU9xCvrI6JPsaQAtTHtweTnsjxsdpmBOGJfwiamN1mrsjfrtv_onQnCq49XEaDmI8qVn7ed8_8sMbkqpoBJsxykwTKijohxVxUNRPhWIs6J6RuuiOlXKaE4qrqAiYk3fpL6SGgxnSQrwFOApSRhUVCo9mpZFztaVIIqVhbYGsLspt1SnqCsCgN1vcoLacsCutvv8TBIGsKutAuw2RmWnd-IZyQ0RNOul-brHij1Gq6x4BotSwZwVGVwSQTinPIx8gK1X2J8Y57UoUYpudwqqElaSQqZgUimoNhTWJQe35KXOGGR5PXowA1lRqxSUZlIrqhImFJJHwjhJOO19l7wPZ-4XaPsOZ-bUg5xJTRmnNSFrWlBBFM30UjxF-N0y6e0T2Hsc9KSqw6fPKd1pNdkryoI-6SSAUT_d0PQBpc_PiCRMuwaj_iEd5wlcUpGXYqsp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