sys-devel/clang-common: add USE=ieee-long-double

Bug: https://bugs.gentoo.org/882815
Bug: https://bugs.gentoo.org/884395
Signed-off-by: Georgy Yakovlev <gyakovlev@gentoo.org>
This commit is contained in:
Georgy Yakovlev
2022-12-05 13:13:18 -08:00
parent 2dfc3ef256
commit ef7ca111bc
7 changed files with 85 additions and 6 deletions

View File

@@ -12,7 +12,7 @@ LICENSE="Apache-2.0-with-LLVM-exceptions UoI-NCSA"
SLOT="0"
KEYWORDS="amd64 arm arm64 ppc ppc64 ~riscv sparc x86 ~amd64-linux ~ppc-macos ~x64-macos"
IUSE="
default-compiler-rt default-libcxx default-lld llvm-libunwind
default-compiler-rt default-libcxx default-lld ieee-long-double llvm-libunwind
stricter
"
@@ -88,6 +88,19 @@ src_install() {
@gentoo-gcc-install.cfg
EOF
# needed until https://reviews.llvm.org/D117181#3266224 is done.
# silently drop support on musl even if enabled, it does not support it.
if use ppc64 && use ieee-long-double && ! use elibc_musl; then
newins - gentoo-ppc64le-ieeelongdouble.cfg <<-EOF
# This file forces 128bit long double on ppc64le systems.
-mabi=ieeelongdouble
EOF
cat >> "${ED}/etc/clang/gentoo-common.cfg" <<-EOF || die
@gentoo-ppc64le-ieeelongdouble.cfg
EOF
fi
if use stricter; then
newins - gentoo-stricter.cfg <<-EOF
# This file increases the strictness of older clang versions

View File

@@ -12,7 +12,7 @@ LICENSE="Apache-2.0-with-LLVM-exceptions UoI-NCSA"
SLOT="0"
KEYWORDS=""
IUSE="
default-compiler-rt default-libcxx default-lld llvm-libunwind
default-compiler-rt default-libcxx default-lld ieee-long-double llvm-libunwind
stricter
"
@@ -88,6 +88,19 @@ src_install() {
@gentoo-gcc-install.cfg
EOF
# needed until https://reviews.llvm.org/D117181#3266224 is done.
# silently drop support on musl even if enabled, it does not support it.
if use ppc64 && use ieee-long-double && ! use elibc_musl; then
newins - gentoo-ppc64le-ieeelongdouble.cfg <<-EOF
# This file forces 128bit long double on ppc64le systems.
-mabi=ieeelongdouble
EOF
cat >> "${ED}/etc/clang/gentoo-common.cfg" <<-EOF || die
@gentoo-ppc64le-ieeelongdouble.cfg
EOF
fi
if use stricter; then
newins - gentoo-stricter.cfg <<-EOF
# This file increases the strictness of older clang versions

View File

@@ -12,7 +12,7 @@ LICENSE="Apache-2.0-with-LLVM-exceptions UoI-NCSA"
SLOT="0"
KEYWORDS="amd64 ~arm arm64 ~ppc ~ppc64 ~riscv ~sparc ~x86 ~amd64-linux ~ppc-macos ~x64-macos"
IUSE="
default-compiler-rt default-libcxx default-lld llvm-libunwind
default-compiler-rt default-libcxx default-lld ieee-long-double llvm-libunwind
stricter
"
@@ -88,6 +88,19 @@ src_install() {
@gentoo-gcc-install.cfg
EOF
# needed until https://reviews.llvm.org/D117181#3266224 is done.
# silently drop support on musl even if enabled, it does not support it.
if use ppc64 && use ieee-long-double && ! use elibc_musl; then
newins - gentoo-ppc64le-ieeelongdouble.cfg <<-EOF
# This file forces 128bit long double on ppc64le systems.
-mabi=ieeelongdouble
EOF
cat >> "${ED}/etc/clang/gentoo-common.cfg" <<-EOF || die
@gentoo-ppc64le-ieeelongdouble.cfg
EOF
fi
if use stricter; then
newins - gentoo-stricter.cfg <<-EOF
# This file increases the strictness of older clang versions

View File

@@ -12,7 +12,7 @@ LICENSE="Apache-2.0-with-LLVM-exceptions UoI-NCSA"
SLOT="0"
KEYWORDS=""
IUSE="
default-compiler-rt default-libcxx default-lld llvm-libunwind
default-compiler-rt default-libcxx default-lld ieee-long-double llvm-libunwind
stricter
"
@@ -88,6 +88,19 @@ src_install() {
@gentoo-gcc-install.cfg
EOF
# needed until https://reviews.llvm.org/D117181#3266224 is done.
# silently drop support on musl even if enabled, it does not support it.
if use ppc64 && use ieee-long-double && ! use elibc_musl; then
newins - gentoo-ppc64le-ieeelongdouble.cfg <<-EOF
# This file forces 128bit long double on ppc64le systems.
-mabi=ieeelongdouble
EOF
cat >> "${ED}/etc/clang/gentoo-common.cfg" <<-EOF || die
@gentoo-ppc64le-ieeelongdouble.cfg
EOF
fi
if use stricter; then
newins - gentoo-stricter.cfg <<-EOF
# This file increases the strictness of older clang versions

View File

@@ -12,7 +12,7 @@ LICENSE="Apache-2.0-with-LLVM-exceptions UoI-NCSA"
SLOT="0"
KEYWORDS="~loong"
IUSE="
default-compiler-rt default-libcxx default-lld llvm-libunwind
default-compiler-rt default-libcxx default-lld ieee-long-double llvm-libunwind
stricter
"
@@ -88,6 +88,19 @@ src_install() {
@gentoo-gcc-install.cfg
EOF
# needed until https://reviews.llvm.org/D117181#3266224 is done.
# silently drop support on musl even if enabled, it does not support it.
if use ppc64 && use ieee-long-double && ! use elibc_musl; then
newins - gentoo-ppc64le-ieeelongdouble.cfg <<-EOF
# This file forces 128bit long double on ppc64le systems.
-mabi=ieeelongdouble
EOF
cat >> "${ED}/etc/clang/gentoo-common.cfg" <<-EOF || die
@gentoo-ppc64le-ieeelongdouble.cfg
EOF
fi
if use stricter; then
newins - gentoo-stricter.cfg <<-EOF
# This file increases the strictness of older clang versions

View File

@@ -12,7 +12,7 @@ LICENSE="Apache-2.0-with-LLVM-exceptions UoI-NCSA"
SLOT="0"
KEYWORDS="~loong"
IUSE="
default-compiler-rt default-libcxx default-lld llvm-libunwind
default-compiler-rt default-libcxx default-lld ieee-long-double llvm-libunwind
stricter
"
@@ -88,6 +88,19 @@ src_install() {
@gentoo-gcc-install.cfg
EOF
# needed until https://reviews.llvm.org/D117181#3266224 is done.
# silently drop support on musl even if enabled, it does not support it.
if use ppc64 && use ieee-long-double && ! use elibc_musl; then
newins - gentoo-ppc64le-ieeelongdouble.cfg <<-EOF
# This file forces 128bit long double on ppc64le systems.
-mabi=ieeelongdouble
EOF
cat >> "${ED}/etc/clang/gentoo-common.cfg" <<-EOF || die
@gentoo-ppc64le-ieeelongdouble.cfg
EOF
fi
if use stricter; then
newins - gentoo-stricter.cfg <<-EOF
# This file increases the strictness of older clang versions

View File

@@ -11,6 +11,7 @@
<flag name="default-compiler-rt">Use compiler-rt + libunwind instead of libgcc as the default rtlib for clang</flag>
<flag name="default-libcxx">Use libc++ instead of libstdc++ as the default stdlib for clang</flag>
<flag name="default-lld">Use lld as the default linker for clang</flag>
<flag name="ieee-long-double">Use accelerated 128-bit IEEE long double ABI (ppc64le only)</flag>
<flag name="stricter">Default to stricter behavior known from newer clang versions, turning more warnings into errors</flag>
</use>
</pkgmetadata>