public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] repo/gentoo:master commit in: dev-libs/gmp/, dev-libs/gmp/files/
@ 2015-10-24 16:14 Mike Frysinger
  0 siblings, 0 replies; 5+ messages in thread
From: Mike Frysinger @ 2015-10-24 16:14 UTC (permalink / raw
  To: gentoo-commits

commit:     d0f1aa52f380ac736b5fc95cf885fb900f198e02
Author:     Mike Frysinger <vapier <AT> gentoo <DOT> org>
AuthorDate: Sat Oct 24 16:12:00 2015 +0000
Commit:     Mike Frysinger <vapier <AT> gentoo <DOT> org>
CommitDate: Sat Oct 24 16:12:00 2015 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=d0f1aa52

dev-libs/gmp: sync GMPABI handling across current versions #563886

No functional changes here really -- just make the ebuilds we want
to keep in the tree act the same.

 dev-libs/gmp/files/gmp-4.3.2-ABI-multilib.patch | 256 ------------------------
 dev-libs/gmp/gmp-4.3.2-r1.ebuild                |  22 +-
 dev-libs/gmp/gmp-5.1.3-r1.ebuild                |   4 +-
 dev-libs/gmp/gmp-6.0.0a.ebuild                  |   4 +-
 4 files changed, 18 insertions(+), 268 deletions(-)

diff --git a/dev-libs/gmp/files/gmp-4.3.2-ABI-multilib.patch b/dev-libs/gmp/files/gmp-4.3.2-ABI-multilib.patch
deleted file mode 100644
index 2f9911c..0000000
--- a/dev-libs/gmp/files/gmp-4.3.2-ABI-multilib.patch
+++ /dev/null
@@ -1,256 +0,0 @@
-Gentoo uses ABI env var already
-
---- gmp-4.2.3/configure
-+++ gmp-4.2.3/configure
-@@ -489,7 +489,7 @@
- WANT_MPBSD_TRUE
- WANT_MPBSD_FALSE
- GMP_NAIL_BITS
--ABI
-+GMPABI
- HAVE_HOST_CPU_FAMILY_power
- HAVE_HOST_CPU_FAMILY_powerpc
- GMP_LDFLAGS
-@@ -930,7 +930,7 @@
-       ac_precious_vars='build_alias
- host_alias
- target_alias
--ABI
-+GMPABI
- CC
- CFLAGS
- LDFLAGS
-@@ -1091,7 +1091,7 @@
-                           include additional configurations [automatic]
- 
- Some influential environment variables:
--  ABI         desired ABI (for processors supporting more than one ABI)
-+  GMPABI      desired ABI (for processors supporting more than one ABI)
-   CC          C compiler command
-   CFLAGS      C compiler flags
-   LDFLAGS     linker flags, e.g. -L<lib dir> if you have libraries in a
-@@ -2670,7 +2670,7 @@
-     # (64-bit), but not both, so there's no option to choose the desired
-     # mode, we must instead detect which of the two it is.  This is done by
-     # checking sizeof(long), either 4 or 8 bytes respectively.  Do this in
--    # ABI=1.0 too, in case someone tries to build that with a 2.0w gcc.
-+    # GMPABI=1.0 too, in case someone tries to build that with a 2.0w gcc.
-     #
-     gcc_cflags="-O2"
-     gcc_cflags_optlist="arch"
-@@ -2694,11 +2694,11 @@
-     # gcc 2.7.2.3 knows -mpa-risc-1-0 and -mpa-risc-1-1
-     # gcc 2.95 adds -mpa-risc-2-0, plus synonyms -march=1.0, 1.1 and 2.0
-     #
--    # We don't use -mpa-risc-2-0 in ABI=1.0 because 64-bit registers may not
-+    # We don't use -mpa-risc-2-0 in GMPABI=1.0 because 64-bit registers may not
-     # be saved by the kernel on an old system.  Actually gcc (as of 3.2)
-     # only adds a few float instructions with -mpa-risc-2-0, so it would
-     # probably be safe, but let's not take the chance.  In any case, a
--    # configuration like --host=hppa2.0 ABI=1.0 is far from optimal.
-+    # configuration like --host=hppa2.0 GMPABI=1.0 is far from optimal.
-     #
-     case $host_cpu in
-       hppa1.0*)           gcc_cflags_arch="-mpa-risc-1-0" ;;
-@@ -2733,9 +2733,9 @@
-         cc_20n_cflags="+DA2.0 +e +O2 -Wl,+vnocompatwarnings"
-         cc_20n_testlist="hpc-hppa-2-0"
- 
--	# ABI=2.0w is available for hppa2.0w and hppa2.0, but not for
-+	# GMPABI=2.0w is available for hppa2.0w and hppa2.0, but not for
- 	# hppa2.0n, on the assumption that that the latter indicates a
--	# desire for ABI=2.0n.
-+	# desire for GMPABI=2.0n.
- 	case $host in
-         hppa2.0n-*-*) ;;
-         *)
-@@ -3203,7 +3203,7 @@
-     # mode, but not set our ABI.  For some reason it's sparc where this
-     # keeps coming up, presumably users there are accustomed to driving the
-     # compiler mode that way.  The effect of our testlist setting is to
--    # reject ABI=64 in favour of ABI=32 if the user has forced the flags to
-+    # reject GMPABI=64 in favour of GMPABI=32 if the user has forced the flags to
-     # 32-bit mode.
-     #
-     abilist="32"
-@@ -3308,12 +3308,12 @@
-     case $host_cpu in
-       sparc64 | sparcv9* | ultrasparc*)
-         case $host in
--          # Solaris 6 and earlier cannot run ABI=64 since it doesn't save
--          # registers properly, so ABI=32 is left as the only choice.
-+          # Solaris 6 and earlier cannot run GMPABI=64 since it doesn't save
-+          # registers properly, so GMPABI=32 is left as the only choice.
-           #
-           *-*-solaris2.[0-6] | *-*-solaris2.[0-6].*) ;;
- 
--          # BSD sparc64 ports are 64-bit-only systems, so ABI=64 is the only
-+          # BSD sparc64 ports are 64-bit-only systems, so GMPABI=64 is the only
-           # choice.  In fact they need no special compiler flags, gcc -m64
-           # is the default, but it doesn't hurt to add it.  v9 CPUs always
-           # use the sparc64 port, since the plain 32-bit sparc ports don't
-@@ -3399,7 +3399,7 @@
-   # -O, but lets assume that's no longer true.
-   #
-   # -m32 forces 32-bit mode on a bi-arch 32/64 amd64 build of gcc.  -m64 is
--  # the default in such a build (we think), so -m32 is essential for ABI=32.
-+  # the default in such a build (we think), so -m32 is essential for GMPABI=32.
-   # This is, of course, done for any $host_cpu, not just x86_64, so we can
-   # get such a gcc into the right mode to cross-compile to say i486-*-*.
-   #
-@@ -3639,7 +3639,7 @@
- 
- cat >&5 <<EOF
- User:
--ABI=$ABI
-+GMPABI=$GMPABI
- CC=$CC
- CFLAGS=$CFLAGS_or_unset
- CPPFLAGS=$CPPFLAGS_or_unset
-@@ -3660,24 +3660,24 @@
- # If the user specifies an ABI then it must be in $abilist, after that
- # $abilist is restricted to just that choice.
- #
--if test -n "$ABI"; then
-+if test -n "$GMPABI"; then
-   found=no
-   for abi in $abilist; do
--    if test $abi = "$ABI"; then found=yes; break; fi
-+    if test $abi = "$GMPABI"; then found=yes; break; fi
-   done
-   if test $found = no; then
--    { { echo "$as_me:$LINENO: error: ABI=$ABI is not among the following valid choices: $abilist" >&5
--echo "$as_me: error: ABI=$ABI is not among the following valid choices: $abilist" >&2;}
-+    { { echo "$as_me:$LINENO: error: GMPABI=$GMPABI is not among the following valid choices: $abilist" >&5
-+echo "$as_me: error: GMPABI=$GMPABI is not among the following valid choices: $abilist" >&2;}
-    { (exit 1); exit 1; }; }
-   fi
--  abilist="$ABI"
-+  abilist="$GMPABI"
- fi
- 
- found_compiler=no
- 
- for abi in $abilist; do
- 
--  echo "checking ABI=$abi"
-+  echo "checking GMPABI=$abi"
- 
-   # Suppose abilist="64 32", then for abi=64, will have abi1="_64" and
-   # abi2="_64".  For abi=32, will have abi1="_32" and abi2="".  This is how
-@@ -5128,7 +5128,7 @@
-             # For -march settings which enable SSE2 we exclude certain bad
-             # gcc versions and we need an OS knowing how to save xmm regs.
-             #
--            # This is only for ABI=32, any 64-bit gcc is good and any OS
-+            # This is only for GMPABI=32, any 64-bit gcc is good and any OS
-             # knowing x86_64 will know xmm.
-             #
-             # -march=k8 was only introduced in gcc 3.3, so we shouldn't need
-@@ -6368,16 +6368,16 @@
-     done
-   fi
- 
--  ABI="$abi"
-+  GMPABI="$abi"
-   CC="$cc"
-   CFLAGS="$cflags"
-   CPPFLAGS="$cppflags"
- 
- 
-   # Could easily have this in config.h too, if desired.
--  ABI_nodots=`echo $ABI | sed 's/\./_/'`
-+  GMPABI_nodots=`echo $GMPABI | sed 's/\./_/'`
- 
--echo "define_not_for_expansion(\`HAVE_ABI_$ABI_nodots')" >> $gmp_tmpconfigm4p
-+echo "define_not_for_expansion(\`HAVE_ABI_$GMPABI_nodots')" >> $gmp_tmpconfigm4p
- 
- 
- 
-@@ -8830,12 +8830,12 @@
- # If there's any sse2 or mmx in the path, check whether the assembler
- # supports it, and remove if not.
- #
--# We only need this in ABI=32, for ABI=64 on x86_64 we can assume a new
-+# We only need this in GMPABI=32, for GMPABI=64 on x86_64 we can assume a new
- # enough assembler.
- #
- case $host in
-   i?86*-*-* | k[5-8]*-*-* | pentium*-*-* | athlon-*-* | viac3*-*-* | geode*-*-* | athlon64-*-* | atom-*-* | core2-*-* | x86_64-*-*)
--    if test "$ABI" = 32; then
-+    if test "$GMPABI" = 32; then
-       case "$path $fat_path" in
-         *mmx*)   echo "$as_me:$LINENO: checking if the assembler knows about MMX instructions" >&5
- echo $ECHO_N "checking if the assembler knows about MMX instructions... $ECHO_C" >&6
-@@ -9019,7 +9019,7 @@
- 
- cat >&5 <<EOF
- Decided:
--ABI=$ABI
-+GMPABI=$GMPABI
- CC=$CC
- CFLAGS=$CFLAGS
- CPPFLAGS=$CPPFLAGS
-@@ -9028,7 +9028,7 @@
- CXXFLAGS=$CXXFLAGS
- path=$path
- EOF
--echo "using ABI=\"$ABI\""
-+echo "using GMPABI=\"$GMPABI\""
- echo "      CC=\"$CC\""
- echo "      CFLAGS=\"$CFLAGS\""
- echo "      CPPFLAGS=\"$CPPFLAGS\""
-@@ -30005,7 +30005,7 @@
- 
-       case $host in
-         *-*-aix*)
--	  case $ABI in
-+	  case $GMPABI in
- 	    64 | aix64)
- echo "include_mpn(\`powerpc64/aix.m4')" >> $gmp_tmpconfigm4i
-  ;;
-@@ -30015,7 +30015,7 @@
-           esac
-           ;;
-         *-*-linux* | *-*-*bsd*)
--	  case $ABI in
-+	  case $GMPABI in
- 	    mode64)
- echo "include_mpn(\`powerpc64/elf.m4')" >> $gmp_tmpconfigm4i
-  ;;
-@@ -30025,7 +30025,7 @@
-           esac
-           ;;
-         *-*-darwin*)
--	  case $ABI in
-+	  case $GMPABI in
- 	    mode64)
- echo "include_mpn(\`powerpc64/darwin.m4')" >> $gmp_tmpconfigm4i
-  ;;
-@@ -30048,7 +30048,7 @@
- 
-       ;;
-     sparcv9*-*-* | ultrasparc*-*-* | sparc64-*-*)
--      case $ABI in
-+      case $GMPABI in
-         64)
- 
- echo "$as_me:$LINENO: checking if the assembler accepts \".register\"" >&5
-@@ -30130,7 +30130,7 @@
- echo "define(<ALIGN_FILL_0x90>,<$gmp_cv_asm_align_fill_0x90>)" >> $gmp_tmpconfigm4
- 
- 
--      case $ABI in
-+      case $GMPABI in
-         32)
- 
- echo "include_mpn(\`x86/x86-defs.m4')" >> $gmp_tmpconfigm4i
-@@ -34032,7 +34032,7 @@
- WANT_MPBSD_TRUE!$WANT_MPBSD_TRUE$ac_delim
- WANT_MPBSD_FALSE!$WANT_MPBSD_FALSE$ac_delim
- GMP_NAIL_BITS!$GMP_NAIL_BITS$ac_delim
--ABI!$ABI$ac_delim
-+GMPABI!$GMPABI$ac_delim
- HAVE_HOST_CPU_FAMILY_power!$HAVE_HOST_CPU_FAMILY_power$ac_delim
- HAVE_HOST_CPU_FAMILY_powerpc!$HAVE_HOST_CPU_FAMILY_powerpc$ac_delim
- GMP_LDFLAGS!$GMP_LDFLAGS$ac_delim

diff --git a/dev-libs/gmp/gmp-4.3.2-r1.ebuild b/dev-libs/gmp/gmp-4.3.2-r1.ebuild
index c42ae5a..94a2563 100644
--- a/dev-libs/gmp/gmp-4.3.2-r1.ebuild
+++ b/dev-libs/gmp/gmp-4.3.2-r1.ebuild
@@ -22,29 +22,35 @@ RDEPEND=""
 
 src_prepare() {
 	epatch "${FILESDIR}"/${PN}-4.1.4-noexecstack.patch
-	epatch "${FILESDIR}"/${PN}-4.3.2-ABI-multilib.patch
 	epatch "${FILESDIR}"/${PN}-4.2.1-s390.diff
 
-	sed -i -e 's:ABI = @ABI@:GMPABI = @GMPABI@:' \
-		Makefile.in */Makefile.in */*/Makefile.in
-
 	# note: we cannot run autotools here as gcc depends on this package
 	elibtoolize
+
+	# 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
+	cat <<-\EOF > configure
+	#!/bin/sh
+	exec env ABI="${GMPABI}" "$0.wrapped" "$@"
+	EOF
+	chmod a+rx configure
 }
 
 src_configure() {
 	# Because of our 32-bit userland, 1.0 is the only HPPA ABI that works
 	# http://gmplib.org/manual/ABI-and-ISA.html#ABI-and-ISA (bug #344613)
 	if [[ ${CHOST} == hppa2.0-* ]] ; then
-		export GMPABI="1.0"
+		GMPABI="1.0"
 	fi
 
 	# ABI mappings (needs all architectures supported)
 	case ${ABI} in
-		32|x86)       export GMPABI=32;;
-		64|amd64|n64) export GMPABI=64;;
-		o32|n32)      export GMPABI=${ABI};;
+		32|x86)       GMPABI=32;;
+		64|amd64|n64) GMPABI=64;;
+		[onx]32)      GMPABI=${ABI};;
 	esac
+	export GMPABI
 
 	tc-export CC
 	econf \

diff --git a/dev-libs/gmp/gmp-5.1.3-r1.ebuild b/dev-libs/gmp/gmp-5.1.3-r1.ebuild
index 8946cc5..4eca2e6 100644
--- a/dev-libs/gmp/gmp-5.1.3-r1.ebuild
+++ b/dev-libs/gmp/gmp-5.1.3-r1.ebuild
@@ -45,7 +45,7 @@ src_prepare() {
 	mv configure configure.wrapped || die
 	cat <<-\EOF > configure
 	#!/bin/sh
-	exec env ABI="$GMPABI" "$0.wrapped" "$@"
+	exec env ABI="${GMPABI}" "$0.wrapped" "$@"
 	EOF
 	chmod a+rx configure
 }
@@ -54,7 +54,7 @@ multilib_src_configure() {
 	# Because of our 32-bit userland, 1.0 is the only HPPA ABI that works
 	# http://gmplib.org/manual/ABI-and-ISA.html#ABI-and-ISA (bug #344613)
 	if [[ ${CHOST} == hppa2.0-* ]] ; then
-		export GMPABI="1.0"
+		GMPABI="1.0"
 	fi
 
 	# ABI mappings (needs all architectures supported)

diff --git a/dev-libs/gmp/gmp-6.0.0a.ebuild b/dev-libs/gmp/gmp-6.0.0a.ebuild
index 72693fb..1b4dcf8 100644
--- a/dev-libs/gmp/gmp-6.0.0a.ebuild
+++ b/dev-libs/gmp/gmp-6.0.0a.ebuild
@@ -44,7 +44,7 @@ src_prepare() {
 	mv configure configure.wrapped || die
 	cat <<-\EOF > configure
 	#!/bin/sh
-	exec env ABI="$GMPABI" "$0.wrapped" "$@"
+	exec env ABI="${GMPABI}" "$0.wrapped" "$@"
 	EOF
 	chmod a+rx configure
 }
@@ -53,7 +53,7 @@ multilib_src_configure() {
 	# Because of our 32-bit userland, 1.0 is the only HPPA ABI that works
 	# http://gmplib.org/manual/ABI-and-ISA.html#ABI-and-ISA (bug #344613)
 	if [[ ${CHOST} == hppa2.0-* ]] ; then
-		export GMPABI="1.0"
+		GMPABI="1.0"
 	fi
 
 	# ABI mappings (needs all architectures supported)


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: dev-libs/gmp/, dev-libs/gmp/files/
@ 2016-11-26 22:08 Mike Frysinger
  0 siblings, 0 replies; 5+ messages in thread
From: Mike Frysinger @ 2016-11-26 22:08 UTC (permalink / raw
  To: gentoo-commits

commit:     8dc3f5d8f82efff45280659e5647c82e3ba6c969
Author:     Mike Frysinger <vapier <AT> gentoo <DOT> org>
AuthorDate: Sat Nov 26 22:03:08 2016 +0000
Commit:     Mike Frysinger <vapier <AT> gentoo <DOT> org>
CommitDate: Sat Nov 26 22:07:53 2016 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=8dc3f5d8

dev-libs/gmp: add upstream fix for USE=-asm builds

 dev-libs/gmp/files/gmp-6.1.0-udiv.patch | 61 +++++++++++++++++++++++++++++++++
 dev-libs/gmp/gmp-6.1.0.ebuild           |  1 +
 dev-libs/gmp/gmp-6.1.1.ebuild           |  1 +
 3 files changed, 63 insertions(+)

diff --git a/dev-libs/gmp/files/gmp-6.1.0-udiv.patch b/dev-libs/gmp/files/gmp-6.1.0-udiv.patch
new file mode 100644
index 00000000..3a6e807
--- /dev/null
+++ b/dev-libs/gmp/files/gmp-6.1.0-udiv.patch
@@ -0,0 +1,61 @@
+https://gmplib.org/list-archives/gmp-bugs/2016-November/004031.html
+
+From dadb1954c8305ea7c7d61d30f7c6338024702280 Mon Sep 17 00:00:00 2001
+From: Torbjorn Granlund <tg@gmplib.org>
+Date: Sat, 26 Nov 2016 02:58:34 +0100
+Subject: [PATCH] Conditionalise udiv_w_sdiv inclusion on --enable-assembly.
+
+---
+ configure.ac | 16 ++++++++++++----
+ 1 file changed, 12 insertions(+), 4 deletions(-)
+
+diff --git a/configure.ac b/configure.ac
+index 689e137f24c2..66c8b057574f 100644
+--- a/configure
++++ b/configure
+@@ -1269,7 +1269,9 @@ case $host in
+     AC_DEFINE(HAVE_HOST_CPU_FAMILY_power)
+     HAVE_HOST_CPU_FAMILY_power=1
+     cclist="gcc"
+-    extra_functions="udiv_w_sdiv"
++    if test "$enable_assembly" = "yes" ; then
++      extra_functions="udiv_w_sdiv"
++    fi
+     path="power"
+ 
+     # gcc 2.7.2 knows rios1, rios2, rsc
+@@ -1306,7 +1308,9 @@ case $host in
+     gcc_cflags="$gcc_cflags $fomit_frame_pointer"
+     gcc_cflags_optlist="arch"
+     path="s390_32"
+-    extra_functions="udiv_w_sdiv"
++    if test "$enable_assembly" = "yes" ; then
++       extra_functions="udiv_w_sdiv"
++    fi
+     gcc_32_cflags_maybe="-m31"
+ 
+     case $host_cpu in
+@@ -1603,14 +1607,18 @@ case $host in
+     GMP_INCLUDE_MPN(vax/elf.m4)
+     gcc_cflags="$gcc_cflags $fomit_frame_pointer"
+     path="vax"
+-    extra_functions="udiv_w_sdiv"
++    if test "$enable_assembly" = "yes" ; then
++      extra_functions="udiv_w_sdiv"
++    fi
+     ;;
+   vax*-*-*)
+     # Default to aout conventions (i.e., no register prefix, '_' global prefix)
+     #
+     gcc_cflags="$gcc_cflags $fomit_frame_pointer"
+     path="vax"
+-    extra_functions="udiv_w_sdiv"
++    if test "$enable_assembly" = "yes" ; then
++      extra_functions="udiv_w_sdiv"
++    fi
+     ;;
+ 
+ 
+-- 
+2.11.0.rc2
+

diff --git a/dev-libs/gmp/gmp-6.1.0.ebuild b/dev-libs/gmp/gmp-6.1.0.ebuild
index c92ceca..a511af5 100644
--- a/dev-libs/gmp/gmp-6.1.0.ebuild
+++ b/dev-libs/gmp/gmp-6.1.0.ebuild
@@ -34,6 +34,7 @@ MULTILIB_WRAPPED_HEADERS=( /usr/include/gmp.h )
 
 src_prepare() {
 	[[ -d ${FILESDIR}/${PV} ]] && EPATCH_SUFFIX="diff" EPATCH_FORCE="yes" epatch "${FILESDIR}"/${PV}
+	epatch "${FILESDIR}"/${PN}-6.1.0-udiv.patch
 
 	# note: we cannot run autotools here as gcc depends on this package
 	elibtoolize

diff --git a/dev-libs/gmp/gmp-6.1.1.ebuild b/dev-libs/gmp/gmp-6.1.1.ebuild
index 4de8a1d..adb201e 100644
--- a/dev-libs/gmp/gmp-6.1.1.ebuild
+++ b/dev-libs/gmp/gmp-6.1.1.ebuild
@@ -33,6 +33,7 @@ MULTILIB_WRAPPED_HEADERS=( /usr/include/gmp.h )
 
 src_prepare() {
 	[[ -d ${FILESDIR}/${PV} ]] && EPATCH_SUFFIX="diff" EPATCH_FORCE="yes" epatch "${FILESDIR}"/${PV}
+	epatch "${FILESDIR}"/${PN}-6.1.0-udiv.patch
 
 	# note: we cannot run autotools here as gcc depends on this package
 	elibtoolize


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: dev-libs/gmp/, dev-libs/gmp/files/
@ 2018-01-03 15:22 Fabian Groffen
  0 siblings, 0 replies; 5+ messages in thread
From: Fabian Groffen @ 2018-01-03 15:22 UTC (permalink / raw
  To: gentoo-commits

commit:     ce669e75475c6e73dad1365857186719559ed33f
Author:     Fabian Groffen <grobian <AT> gentoo <DOT> org>
AuthorDate: Wed Jan  3 15:22:44 2018 +0000
Commit:     Fabian Groffen <grobian <AT> gentoo <DOT> org>
CommitDate: Wed Jan  3 15:22:55 2018 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=ce669e75

dev-libs/gmp: add patch to aid bootstrapping with old gcc on darwin

Package-Manager: Portage-2.3.13, Repoman-2.3.3

 dev-libs/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(-)

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 00000000000..8960464ac4f
--- /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 266f6ce8b86..9134d5cfa90 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


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: dev-libs/gmp/, dev-libs/gmp/files/
@ 2021-03-02  0:33 Sergei Trofimovich
  0 siblings, 0 replies; 5+ messages in thread
From: Sergei Trofimovich @ 2021-03-02  0:33 UTC (permalink / raw
  To: gentoo-commits

commit:     e9697a383036e80b9d79a038d8b0e879f71db67c
Author:     Sergei Trofimovich <slyfox <AT> gentoo <DOT> org>
AuthorDate: Tue Mar  2 00:29:48 2021 +0000
Commit:     Sergei Trofimovich <slyfox <AT> gentoo <DOT> org>
CommitDate: Tue Mar  2 00:33:33 2021 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=e9697a38

dev-libs/gmp: fix s390 symbol leak on -mzarch

Reported-by: Sam James
Bug: https://bugs.gentoo.org/761310
Package-Manager: Portage-3.0.16, Repoman-3.0.2
Signed-off-by: Sergei Trofimovich <slyfox <AT> gentoo.org>

 dev-libs/gmp/files/gmp-6.2.1-no-zarch.patch |  20 ++++++
 dev-libs/gmp/gmp-6.2.1-r1.ebuild            | 108 ++++++++++++++++++++++++++++
 2 files changed, 128 insertions(+)

diff --git a/dev-libs/gmp/files/gmp-6.2.1-no-zarch.patch b/dev-libs/gmp/files/gmp-6.2.1-no-zarch.patch
new file mode 100644
index 00000000000..6ba7c8aa561
--- /dev/null
+++ b/dev-libs/gmp/files/gmp-6.2.1-no-zarch.patch
@@ -0,0 +1,20 @@
+configure.ac decides whether udiv_w_sdiv.c fallback is needed
+based on $CHOST value (without $CFLAGS). longlong.h relies
+on compiler macros (relies on $CFLAGS implicitly).
+
+That leads to use of undefined macros. The workaround makes
+udiv_w_sdiv.c a no-on for -mzarch.
+
+https://bugs.gentoo.org/761310
+--- a/mpn/generic/udiv_w_sdiv.c
++++ b/mpn/generic/udiv_w_sdiv.c
+@@ -1,3 +1,4 @@
++#if !defined(__zarch__)
+ /* mpn_udiv_w_sdiv -- implement udiv_qrnnd on machines with only signed
+    division.
+ 
+@@ -139,3 +140,4 @@ mpn_udiv_w_sdiv (mp_limb_t *rp, mp_limb_t a1, mp_limb_t a0, mp_limb_t d)
+   *rp = r;
+   return q;
+ }
++#endif

diff --git a/dev-libs/gmp/gmp-6.2.1-r1.ebuild b/dev-libs/gmp/gmp-6.2.1-r1.ebuild
new file mode 100644
index 00000000000..9046e865110
--- /dev/null
+++ b/dev-libs/gmp/gmp-6.2.1-r1.ebuild
@@ -0,0 +1,108 @@
+# Copyright 1999-2021 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+inherit flag-o-matic eutils libtool multilib-minimal toolchain-funcs
+
+MY_PV=${PV/_p*}
+MY_PV=${MY_PV/_/-}
+MANUAL_PV=$MY_PV
+MANUAL_PV=6.2.0 # 6.2.1 manual is not ready yet
+MY_P=${PN}-${MY_PV}
+PLEVEL=${PV/*p}
+DESCRIPTION="Library for arbitrary-precision arithmetic on different type of numbers"
+HOMEPAGE="https://gmplib.org/"
+SRC_URI="ftp://ftp.gmplib.org/pub/${MY_P}/${MY_P}.tar.xz
+	mirror://gnu/${PN}/${MY_P}.tar.xz
+	doc? ( https://gmplib.org/${PN}-man-${MANUAL_PV}.pdf )"
+
+LICENSE="|| ( LGPL-3+ GPL-2+ )"
+# The subslot reflects the C & C++ SONAMEs.
+SLOT="0/10.4"
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86 ~x64-cygwin ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
+IUSE="+asm doc +cxx pic static-libs"
+
+BDEPEND="sys-devel/m4
+	app-arch/xz-utils"
+
+S=${WORKDIR}/${MY_P%a}
+
+DOCS=( AUTHORS ChangeLog NEWS README doc/configuration doc/isa_abi_headache )
+HTML_DOCS=( doc )
+MULTILIB_WRAPPED_HEADERS=( /usr/include/gmp.h )
+
+PATCHES=(
+	"${FILESDIR}"/${PN}-6.1.0-noexecstack-detect.patch
+	"${FILESDIR}"/${PN}-6.2.1-no-zarch.patch
+)
+
+src_prepare() {
+	default
+
+	# note: we cannot run autotools here as gcc depends on this package
+	elibtoolize
+
+	# https://bugs.gentoo.org/536894
+	if [[ ${CHOST} == *-darwin* ]] ; then
+		eapply "${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
+	cat <<-\EOF > configure
+	#!/usr/bin/env sh
+	exec env ABI="${GMPABI}" "$0.wrapped" "$@"
+	EOF
+	# Patches to original configure might have lost the +x bit.
+	chmod a+rx configure{,.wrapped} || die
+}
+
+multilib_src_configure() {
+	# Because of our 32-bit userland, 1.0 is the only HPPA ABI that works
+	# https://gmplib.org/manual/ABI-and-ISA.html#ABI-and-ISA (bug #344613)
+	if [[ ${CHOST} == hppa2.0-* ]] ; then
+		GMPABI="1.0"
+	fi
+
+	# ABI mappings (needs all architectures supported)
+	case ${ABI} in
+		32|x86)       GMPABI=32;;
+		64|amd64|n64) GMPABI=64;;
+		[onx]32)      GMPABI=${ABI};;
+	esac
+	export GMPABI
+
+	#367719
+	if [[ ${CHOST} == *-mint* ]]; then
+		filter-flags -O?
+	fi
+
+	# --with-pic forces static libraries to be built as PIC
+	# and without TEXTRELs. musl does not support TEXTRELs: bug #707332
+	tc-export CC
+	ECONF_SOURCE="${S}" econf \
+		CC_FOR_BUILD="$(tc-getBUILD_CC)" \
+		--localstatedir="${EPREFIX}"/var/state/gmp \
+		--enable-shared \
+		$(use_enable asm assembly) \
+		$(use_enable cxx) \
+		$(use pic && echo --with-pic) \
+		$(use_enable static-libs static)
+}
+
+multilib_src_install() {
+	emake DESTDIR="${D}" install
+
+	# should be a standalone lib
+	rm -f "${ED}"/usr/$(get_libdir)/libgmp.la
+	# this requires libgmp
+	local la="${ED}/usr/$(get_libdir)/libgmpxx.la"
+	use static-libs || rm -f "${la}"
+}
+
+multilib_src_install_all() {
+	einstalldocs
+	use doc && cp "${DISTDIR}"/gmp-man-${MANUAL_PV}.pdf "${ED}"/usr/share/doc/${PF}/
+}


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: dev-libs/gmp/, dev-libs/gmp/files/
@ 2021-11-25  2:45 Sam James
  0 siblings, 0 replies; 5+ messages in thread
From: Sam James @ 2021-11-25  2:45 UTC (permalink / raw
  To: gentoo-commits

commit:     0c55fe4bf46a1b867746a6ead419fce585d0d456
Author:     Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Thu Nov 25 02:41:44 2021 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Thu Nov 25 02:45:24 2021 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=0c55fe4b

dev-libs/gmp: add patch for CVE-2021-43618; add Darwin arm64 patch

Apply two upstream patches:
- Fix CVE-2021-43618
- Fix incorrect use of reserved register on Darwin/arm64

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

 dev-libs/gmp/Manifest                             |   1 +
 dev-libs/gmp/files/gmp-6.2.1-CVE-2021-43618.patch |  17 ++++
 dev-libs/gmp/gmp-6.2.1-r2.ebuild                  | 116 ++++++++++++++++++++++
 3 files changed, 134 insertions(+)

diff --git a/dev-libs/gmp/Manifest b/dev-libs/gmp/Manifest
index 4db6b7b96743..846b78dc7601 100644
--- a/dev-libs/gmp/Manifest
+++ b/dev-libs/gmp/Manifest
@@ -1,2 +1,3 @@
+DIST gmp-6.2.1-arm64-darwin.patch.bz2 2520 BLAKE2B 3d4e9dbd29dc9aa81f0c9e0de4a5904c989d54148c9e3dcc5097a43b3fb1ecd17802dacfc71ee131c0805a345f5dce9009e88439758d3a0ed8b3a88526353b4a SHA512 72d49f09c3facd75036c945e076207e72e5673ba9605999c32a122e43e8b970ed646c8ca8f07acbb62bff5e7c387d4c8e1f73ca73e50ac3f574b5f6471d66d56
 DIST gmp-6.2.1.tar.xz 2027316 BLAKE2B c0d85f175392a50cfa01bc6b0a312b235946ad8b4f6f84f6dabd33d7a6f2cc75c9b0e1e33057be07750bfa0145b7c4cf3b6188a5be6ca9d7271ec2276c84ebcb SHA512 c99be0950a1d05a0297d65641dd35b75b74466f7bf03c9e8a99895a3b2f9a0856cd17887738fa51cf7499781b65c049769271cbcb77d057d2e9f1ec52e07dd84
 DIST gmp-man-6.2.1.pdf 827583 BLAKE2B 9aa25457a3c488e37cc7d54d825253ab749a3780919570579b319cf607001de50b212ca387b70213abcc5ab428b4525bdb9cd8ae932798a2d7928da98ce3f353 SHA512 f2d9d02e97975355ef490e921fedc94fb7687c3661eec8fa2e94a1622b6e59b17b3879eb3ec1f2df8edac100f727175144d107f4c49c602b773c43bc9e91dbcb

diff --git a/dev-libs/gmp/files/gmp-6.2.1-CVE-2021-43618.patch b/dev-libs/gmp/files/gmp-6.2.1-CVE-2021-43618.patch
new file mode 100644
index 000000000000..90129ec5b2bd
--- /dev/null
+++ b/dev-libs/gmp/files/gmp-6.2.1-CVE-2021-43618.patch
@@ -0,0 +1,17 @@
+https://bugs.gentoo.org/823804
+https://gmplib.org/repo/gmp-6.2/rev/561a9c25298e
+--- a/mpz/inp_raw.c
++++ b/mpz/inp_raw.c
+@@ -88,8 +88,11 @@ mpz_inp_raw (mpz_ptr x, FILE *fp)
+ 
+   abs_csize = ABS (csize);
+ 
++  if (UNLIKELY (abs_csize > ~(mp_bitcnt_t) 0 / 8))
++    return 0; /* Bit size overflows */
++
+   /* round up to a multiple of limbs */
+-  abs_xsize = BITS_TO_LIMBS (abs_csize*8);
++  abs_xsize = BITS_TO_LIMBS ((mp_bitcnt_t) abs_csize * 8);
+ 
+   if (abs_xsize != 0)
+     {

diff --git a/dev-libs/gmp/gmp-6.2.1-r2.ebuild b/dev-libs/gmp/gmp-6.2.1-r2.ebuild
new file mode 100644
index 000000000000..f228e714b6e2
--- /dev/null
+++ b/dev-libs/gmp/gmp-6.2.1-r2.ebuild
@@ -0,0 +1,116 @@
+# Copyright 1999-2021 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+inherit flag-o-matic libtool multilib-minimal toolchain-funcs
+
+MY_PV=${PV/_p*}
+MY_PV=${MY_PV/_/-}
+MANUAL_PV=${MY_PV}
+MANUAL_PV=6.2.1
+MY_P=${PN}-${MY_PV}
+PLEVEL=${PV/*p}
+DESCRIPTION="Library for arbitrary-precision arithmetic on different type of numbers"
+HOMEPAGE="https://gmplib.org/"
+SRC_URI="ftp://ftp.gmplib.org/pub/${MY_P}/${MY_P}.tar.xz
+	mirror://gnu/${PN}/${MY_P}.tar.xz
+	doc? ( https://gmplib.org/${PN}-man-${MANUAL_PV}.pdf )"
+SRC_URI+=" https://dev.gentoo.org/~sam/distfiles/${CATEGORY}/${PN}/${P}-arm64-darwin.patch.bz2"
+
+LICENSE="|| ( LGPL-3+ GPL-2+ )"
+# The subslot reflects the C & C++ SONAMEs.
+SLOT="0/10.4"
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86 ~x64-cygwin ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
+IUSE="+asm doc +cxx pic static-libs"
+
+BDEPEND="sys-devel/m4
+	app-arch/xz-utils"
+
+S=${WORKDIR}/${MY_P%a}
+
+DOCS=( AUTHORS ChangeLog NEWS README doc/configuration doc/isa_abi_headache )
+HTML_DOCS=( doc )
+MULTILIB_WRAPPED_HEADERS=( /usr/include/gmp.h )
+
+PATCHES=(
+	"${FILESDIR}"/${PN}-6.1.0-noexecstack-detect.patch
+	"${FILESDIR}"/${PN}-6.2.1-no-zarch.patch
+	"${WORKDIR}"/${P}-arm64-darwin.patch
+	"${FILESDIR}"/${P}-CVE-2021-43618.patch
+)
+
+src_prepare() {
+	default
+
+	# We cannot run autotools here as gcc depends on this package
+	elibtoolize
+
+	# bug #536894
+	if [[ ${CHOST} == *-darwin* ]] ; then
+		eapply "${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
+	cat <<-\EOF > configure
+	#!/usr/bin/env sh
+	exec env ABI="${GMPABI}" "$0.wrapped" "$@"
+	EOF
+
+	# Patches to original configure might have lost the +x bit.
+	chmod a+rx configure{,.wrapped} || die
+}
+
+multilib_src_configure() {
+	# Because of our 32-bit userland, 1.0 is the only HPPA ABI that works
+	# https://gmplib.org/manual/ABI-and-ISA.html#ABI-and-ISA (bug #344613)
+	if [[ ${CHOST} == hppa2.0-* ]] ; then
+		GMPABI="1.0"
+	fi
+
+	# ABI mappings (needs all architectures supported)
+	case ${ABI} in
+		32|x86)       GMPABI=32;;
+		64|amd64|n64) GMPABI=64;;
+		[onx]32)      GMPABI=${ABI};;
+	esac
+	export GMPABI
+
+	# bug #367719
+	if [[ ${CHOST} == *-mint* ]]; then
+		filter-flags -O?
+	fi
+
+	tc-export CC
+
+	# --with-pic forces static libraries to be built as PIC
+	# and without TEXTRELs. musl does not support TEXTRELs: bug #707332
+	ECONF_SOURCE="${S}" econf \
+		CC_FOR_BUILD="$(tc-getBUILD_CC)" \
+		--localstatedir="${EPREFIX}"/var/state/gmp \
+		--enable-shared \
+		$(use_enable asm assembly) \
+		$(use_enable cxx) \
+		$(use pic && echo --with-pic) \
+		$(use_enable static-libs static)
+}
+
+multilib_src_install() {
+	emake DESTDIR="${D}" install
+
+	# Should be a standalone lib
+	rm -f "${ED}"/usr/$(get_libdir)/libgmp.la
+
+	# This requires libgmp
+	local la="${ED}/usr/$(get_libdir)/libgmpxx.la"
+	if ! use static-libs ; then
+		rm -f "${la}"
+	fi
+}
+
+multilib_src_install_all() {
+	einstalldocs
+	use doc && cp "${DISTDIR}"/gmp-man-${MANUAL_PV}.pdf "${ED}"/usr/share/doc/${PF}/
+}


^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2021-11-25  2:45 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-10-24 16:14 [gentoo-commits] repo/gentoo:master commit in: dev-libs/gmp/, dev-libs/gmp/files/ Mike Frysinger
  -- strict thread matches above, loose matches on Subject: below --
2016-11-26 22:08 Mike Frysinger
2018-01-03 15:22 Fabian Groffen
2021-03-02  0:33 Sergei Trofimovich
2021-11-25  2:45 Sam James

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox