diff options
author | Anthony G. Basile <blueness@gentoo.org> | 2013-01-26 16:21:50 -0500 |
---|---|---|
committer | Anthony G. Basile <blueness@gentoo.org> | 2013-01-28 20:37:06 -0500 |
commit | 7d440be9c8948a68f6d58c27f09f357883154f1d (patch) | |
tree | 0ee6026d0b4424b65ffbed1ce6f797b2c0a32420 | |
parent | sys-libs/uclibc: restrict -r99 to just arm that doesn't have SYS_utime (diff) | |
download | hardened-dev-7d440be9c8948a68f6d58c27f09f357883154f1d.tar.gz hardened-dev-7d440be9c8948a68f6d58c27f09f357883154f1d.tar.bz2 hardened-dev-7d440be9c8948a68f6d58c27f09f357883154f1d.zip |
dev-libs/elfutils: fix mempcpy and assert_perror for uclibc
-rw-r--r-- | dev-libs/elfutils/Manifest | 8 | ||||
-rw-r--r-- | dev-libs/elfutils/elfutils-0.155.ebuild | 72 | ||||
-rw-r--r-- | dev-libs/elfutils/files/elfutils-0.118-PaX-support.patch | 26 | ||||
-rw-r--r-- | dev-libs/elfutils/files/elfutils-0.155-fallback-assert.patch | 28 | ||||
-rw-r--r-- | dev-libs/elfutils/files/elfutils-0.155-fallback-mempcpy.patch | 61 | ||||
-rw-r--r-- | dev-libs/elfutils/metadata.xml | 10 |
6 files changed, 205 insertions, 0 deletions
diff --git a/dev-libs/elfutils/Manifest b/dev-libs/elfutils/Manifest new file mode 100644 index 00000000..b0a558a8 --- /dev/null +++ b/dev-libs/elfutils/Manifest @@ -0,0 +1,8 @@ +AUX elfutils-0.118-PaX-support.patch 954 SHA256 e769e1168dc645ce99655f984f5c19a54d765210cacd098556b6b68743b877fa SHA512 d2b27b1715908ebc68c304a32b29e5bdebede5d4c9819b552617b3e3fd00f21570fa2346ec0e01b9b8028e9139eea629e0e70bee2f509ebfdacd31bbcd3bea0d WHIRLPOOL 47b537a5a01b9a1240b0e922eeef7e5e0e00b04cb474dbb0728849deba4a50c13e6a56b9b5476121771dab25a61641091deefd2cf94bb7cdcf4858f1b6222670 +AUX elfutils-0.155-fallback-assert.patch 1042 SHA256 0c2f8805ef0499f3c928f4aeffe8ddf9af69335af2c5ade2273899d7c6e1128c SHA512 a2d7cf1538cb881f7e7585919e89022331dd484c3f976269fdecb9443d4ba47e542bbf5a61bf736a9927d4888b735b0f91e46d654499e2d808fbd7a232370f00 WHIRLPOOL 7f953eb69f4b1c4627a28e9440d26f0f861b980979abc87ab876919ca3b80f92968e09ea37064a3c4c537e3e111ff89f16de2b6383e127f3754efded0403d8d4 +AUX elfutils-0.155-fallback-mempcpy.patch 2131 SHA256 098a6d87b4a4ad9a2f7ae80a147cca18c007d9a24e2b53b7b5ca55b88f7625ea SHA512 02ae4978bcbe54083f7936a6db663e02ea1dbfa4e79aa6303dc2bd5359329ad4b747d5a22a34f843f7c84be0389be46a77fe21e1afec4f68373de4e1cfa2bc9c WHIRLPOOL a02eb022b6ebd2b7a5422880e72465f1d7b667dd9adc085108649c38544aade7b1060ff3e2f03482cb5da19321059edf88bae648300797ba9f1ae04283808438 +DIST elfutils-0.155-portability.patch 57540 SHA256 b101c8360abc746a5a66cf0549e0d6259fa3cd78a1314e857e3962983a491171 SHA512 7a498f28134134ce81e25f39ea42ce36fac7a2cae79f6b2eda9c7d384f6dfb2907a013b4800da36ba9ab6ad18fac63eacf8a5847cf94248962d5580650d4b501 WHIRLPOOL f69852a6281203bff90934cd1c21e7507da1c0c217f88e6c158b2e5a59fc685a813a8f5ae138004f674918c7787425ab625e454f323ee65563b4893a0c57131f +DIST elfutils-0.155-robustify.patch 62788 SHA256 062a7940757aea1fedec4c9943bdd34b853c97458f229569777d65541b77c174 SHA512 d18fcdd6b57266805d3934ff07123b19f5da7df5ab72b8673d77e35929b34e14a33a08ec0940b06d763a0279d98d677892ccf89717bc995be6a839cab19acd97 WHIRLPOOL 30d3b3c96b03647dadb7860b15dc486147f20f6199fe4c7bb9b88c7fd20fa76d0fb3882e037caac54a40591f5aa9c155b6a86df16813542254dcbc2fc1cff86a +DIST elfutils-0.155.tar.bz2 2477883 SHA256 68444a4526416ffd68852ec3c6a40ceddcca46538297322405319884c5d30ed8 SHA512 4f434c7a01c768df00499cac4e02c2316077eab9a6b6f0e6f3ce5194e6cfd2258fa30f9a163febce15278e1fbbbab9c7238c0cf56bf7dbcb5363b42a1a947b8e WHIRLPOOL 30647d492eff02c92ac1c7b0e9d5090cde3cbf4541bcc61fbc38f9fdd40ade08763e5e8ff23e0874f77955dcd71bd73e8b1e9f77460dd453c74fa1643efe0156 +EBUILD elfutils-0.155.ebuild 2525 SHA256 696d8f14f966410b0c361e0a7f93b07ff1c56993cec1ffb55626fdddc981509e SHA512 c9e264e5142b86510bd3ebac19fa6dd6fe8273cad8daea77c77da51b3279c1329a6bdc331dc215fc6a7efbce3fadd7487321bfe38c875576be6bf8d030270957 WHIRLPOOL 41851b7c4f22cfb90c48f7166881c3aed51d7d85024f3db6ca9b7740680c6ddfd2ea7feffabd5c1be1cb8aa72f889e63600e6b84ae42de417baa950dc9cecc79 +MISC metadata.xml 438 SHA256 33cbcbd727257fa6d03488d531c099d33f4c3e4db3cf3739d11d8d4cd8266b37 SHA512 e013123116aa3a3f00fa77cc3e9d18a5c1f481dd304ee6af6e77e3e5e44fb9e3f94ac542fc10fb0c59dea6699c15cce11b1513c061494919f1e821120fb162d9 WHIRLPOOL f07f16d5235c538cef44daca3210ad7374af35705b6562b9bb17b2a5532ba0ed6ea32d1d7f23e93c899e8868503f7a9f8994d2454ca144c45ae7e9317fb0cabd diff --git a/dev-libs/elfutils/elfutils-0.155.ebuild b/dev-libs/elfutils/elfutils-0.155.ebuild new file mode 100644 index 00000000..a2129bd6 --- /dev/null +++ b/dev-libs/elfutils/elfutils-0.155.ebuild @@ -0,0 +1,72 @@ +# Copyright 1999-2013 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/dev-libs/elfutils/elfutils-0.155.ebuild,v 1.2 2012/10/09 15:49:14 vapier Exp $ + +EAPI="4" + +inherit autotools eutils flag-o-matic + +DESCRIPTION="Libraries/utilities to handle ELF objects (drop in replacement for libelf)" +HOMEPAGE="https://fedorahosted.org/elfutils/" +SRC_URI="https://fedorahosted.org/releases/e/l/${PN}/${PV}/${P}.tar.bz2 + https://fedorahosted.org/releases/e/l/${PN}/${PV}/${PN}-portability.patch -> ${P}-portability.patch + https://fedorahosted.org/releases/e/l/${PN}/${PV}/${PN}-robustify.patch -> ${P}-robustify.patch" + +LICENSE="GPL-2-with-exceptions" +SLOT="0" +KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-linux ~x86-linux" +IUSE="bzip2 lzma nls static-libs test +threads +utils zlib" + +# This pkg does not actually seem to compile currently in a uClibc +# environment (xrealloc errs), but we need to ensure that glibc never +# gets pulled in as a dep since this package does not respect virtual/libc +RDEPEND="zlib? ( >=sys-libs/zlib-1.2.2.3 ) + bzip2? ( app-arch/bzip2 ) + lzma? ( app-arch/xz-utils ) + !dev-libs/libelf" +DEPEND="${RDEPEND} + uclibc? ( sys-libs/argp-standalone ) + nls? ( sys-devel/gettext ) + >=sys-devel/flex-2.5.4a + sys-devel/m4" + +src_prepare() { + epatch "${FILESDIR}"/${PN}-0.155-fallback-mempcpy.patch + epatch "${FILESDIR}"/${PN}-0.155-fallback-assert.patch + eautoreconf + + epatch "${FILESDIR}"/${PN}-0.118-PaX-support.patch + epatch "${DISTDIR}"/${P}-{portability,robustify}.patch + sed -i -e 's:-Werror::g' $(find -name Makefile.in) || die + use test || sed -i -e 's: tests::' Makefile.in #226349 + use static-libs || sed -i -e '/^lib_LIBRARIES/s:=.*:=:' -e '/^%.os/s:%.o$::' lib{asm,dw,elf}/Makefile.in + # some patches touch both configure and configure.ac + find -type f -exec touch -r configure {} + +} + +src_configure() { + use test && append-flags -g #407135 + use uclibc && append-flags -Wl,-lintl + econf \ + --disable-werror \ + $(use_enable nls) \ + $(use_enable threads thread-safety) \ + --program-prefix="eu-" \ + $(use_with zlib) \ + $(use_with bzip2 bzlib) \ + $(use_with lzma) +} + +src_test() { + env LD_LIBRARY_PATH="${S}/libelf:${S}/libebl:${S}/libdw:${S}/libasm" \ + LC_ALL="C" \ + emake check || die +} + +src_install() { + default + dodoc NOTES + # These build quick, and are needed for most tests, so don't + # disable their building when the USE flag is disabled. + use utils || rm -rf "${ED}"/usr/bin +} diff --git a/dev-libs/elfutils/files/elfutils-0.118-PaX-support.patch b/dev-libs/elfutils/files/elfutils-0.118-PaX-support.patch new file mode 100644 index 00000000..083f32ff --- /dev/null +++ b/dev-libs/elfutils/files/elfutils-0.118-PaX-support.patch @@ -0,0 +1,26 @@ +Add support for PaX ELF markings + +Patch by Kevin F. Quinn <kevquinn@gentoo.org> + +http://bugs.gentoo.org/115100 + +--- libelf/elf.h ++++ libelf/elf.h +@@ -568,6 +568,7 @@ + #define PT_GNU_EH_FRAME 0x6474e550 /* GCC .eh_frame_hdr segment */ + #define PT_GNU_STACK 0x6474e551 /* Indicates stack executability */ + #define PT_GNU_RELRO 0x6474e552 /* Read-only after relocation */ ++#define PT_PAX_FLAGS 0x65041580 /* Indicates PaX flag markings */ + #define PT_LOSUNW 0x6ffffffa + #define PT_SUNWBSS 0x6ffffffa /* Sun Specific segment */ + #define PT_SUNWSTACK 0x6ffffffb /* Stack segment */ +--- src/elflint.c ++++ src/elflint.c +@@ -3187,6 +3187,7 @@ + + if (phdr->p_type >= PT_NUM && phdr->p_type != PT_GNU_EH_FRAME + && phdr->p_type != PT_GNU_STACK && phdr->p_type != PT_GNU_RELRO ++ && phdr->p_type != PT_PAX_FLAGS + /* Check for a known machine-specific type. */ + && ebl_segment_type_name (ebl, phdr->p_type, NULL, 0) == NULL) + ERROR (gettext ("\ diff --git a/dev-libs/elfutils/files/elfutils-0.155-fallback-assert.patch b/dev-libs/elfutils/files/elfutils-0.155-fallback-assert.patch new file mode 100644 index 00000000..a1c1c819 --- /dev/null +++ b/dev-libs/elfutils/files/elfutils-0.155-fallback-assert.patch @@ -0,0 +1,28 @@ +--- elfutils-0.155.orig/configure.ac 2013-01-26 21:46:03.000000000 +0000 ++++ elfutils-0.155/configure.ac 2013-01-26 21:48:04.000000000 +0000 +@@ -281,6 +281,9 @@ + dnl Check for __mempcpy + AC_CHECK_FUNCS_ONCE([__mempcpy]) + ++dnl check for assert_perror ++AC_CHECK_DECLS_ONCE([assert_perror]) ++ + dnl The directories with content. + + dnl Documentation. +--- elfutils-0.155.orig/lib/eu-config.h 2013-01-26 21:46:03.000000000 +0000 ++++ elfutils-0.155/lib/eu-config.h 2013-01-26 21:50:11.000000000 +0000 +@@ -33,8 +33,13 @@ + # include <pthread.h> + # include <assert.h> + # define rwlock_define(class,name) class pthread_rwlock_t name ++#if HAVE_DECL_ASSERT_PERROR + # define RWLOCK_CALL(call) \ + ({ int _err = pthread_rwlock_ ## call; assert_perror (_err); }) ++#else ++# define RWLOCK_CALL(call) \ ++ ({ int _err = pthread_rwlock_ ## call; assert (_err == 0); }) ++#endif + # define rwlock_init(lock) RWLOCK_CALL (init (&lock, NULL)) + # define rwlock_fini(lock) RWLOCK_CALL (destroy (&lock)) + # define rwlock_rdlock(lock) RWLOCK_CALL (rdlock (&lock)) diff --git a/dev-libs/elfutils/files/elfutils-0.155-fallback-mempcpy.patch b/dev-libs/elfutils/files/elfutils-0.155-fallback-mempcpy.patch new file mode 100644 index 00000000..e62daf8d --- /dev/null +++ b/dev-libs/elfutils/files/elfutils-0.155-fallback-mempcpy.patch @@ -0,0 +1,61 @@ +diff -Naur elfutils-0.155.orig/configure.ac elfutils-0.155/configure.ac +--- elfutils-0.155.orig/configure.ac 2013-01-26 16:27:55.000000000 -0500 ++++ elfutils-0.155/configure.ac 2013-01-26 16:32:15.000000000 -0500 +@@ -278,6 +278,9 @@ + AC_DEFINE([USE_DEMANGLE], [1], [Defined if demangling is enabled])]) + AM_CONDITIONAL(DEMANGLE, test "$ac_cv_lib_stdcpp___cxa_demangle" = yes) + ++dnl Check for __mempcpy ++AC_CHECK_FUNCS_ONCE([__mempcpy]) ++ + dnl The directories with content. + + dnl Documentation. +--- elfutils-0.155.orig/libelf/elf_begin.c 2013-01-26 16:27:55.000000000 -0500 ++++ elfutils-0.155/libelf/elf_begin.c 2013-01-26 16:39:21.000000000 -0500 +@@ -801,7 +801,11 @@ + } + + /* Copy the raw name over to a NUL terminated buffer. */ ++#ifdef HAVE___MEMPCPY + *((char *) __mempcpy (elf->state.ar.raw_name, ar_hdr->ar_name, 16)) = '\0'; ++#else ++ *((char *) mempcpy (elf->state.ar.raw_name, ar_hdr->ar_name, 16)) = '\0'; ++#endif + + elf_ar_hdr = &elf->state.ar.elf_ar_hdr; + +@@ -890,6 +894,7 @@ + filled in which case we cannot simply use atol/l but instead have + to create a temporary copy. */ + ++#ifdef HAVE___MEMPCPY + #define INT_FIELD(FIELD) \ + do \ + { \ +@@ -907,6 +912,25 @@ + elf_ar_hdr->FIELD = (__typeof (elf_ar_hdr->FIELD)) atoll (string); \ + } \ + while (0) ++#else ++#define INT_FIELD(FIELD) \ ++ do \ ++ { \ ++ char buf[sizeof (ar_hdr->FIELD) + 1]; \ ++ const char *string = ar_hdr->FIELD; \ ++ if (ar_hdr->FIELD[sizeof (ar_hdr->FIELD) - 1] != ' ') \ ++ { \ ++ *((char *) mempcpy (buf, ar_hdr->FIELD, sizeof (ar_hdr->FIELD))) \ ++ = '\0'; \ ++ string = buf; \ ++ } \ ++ if (sizeof (elf_ar_hdr->FIELD) <= sizeof (long int)) \ ++ elf_ar_hdr->FIELD = (__typeof (elf_ar_hdr->FIELD)) atol (string); \ ++ else \ ++ elf_ar_hdr->FIELD = (__typeof (elf_ar_hdr->FIELD)) atoll (string); \ ++ } \ ++ while (0) ++#endif + + INT_FIELD (ar_date); + INT_FIELD (ar_uid); diff --git a/dev-libs/elfutils/metadata.xml b/dev-libs/elfutils/metadata.xml new file mode 100644 index 00000000..6d5bc382 --- /dev/null +++ b/dev-libs/elfutils/metadata.xml @@ -0,0 +1,10 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd"> +<pkgmetadata> + <herd>toolchain</herd> + <use> + <flag name="lzma">Support automatic decompression of LZMA-compressed files and kernel images</flag> + <flag name="threads">Build the libraries with thread safe support</flag> + <flag name="utils">Install command-line utilities (all the eu-* programs)</flag> + </use> +</pkgmetadata> |