Closed russeree closed 2 weeks ago
I've seen the same issue on my system, Fedora with GCC 14 C++ headers and Clang 18.
I could get it to work with --std=c++17
(which sets __STRICT_ANSI__
and thereby removes the references to __float128
in the headers) and using GCC 13 headers with --gcc-install-dir
.
The GCC 14 headers introduced another mention of __float128
that is not guarded by __STRICT__ANSI__
, which is why we see the error even with --std=c++17
.
I think the root cause of the problem is that clang sets __FLOAT128__
on x86(_64) Linux systems even when the CUDA target doesn't support it. We were just lucky in the past that the problematic parts of the GCC C++ headers were guarded by __STRICT_ANSI__
.
I think the logic that enables __FLOAT128__
is here. I guess it should be disabled in case we build for CUDA.
Should be fixed by https://github.com/llvm/llvm-project/pull/83918
@llvm/issue-subscribers-clang-frontend
Author: Portland.HODL (russeree)
Works with gcc-15: https://godbolt.org/z/EPYWaeTPW
Thanks for pointing this out. I can confirm the problem went away completely when switching to the current main
branch of LLVM. Any chance this fix will be backported for version 18?
My guess is that it's unlikely to happen. Post-release changes are usually limited to critical issues (https://llvm.org/docs/HowToReleaseLLVM.html#release-patch-rules) and this is not one of them, in general.
This problem had existed for a very long time, and went largely unnoticed because the libstdc++ headers installed by debian and ubuntu had patches to work around it, so it only affected the users who used pristine libstdc++ headers, and relatively few users did that.
My guess is that it's unlikely to happen. Post-release changes are usually limited to critical issues (https://llvm.org/docs/HowToReleaseLLVM.html#release-patch-rules) and this is not one of them, in general.
This problem had existed for a very long time, and went largely unnoticed because the libstdc++ headers installed by debian and ubuntu had patches to work around it, so it only affected the users who used pristine libstdc++ headers, and relatively few users did that.
switching to main solved this problem completely! Thank you so much!
Closing as fixed.
Hey currently I am having difficulty getting the Clang++ Cuda compiler to build anything on my instance of Arch Linux. The primary error being
error: __float128 is not supported on this target
System Specs
I have tried multiple versions of Clang and they all have the same behavior.
My Code
https://gist.github.com/russeree/4756646281b36fcf1825eaf28330136b
My Command
I have tried the other flags such as
These do not help at all
Errors
Full log in this gist https://gist.github.com/russeree/b77db6865093ee452f01ff797098a9fe