clang errors with __float128 is not supported on this target on ppc64le
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
gcc-8 (Ubuntu) |
Fix Released
|
Undecided
|
Matthias Klose | ||
Bionic |
Fix Released
|
Undecided
|
Unassigned |
Bug Description
Running Ubuntu cosmic on ppc64le, since the GCC 8 update I am unable to compile programs with clang that include cmath:
$ cat foo.cpp
#include <cmath>
int main() { }
$ clang++ foo.cpp
In file included from foo.cpp:1:
In file included from /usr/bin/
/usr/bin/
__float128 is not supported on this target
abs(__float128 __x)
^
/usr/bin/
__float128 is not supported on this target
__float128
^
2 errors generated.
GCC works fine. If I add -mfloat128, it fails with this error:
$ clang++ -mfloat128 foo.cpp
In file included from foo.cpp:1:
In file included from /usr/bin/
In file included from /usr/include/
/usr/include/
typedef _Complex float __cfloat128 __attribute__ ((__mode__ (__KC__)));
$ clang++ --version
clang version 6.0.1-2ubuntu1 (tags/RELEASE_
Target: powerpc64le-
libc6: 2.27-3ubuntu1
clang: 6.0-41ubuntu1
gcc: 4:8.1.0-2ubuntu1
ProblemType: Bug
DistroRelease: Ubuntu 18.10
Package: clang 1:6.0-41ubuntu1
Uname: Linux 4.18.0-
ApportVersion: 2.20.10-0ubuntu5
Architecture: ppc64el
Date: Thu Jul 26 16:27:16 2018
ProcEnviron:
TERM=xterm-
PATH=(custom, no user)
XDG_RUNTIME_
LANG=en_US.UTF-8
SHELL=/bin/bash
ProcLoadAvg: 0.15 1.70 2.08 1/1654 18418
ProcLocks:
1: FLOCK ADVISORY WRITE 4151 00:32:46558 0 EOF
2: FLOCK ADVISORY WRITE 3971 00:1a:62741 0 EOF
3: FLOCK ADVISORY WRITE 3418 00:32:85157 0 EOF
4: FLOCK ADVISORY WRITE 3104 00:17:44175 0 EOF
5: POSIX ADVISORY WRITE 3109 00:17:39081 0 EOF
ProcSwaps:
Filename Type Size Used Priority
/swapfile file 2097088 0 -2
ProcVersion: Linux version 4.18.0-
SourcePackage: llvm-defaults
UpgradeStatus: No upgrade log present (probably fresh install)
VarLogDump_list: total 0
cpu_cores: Number of cores present = 32
cpu_coreson: Number of cores online = 32
cpu_smt: SMT=4
The error is due to clang using this header:
/usr/include/ powerpc64le- linux-gnu/ c++/8/bits/ c++config. h
The difference between this header for gcc7 and gcc8:
--- /usr/include/ powerpc64le- linux-gnu/ c++/7/bits/ c++config. h 2018-07-20 21:27:51.000000000 +0930 powerpc64le- linux-gnu/ c++/8/bits/ c++config. h 2018-07-28 15:23:29.000000000 +0930 USE_FCHMODAT 1
+++ /usr/include/
@@ -1550,7 +1531,7 @@ namespace std
#define _GLIBCXX_
/* Define if __float128 is supported on this host. */ USE_FLOAT128 */ USE_FLOAT128 1
-/* #undef _GLIBCXX_
+#define _GLIBCXX_
/* Defined if gettimeofday is available. */ USE_GETTIMEOFDA Y 1
#define _GLIBCXX_
$ dpkg -S /usr/include/ powerpc64le- linux-gnu/ c++/8/bits/ c++config. h +-8-dev: ppc64el: /usr/include/ powerpc64le- linux-gnu/ c++/8/bits/ c++config. h
libstdc+
$ apt-cache policy libstdc++-8-dev
libstdc++-8-dev:
Installed: 8.2.0-1ubuntu2
Upstream gcc has this change to c++config which would fix clang:
/* Define if __float128 is supported on this host. */ __FLOAT128_ _) || defined( __SIZEOF_ FLOAT128_ _) USE_FLOAT128
#if defined(
#define _GLIBCXX_
#endif
https:/ /gcc.gnu. org/viewcvs/ gcc?view= revision& revision= 260043
PR libstdc++/84654 Disable __float128 specializations for -mno-float128
2018-05-01 Tulio Magno Quites Machado Filho <email address hidden>
PR libstdc++/84654 USE_FLOAT128. USE_FLOAT128. Makefile. am: Replace the value of _GLIBCXX_ USE_FLOAT128 Makefile. in: Regenerate. bits/c+ +config: Define _GLIBCXX_ USE_FLOAT128.
[! defined( __FLOAT128_ _) && !defined( __SIZEOF_ FLOAT128_ _)]: Undefine
_GLIBCXX_ USE_FLOAT128.
* acinclude.m4: Set ENABLE_FLOAT128 instead of _GLIBCXX_
* config.h.in: Remove references to _GLIBCXX_
* configure: Regenerate.
* include/
based on ENABLE_FLOAT128.
* include/
* include/