summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichał Górny <mgorny@gentoo.org>2018-03-10 21:48:02 +0100
committerMichał Górny <mgorny@gentoo.org>2018-03-10 21:48:34 +0100
commitdeda94ea9dfc8e43ece0a6bd7190ba67147ec08e (patch)
tree90bb61b615596e68f6031300ae29ceaee17b6892 /sys-devel
parentsys-devel/gdb: bump the patchset up to 1, bug #650130 (diff)
downloadgentoo-deda94ea9dfc8e43ece0a6bd7190ba67147ec08e.tar.gz
gentoo-deda94ea9dfc8e43ece0a6bd7190ba67147ec08e.tar.bz2
gentoo-deda94ea9dfc8e43ece0a6bd7190ba67147ec08e.zip
sys-devel/llvm: Apply -mno-bmi to work-around gcc-7 bug
Thanks to Alexander Bezrukov for finding the upstream bug and suggesting a proper workaround. Closes: https://bugs.gentoo.org/649880
Diffstat (limited to 'sys-devel')
-rw-r--r--sys-devel/llvm/llvm-6.0.0.ebuild16
-rw-r--r--sys-devel/llvm/llvm-6.0.9999.ebuild7
-rw-r--r--sys-devel/llvm/llvm-9999.ebuild7
3 files changed, 21 insertions, 9 deletions
diff --git a/sys-devel/llvm/llvm-6.0.0.ebuild b/sys-devel/llvm/llvm-6.0.0.ebuild
index f38524606bb8..cf9585069ad3 100644
--- a/sys-devel/llvm/llvm-6.0.0.ebuild
+++ b/sys-devel/llvm/llvm-6.0.0.ebuild
@@ -75,15 +75,6 @@ S=${WORKDIR}/${P/_/}.src
# least intrusive of all
CMAKE_BUILD_TYPE=RelWithDebInfo
-pkg_pretend() {
- if tc-is-gcc && [[ $(gcc-major-version) -ge 7 ]]; then
- eerror "GCC 7 is known to cause mis-compilation that causes the build to hang."
- eerror "Please use an older version to build LLVM until a good solution is found."
- eerror "Bug report: https://bugs.gentoo.org/649880"
- die "GCC-7+ is not supported"
- fi
-}
-
src_prepare() {
# Fix llvm-config for shared linking and sane flags
# https://bugs.gentoo.org/show_bug.cgi?id=565358
@@ -179,6 +170,13 @@ multilib_src_configure() {
)
fi
+ # workaround BMI bug in gcc-7 (fixed in 7.4)
+ # https://bugs.gentoo.org/649880
+ if tc-is-gcc && [[ $(gcc-major-version) -eq 7 && $(gcc-minor-version) -lt 4 ]]; then
+ local CFLAGS="${CFLAGS} -mno-bmi"
+ local CXXFLAGS="${CXXFLAGS} -mno-bmi"
+ fi
+
# LLVM_ENABLE_ASSERTIONS=NO does not guarantee this for us, #614844
use debug || local -x CPPFLAGS="${CPPFLAGS} -DNDEBUG"
cmake-utils_src_configure
diff --git a/sys-devel/llvm/llvm-6.0.9999.ebuild b/sys-devel/llvm/llvm-6.0.9999.ebuild
index 38353f69eef9..631422bd1ad4 100644
--- a/sys-devel/llvm/llvm-6.0.9999.ebuild
+++ b/sys-devel/llvm/llvm-6.0.9999.ebuild
@@ -170,6 +170,13 @@ multilib_src_configure() {
)
fi
+ # workaround BMI bug in gcc-7 (fixed in 7.4)
+ # https://bugs.gentoo.org/649880
+ if tc-is-gcc && [[ $(gcc-major-version) -eq 7 && $(gcc-minor-version) -lt 4 ]]; then
+ local CFLAGS="${CFLAGS} -mno-bmi"
+ local CXXFLAGS="${CXXFLAGS} -mno-bmi"
+ fi
+
# LLVM_ENABLE_ASSERTIONS=NO does not guarantee this for us, #614844
use debug || local -x CPPFLAGS="${CPPFLAGS} -DNDEBUG"
cmake-utils_src_configure
diff --git a/sys-devel/llvm/llvm-9999.ebuild b/sys-devel/llvm/llvm-9999.ebuild
index 603571a0bd65..1c439e6fd6a5 100644
--- a/sys-devel/llvm/llvm-9999.ebuild
+++ b/sys-devel/llvm/llvm-9999.ebuild
@@ -172,6 +172,13 @@ multilib_src_configure() {
)
fi
+ # workaround BMI bug in gcc-7 (fixed in 7.4)
+ # https://bugs.gentoo.org/649880
+ if tc-is-gcc && [[ $(gcc-major-version) -eq 7 && $(gcc-minor-version) -lt 4 ]]; then
+ local CFLAGS="${CFLAGS} -mno-bmi"
+ local CXXFLAGS="${CXXFLAGS} -mno-bmi"
+ fi
+
# LLVM_ENABLE_ASSERTIONS=NO does not guarantee this for us, #614844
use debug || local -x CPPFLAGS="${CPPFLAGS} -DNDEBUG"
cmake-utils_src_configure