llvm-project icon indicating copy to clipboard operation
llvm-project copied to clipboard

[libc] {u}lkbits broken on riscv32

Open nickdesaulniers opened this issue 2 years ago • 4 comments

#114912 broke the riscv32 buildbot:

libc/src/stdfix/lkbits.cpp:16:10: error: no matching function for call to 'bit_cast' 16 | return cpp::bit_cast<long accum, int_lk_t>(x); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ llvm-project/libc/src/__support/CPP/bit.h:38:1: note: candidate template ignored: substitution failure [with To = long _Accum, From = int_lk_t]: implicit instantiation of undefined template '__llvm_libc_20_0_0_git::cpp::enable_if<false, long _Accum>' 38 | bit_cast(const From &from) { | ^

I'm going to disable this for now.

Reproducible via:

$ cmake ../runtimes -G Ninja -DLLVM_ENABLE_LLD=ON -DCMAKE_BUILD_TYPE=Debug -DLLVM_ENABLE_RUNTIMES="libc" -DLIBC_TARGET_TRIPLE=riscv32-linux-gnu -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++
$ ninja libc

cc @smallp-o-p

nickdesaulniers avatar Nov 11 '24 22:11 nickdesaulniers

@llvm/issue-subscribers-libc

Author: Nick Desaulniers (nickdesaulniers)

#114912 broke the riscv32 buildbot: ``` libc/src/stdfix/lkbits.cpp:16:10: error: no matching function for call to 'bit_cast' 16 | return cpp::bit_cast<long accum, int_lk_t>(x); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ llvm-project/libc/src/__support/CPP/bit.h:38:1: note: candidate template ignored: substitution failure [with To = long _Accum, From = int_lk_t]: implicit instantiation of undefined template '__llvm_libc_20_0_0_git::cpp::enable_if<false, long _Accum>' 38 | bit_cast(const From &from) { | ^ ``` I'm going to disable this for now.

Reproducible via:

$ cmake ../runtimes -G Ninja -DLLVM_ENABLE_LLD=ON -DCMAKE_BUILD_TYPE=Debug -DLLVM_ENABLE_RUNTIMES="libc" -DLIBC_TARGET_TRIPLE=riscv32-linux-gnu -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++
$ ninja libc

cc @smallp-o-p

llvmbot avatar Nov 11 '24 22:11 llvmbot

I'll investigate.

smallp-o-p avatar Nov 11 '24 22:11 smallp-o-p

argh ulkbits also has this issue

nickdesaulniers avatar Nov 11 '24 23:11 nickdesaulniers

Fixed by #115799

kaladron avatar Nov 07 '26 20:11 kaladron