summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorV3n3RiX <venerix@redcorelinux.org>2019-12-31 15:20:29 +0000
committerV3n3RiX <venerix@redcorelinux.org>2019-12-31 15:20:29 +0000
commitccaa7664498ab56de5e05d0b0d3c0d45fb010c2e (patch)
tree0f35167eb3bd66784dbe9e005581daf1861f83c5
parent0d81ce2466fa9660979d0e31ce7a9ba1989dbb99 (diff)
sys-libs/glibc : grab small tweaks from Gentoo's ebuild
-rw-r--r--sys-libs/glibc/Manifest2
-rw-r--r--sys-libs/glibc/glibc-2.28-r314.ebuild (renamed from sys-libs/glibc/glibc-2.28-r1337.ebuild)74
2 files changed, 41 insertions, 35 deletions
diff --git a/sys-libs/glibc/Manifest b/sys-libs/glibc/Manifest
index 03e7adf2..01f7837d 100644
--- a/sys-libs/glibc/Manifest
+++ b/sys-libs/glibc/Manifest
@@ -1,3 +1,3 @@
DIST gcc-multilib-bootstrap-20180511.tar.xz 2392908 BLAKE2B f3cf614399368acd8908f60d894c6344a2fa09383b30c1633a0682bc668367c8a2f8c6fec2d41b6e2178d709a2bd8db57e8b2ab56ba263c7d56f819c15acd061 SHA512 98c766e913693ab42ff790557acde2a36a8001e2648046a685b21964200df8d4d52d8452d499c0068c6648284d086ce062c2d36e2c6c2fd8aacd232d193f2853
-DIST glibc-2.28-patches-6.tar.xz 89724 BLAKE2B f846534dc912f11ed9b22badfd28ef0402451654390756d2f6332f52ce7c2d3491ed90bbdf2553d7bb38caea6373ad2d3c19e4a1f31f3669948f4e2cbaeb1577 SHA512 f687febde875bb8adb7a61408caea3db99bbbda703eb3486c7d5c09540515e657eda406bf14686498e2c093355c72395502a343201e02cfc97adf6483d8e7455
+DIST glibc-2.28-patches-9.tar.xz 98588 BLAKE2B 4ab583be712994f949dee2512da6e12fd7f7ad73e96393f21678552b43da98f49321b53b5b009551300cdb09ca135e7f6adc636ff750c251a1d6d7f262dbc410 SHA512 e3f40ae6e9d06471c1a11bd2bce7b5161d07c3d0a81791505a72aec4817e7faf9ef09841e98c6dcf62a0a00754dff87dd194d97ac6b6354aeb2497cf60900b96
DIST glibc-2.28.tar.xz 16484344 BLAKE2B 9aa8cbd5a145c2a6fde3a60b3d0a14b12b46ed79333ad1ca3e73464adcfe700277a17a9e7fd0ca36e355a0c5b0b27decfa091da320ba802741ad75cc955bbcc8 SHA512 521f820953ff07c69ece4c2186f59fc061a7f9747932cd70ef2995c2b2deee76eeb6de700d85071cdca5949179aa8ccee75eda7feca1394121ec7b821ad0a3f3
diff --git a/sys-libs/glibc/glibc-2.28-r1337.ebuild b/sys-libs/glibc/glibc-2.28-r314.ebuild
index bbe2505a..8752c872 100644
--- a/sys-libs/glibc/glibc-2.28-r1337.ebuild
+++ b/sys-libs/glibc/glibc-2.28-r314.ebuild
@@ -1,4 +1,4 @@
-# Copyright 1999-2018 Gentoo Authors
+# Copyright 1999-2019 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=6
@@ -9,7 +9,6 @@ inherit prefix eutils eapi7-ver toolchain-funcs flag-o-matic gnuconfig \
DESCRIPTION="GNU libc C library"
HOMEPAGE="https://www.gnu.org/software/libc/"
LICENSE="LGPL-2.1+ BSD HPND ISC inner-net rc PCRE"
-RESTRICT="strip" # Strip ourself #46186
SLOT="2.2"
EMULTILIB_PKG="true"
@@ -18,7 +17,7 @@ if [[ ${PV} == 9999* ]]; then
EGIT_REPO_URI="https://sourceware.org/git/glibc.git"
inherit git-r3
else
- KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86"
+ KEYWORDS="alpha amd64 arm arm64 hppa ia64 m68k ~mips ppc ppc64 s390 sh sparc x86"
SRC_URI="mirror://gnu/glibc/${P}.tar.xz"
fi
@@ -27,12 +26,12 @@ RELEASE_VER=${PV}
GCC_BOOTSTRAP_VER=20180511
# Gentoo patchset
-PATCH_VER=6
+PATCH_VER=9
SRC_URI+=" https://dev.gentoo.org/~dilfridge/distfiles/${P}-patches-${PATCH_VER}.tar.xz"
SRC_URI+=" multilib? ( https://dev.gentoo.org/~dilfridge/distfiles/gcc-multilib-bootstrap-${GCC_BOOTSTRAP_VER}.tar.xz )"
-IUSE="audit caps cet compile-locales doc gd headers-only +multiarch multilib nscd profile selinux suid systemtap test vanilla"
+IUSE="audit caps cet compile-locales doc gd headers-only +multiarch multilib nscd profile selinux +ssp suid systemtap test vanilla"
# Minimum kernel version that glibc requires
MIN_KERN_VER="3.2.0"
@@ -59,6 +58,28 @@ if [[ ${CTARGET} == ${CHOST} ]] ; then
fi
fi
+# Note [Disable automatic stripping]
+# Disabling automatic stripping for a few reasons:
+# - portage's attempt to strip breaks non-native binaries at least on
+# arm: bug #697428
+# - portage's attempt to strip libpthread.so.0 breaks gdb thread
+# enumeration: bug #697910. This is quite subtle:
+# * gdb uses glibc's libthread_db-1.0.so to enumerate threads.
+# * libthread_db-1.0.so needs access to libpthread.so.0 local symbols
+# via 'ps_pglobal_lookup' symbol defined in gdb.
+# * 'ps_pglobal_lookup' uses '.symtab' section table to resolve all
+# known symbols in 'libpthread.so.0'. Specifically 'nptl_version'
+# (unexported) is used to sanity check compatibility before enabling
+# debugging.
+# Also see https://sourceware.org/gdb/wiki/FAQ#GDB_does_not_see_any_threads_besides_the_one_in_which_crash_occurred.3B_or_SIGTRAP_kills_my_program_when_I_set_a_breakpoint
+# * normal 'strip' command trims '.symtab'
+# Thus our main goal here is to prevent 'libpthread.so.0' from
+# losing it's '.symtab' entries.
+# As Gentoo's strip does not allow us to pass less aggressive stripping
+# options and does not check the machine target we disable stripping
+# entirely.
+RESTRICT="strip !test? ( test )"
+
# We need a new-enough binutils/gcc to match upstream baseline.
# Also we need to make sure our binutils/gcc supports TLS,
# and that gcc already contains the hardened patches.
@@ -74,18 +95,13 @@ COMMON_DEPEND="
DEPEND="${COMMON_DEPEND}
>=app-misc/pax-utils-0.1.10
sys-devel/bison
- !<sys-apps/sandbox-1.6
- !<sys-apps/portage-2.1.2
!<sys-devel/bison-2.7
!<sys-devel/make-4
doc? ( sys-apps/texinfo )
test? ( >=net-dns/libidn2-2.0.5 )
"
RDEPEND="${COMMON_DEPEND}
- >=net-dns/libidn2-2.0.5
sys-apps/gentoo-functions
- !sys-kernel/ps3-sources
- !sys-libs/nss-db
"
if [[ ${CATEGORY} == cross-* ]] ; then
@@ -100,7 +116,10 @@ else
>=sys-devel/gcc-6
virtual/os-headers
"
- RDEPEND+=" vanilla? ( !sys-libs/timezone-data )"
+ RDEPEND+="
+ >=net-dns/libidn2-2.0.5
+ vanilla? ( !sys-libs/timezone-data )
+ "
PDEPEND+=" !vanilla? ( sys-libs/timezone-data )"
fi
@@ -448,7 +467,7 @@ setup_env() {
export ABI=${ABI:-${DEFAULT_ABI:-default}}
- if use headers-only ; then
+ if just_headers ; then
# Avoid mixing host's CC and target's CFLAGS_${ABI}:
# At this bootstrap stage we have only binutils for
# target but not compiler yet.
@@ -597,7 +616,7 @@ sanity_prechecks() {
if has_version ">${CATEGORY}/${P}-r10000" ; then
eerror "Sanity check to keep you from breaking your system:"
eerror " Downgrading glibc is not supported and a sure way to destruction."
- die "Aborting to save your system."
+ [[ ${I_ALLOW_TO_BREAK_MY_SYSTEM} = yes ]] || die "Aborting to save your system."
fi
if ! do_run_test '#include <unistd.h>\n#include <sys/syscall.h>\nint main(){return syscall(1000)!=-1;}\n' ; then
@@ -799,6 +818,11 @@ glibc_do_configure() {
local myconf=()
case ${CTARGET} in
+ m68k*)
+ # setjmp() is not compatible with stack protection:
+ # https://sourceware.org/PR24202
+ myconf+=( --enable-stack-protector=no )
+ ;;
powerpc-*)
# Currently gcc on powerpc32 generates invalid code for
# __builtin_return_address(0) calls. Normally programs
@@ -808,7 +832,7 @@ glibc_do_configure() {
myconf+=( --enable-stack-protector=no )
;;
*)
- myconf+=( --enable-stack-protector=all )
+ myconf+=( --enable-stack-protector=$(usex ssp all no) )
;;
esac
myconf+=( --enable-stackguard-randomization )
@@ -1060,7 +1084,7 @@ src_configure() {
}
do_src_compile() {
- emake -C "$(builddir nptl)" || die "make nptl for ${ABI} failed"
+ emake -C "$(builddir nptl)"
}
src_compile() {
@@ -1113,7 +1137,7 @@ glibc_do_src_install() {
local builddir=$(builddir nptl)
cd "${builddir}"
- emake install_root="${D}$(alt_prefix)" install || die
+ emake install_root="${D}$(alt_prefix)" install
# This version (2.26) provides some compatibility libraries for the NIS/NIS+ support
# which come without headers etc. Only needed for binary packages since the
@@ -1294,23 +1318,6 @@ glibc_headers_install() {
dosym usr/include $(alt_prefix)/sys-include
}
-src_strip() {
- # gdb is lame and requires some debugging information to remain in
- # libpthread, so we need to strip it by hand. libthread_db makes no
- # sense stripped as it is only used when debugging.
- local pthread=$(has splitdebug ${FEATURES} && echo "libthread_db" || echo "lib{pthread,thread_db}")
- env \
- -uRESTRICT \
- CHOST=${CTARGET} \
- STRIP_MASK="/*/{,tls/}${pthread}*" \
- prepallstrip
- # if user has stripping enabled and does not have split debug turned on,
- # then leave the debugging sections in libpthread.
- if ! has nostrip ${FEATURES} && ! has splitdebug ${FEATURES} ; then
- ${STRIP:-${CTARGET}-strip} --strip-debug "${ED}"$(alt_prefix)/*/libpthread-*.so
- fi
-}
-
src_install() {
if just_headers ; then
export ABI=default
@@ -1319,7 +1326,6 @@ src_install() {
fi
foreach_abi glibc_do_src_install
- src_strip
}
# Simple test to make sure our new glibc isn't completely broken.