* [gentoo-commits] proj/hardened-dev:uclibc commit in: dev-libs/elfutils/files/, dev-libs/elfutils/
@ 2013-01-29 1:37 Anthony G. Basile
0 siblings, 0 replies; 6+ messages in thread
From: Anthony G. Basile @ 2013-01-29 1:37 UTC (permalink / raw
To: gentoo-commits
commit: 7d440be9c8948a68f6d58c27f09f357883154f1d
Author: Anthony G. Basile <blueness <AT> gentoo <DOT> org>
AuthorDate: Sat Jan 26 21:21:50 2013 +0000
Commit: Anthony G. Basile <blueness <AT> gentoo <DOT> org>
CommitDate: Tue Jan 29 01:37:06 2013 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/hardened-dev.git;a=commit;h=7d440be9
dev-libs/elfutils: fix mempcpy and assert_perror for uclibc
---
dev-libs/elfutils/elfutils-0.155.ebuild | 72 ++++++++++++++++++++
.../files/elfutils-0.118-PaX-support.patch | 26 +++++++
.../files/elfutils-0.155-fallback-assert.patch | 28 ++++++++
.../files/elfutils-0.155-fallback-mempcpy.patch | 61 +++++++++++++++++
dev-libs/elfutils/metadata.xml | 10 +++
5 files changed, 197 insertions(+), 0 deletions(-)
diff --git a/dev-libs/elfutils/elfutils-0.155.ebuild b/dev-libs/elfutils/elfutils-0.155.ebuild
new file mode 100644
index 0000000..a2129bd
--- /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 0000000..083f32f
--- /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 0000000..a1c1c81
--- /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 0000000..e62daf8
--- /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 0000000..6d5bc38
--- /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>
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [gentoo-commits] proj/hardened-dev:uclibc commit in: dev-libs/elfutils/files/, dev-libs/elfutils/
@ 2013-05-20 21:37 Anthony G. Basile
0 siblings, 0 replies; 6+ messages in thread
From: Anthony G. Basile @ 2013-05-20 21:37 UTC (permalink / raw
To: gentoo-commits
commit: 77949d822b6a39e38b4b620495547b08a5638885
Author: Anthony G. Basile <blueness <AT> gentoo <DOT> org>
AuthorDate: Mon May 20 21:37:13 2013 +0000
Commit: Anthony G. Basile <blueness <AT> gentoo <DOT> org>
CommitDate: Mon May 20 21:37:13 2013 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/hardened-dev.git;a=commit;h=77949d82
dev-libs/elfutils: use argp-standalone
---
dev-libs/elfutils/elfutils-0.155.ebuild | 6 ++-
.../elfutils-0.155-link-argp-standalone.patch | 56 ++++++++++++++++++++
2 files changed, 60 insertions(+), 2 deletions(-)
diff --git a/dev-libs/elfutils/elfutils-0.155.ebuild b/dev-libs/elfutils/elfutils-0.155.ebuild
index a2129bd..173a297 100644
--- a/dev-libs/elfutils/elfutils-0.155.ebuild
+++ b/dev-libs/elfutils/elfutils-0.155.ebuild
@@ -31,12 +31,14 @@ DEPEND="${RDEPEND}
sys-devel/m4"
src_prepare() {
+ epatch "${FILESDIR}"/${PN}-0.118-PaX-support.patch
+ epatch "${DISTDIR}"/${P}-{portability,robustify}.patch
+
epatch "${FILESDIR}"/${PN}-0.155-fallback-mempcpy.patch
epatch "${FILESDIR}"/${PN}-0.155-fallback-assert.patch
+ epatch "${FILESDIR}"/${PN}-0.155-link-argp-standalone.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
diff --git a/dev-libs/elfutils/files/elfutils-0.155-link-argp-standalone.patch b/dev-libs/elfutils/files/elfutils-0.155-link-argp-standalone.patch
new file mode 100644
index 0000000..4c0e341
--- /dev/null
+++ b/dev-libs/elfutils/files/elfutils-0.155-link-argp-standalone.patch
@@ -0,0 +1,56 @@
+diff -Naur elfutils-0.155.orig/libdw/Makefile.am elfutils-0.155/libdw/Makefile.am
+--- elfutils-0.155.orig/libdw/Makefile.am 2012-08-27 18:27:31.000000000 +0000
++++ elfutils-0.155/libdw/Makefile.am 2013-05-19 19:53:39.943546921 +0000
+@@ -111,7 +111,7 @@
+ -Wl,--enable-new-dtags,-rpath,$(pkglibdir) \
+ -Wl,--version-script,$<,--no-undefined \
+ -Wl,--whole-archive $(filter-out $<,$^) -Wl,--no-whole-archive\
+- -ldl $(zip_LIBS)
++ -ldl $(zip_LIBS) -largp
+ if readelf -d $@ | fgrep -q TEXTREL; then exit 1; fi
+ ln -fs $@ $@.$(VERSION)
+
+diff -Naur elfutils-0.155.orig/src/Makefile.am elfutils-0.155/src/Makefile.am
+--- elfutils-0.155.orig/src/Makefile.am 2012-08-27 18:29:31.000000000 +0000
++++ elfutils-0.155/src/Makefile.am 2013-05-19 19:59:30.707535687 +0000
+@@ -95,26 +95,26 @@
+ # XXX While the file is not finished, don't warn about this
+ ldgeneric_no_Wunused = yes
+
+-readelf_LDADD = $(libdw) $(libebl) $(libelf) $(libeu) $(libmudflap) -ldl
+-nm_LDADD = $(libdw) $(libebl) $(libelf) $(libeu) $(libmudflap) -ldl \
++readelf_LDADD = $(libdw) $(libebl) $(libelf) $(libeu) $(libmudflap) -ldl -largp
++nm_LDADD = $(libdw) $(libebl) $(libelf) $(libeu) $(libmudflap) -ldl -largp \
+ $(demanglelib)
+-size_LDADD = $(libelf) $(libeu) $(libmudflap)
+-strip_LDADD = $(libebl) $(libelf) $(libeu) $(libmudflap) -ldl
+-ld_LDADD = $(libebl) $(libelf) $(libeu) $(libmudflap) -ldl
++size_LDADD = $(libelf) $(libeu) $(libmudflap) -largp
++strip_LDADD = $(libebl) $(libelf) $(libeu) $(libmudflap) -ldl -largp
++ld_LDADD = $(libebl) $(libelf) $(libeu) $(libmudflap) -ldl -largp
+ if NATIVE_LD
+ # -ldl is always needed for libebl.
+ ld_LDADD += libld_elf.a
+ endif
+ ld_LDFLAGS = -rdynamic
+-elflint_LDADD = $(libebl) $(libelf) $(libeu) $(libmudflap) -ldl
+-findtextrel_LDADD = $(libdw) $(libelf) $(libmudflap)
+-addr2line_LDADD = $(libdw) $(libelf) $(libmudflap)
+-elfcmp_LDADD = $(libebl) $(libelf) $(libmudflap) -ldl
+-objdump_LDADD = $(libasm) $(libebl) $(libelf) $(libeu) $(libmudflap) -ldl
+-ranlib_LDADD = libar.a $(libelf) $(libeu) $(libmudflap)
+-strings_LDADD = $(libelf) $(libeu) $(libmudflap)
+-ar_LDADD = libar.a $(libelf) $(libeu) $(libmudflap)
+-unstrip_LDADD = $(libebl) $(libelf) $(libdw) $(libeu) $(libmudflap) -ldl
++elflint_LDADD = $(libebl) $(libelf) $(libeu) $(libmudflap) -ldl -largp
++findtextrel_LDADD = $(libdw) $(libelf) $(libmudflap) -largp
++addr2line_LDADD = $(libdw) $(libelf) $(libmudflap) -largp
++elfcmp_LDADD = $(libebl) $(libelf) $(libmudflap) -ldl -largp
++objdump_LDADD = $(libasm) $(libebl) $(libelf) $(libeu) $(libmudflap) -ldl -largp
++ranlib_LDADD = libar.a $(libelf) $(libeu) $(libmudflap) -largp
++strings_LDADD = $(libelf) $(libeu) $(libmudflap) -largp
++ar_LDADD = libar.a $(libelf) $(libeu) $(libmudflap) -largp
++unstrip_LDADD = $(libebl) $(libelf) $(libdw) $(libeu) $(libmudflap) -ldl -largp
+
+ ldlex.o: ldscript.c
+ ldlex_no_Werror = yes
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [gentoo-commits] proj/hardened-dev:uclibc commit in: dev-libs/elfutils/files/, dev-libs/elfutils/
@ 2013-05-20 22:55 Anthony G. Basile
0 siblings, 0 replies; 6+ messages in thread
From: Anthony G. Basile @ 2013-05-20 22:55 UTC (permalink / raw
To: gentoo-commits
commit: 77b702738d68c216fcefb6e2bf7226be23178153
Author: Anthony G. Basile <blueness <AT> gentoo <DOT> org>
AuthorDate: Mon May 20 22:56:34 2013 +0000
Commit: Anthony G. Basile <blueness <AT> gentoo <DOT> org>
CommitDate: Mon May 20 22:56:34 2013 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/hardened-dev.git;a=commit;h=77b70273
dev-libs/elfutils: remove mtrace
Package-Manager: portage-2.1.11.62
---
dev-libs/elfutils/elfutils-0.155.ebuild | 1 +
.../files/elfutils-0.155-remove-mtrace.patch | 191 ++++++++++++++++++++
2 files changed, 192 insertions(+), 0 deletions(-)
diff --git a/dev-libs/elfutils/elfutils-0.155.ebuild b/dev-libs/elfutils/elfutils-0.155.ebuild
index 173a297..0e46d90 100644
--- a/dev-libs/elfutils/elfutils-0.155.ebuild
+++ b/dev-libs/elfutils/elfutils-0.155.ebuild
@@ -37,6 +37,7 @@ src_prepare() {
epatch "${FILESDIR}"/${PN}-0.155-fallback-mempcpy.patch
epatch "${FILESDIR}"/${PN}-0.155-fallback-assert.patch
epatch "${FILESDIR}"/${PN}-0.155-link-argp-standalone.patch
+ epatch "${FILESDIR}"/${PN}-0.155-remove-mtrace.patch
eautoreconf
sed -i -e 's:-Werror::g' $(find -name Makefile.in) || die
diff --git a/dev-libs/elfutils/files/elfutils-0.155-remove-mtrace.patch b/dev-libs/elfutils/files/elfutils-0.155-remove-mtrace.patch
new file mode 100644
index 0000000..3021180
--- /dev/null
+++ b/dev-libs/elfutils/files/elfutils-0.155-remove-mtrace.patch
@@ -0,0 +1,191 @@
+diff -Naur elfutils-0.155.orig/src/addr2line.c elfutils-0.155/src/addr2line.c
+--- elfutils-0.155.orig/src/addr2line.c 2012-08-27 18:29:31.000000000 +0000
++++ elfutils-0.155/src/addr2line.c 2013-05-20 22:39:59.231647796 +0000
+@@ -30,7 +30,6 @@
+ #include <dwarf.h>
+ #include <libintl.h>
+ #include <locale.h>
+-#include <mcheck.h>
+ #include <stdbool.h>
+ #include <stdio.h>
+ #include <stdio_ext.h>
+@@ -121,9 +120,6 @@
+ int remaining;
+ int result = 0;
+
+- /* Make memory leak detection possible. */
+- mtrace ();
+-
+ /* We use no threads here which can interfere with handling a stream. */
+ (void) __fsetlocking (stdout, FSETLOCKING_BYCALLER);
+
+diff -Naur elfutils-0.155.orig/src/ar.c elfutils-0.155/src/ar.c
+--- elfutils-0.155.orig/src/ar.c 2012-08-27 18:27:31.000000000 +0000
++++ elfutils-0.155/src/ar.c 2013-05-20 22:40:10.431647717 +0000
+@@ -28,7 +28,6 @@
+ #include <libintl.h>
+ #include <limits.h>
+ #include <locale.h>
+-#include <mcheck.h>
+ #include <search.h>
+ #include <stdbool.h>
+ #include <stdlib.h>
+@@ -141,9 +140,6 @@
+ int
+ main (int argc, char *argv[])
+ {
+- /* Make memory leak detection possible. */
+- mtrace ();
+-
+ /* We use no threads here which can interfere with handling a stream. */
+ (void) __fsetlocking (stdin, FSETLOCKING_BYCALLER);
+ (void) __fsetlocking (stdout, FSETLOCKING_BYCALLER);
+diff -Naur elfutils-0.155.orig/src/ld.c elfutils-0.155/src/ld.c
+--- elfutils-0.155.orig/src/ld.c 2012-08-27 18:27:31.000000000 +0000
++++ elfutils-0.155/src/ld.c 2013-05-20 22:41:25.431647187 +0000
+@@ -26,7 +26,6 @@
+ #include <libelf.h>
+ #include <libintl.h>
+ #include <locale.h>
+-#include <mcheck.h>
+ #include <stdio.h>
+ #include <stdio_ext.h>
+ #include <stdlib.h>
+@@ -277,11 +276,6 @@
+ int remaining;
+ int err;
+
+-#ifndef NDEBUG
+- /* Enable memory debugging. */
+- mtrace ();
+-#endif
+-
+ /* Sanity check. We always want to use the LFS functionality. */
+ if (sizeof (off_t) != sizeof (off64_t))
+ abort ();
+diff -Naur elfutils-0.155.orig/src/nm.c elfutils-0.155/src/nm.c
+--- elfutils-0.155.orig/src/nm.c 2012-08-27 18:27:31.000000000 +0000
++++ elfutils-0.155/src/nm.c 2013-05-20 22:41:37.061647104 +0000
+@@ -33,7 +33,6 @@
+ #include <libdw.h>
+ #include <libintl.h>
+ #include <locale.h>
+-#include <mcheck.h>
+ #include <obstack.h>
+ #include <search.h>
+ #include <stdbool.h>
+@@ -217,9 +216,6 @@
+ int remaining;
+ int result = 0;
+
+- /* Make memory leak detection possible. */
+- mtrace ();
+-
+ /* We use no threads here which can interfere with handling a stream. */
+ (void) __fsetlocking (stdin, FSETLOCKING_BYCALLER);
+ (void) __fsetlocking (stdout, FSETLOCKING_BYCALLER);
+diff -Naur elfutils-0.155.orig/src/objdump.c elfutils-0.155/src/objdump.c
+--- elfutils-0.155.orig/src/objdump.c 2012-08-27 18:27:31.000000000 +0000
++++ elfutils-0.155/src/objdump.c 2013-05-20 22:41:48.531647023 +0000
+@@ -26,7 +26,6 @@
+ #include <inttypes.h>
+ #include <libintl.h>
+ #include <locale.h>
+-#include <mcheck.h>
+ #include <stdbool.h>
+ #include <stdio.h>
+ #include <stdio_ext.h>
+@@ -131,9 +130,6 @@
+ int
+ main (int argc, char *argv[])
+ {
+- /* Make memory leak detection possible. */
+- mtrace ();
+-
+ /* We use no threads here which can interfere with handling a stream. */
+ (void) __fsetlocking (stdin, FSETLOCKING_BYCALLER);
+ (void) __fsetlocking (stdout, FSETLOCKING_BYCALLER);
+diff -Naur elfutils-0.155.orig/src/ranlib.c elfutils-0.155/src/ranlib.c
+--- elfutils-0.155.orig/src/ranlib.c 2012-08-27 18:27:31.000000000 +0000
++++ elfutils-0.155/src/ranlib.c 2013-05-20 22:42:03.951646914 +0000
+@@ -29,7 +29,6 @@
+ #include <gelf.h>
+ #include <libintl.h>
+ #include <locale.h>
+-#include <mcheck.h>
+ #include <obstack.h>
+ #include <stdlib.h>
+ #include <stdio.h>
+@@ -78,9 +77,6 @@
+ int
+ main (int argc, char *argv[])
+ {
+- /* Make memory leak detection possible. */
+- mtrace ();
+-
+ /* We use no threads here which can interfere with handling a stream. */
+ (void) __fsetlocking (stdin, FSETLOCKING_BYCALLER);
+ (void) __fsetlocking (stdout, FSETLOCKING_BYCALLER);
+diff -Naur elfutils-0.155.orig/src/size.c elfutils-0.155/src/size.c
+--- elfutils-0.155.orig/src/size.c 2012-08-27 18:27:31.000000000 +0000
++++ elfutils-0.155/src/size.c 2013-05-20 22:42:16.271646827 +0000
+@@ -28,7 +28,6 @@
+ #include <libelf.h>
+ #include <libintl.h>
+ #include <locale.h>
+-#include <mcheck.h>
+ #include <stdbool.h>
+ #include <stdio.h>
+ #include <stdio_ext.h>
+@@ -160,9 +159,6 @@
+ int remaining;
+ int result = 0;
+
+- /* Make memory leak detection possible. */
+- mtrace ();
+-
+ /* We use no threads here which can interfere with handling a stream. */
+ __fsetlocking (stdin, FSETLOCKING_BYCALLER);
+ __fsetlocking (stdout, FSETLOCKING_BYCALLER);
+diff -Naur elfutils-0.155.orig/src/strip.c elfutils-0.155/src/strip.c
+--- elfutils-0.155.orig/src/strip.c 2012-08-27 18:29:31.000000000 +0000
++++ elfutils-0.155/src/strip.c 2013-05-20 22:42:28.781646739 +0000
+@@ -30,7 +30,6 @@
+ #include <libelf.h>
+ #include <libintl.h>
+ #include <locale.h>
+-#include <mcheck.h>
+ #include <stdbool.h>
+ #include <stdio.h>
+ #include <stdio_ext.h>
+@@ -155,9 +154,6 @@
+ int remaining;
+ int result = 0;
+
+- /* Make memory leak detection possible. */
+- mtrace ();
+-
+ /* We use no threads here which can interfere with handling a stream. */
+ __fsetlocking (stdin, FSETLOCKING_BYCALLER);
+ __fsetlocking (stdout, FSETLOCKING_BYCALLER);
+diff -Naur elfutils-0.155.orig/src/unstrip.c elfutils-0.155/src/unstrip.c
+--- elfutils-0.155.orig/src/unstrip.c 2012-08-27 18:27:31.000000000 +0000
++++ elfutils-0.155/src/unstrip.c 2013-05-20 22:42:44.201646629 +0000
+@@ -36,7 +36,6 @@
+ #include <fnmatch.h>
+ #include <libintl.h>
+ #include <locale.h>
+-#include <mcheck.h>
+ #include <stdbool.h>
+ #include <stdio.h>
+ #include <stdio_ext.h>
+@@ -2215,9 +2214,6 @@
+ int
+ main (int argc, char **argv)
+ {
+- /* Make memory leak detection possible. */
+- mtrace ();
+-
+ /* We use no threads here which can interfere with handling a stream. */
+ __fsetlocking (stdin, FSETLOCKING_BYCALLER);
+ __fsetlocking (stdout, FSETLOCKING_BYCALLER);
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [gentoo-commits] proj/hardened-dev:uclibc commit in: dev-libs/elfutils/files/, dev-libs/elfutils/
@ 2013-05-22 12:35 Anthony G. Basile
0 siblings, 0 replies; 6+ messages in thread
From: Anthony G. Basile @ 2013-05-22 12:35 UTC (permalink / raw
To: gentoo-commits
commit: aeea696ab0dbb8012b2dbb2b3f1b655ad02d0644
Author: Anthony G. Basile <blueness <AT> gentoo <DOT> org>
AuthorDate: Wed May 22 12:36:37 2013 +0000
Commit: Anthony G. Basile <blueness <AT> gentoo <DOT> org>
CommitDate: Wed May 22 12:36:37 2013 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/hardened-dev.git;a=commit;h=aeea696a
dev-libs/elfutils: remove profiling support
---
dev-libs/elfutils/elfutils-0.155.ebuild | 1 +
.../elfutils-0.155-remove-profiling-support.patch | 145 ++++++++++++++++++++
2 files changed, 146 insertions(+), 0 deletions(-)
diff --git a/dev-libs/elfutils/elfutils-0.155.ebuild b/dev-libs/elfutils/elfutils-0.155.ebuild
index 0e46d90..4d94af8 100644
--- a/dev-libs/elfutils/elfutils-0.155.ebuild
+++ b/dev-libs/elfutils/elfutils-0.155.ebuild
@@ -38,6 +38,7 @@ src_prepare() {
epatch "${FILESDIR}"/${PN}-0.155-fallback-assert.patch
epatch "${FILESDIR}"/${PN}-0.155-link-argp-standalone.patch
epatch "${FILESDIR}"/${PN}-0.155-remove-mtrace.patch
+ epatch "${FILESDIR}"/${PN}-0.155-remove-profiling-support.patch
eautoreconf
sed -i -e 's:-Werror::g' $(find -name Makefile.in) || die
diff --git a/dev-libs/elfutils/files/elfutils-0.155-remove-profiling-support.patch b/dev-libs/elfutils/files/elfutils-0.155-remove-profiling-support.patch
new file mode 100644
index 0000000..f97682f
--- /dev/null
+++ b/dev-libs/elfutils/files/elfutils-0.155-remove-profiling-support.patch
@@ -0,0 +1,145 @@
+diff -Naur elfutils-0.155.orig/src/ld.h elfutils-0.155/src/ld.h
+--- elfutils-0.155.orig/src/ld.h 2012-08-27 18:29:31.000000000 +0000
++++ elfutils-0.155/src/ld.h 2013-05-22 12:21:43.171830137 +0000
+@@ -291,7 +291,7 @@
+ const char **(*lib_extensions) (struct ld_state *)
+ __attribute__ ((__const__));
+ #define LIB_EXTENSION(state) \
+- DL_CALL_FCT ((state)->callbacks.lib_extensions, (state))
++ ((state)->callbacks.lib_extensions)(state)
+
+ /* Process the given file. If the file is not yet open, open it.
+ The first parameter is a file descriptor for the file which can
+@@ -302,12 +302,12 @@
+ int (*file_process) (int fd, struct usedfiles *, struct ld_state *,
+ struct usedfiles **);
+ #define FILE_PROCESS(fd, file, state, nextp) \
+- DL_CALL_FCT ((state)->callbacks.file_process, (fd, file, state, nextp))
++ ((state)->callbacks.file_process)(fd, file, state, nextp)
+
+ /* Close the given file. */
+ int (*file_close) (struct usedfiles *, struct ld_state *);
+ #define FILE_CLOSE(file, state) \
+- DL_CALL_FCT ((state)->callbacks.file_close, (file, state))
++ ((state)->callbacks.file_close)(file, state)
+
+ /* Create the output sections now. This requires knowledge about
+ all the sections we will need. It may be necessary to sort the
+@@ -319,99 +319,97 @@
+ output routines. */
+ void (*create_sections) (struct ld_state *);
+ #define CREATE_SECTIONS(state) \
+- DL_CALL_FCT ((state)->callbacks.create_sections, (state))
++ ((state)->callbacks.create_sections)(state)
+
+ /* Determine whether we have any non-weak unresolved references left. */
+ int (*flag_unresolved) (struct ld_state *);
+ #define FLAG_UNRESOLVED(state) \
+- DL_CALL_FCT ((state)->callbacks.flag_unresolved, (state))
++ ((state)->callbacks.flag_unresolved)(state)
+
+ /* Create the sections which are generated by the linker and are not
+ present in the input file. */
+ void (*generate_sections) (struct ld_state *);
+ #define GENERATE_SECTIONS(state) \
+- DL_CALL_FCT ((state)->callbacks.generate_sections, (state))
++ ((state)->callbacks.generate_sections)(state)
+
+ /* Open the output file. The file name is given or "a.out". We
+ create as much of the ELF structure as possible. */
+ int (*open_outfile) (struct ld_state *, int, int, int);
+ #define OPEN_OUTFILE(state, machine, class, data) \
+- DL_CALL_FCT ((state)->callbacks.open_outfile, (state, machine, class, data))
++ ((state)->callbacks.open_outfile)(state, machine, class, data)
+
+ /* Create the data for the output file. */
+ int (*create_outfile) (struct ld_state *);
+ #define CREATE_OUTFILE(state) \
+- DL_CALL_FCT ((state)->callbacks.create_outfile, (state))
++ ((state)->callbacks.create_outfile)(state)
+
+ /* Process a relocation section. */
+ void (*relocate_section) (struct ld_state *, Elf_Scn *, struct scninfo *,
+ const Elf32_Word *);
+ #define RELOCATE_SECTION(state, outscn, first, dblindirect) \
+- DL_CALL_FCT ((state)->callbacks.relocate_section, (state, outscn, first, \
+- dblindirect))
++ ((state)->callbacks.relocate_section)(state, outscn, first, dblindirect)
+
+ /* Allocate a data buffer for the relocations of the given output
+ section. */
+ void (*count_relocations) (struct ld_state *, struct scninfo *);
+ #define COUNT_RELOCATIONS(state, scninfo) \
+- DL_CALL_FCT ((state)->callbacks.count_relocations, (state, scninfo))
++ ((state)->callbacks.count_relocations)(state, scninfo)
+
+ /* Create relocations for executable or DSO. */
+ void (*create_relocations) (struct ld_state *, const Elf32_Word *);
+ #define CREATE_RELOCATIONS(state, dlbindirect) \
+- DL_CALL_FCT ((state)->callbacks.create_relocations, (state, dblindirect))
++ ((state)->callbacks.create_relocations)(state, dblindirect)
+
+ /* Finalize the output file. */
+ int (*finalize) (struct ld_state *);
+ #define FINALIZE(state) \
+- DL_CALL_FCT ((state)->callbacks.finalize, (state))
++ ((state)->callbacks.finalize)(state)
+
+ /* Check whether special section number is known. */
+ bool (*special_section_number_p) (struct ld_state *, size_t);
+ #define SPECIAL_SECTION_NUMBER_P(state, number) \
+- DL_CALL_FCT ((state)->callbacks.special_section_number_p, (state, number))
++ ((state)->callbacks.special_section_number_p)(state, number)
+
+ /* Check whether section type is known. */
+ bool (*section_type_p) (struct ld_state *, XElf_Word);
+ #define SECTION_TYPE_P(state, type) \
+- DL_CALL_FCT ((state)->callbacks.section_type_p, (state, type))
++ ((state)->callbacks.section_type_p)(state, type)
+
+ /* Return section flags for .dynamic section. */
+ XElf_Xword (*dynamic_section_flags) (struct ld_state *);
+ #define DYNAMIC_SECTION_FLAGS(state) \
+- DL_CALL_FCT ((state)->callbacks.dynamic_section_flags, (state))
++ ((state)->callbacks.dynamic_section_flags)(state)
+
+ /* Create the data structures for the .plt section and initialize it. */
+ void (*initialize_plt) (struct ld_state *, Elf_Scn *scn);
+ #define INITIALIZE_PLT(state, scn) \
+- DL_CALL_FCT ((state)->callbacks.initialize_plt, (state, scn))
++ ((state)->callbacks.initialize_plt)(state, scn)
+
+ /* Create the data structures for the .rel.plt section and initialize it. */
+ void (*initialize_pltrel) (struct ld_state *, Elf_Scn *scn);
+ #define INITIALIZE_PLTREL(state, scn) \
+- DL_CALL_FCT ((state)->callbacks.initialize_pltrel, (state, scn))
++ ((state)->callbacks.initialize_pltrel)(state, scn)
+
+ /* Finalize the .plt section the what belongs to them. */
+ void (*finalize_plt) (struct ld_state *, size_t, size_t, struct symbol **);
+ #define FINALIZE_PLT(state, nsym, nsym_dyn, ndxtosym) \
+- DL_CALL_FCT ((state)->callbacks.finalize_plt, (state, nsym, nsym_dyn, \
+- ndxtosym))
++ ((state)->callbacks.finalize_plt)(state, nsym, nsym_dyn, ndxtosym)
+
+ /* Create the data structures for the .got section and initialize it. */
+ void (*initialize_got) (struct ld_state *, Elf_Scn *scn);
+ #define INITIALIZE_GOT(state, scn) \
+- DL_CALL_FCT ((state)->callbacks.initialize_got, (state, scn))
++ ((state)->callbacks.initialize_got)(state, scn)
+
+ /* Create the data structures for the .got.plt section and initialize it. */
+ void (*initialize_gotplt) (struct ld_state *, Elf_Scn *scn);
+ #define INITIALIZE_GOTPLT(state, scn) \
+- DL_CALL_FCT ((state)->callbacks.initialize_gotplt, (state, scn))
++ ((state)->callbacks.initialize_gotplt)(state, scn)
+
+ /* Return the tag corresponding to the native relocation type for
+ the platform. */
+ int (*rel_type) (struct ld_state *);
+ #define REL_TYPE(state) \
+- DL_CALL_FCT ((state)->callbacks.rel_type, (state))
++ ((state)->callbacks.rel_type)(state)
+ };
+
+
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [gentoo-commits] proj/hardened-dev:uclibc commit in: dev-libs/elfutils/files/, dev-libs/elfutils/
@ 2013-05-25 3:58 Anthony G. Basile
0 siblings, 0 replies; 6+ messages in thread
From: Anthony G. Basile @ 2013-05-25 3:58 UTC (permalink / raw
To: gentoo-commits
commit: 1820850a7c8f5c0489a33bac3c271c07d57369d9
Author: Anthony G. Basile <blueness <AT> gentoo <DOT> org>
AuthorDate: Sat May 25 03:57:59 2013 +0000
Commit: Anthony G. Basile <blueness <AT> gentoo <DOT> org>
CommitDate: Sat May 25 03:57:59 2013 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/hardened-dev.git;a=commit;h=1820850a
dev-libs/elfutils: replace futimes with utimes
Package-Manager: portage-2.1.11.62
---
dev-libs/elfutils/elfutils-0.155.ebuild | 1 +
.../files/elfutils-0.155-replace-futimes.patch | 12 ++++++++++++
2 files changed, 13 insertions(+), 0 deletions(-)
diff --git a/dev-libs/elfutils/elfutils-0.155.ebuild b/dev-libs/elfutils/elfutils-0.155.ebuild
index 4d94af8..6e79b0b 100644
--- a/dev-libs/elfutils/elfutils-0.155.ebuild
+++ b/dev-libs/elfutils/elfutils-0.155.ebuild
@@ -39,6 +39,7 @@ src_prepare() {
epatch "${FILESDIR}"/${PN}-0.155-link-argp-standalone.patch
epatch "${FILESDIR}"/${PN}-0.155-remove-mtrace.patch
epatch "${FILESDIR}"/${PN}-0.155-remove-profiling-support.patch
+ epatch "${FILESDIR}"/${PN}-0.155-replace-futimes.patch
eautoreconf
sed -i -e 's:-Werror::g' $(find -name Makefile.in) || die
diff --git a/dev-libs/elfutils/files/elfutils-0.155-replace-futimes.patch b/dev-libs/elfutils/files/elfutils-0.155-replace-futimes.patch
new file mode 100644
index 0000000..2ed3a92
--- /dev/null
+++ b/dev-libs/elfutils/files/elfutils-0.155-replace-futimes.patch
@@ -0,0 +1,12 @@
+diff -Naur elfutils-0.155.orig/src/ar.c elfutils-0.155/src/ar.c
+--- elfutils-0.155.orig/src/ar.c 2012-08-27 18:27:31.000000000 +0000
++++ elfutils-0.155/src/ar.c 2013-05-22 13:17:26.111852015 +0000
+@@ -689,7 +685,7 @@
+ tv[1].tv_sec = arhdr->ar_date;
+ tv[1].tv_usec = 0;
+
+- if (unlikely (futimes (xfd, tv) != 0))
++ if (unlikely (utimes (arhdr->ar_name, tv) != 0))
+ {
+ error (0, errno,
+ gettext ("cannot change modification time of %s"),
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [gentoo-commits] proj/hardened-dev:uclibc commit in: dev-libs/elfutils/files/, dev-libs/elfutils/
@ 2013-05-30 0:57 Anthony G. Basile
0 siblings, 0 replies; 6+ messages in thread
From: Anthony G. Basile @ 2013-05-30 0:57 UTC (permalink / raw
To: gentoo-commits
commit: 343b7744b26424b631a72b2c80e9f2a55e5d0d03
Author: Anthony G. Basile <blueness <AT> gentoo <DOT> org>
AuthorDate: Thu May 30 00:56:25 2013 +0000
Commit: Anthony G. Basile <blueness <AT> gentoo <DOT> org>
CommitDate: Thu May 30 00:56:25 2013 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/hardened-dev.git;a=commit;h=343b7744
dev-libs/elfutils: replace obstack_printf with asprintf/obstack_grow
Package-Manager: portage-2.1.11.62
Manifest-Sign-Key: 0xF52D4BBA
---
dev-libs/elfutils/elfutils-0.155.ebuild | 1 +
.../elfutils-0.155-replace-obstack_printf.patch | 38 ++++++++++++++++++++++
2 files changed, 39 insertions(+)
diff --git a/dev-libs/elfutils/elfutils-0.155.ebuild b/dev-libs/elfutils/elfutils-0.155.ebuild
index 6e79b0b..d8454ad 100644
--- a/dev-libs/elfutils/elfutils-0.155.ebuild
+++ b/dev-libs/elfutils/elfutils-0.155.ebuild
@@ -40,6 +40,7 @@ src_prepare() {
epatch "${FILESDIR}"/${PN}-0.155-remove-mtrace.patch
epatch "${FILESDIR}"/${PN}-0.155-remove-profiling-support.patch
epatch "${FILESDIR}"/${PN}-0.155-replace-futimes.patch
+ epatch "${FILESDIR}"/${PN}-0.155-replace-obstack_printf.patch
eautoreconf
sed -i -e 's:-Werror::g' $(find -name Makefile.in) || die
diff --git a/dev-libs/elfutils/files/elfutils-0.155-replace-obstack_printf.patch b/dev-libs/elfutils/files/elfutils-0.155-replace-obstack_printf.patch
new file mode 100644
index 0000000..0b6c226
--- /dev/null
+++ b/dev-libs/elfutils/files/elfutils-0.155-replace-obstack_printf.patch
@@ -0,0 +1,38 @@
+diff -Naur elfutils-0.155.orig/src/nm.c elfutils-0.155/src/nm.c
+--- elfutils-0.155.orig/src/nm.c 2013-05-30 00:32:10.259792903 +0000
++++ elfutils-0.155/src/nm.c 2013-05-30 00:32:42.069792699 +0000
+@@ -1286,12 +1286,11 @@
+ /* We found the line. */
+ int lineno;
+ (void) dwarf_lineno (line, &lineno);
+- int n;
+- n = obstack_printf (&whereob, "%s:%d%c",
+- basename (dwarf_linesrc (line,
+- NULL,
+- NULL)),
+- lineno, '\0');
++ char *s;
++ int n = asprintf (&s, "%s:%d%c",
++ basename (dwarf_linesrc (line, NULL, NULL)),
++ lineno, '\0');
++ obstack_grow (&whereob, s, strlen(s));
+ sym_mem[nentries_used].where
+ = obstack_finish (&whereob);
+
+@@ -1318,10 +1317,12 @@
+ if (found != NULL)
+ {
+ /* We found the line. */
+- int n = obstack_printf (&whereob, "%s:%" PRIu64 "%c",
+- basename ((*found)->file),
+- (*found)->lineno,
+- '\0');
++ char *s;
++ int n = asprintf (&s, "%s:%" PRIu64 "%c",
++ basename ((*found)->file),
++ (*found)->lineno,
++ '\0');
++ obstack_grow (&whereob, s, strlen(s));
+ sym_mem[nentries_used].where = obstack_finish (&whereob);
+
+ /* The return value of obstack_print included the
^ permalink raw reply related [flat|nested] 6+ messages in thread
end of thread, other threads:[~2013-05-30 0:57 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-05-20 22:55 [gentoo-commits] proj/hardened-dev:uclibc commit in: dev-libs/elfutils/files/, dev-libs/elfutils/ Anthony G. Basile
-- strict thread matches above, loose matches on Subject: below --
2013-05-30 0:57 Anthony G. Basile
2013-05-25 3:58 Anthony G. Basile
2013-05-22 12:35 Anthony G. Basile
2013-05-20 21:37 Anthony G. Basile
2013-01-29 1:37 Anthony G. Basile
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox