commit:     231fb829f816206e368c83c44e3f3a175b217918
Author:     Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Wed Jan 10 11:21:09 2024 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Wed Jan 10 11:21:57 2024 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=231fb829

dev-libs/xerces-c: disable strict aliasing, filter LTO

It's only in the tests but it implies they're not testing it at all.

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

 .../xerces-c/files/xerces-c-3.2.4-strict-aliasing.patch   | 13 +++++++++++++
 .../{xerces-c-9999.ebuild => xerces-c-3.2.4-r3.ebuild}    | 15 +++++++++++----
 dev-libs/xerces-c/xerces-c-9999.ebuild                    | 15 +++++++++++----
 3 files changed, 35 insertions(+), 8 deletions(-)

diff --git a/dev-libs/xerces-c/files/xerces-c-3.2.4-strict-aliasing.patch 
b/dev-libs/xerces-c/files/xerces-c-3.2.4-strict-aliasing.patch
new file mode 100644
index 000000000000..18483070e736
--- /dev/null
+++ b/dev-libs/xerces-c/files/xerces-c-3.2.4-strict-aliasing.patch
@@ -0,0 +1,13 @@
+https://bugs.gentoo.org/856100
+--- a/cmake/XercesWarnings.cmake
++++ b/cmake/XercesWarnings.cmake
+@@ -50,8 +50,7 @@ if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU" OR
+       -Wswitch-default
+       -Wunused-variable
+       -Wwrite-strings
+-      -Wno-variadic-macros
+-      -fstrict-aliasing)
++      -Wno-variadic-macros)
+   if(extra-warnings)
+     list(APPEND test_flags
+         -Wfloat-equal

diff --git a/dev-libs/xerces-c/xerces-c-9999.ebuild 
b/dev-libs/xerces-c/xerces-c-3.2.4-r3.ebuild
similarity index 89%
copy from dev-libs/xerces-c/xerces-c-9999.ebuild
copy to dev-libs/xerces-c/xerces-c-3.2.4-r3.ebuild
index 4b24ee3df5d8..fea427072055 100644
--- a/dev-libs/xerces-c/xerces-c-9999.ebuild
+++ b/dev-libs/xerces-c/xerces-c-3.2.4-r3.ebuild
@@ -1,11 +1,11 @@
-# Copyright 1999-2023 Gentoo Authors
+# Copyright 1999-2024 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
 EAPI=8
 
-inherit cmake prefix
+inherit cmake flag-o-matic prefix
 
-DESCRIPTION="A validating XML parser written in a portable subset of C++"
+DESCRIPTION="Validating XML parser written in a portable subset of C++"
 HOMEPAGE="https://xerces.apache.org/xerces-c/";
 
 if [[ ${PV} == *9999 ]] ; then
@@ -33,7 +33,10 @@ BDEPEND="
 
 DOCS=( CREDITS KEYS NOTICE README )
 
-PATCHES=( "${FILESDIR}"/${PN}-3.2.2-fix-XERCESC-2163.patch )
+PATCHES=(
+       "${FILESDIR}"/${PN}-3.2.2-fix-XERCESC-2163.patch
+       "${FILESDIR}"/${PN}-3.2.4-strict-aliasing.patch
+)
 
 pkg_setup() {
        export ICUROOT="${EPREFIX}/usr"
@@ -45,6 +48,10 @@ pkg_setup() {
 }
 
 src_configure() {
+       # bug #856100
+       filter-lto
+       append-flags -fno-strict-aliasing
+
        # 'cfurl' is only available on OSX and 'socket' isn't supposed to work.
        # But the docs aren't clear about it, so we would need some testing...
        local netaccessor

diff --git a/dev-libs/xerces-c/xerces-c-9999.ebuild 
b/dev-libs/xerces-c/xerces-c-9999.ebuild
index 4b24ee3df5d8..fea427072055 100644
--- a/dev-libs/xerces-c/xerces-c-9999.ebuild
+++ b/dev-libs/xerces-c/xerces-c-9999.ebuild
@@ -1,11 +1,11 @@
-# Copyright 1999-2023 Gentoo Authors
+# Copyright 1999-2024 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
 EAPI=8
 
-inherit cmake prefix
+inherit cmake flag-o-matic prefix
 
-DESCRIPTION="A validating XML parser written in a portable subset of C++"
+DESCRIPTION="Validating XML parser written in a portable subset of C++"
 HOMEPAGE="https://xerces.apache.org/xerces-c/";
 
 if [[ ${PV} == *9999 ]] ; then
@@ -33,7 +33,10 @@ BDEPEND="
 
 DOCS=( CREDITS KEYS NOTICE README )
 
-PATCHES=( "${FILESDIR}"/${PN}-3.2.2-fix-XERCESC-2163.patch )
+PATCHES=(
+       "${FILESDIR}"/${PN}-3.2.2-fix-XERCESC-2163.patch
+       "${FILESDIR}"/${PN}-3.2.4-strict-aliasing.patch
+)
 
 pkg_setup() {
        export ICUROOT="${EPREFIX}/usr"
@@ -45,6 +48,10 @@ pkg_setup() {
 }
 
 src_configure() {
+       # bug #856100
+       filter-lto
+       append-flags -fno-strict-aliasing
+
        # 'cfurl' is only available on OSX and 'socket' isn't supposed to work.
        # But the docs aren't clear about it, so we would need some testing...
        local netaccessor

Reply via email to