From ce669e75475c6e73dad1365857186719559ed33f Mon Sep 17 00:00:00 2001 From: Fabian Groffen Date: Wed, 3 Jan 2018 16:22:44 +0100 Subject: [PATCH] dev-libs/gmp: add patch to aid bootstrapping with old gcc on darwin Package-Manager: Portage-2.3.13, Repoman-2.3.3 --- .../gmp/files/gmp-6.1.2-gcc-apple-4.0.1.patch | 21 +++++++++++++++++++ dev-libs/gmp/gmp-6.1.2.ebuild | 7 ++++++- 2 files changed, 27 insertions(+), 1 deletion(-) create mode 100644 dev-libs/gmp/files/gmp-6.1.2-gcc-apple-4.0.1.patch diff --git a/dev-libs/gmp/files/gmp-6.1.2-gcc-apple-4.0.1.patch b/dev-libs/gmp/files/gmp-6.1.2-gcc-apple-4.0.1.patch new file mode 100644 index 000000000000..8960464ac4f4 --- /dev/null +++ b/dev-libs/gmp/files/gmp-6.1.2-gcc-apple-4.0.1.patch @@ -0,0 +1,21 @@ +--- gmp-6.0.0/gmp-h.in.orig 2015-01-16 22:25:51.000000000 +0100 ++++ gmp-6.0.0/gmp-h.in 2015-01-16 22:26:40.000000000 +0100 +@@ -360,14 +360,14 @@ + GCC 4.3 and above with -std=c99 or -std=gnu99 implements ISO C99 + inline semantics, unless -fgnu89-inline is used. */ + #ifdef __GNUC__ +-#if (defined __GNUC_STDC_INLINE__) || (__GNUC__ == 4 && __GNUC_MINOR__ == 2) \ +- || (defined __GNUC_GNU_INLINE__ && defined __cplusplus) ++#if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 2) + #define __GMP_EXTERN_INLINE extern __inline__ __attribute__ ((__gnu_inline__)) +-#else ++#define __GMP_INLINE_PROTOTYPES 1 ++#elif !(defined __APPLE__ && defined __MACH__ && __APPLE_CC__ >= 5465 && __STDC_VERSION__ >= 199901L) + #define __GMP_EXTERN_INLINE extern __inline__ +-#endif + #define __GMP_INLINE_PROTOTYPES 1 + #endif ++#endif + + /* DEC C (eg. version 5.9) supports "static __inline foo()", even in -std1 + strict ANSI mode. Inlining is done even when not optimizing (ie. -O0 diff --git a/dev-libs/gmp/gmp-6.1.2.ebuild b/dev-libs/gmp/gmp-6.1.2.ebuild index 266f6ce8b86a..9134d5cfa90e 100644 --- a/dev-libs/gmp/gmp-6.1.2.ebuild +++ b/dev-libs/gmp/gmp-6.1.2.ebuild @@ -1,4 +1,4 @@ -# Copyright 1999-2017 Gentoo Foundation +# Copyright 1999-2018 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 EAPI="5" @@ -39,6 +39,11 @@ src_prepare() { epatch "${FILESDIR}"/${PN}-6.1.0-noexecstack-detect.patch + # https://bugs.gentoo.org/536894 + if [[ ${CHOST} == *-darwin* ]] ; then + epatch "${FILESDIR}"/${PN}-6.1.2-gcc-apple-4.0.1.patch + fi + # GMP uses the "ABI" env var during configure as does Gentoo (econf). # So, to avoid patching the source constantly, wrap things up. mv configure configure.wrapped || die -- 2.26.2