gmp: import current stable from upstream Gentoo

This changes ABI of the gmp library, but the ebuild itself takes care
of preserving the old SONAME so that existing binaries don't break.
Newly linked programs will use the new ABI SONAME automatically.

BUG=None
TEST=tested upgrade path (build_packages/build_image); rebuilt strongswan; ran `cbuildbot chromiumos-sdk`

Change-Id: I0e51efecd59a9f2127e2d299a4da7e23df5eefd2
Reviewed-on: http://gerrit.chromium.org/gerrit/7441
Reviewed-by: Ken Mixter <kmixter@chromium.org>
Reviewed-by: David James <davidjames@chromium.org>
Commit-Ready: Mike Frysinger <vapier@chromium.org>
Tested-by: Mike Frysinger <vapier@chromium.org>
This commit is contained in:
Mike Frysinger 2011-09-06 21:58:47 -04:00
parent 8df2a8453b
commit a60d15ca11
4 changed files with 304 additions and 0 deletions

View File

@ -0,0 +1,20 @@
fixed executable stack
http://bugs.gentoo.org/115038
--- gmp-4.1.4/configure
+++ gmp-4.1.4/configure
@@ -21689,6 +21689,13 @@
fi
echo "')" >> $gmp_configm4
echo "define(\`__CONFIG_M4_INCLUDED__')" >> $gmp_configm4
+# Gentoo hack
+case $host_os in
+ *linux*)
+ echo '.section .note.GNU-stack,"",%progbits' >> $gmp_configm4
+ echo '.previous' >> $gmp_configm4
+ ;;
+esac
# Create Makefiles
# FIXME: Upcoming version of autoconf/automake may not like broken lines.

View File

@ -0,0 +1,68 @@
stolen from SuSE
--- configure.in
+++ configure.in
@@ -1050,6 +1050,9 @@
;;
+ s390x-*-*)
+ path="s390x" ;;
+
# IBM s/370 and similar
[s3[6-9]0*-*-*])
gcc_cflags="-O2 $fomit_frame_pointer"
--- configure
+++ configure
@@ -1050,6 +1050,9 @@
;;
+ s390x-*-*)
+ path="s390x" ;;
+
# IBM s/370 and similar
s3[6-9]0*-*-*)
gcc_cflags="-O2 $fomit_frame_pointer"
--- mpn/s390/gmp-mparam.h
+++ mpn/s390/gmp-mparam.h
@@ -20,7 +20,8 @@
MA 02110-1301, USA. */
-/* GMP_LIMB_BITS etc generated by configure */
+#define GMP_LIMB_BITS 32
+#define BYTES_PER_MP_LIMB 4
/* Generated by tuneup.c, 2001-12-03, gcc 2.95 */
--- mpn/s390x/gmp-mparam.h
+++ mpn/s390x/gmp-mparam.h
@@ -0,0 +1,27 @@
+/* gmp-mparam.h -- Compiler/machine parameter header file.
+
+Copyright (C) 1991, 1993, 1994, 1995 Free Software Foundation, Inc.
+
+This file is part of the GNU MP Library.
+
+The GNU MP Library is free software; you can redistribute it and/or modify
+it under the terms of the GNU Library General Public License as published by
+the Free Software Foundation; either version 2 of the License, or (at your
+option) any later version.
+
+The GNU MP Library is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public
+License for more details.
+
+You should have received a copy of the GNU Library General Public License
+along with the GNU MP Library; see the file COPYING.LIB. If not, write to
+the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
+MA 02111-1307, USA. */
+
+#define GMP_LIMB_BITS 64
+#define BYTES_PER_MP_LIMB 8
+#define BITS_PER_LONGINT 64
+#define BITS_PER_INT 32
+#define BITS_PER_SHORTINT 16
+#define BITS_PER_CHAR 8

View File

@ -0,0 +1,130 @@
2010-07-27 Magnus Granberg <zorry@gentoo.org>
#236054
tests/Makefile.in add -nopie to CFLAGS
test/misc/Makefile.in likewise
test/mpbsd/Makefile.in likewise
test/mpf/Makefile.in likewise
test/mpn/Makefile.in likewise
test/mpq/Makefile.in likewise
test/mpz/Makefile.in likewise
test/randMakefile.in likewise
test/cxx/Makefile.in likewise and CXXFLAGS
--- a/tests/Makefile.in 2010-07-27 00:53:05.000000000 +0000
+++ b/tests/Makefile.in 2010-07-27 00:35:10.000000000 +0000
@@ -200,7 +200,7 @@
CC = @CC@
CCAS = @CCAS@
CC_FOR_BUILD = @CC_FOR_BUILD@
-CFLAGS = @CFLAGS@
+CFLAGS = @CFLAGS@ -nopie
CPP = @CPP@
CPPFLAGS = @CPPFLAGS@
CPP_FOR_BUILD = @CPP_FOR_BUILD@
--- a/tests/devel/Makefile.in 2010-07-27 00:53:05.000000000 +0000
+++ b/tests/devel/Makefile.in 2010-07-27 00:35:10.000000000 +0000
@@ -200,7 +200,7 @@
CC = @CC@
CCAS = @CCAS@
CC_FOR_BUILD = @CC_FOR_BUILD@
-CFLAGS = @CFLAGS@
+CFLAGS = @CFLAGS@ -nopie
CPP = @CPP@
CPPFLAGS = @CPPFLAGS@
CPP_FOR_BUILD = @CPP_FOR_BUILD@
--- a/tests/misc/Makefile.in 2010-07-27 00:53:05.000000000 +0000
+++ b/tests/misc/Makefile.in 2010-07-27 00:35:10.000000000 +0000
@@ -200,7 +200,7 @@
CC = @CC@
CCAS = @CCAS@
CC_FOR_BUILD = @CC_FOR_BUILD@
-CFLAGS = @CFLAGS@
+CFLAGS = @CFLAGS@ -nopie
CPP = @CPP@
CPPFLAGS = @CPPFLAGS@
CPP_FOR_BUILD = @CPP_FOR_BUILD@
--- a/tests/mpbsd/Makefile.in 2010-07-27 00:53:05.000000000 +0000
+++ b/tests/mpbsd/Makefile.in 2010-07-27 00:35:10.000000000 +0000
@@ -200,7 +200,7 @@
CC = @CC@
CCAS = @CCAS@
CC_FOR_BUILD = @CC_FOR_BUILD@
-CFLAGS = @CFLAGS@
+CFLAGS = @CFLAGS@ -nopie
CPP = @CPP@
CPPFLAGS = @CPPFLAGS@
CPP_FOR_BUILD = @CPP_FOR_BUILD@
--- a/tests/mpf/Makefile.in 2010-07-27 00:53:05.000000000 +0000
+++ b/tests/mpf/Makefile.in 2010-07-27 00:35:10.000000000 +0000
@@ -200,7 +200,7 @@
CC = @CC@
CCAS = @CCAS@
CC_FOR_BUILD = @CC_FOR_BUILD@
-CFLAGS = @CFLAGS@
+CFLAGS = @CFLAGS@ -nopie
CPP = @CPP@
CPPFLAGS = @CPPFLAGS@
CPP_FOR_BUILD = @CPP_FOR_BUILD@
--- a/tests/mpn/Makefile.in 2010-07-27 00:53:05.000000000 +0000
+++ b/tests/mpn/Makefile.in 2010-07-27 00:35:10.000000000 +0000
@@ -200,7 +200,7 @@
CC = @CC@
CCAS = @CCAS@
CC_FOR_BUILD = @CC_FOR_BUILD@
-CFLAGS = @CFLAGS@
+CFLAGS = @CFLAGS@ -nopie
CPP = @CPP@
CPPFLAGS = @CPPFLAGS@
CPP_FOR_BUILD = @CPP_FOR_BUILD@
--- a/tests/mpq/Makefile.in 2010-07-27 00:53:05.000000000 +0000
+++ b/tests/mpq/Makefile.in 2010-07-27 00:35:10.000000000 +0000
@@ -200,7 +200,7 @@
CC = @CC@
CCAS = @CCAS@
CC_FOR_BUILD = @CC_FOR_BUILD@
-CFLAGS = @CFLAGS@
+CFLAGS = @CFLAGS@ -nopie
CPP = @CPP@
CPPFLAGS = @CPPFLAGS@
CPP_FOR_BUILD = @CPP_FOR_BUILD@
--- a/tests/mpz/Makefile.in 2010-07-27 00:53:05.000000000 +0000
+++ b/tests/mpz/Makefile.in 2010-07-27 00:35:10.000000000 +0000
@@ -200,7 +200,7 @@
CC = @CC@
CCAS = @CCAS@
CC_FOR_BUILD = @CC_FOR_BUILD@
-CFLAGS = @CFLAGS@
+CFLAGS = @CFLAGS@ -nopie
CPP = @CPP@
CPPFLAGS = @CPPFLAGS@
CPP_FOR_BUILD = @CPP_FOR_BUILD@
--- a/tests/rand/Makefile.in 2010-07-27 00:53:05.000000000 +0000
+++ b/tests/rand/Makefile.in 2010-07-27 00:35:10.000000000 +0000
@@ -200,7 +200,7 @@
CC = @CC@
CCAS = @CCAS@
CC_FOR_BUILD = @CC_FOR_BUILD@
-CFLAGS = @CFLAGS@
+CFLAGS = @CFLAGS@ -nopie
CPP = @CPP@
CPPFLAGS = @CPPFLAGS@
CPP_FOR_BUILD = @CPP_FOR_BUILD@
--- a/tests/cxx/Makefile.in 2010-02-06 12:43:21.000000000 +0000
+++ b/tests/cxx/Makefile.in 2010-07-27 01:31:43.000000000 +0000
@@ -189,13 +189,13 @@
CC = @CC@
CCAS = @CCAS@
CC_FOR_BUILD = @CC_FOR_BUILD@
-CFLAGS = @CFLAGS@
+CFLAGS = @CFLAGS@ -nopie
CPP = @CPP@
CPPFLAGS = @CPPFLAGS@
CPP_FOR_BUILD = @CPP_FOR_BUILD@
CXX = @CXX@
CXXCPP = @CXXCPP@
-CXXFLAGS = @CXXFLAGS@
+CXXFLAGS = @CXXFLAGS@ -nopie
CYGPATH_W = @CYGPATH_W@
DEFN_LONG_LONG_LIMB = @DEFN_LONG_LONG_LIMB@
DEFS = @DEFS@

View File

@ -0,0 +1,86 @@
# Copyright 1999-2011 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/dev-libs/gmp/gmp-5.0.2.ebuild,v 1.5 2011/09/04 21:01:37 maekke Exp $
inherit flag-o-matic eutils libtool flag-o-matic toolchain-funcs
DESCRIPTION="Library for arithmetic on arbitrary precision integers, rational numbers, and floating-point numbers"
HOMEPAGE="http://gmplib.org/"
SRC_URI="mirror://gnu/${PN}/${P}.tar.bz2"
# doc? ( http://www.nada.kth.se/~tege/${PN}-man-${PV}.pdf )"
LICENSE="LGPL-3"
SLOT="0"
KEYWORDS="~alpha amd64 arm ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc x86 ~sparc-fbsd ~x86-fbsd"
IUSE="nocxx" #doc
DEPEND="sys-devel/m4"
RDEPEND=""
src_unpack() {
unpack ${A}
cd "${S}"
[[ -d ${FILESDIR}/${PV} ]] && EPATCH_SUFFIX="diff" EPATCH_FORCE="yes" epatch "${FILESDIR}"/${PV}
epatch "${FILESDIR}"/${PN}-4.1.4-noexecstack.patch
epatch "${FILESDIR}"/${PN}-5.0.0-s390.diff
# disable -fPIE -pie in the tests for x86 #236054
if use x86 && gcc-specs-pie ; then
epatch "${FILESDIR}"/${PN}-5.0.1-x86-nopie-tests.patch
fi
# 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_compile() {
# 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"
fi
# ABI mappings (needs all architectures supported)
case ${ABI} in
32|x86) GMPABI=32;;
64|amd64|n64) GMPABI=64;;
o32|n32) GMPABI=${ABI};;
esac
export GMPABI
tc-export CC
econf \
--localstatedir=/var/state/gmp \
--disable-mpbsd \
$(use_enable !nocxx cxx) \
|| die "configure failed"
emake || die "emake failed"
}
src_install() {
emake DESTDIR="${D}" install || die "make install failed"
dodoc AUTHORS ChangeLog NEWS README
dodoc doc/configuration doc/isa_abi_headache
dohtml -r doc
#use doc && cp "${DISTDIR}"/gmp-man-${PV}.pdf "${D}"/usr/share/doc/${PF}/
}
pkg_preinst() {
preserve_old_lib /usr/$(get_libdir)/libgmp.so.3
}
pkg_postinst() {
preserve_old_lib_notify /usr/$(get_libdir)/libgmp.so.3
}