commit:     3b08335ec801c4736369fa57bce00c1c8669682d
Author:     Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Tue Mar 12 07:57:41 2024 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Tue Mar 12 08:00:18 2024 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=3b08335e

sys-devel/llvm: filter LTO for GCC again

These failures aren't GCC specific but only GCC has these warnings implemented
and it's less likely that LLVM will miscompile itself because people will test
it more, even if the issue is UB in LLVM.

Filter to avoid people hitting roadblocks on a common package when using
safe LTO flags (-Werror=...).

Closes: https://bugs.gentoo.org/917536
Closes: https://bugs.gentoo.org/926529
Signed-off-by: Sam James <sam <AT> gentoo.org>

 sys-devel/llvm/llvm-17.0.6.ebuild             | 7 ++++++-
 sys-devel/llvm/llvm-18.1.0.ebuild             | 7 ++++++-
 sys-devel/llvm/llvm-19.0.0.9999.ebuild        | 7 ++++++-
 sys-devel/llvm/llvm-19.0.0_pre20240302.ebuild | 7 ++++++-
 sys-devel/llvm/llvm-19.0.0_pre20240309.ebuild | 7 ++++++-
 5 files changed, 30 insertions(+), 5 deletions(-)

diff --git a/sys-devel/llvm/llvm-17.0.6.ebuild 
b/sys-devel/llvm/llvm-17.0.6.ebuild
index c5159086d72c..bb3bd996f1e3 100644
--- a/sys-devel/llvm/llvm-17.0.6.ebuild
+++ b/sys-devel/llvm/llvm-17.0.6.ebuild
@@ -5,7 +5,7 @@ EAPI=8
 
 PYTHON_COMPAT=( python3_{10..12} )
 
-inherit cmake llvm.org multilib-minimal pax-utils python-any-r1
+inherit cmake flag-o-matic llvm.org multilib-minimal pax-utils python-any-r1
 inherit toolchain-funcs
 
 DESCRIPTION="Low Level Virtual Machine"
@@ -338,6 +338,11 @@ get_distribution_components() {
 }
 
 multilib_src_configure() {
+       # ODR violations (bug #917536, bug #926529). Just do it for GCC for now
+       # to avoid people grumbling. GCC is, anecdotally, more likely to 
miscompile
+       # LLVM with LTO anyway (which is not necessarily its fault).
+       tc-is-gcc && filter-lto
+
        local ffi_cflags ffi_ldflags
        if use libffi; then
                ffi_cflags=$($(tc-getPKG_CONFIG) --cflags-only-I libffi)

diff --git a/sys-devel/llvm/llvm-18.1.0.ebuild 
b/sys-devel/llvm/llvm-18.1.0.ebuild
index 4c955a46c3e0..af10d82f811a 100644
--- a/sys-devel/llvm/llvm-18.1.0.ebuild
+++ b/sys-devel/llvm/llvm-18.1.0.ebuild
@@ -5,7 +5,7 @@ EAPI=8
 
 PYTHON_COMPAT=( python3_{10..12} )
 
-inherit cmake llvm.org multilib-minimal pax-utils python-any-r1
+inherit cmake flag-o-matic llvm.org multilib-minimal pax-utils python-any-r1
 inherit toolchain-funcs
 
 DESCRIPTION="Low Level Virtual Machine"
@@ -346,6 +346,11 @@ get_distribution_components() {
 }
 
 multilib_src_configure() {
+       # ODR violations (bug #917536, bug #926529). Just do it for GCC for now
+       # to avoid people grumbling. GCC is, anecdotally, more likely to 
miscompile
+       # LLVM with LTO anyway (which is not necessarily its fault).
+       tc-is-gcc && filter-lto
+
        local ffi_cflags ffi_ldflags
        if use libffi; then
                ffi_cflags=$($(tc-getPKG_CONFIG) --cflags-only-I libffi)

diff --git a/sys-devel/llvm/llvm-19.0.0.9999.ebuild 
b/sys-devel/llvm/llvm-19.0.0.9999.ebuild
index 5031f93dd455..b4633658a186 100644
--- a/sys-devel/llvm/llvm-19.0.0.9999.ebuild
+++ b/sys-devel/llvm/llvm-19.0.0.9999.ebuild
@@ -5,7 +5,7 @@ EAPI=8
 
 PYTHON_COMPAT=( python3_{10..12} )
 
-inherit cmake llvm.org multilib-minimal pax-utils python-any-r1
+inherit cmake flag-o-matic llvm.org multilib-minimal pax-utils python-any-r1
 inherit toolchain-funcs
 
 DESCRIPTION="Low Level Virtual Machine"
@@ -345,6 +345,11 @@ get_distribution_components() {
 }
 
 multilib_src_configure() {
+       # ODR violations (bug #917536, bug #926529). Just do it for GCC for now
+       # to avoid people grumbling. GCC is, anecdotally, more likely to 
miscompile
+       # LLVM with LTO anyway (which is not necessarily its fault).
+       tc-is-gcc && filter-lto
+
        local ffi_cflags ffi_ldflags
        if use libffi; then
                ffi_cflags=$($(tc-getPKG_CONFIG) --cflags-only-I libffi)

diff --git a/sys-devel/llvm/llvm-19.0.0_pre20240302.ebuild 
b/sys-devel/llvm/llvm-19.0.0_pre20240302.ebuild
index 5031f93dd455..b4633658a186 100644
--- a/sys-devel/llvm/llvm-19.0.0_pre20240302.ebuild
+++ b/sys-devel/llvm/llvm-19.0.0_pre20240302.ebuild
@@ -5,7 +5,7 @@ EAPI=8
 
 PYTHON_COMPAT=( python3_{10..12} )
 
-inherit cmake llvm.org multilib-minimal pax-utils python-any-r1
+inherit cmake flag-o-matic llvm.org multilib-minimal pax-utils python-any-r1
 inherit toolchain-funcs
 
 DESCRIPTION="Low Level Virtual Machine"
@@ -345,6 +345,11 @@ get_distribution_components() {
 }
 
 multilib_src_configure() {
+       # ODR violations (bug #917536, bug #926529). Just do it for GCC for now
+       # to avoid people grumbling. GCC is, anecdotally, more likely to 
miscompile
+       # LLVM with LTO anyway (which is not necessarily its fault).
+       tc-is-gcc && filter-lto
+
        local ffi_cflags ffi_ldflags
        if use libffi; then
                ffi_cflags=$($(tc-getPKG_CONFIG) --cflags-only-I libffi)

diff --git a/sys-devel/llvm/llvm-19.0.0_pre20240309.ebuild 
b/sys-devel/llvm/llvm-19.0.0_pre20240309.ebuild
index 5031f93dd455..b4633658a186 100644
--- a/sys-devel/llvm/llvm-19.0.0_pre20240309.ebuild
+++ b/sys-devel/llvm/llvm-19.0.0_pre20240309.ebuild
@@ -5,7 +5,7 @@ EAPI=8
 
 PYTHON_COMPAT=( python3_{10..12} )
 
-inherit cmake llvm.org multilib-minimal pax-utils python-any-r1
+inherit cmake flag-o-matic llvm.org multilib-minimal pax-utils python-any-r1
 inherit toolchain-funcs
 
 DESCRIPTION="Low Level Virtual Machine"
@@ -345,6 +345,11 @@ get_distribution_components() {
 }
 
 multilib_src_configure() {
+       # ODR violations (bug #917536, bug #926529). Just do it for GCC for now
+       # to avoid people grumbling. GCC is, anecdotally, more likely to 
miscompile
+       # LLVM with LTO anyway (which is not necessarily its fault).
+       tc-is-gcc && filter-lto
+
        local ffi_cflags ffi_ldflags
        if use libffi; then
                ffi_cflags=$($(tc-getPKG_CONFIG) --cflags-only-I libffi)

Reply via email to