commit:     a0ff1230984dd1d740c823eead6a091777d3d0fa
Author:     Fabian Groffen <grobian <AT> gentoo <DOT> org>
AuthorDate: Sun Dec 29 13:32:15 2024 +0000
Commit:     Fabian Groffen <grobian <AT> gentoo <DOT> org>
CommitDate: Sun Dec 29 13:32:15 2024 +0000
URL:        https://gitweb.gentoo.org/repo/proj/prefix.git/commit/?id=a0ff1230

sys-devel/gcc-14.2.1_p20241221: fix compilation with libintl-0.23

Closes: https://bugs.gentoo.org/946500
Signed-off-by: Fabian Groffen <grobian <AT> gentoo.org>

 .../gcc/files/gcc-14.2.0-libintl-setlocale.patch   | 25 ++++++++++++++++++++++
 sys-devel/gcc/gcc-14.2.1_p20241221.ebuild          |  3 +++
 2 files changed, 28 insertions(+)

diff --git a/sys-devel/gcc/files/gcc-14.2.0-libintl-setlocale.patch 
b/sys-devel/gcc/files/gcc-14.2.0-libintl-setlocale.patch
new file mode 100644
index 0000000000..2962b677af
--- /dev/null
+++ b/sys-devel/gcc/files/gcc-14.2.0-libintl-setlocale.patch
@@ -0,0 +1,25 @@
+libcpp/system.h: remove setlocale override
+
+This is non-upstreamable as is, it seems the configure check for
+HAVE_SETLOCALE is missing, but since it comes from libintl.h not sure
+how trivial this is (needs gettext macros).
+
+In Prefix setlocale is always present, either via the libc, or libintl.
+So we don't need to dummy it.  Doing so results in problems with
+libintl-0.23, which is included right after dummifying.
+
+Bug: https://bugs.gentoo.org/946500
+
+--- a/libcpp/system.h
++++ b/libcpp/system.h
+@@ -271,10 +271,6 @@
+ # include <langinfo.h>
+ #endif
+ 
+-#ifndef HAVE_SETLOCALE
+-# define setlocale(category, locale) (locale)
+-#endif
+-
+ #ifdef ENABLE_NLS
+ #include <libintl.h>
+ #else

diff --git a/sys-devel/gcc/gcc-14.2.1_p20241221.ebuild 
b/sys-devel/gcc/gcc-14.2.1_p20241221.ebuild
index e99242970c..a070196cdd 100644
--- a/sys-devel/gcc/gcc-14.2.1_p20241221.ebuild
+++ b/sys-devel/gcc/gcc-14.2.1_p20241221.ebuild
@@ -50,6 +50,9 @@ src_prepare() {
        # run as with - on pipe (for Clang 16)
        eapply "${FILESDIR}"/${PN}-14.2.0-darwin-as-dash-pipe.patch
 
+       # fix build with libintl-0.23
+       eapply "${FILESDIR}"/${PN}-14.2.0-libintl-setlocale.patch
+
        # make sure 64-bits native targets don't screw up the linker paths
        eapply "${FILESDIR}"/gcc-12-no-libs-for-startfile.patch
 

Reply via email to