-
Notifications
You must be signed in to change notification settings - Fork 10.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
libc/src/__support/FPUtil/FPBits.h:111:14
: error: no matching function for call to bit_cast
#74258
Comments
@llvm/issue-subscribers-libc Author: Petr Hosek (petrhosek)
I encountered the following error when trying to compile LLVM libc for baremetal riscv32 target:
```
/usr/local/google/home/phosek/llvm/llvm-project/build/baremetal/./bin/clang++ --target=riscv32-unknown-elf -DLIBC_NAMESPACE=__llvm_libc_18_0_0_git -D_DEBUG -D_FILE_OFFSET_BITS=64 -D_GLIBCXX_ASSERTIONS -D_LARGEFILE_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -I/usr/local/google/home/phosek/llvm/llvm-project/libc -isystem /usr/local/google/home/phosek/llvm/llvm-project/build/baremetal/include
/riscv32-unknown-elf --target=riscv32-unknown-elf -march=rv32imafc -mabi=ilp32f -fPIC -fno-semantic-interposition -fvisibility-inlines-hidden -Werror=date-time -Werror=unguarded-availability-new -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wmissing-field-initializers -Wimplicit-fallthrough -Wcovered-switch-default -Wno-noexcept-type -Wnon-virtual-dtor -Wdelete-non-virtual-dtor -Wsuggest-override -Wstrin
g-conversion -Wmisleading-indentation -Wctad-maybe-unsupported -ffunction-sections -fdata-sections -ffile-prefix-map=/usr/local/google/home/phosek/llvm/llvm-project/build/baremetal/runtimes/runtimes-riscv32-unknown-elf-bins=../../../../ -ffile-prefix-map=/usr/local/google/home/phosek/llvm/llvm-project/= -no-canonical-prefixes -O2 -g -DNDEBUG -std=gnu++17 --target=riscv32-unknown-elf -O2 -fpie -ffreestanding -fno-builtin -f
no-exceptions -fno-lax-vector-conversions -fno-unwind-tables -fno-asynchronous-unwind-tables -fno-rtti -Wall -Wextra -Wconversion -Wno-sign-conversion -Wimplicit-fallthrough -Wwrite-strings -Wextra-semi -Wnewline-eof -Wnonportable-system-include-path -Wstrict-prototypes -Wthread-safety -Wglobal-constructors -DLIBC_COPT_PUBLIC_PACKAGING -UNDEBUG -MD -MT libc/src/math/generic/CMakeFiles/libc.src.math.generic.fabsl.dir/fabsl.
cpp.obj -MF libc/src/math/generic/CMakeFiles/libc.src.math.generic.fabsl.dir/fabsl.cpp.obj.d -o libc/src/math/generic/CMakeFiles/libc.src.math.generic.fabsl.dir/fabsl.cpp.obj -c /usr/local/google/home/phosek/llvm/llvm-project/libc/src/math/generic/fabsl.cpp
In file included from /usr/local/google/home/phosek/llvm/llvm-project/libc/src/math/generic/fabsl.cpp:10:
In file included from /usr/local/google/home/phosek/llvm/llvm-project/libc/src/__support/FPUtil/BasicOperations.h:12:
/usr/local/google/home/phosek/llvm/llvm-project/libc/src/__support/FPUtil/FPBits.h:111:14: error: no matching function for call to 'bit_cast'
111 | : bits(cpp::bit_cast<UIntType>(x)) {}
| ^~~~~~~~~~~~~~~~~~~~~~~
/usr/local/google/home/phosek/llvm/llvm-project/libc/src/__support/FPUtil/BasicOperations.h:22:13: note: in instantiation of function template specialization '__llvm_libc_18_0_0_git::fputil::FPBits<long double>::FPBits<long double, 0>' requested here
22 | FPBits<T> bits(x);
| ^
/usr/local/google/home/phosek/llvm/llvm-project/libc/src/math/generic/fabsl.cpp:16:18: note: in instantiation of function template specialization '__llvm_libc_18_0_0_git::fputil::abs<long double, 0>' requested here
16 | return fputil::abs(x);
| ^
/usr/local/google/home/phosek/llvm/llvm-project/libc/src/__support/CPP/bit.h:36:26: note: candidate template ignored: substitution failure [with To = UIntType, From = long double, $2 = cpp::enable_if_t<sizeof(UIntType) == sizeof(long double)>]: implicit instantiation of undefined template '__llvm_libc_18_0_0_git::cpp::enable_if<false>'
36 | LIBC_INLINE constexpr To bit_cast(const From &from) {
| ^
1 error generated.
```
|
@llvm/issue-subscribers-backend-risc-v Author: Petr Hosek (petrhosek)
I encountered the following error when trying to compile LLVM libc for baremetal riscv32 target:
```
/usr/local/google/home/phosek/llvm/llvm-project/build/baremetal/./bin/clang++ --target=riscv32-unknown-elf -DLIBC_NAMESPACE=__llvm_libc_18_0_0_git -D_DEBUG -D_FILE_OFFSET_BITS=64 -D_GLIBCXX_ASSERTIONS -D_LARGEFILE_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -I/usr/local/google/home/phosek/llvm/llvm-project/libc -isystem /usr/local/google/home/phosek/llvm/llvm-project/build/baremetal/include
/riscv32-unknown-elf --target=riscv32-unknown-elf -march=rv32imafc -mabi=ilp32f -fPIC -fno-semantic-interposition -fvisibility-inlines-hidden -Werror=date-time -Werror=unguarded-availability-new -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wmissing-field-initializers -Wimplicit-fallthrough -Wcovered-switch-default -Wno-noexcept-type -Wnon-virtual-dtor -Wdelete-non-virtual-dtor -Wsuggest-override -Wstrin
g-conversion -Wmisleading-indentation -Wctad-maybe-unsupported -ffunction-sections -fdata-sections -ffile-prefix-map=/usr/local/google/home/phosek/llvm/llvm-project/build/baremetal/runtimes/runtimes-riscv32-unknown-elf-bins=../../../../ -ffile-prefix-map=/usr/local/google/home/phosek/llvm/llvm-project/= -no-canonical-prefixes -O2 -g -DNDEBUG -std=gnu++17 --target=riscv32-unknown-elf -O2 -fpie -ffreestanding -fno-builtin -f
no-exceptions -fno-lax-vector-conversions -fno-unwind-tables -fno-asynchronous-unwind-tables -fno-rtti -Wall -Wextra -Wconversion -Wno-sign-conversion -Wimplicit-fallthrough -Wwrite-strings -Wextra-semi -Wnewline-eof -Wnonportable-system-include-path -Wstrict-prototypes -Wthread-safety -Wglobal-constructors -DLIBC_COPT_PUBLIC_PACKAGING -UNDEBUG -MD -MT libc/src/math/generic/CMakeFiles/libc.src.math.generic.fabsl.dir/fabsl.
cpp.obj -MF libc/src/math/generic/CMakeFiles/libc.src.math.generic.fabsl.dir/fabsl.cpp.obj.d -o libc/src/math/generic/CMakeFiles/libc.src.math.generic.fabsl.dir/fabsl.cpp.obj -c /usr/local/google/home/phosek/llvm/llvm-project/libc/src/math/generic/fabsl.cpp
In file included from /usr/local/google/home/phosek/llvm/llvm-project/libc/src/math/generic/fabsl.cpp:10:
In file included from /usr/local/google/home/phosek/llvm/llvm-project/libc/src/__support/FPUtil/BasicOperations.h:12:
/usr/local/google/home/phosek/llvm/llvm-project/libc/src/__support/FPUtil/FPBits.h:111:14: error: no matching function for call to 'bit_cast'
111 | : bits(cpp::bit_cast<UIntType>(x)) {}
| ^~~~~~~~~~~~~~~~~~~~~~~
/usr/local/google/home/phosek/llvm/llvm-project/libc/src/__support/FPUtil/BasicOperations.h:22:13: note: in instantiation of function template specialization '__llvm_libc_18_0_0_git::fputil::FPBits<long double>::FPBits<long double, 0>' requested here
22 | FPBits<T> bits(x);
| ^
/usr/local/google/home/phosek/llvm/llvm-project/libc/src/math/generic/fabsl.cpp:16:18: note: in instantiation of function template specialization '__llvm_libc_18_0_0_git::fputil::abs<long double, 0>' requested here
16 | return fputil::abs(x);
| ^
/usr/local/google/home/phosek/llvm/llvm-project/libc/src/__support/CPP/bit.h:36:26: note: candidate template ignored: substitution failure [with To = UIntType, From = long double, $2 = cpp::enable_if_t<sizeof(UIntType) == sizeof(long double)>]: implicit instantiation of undefined template '__llvm_libc_18_0_0_git::cpp::enable_if<false>'
36 | LIBC_INLINE constexpr To bit_cast(const From &from) {
| ^
1 error generated.
```
|
On llvm-project/libc/src/__support/UInt128.h Lines 14 to 20 in dca432c
Because
llvm-project/libc/src/__support/UInt.h Line 33 in e0357e9
The So I see two options here:
edit: We have the same issue here
|
I think making |
Fix llvm#74258 This is a reland of llvm#74837
Fix #74258 This is a reland of #74837, the error went unnoticed because it compiles fine on clang-16 but not on clang-12 which is the version used on the buildbots. The fix was to explicitly initialize `BigInt` variables in `constexpr` operations: `BigInt<Bits, Signed> result(0);` instead of `BigInt<Bits, Signed> result;`
So unfortunately I think having
And if it's "mem-initialized" it is not trivially constructible anymore and so not |
This reverts the following commits: - a539a09 - 31316b3 Rationale for revert: llvm#74258 (comment)
@gchatelet can you try to build the whole project or that part with |
This reverts the following commits: - a539a09 - 31316b3 Rationale for revert: #74258 (comment)
I just reverted it but let me try your suggestion. Are you referring to this part of the standard? |
Yes, I think that's the one blocking your attempt. |
I'm running in a lot of errors when building with GCC-13 and C++20. I first thought it was because of poor compiler support but it seems it's well supported.
|
Yes, I also see them when trying gcc with |
This is a second take on llvm#74837 to fix llvm#74258
…cast-able to compatible types" (#74887) This reverts the following commits: - a539a090009378ecfcfbfaaa280eeac8f5b9d695 - 31316b3f8511d659cc14ebc72fb2b226f78478a9 Rationale for revert: llvm/llvm-project#74258 (comment) GitOrigin-RevId: 6ebf5b81158724c0d5de02bc191993deaa637284 Original-Revision: f272d26c79de7764c122dc4791e09ca4952ea857 Roller-URL: https://ci.chromium.org/b/8762210348997478881 CQ-Do-Not-Cancel-Tryjobs: true Change-Id: I57c504572ddd028abbd875332de10bcc367e6eb3 Reviewed-on: https://fuchsia-review.googlesource.com/c/fuchsia/+/958212
I encountered the following error when trying to compile LLVM libc for baremetal riscv32 target:
The text was updated successfully, but these errors were encountered: