Revision: 6771 http://ipcop.svn.sourceforge.net/ipcop/?rev=6771&view=rev Author: gespinasse Date: 2012-08-19 19:52:11 +0000 (Sun, 19 Aug 2012) Log Message: ----------- Add patches from alt-linux to compile with binutils-2.22
Modified Paths: -------------- ipcop/trunk/lfs/glibc Added Paths: ----------- ipcop/trunk/src/patches/glibc-2.11_elf-noload-against-ldl.patch ipcop/trunk/src/patches/glibc-2.11_link-as-needed-against-ld.so.patch ipcop/trunk/src/patches/glibc-2.11_remove-ctors-dtors-outputs.patch Modified: ipcop/trunk/lfs/glibc =================================================================== --- ipcop/trunk/lfs/glibc 2012-08-19 15:58:53 UTC (rev 6770) +++ ipcop/trunk/lfs/glibc 2012-08-19 19:52:11 UTC (rev 6771) @@ -122,6 +122,10 @@ # this fix 'checking for working GNU getopt function... no' for packages that include recent gnulib getopt test # like bison-2.5.1, coreutils-8.17, diffutils-3.2, grep-2.13, gzip-1.5, wget-1.13.4 cd $(DIR_APP) && patch -p1 -i $(DIR_PATCHES)/glibc-2.14.1_getopt.patch + # required by binutils-2.22 (alt-linux borrowed) + cd $(DIR_APP) && patch -p1 -i $(DIR_PATCHES)/glibc-2.11_remove-ctors-dtors-outputs.patch + cd $(DIR_APP) && patch -p1 -i $(DIR_PATCHES)/glibc-2.11_elf-noload-against-ldl.patch + cd $(DIR_APP) && patch -p1 -i $(DIR_PATCHES)/glibc-2.11_link-as-needed-against-ld.so.patch @mkdir $(DIR_SRC)/glibc-build Added: ipcop/trunk/src/patches/glibc-2.11_elf-noload-against-ldl.patch =================================================================== --- ipcop/trunk/src/patches/glibc-2.11_elf-noload-against-ldl.patch (rev 0) +++ ipcop/trunk/src/patches/glibc-2.11_elf-noload-against-ldl.patch 2012-08-19 19:52:11 UTC (rev 6771) @@ -0,0 +1,47 @@ +http://git.altlinux.org/people/ldv/packages/?p=glibc.git;a=patch;h=dd08bb614ed0437003a609d6780d68b017fc58a2 + +From dd08bb614ed0437003a609d6780d68b017fc58a2 Mon Sep 17 00:00:00 2001 +From: Roland McGrath <rol...@redhat.com> +Date: Mon, 19 Apr 2010 15:38:48 -0700 +Subject: [PATCH] Link elf/noload test against -ldl. + +(cherry picked from commit 1d4bf3155f06d7e807985589665c967d1af36517) +--- + ChangeLog | 4 ++++ + elf/Makefile | 4 ++-- + 2 files changed, 6 insertions(+), 2 deletions(-) + +#diff --git a/ChangeLog b/ChangeLog +#index a3026a3..e3af885 100644 +#--- a/ChangeLog +#+++ b/ChangeLog +#@@ -1,3 +1,7 @@ +#+2010-04-19 Roland McGrath <rol...@redhat.com> +#+ +#+ * elf/Makefile ($(objpfx)noload): Depend on libdl.so. +#+ +# 2010-12-15 H.J. Lu <hongjiu...@intel.com> +# +# * config.h.in (NO_CTORS_DTORS_SECTIONS): Define. +diff --git a/elf/Makefile b/elf/Makefile +index 8043252..7e1c289 100644 +--- a/elf/Makefile ++++ b/elf/Makefile +@@ -1,4 +1,4 @@ +-# Copyright (C) 1995-2007, 2008, 2009 Free Software Foundation, Inc. ++# Copyright (C) 1995-2007,2008,2009,2010 Free Software Foundation, Inc. + # This file is part of the GNU C Library. + + # The GNU C Library is free software; you can redistribute it and/or +@@ -662,7 +662,7 @@ $(objpfx)vismain: $(addprefix $(objpfx),vismod1.so vismod2.so) + $(objpfx)vismain.out: $(addprefix $(objpfx),vismod3.so) + vismain-ENV = LD_PRELOAD=$(addprefix $(objpfx),vismod3.so) + +-$(objpfx)noload: $(objpfx)testobj1.so ++$(objpfx)noload: $(objpfx)testobj1.so $(common-objpfx)dlfcn/libdl.so + LDFLAGS-noload = -rdynamic + $(objpfx)noload.out: $(objpfx)testobj5.so + +-- +1.7.3.3 + Added: ipcop/trunk/src/patches/glibc-2.11_link-as-needed-against-ld.so.patch =================================================================== --- ipcop/trunk/src/patches/glibc-2.11_link-as-needed-against-ld.so.patch (rev 0) +++ ipcop/trunk/src/patches/glibc-2.11_link-as-needed-against-ld.so.patch 2012-08-19 19:52:11 UTC (rev 6771) @@ -0,0 +1,60 @@ +http://git.altlinux.org/people/ldv/packages/?p=glibc.git;a=patch;h=1a87841fb039cd27118a4bbb6e32c77b3fc8b217 + +From 1a87841fb039cd27118a4bbb6e32c77b3fc8b217 Mon Sep 17 00:00:00 2001 +From: Roland McGrath <rol...@redhat.com> +Date: Mon, 19 Apr 2010 15:31:43 -0700 +Subject: [PATCH] Link as-needed against ld.so. + +(cherry picked from commit 7e2b0c8562b35155820f87b5ff02a8b6850344cc) +--- + ChangeLog | 5 +++++ + Makeconfig | 11 ++++++++++- + 2 files changed, 15 insertions(+), 1 deletions(-) + +#diff --git a/ChangeLog b/ChangeLog +#index e3af885..0fac53b 100644 +#--- a/ChangeLog +#+++ b/ChangeLog +#@@ -1,5 +1,10 @@ +# 2010-04-19 Roland McGrath <rol...@redhat.com> +# +#+ * Makeconfig (as-needed, no-as-needed): New variables. +#+ (link-libc): Add ld.so inside --as-needed. +#+ +#+2010-04-19 Roland McGrath <rol...@redhat.com> +#+ +# * elf/Makefile ($(objpfx)noload): Depend on libdl.so. +# +# 2010-12-15 H.J. Lu <hongjiu...@intel.com> +diff --git a/Makeconfig b/Makeconfig +index 6986e58..0a05519 100644 +--- a/Makeconfig ++++ b/Makeconfig +@@ -387,6 +387,14 @@ ifeq ($(elf),yes) + have-initfini = yes + endif + ++ifeq ($(have-as-needed),yes) ++as-needed := -Wl,--as-needed ++no-as-needed := -Wl,--no-as-needed ++else ++as-needed := ++no-as-needed := ++endif ++ + # Installed name of the startup code. + ifneq ($(have-initfini),yes) + # When not having init/fini, there is just one startfile, called crt0.o. +@@ -484,7 +492,8 @@ ifeq ($(elf),yes) + # run the linked programs. + link-libc = -Wl,-rpath-link=$(rpath-link) \ + $(common-objpfx)libc.so$(libc.so-version) \ +- $(common-objpfx)$(patsubst %,$(libtype.oS),c) $(gnulib) ++ $(common-objpfx)$(patsubst %,$(libtype.oS),c) \ ++ $(as-needed) $(common-objpfx)elf/ld.so $(no-as-needed) $(gnulib) + # This is how to find at build-time things that will be installed there. + rpath-dirs = math elf dlfcn nss nis rt resolv crypt + endif +-- +1.7.3.3 + Added: ipcop/trunk/src/patches/glibc-2.11_remove-ctors-dtors-outputs.patch =================================================================== --- ipcop/trunk/src/patches/glibc-2.11_remove-ctors-dtors-outputs.patch (rev 0) +++ ipcop/trunk/src/patches/glibc-2.11_remove-ctors-dtors-outputs.patch 2012-08-19 19:52:11 UTC (rev 6771) @@ -0,0 +1,200 @@ +http://git.altlinux.org/people/ldv/packages/?p=glibc.git;a=patch;h=1aeea77ebf88af0941d0dd47549374d73fa37a19 + +From 1aeea77ebf88af0941d0dd47549374d73fa37a19 Mon Sep 17 00:00:00 2001 +From: H.J. Lu <hongjiu...@intel.com> +Date: Fri, 24 Dec 2010 20:14:37 -0500 +Subject: [PATCH] Remove `.ctors' and `.dtors' output sections + +(cherry picked from commit 4a531bb0b3b582cb693de9f76d2d97d970f9a5d5) + +Conflicts: + + configure +--- + ChangeLog | 15 +++++++++++++++ + config.h.in | 3 +++ + configure | 7 +++++++ + configure.in | 2 ++ + elf/sofini.c | 2 ++ + elf/soinit.c | 2 ++ + sysdeps/i386/init-first.c | 2 ++ + sysdeps/mach/hurd/i386/init-first.c | 2 +- + sysdeps/mach/hurd/powerpc/init-first.c | 2 +- + sysdeps/sh/init-first.c | 2 ++ + sysdeps/unix/sysv/linux/init-first.c | 2 +- + 11 files changed, 38 insertions(+), 3 deletions(-) + +#diff --git a/ChangeLog b/ChangeLog +#index 7ab3246..a3026a3 100644 +#--- a/ChangeLog +#+++ b/ChangeLog +#@@ -1,3 +1,18 @@ +#+2010-12-15 H.J. Lu <hongjiu...@intel.com> +#+ +#+ * config.h.in (NO_CTORS_DTORS_SECTIONS): Define. +#+ * configure.in: Define NO_CTORS_DTORS_SECTIONS if linker +#+ script has SORT_BY_INIT_PRIORITY. +#+ * elf/sofini.c: Remove `.ctors' and `.dtors' sections if +#+ NO_CTORS_DTORS_SECTIONS is defined. +#+ * elf/soinit.c: Likewise. +#+ * sysdeps/i386/init-first.c: Don't call __libc_global_ctors if +#+ NO_CTORS_DTORS_SECTIONS is defined. +#+ * sysdeps/mach/hurd/i386/init-first.c: Likewise. +#+ * sysdeps/mach/hurd/powerpc/init-first.c: Likewise. +#+ * sysdeps/sh/init-first.c: Likewise. +#+ * sysdeps/unix/sysv/linux/init-first.c: Likewise. +#+ +# 2011-05-14 Ulrich Drepper <drep...@gmail.com> + + [BZ #12453] +diff --git a/config.h.in b/config.h.in +index 18bf01a..9e797eb 100644 +--- a/config.h.in ++++ b/config.h.in +@@ -201,6 +201,9 @@ + /* Define if multi-arch DSOs should be generated. */ + #undef USE_MULTIARCH + ++/* Define if `.ctors' and `.dtors' sections shouldn't be used. */ ++#undef NO_CTORS_DTORS_SECTIONS ++ + /* + */ + +diff --git a/configure b/configure +index 91fc0e5..2ac7f7e 100755 +--- a/configure ++++ b/configure +@@ -6414,6 +6414,13 @@ $as_echo "$libc_cv_initfini_array" >&6; } + { { $as_echo "$as_me:$LINENO: error: Need linker with .init_array/.fini_array support." >&5 + $as_echo "$as_me: error: Need linker with .init_array/.fini_array support." >&2;} + { (exit 1); exit 1; }; } ++ elif { ac_try='${CC-cc} -Wl,--verbose 2>&1|grep SORT_BY_INIT_PRIORITY 1>&5' ++ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 ++ (eval $ac_try) 2>&5 ++ ac_status=$? ++ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 ++ test $ac_status = 0; }; }; then ++ $as_echo "#define NO_CTORS_DTORS_SECTIONS 1" >>confdefs.h + fi + + { $as_echo "$as_me:$LINENO: checking for libunwind-support in compiler" >&5 +diff --git a/configure.in b/configure.in +index 338dae7..e23503c 100644 +--- a/configure.in ++++ b/configure.in +@@ -1486,6 +1486,8 @@ EOF + rm -f conftest*]) + if test $libc_cv_initfini_array != yes; then + AC_MSG_ERROR([Need linker with .init_array/.fini_array support.]) ++ elif AC_TRY_COMMAND([${CC-cc} -Wl,--verbose 2>&1|grep SORT_BY_INIT_PRIORITY 1>&AS_MESSAGE_LOG_FD]); then ++ AC_DEFINE(NO_CTORS_DTORS_SECTIONS) + fi + + AC_CACHE_CHECK(for libunwind-support in compiler, +diff --git a/elf/sofini.c b/elf/sofini.c +index 5e06f0c..13e74b7 100644 +--- a/elf/sofini.c ++++ b/elf/sofini.c +@@ -1,12 +1,14 @@ + /* Finalizer module for ELF shared C library. This provides terminating + null pointer words in the `.ctors' and `.dtors' sections. */ + ++#ifndef NO_CTORS_DTORS_SECTIONS + static void (*const __CTOR_END__[1]) (void) + __attribute__ ((used, section (".ctors"))) + = { 0 }; + static void (*const __DTOR_END__[1]) (void) + __attribute__ ((used, section (".dtors"))) + = { 0 }; ++#endif + + /* Terminate the frame unwind info section with a 4byte 0 as a sentinel; + this would be the 'length' field in a real FDE. */ +diff --git a/elf/soinit.c b/elf/soinit.c +index 6fecbb5..1db676a 100644 +--- a/elf/soinit.c ++++ b/elf/soinit.c +@@ -3,6 +3,7 @@ + the `.ctors' and `.dtors' sections so the lists are terminated, and + calling those lists of functions. */ + ++#ifndef NO_CTORS_DTORS_SECTIONS + #include <libc-internal.h> + #include <stdlib.h> + +@@ -40,3 +41,4 @@ __libc_fini (void) + + void (*_fini_ptr) (void) __attribute__ ((section (".fini_array"))) + = &__libc_fini; ++#endif +diff --git a/sysdeps/i386/init-first.c b/sysdeps/i386/init-first.c +index c6355a8..2af042f 100644 +--- a/sysdeps/i386/init-first.c ++++ b/sysdeps/i386/init-first.c +@@ -59,7 +59,9 @@ _init (int argc, ...) + { + init (&argc); + ++#ifndef NO_CTORS_DTORS_SECTIONS + __libc_global_ctors (); ++#endif + } + #endif + +diff --git a/sysdeps/mach/hurd/i386/init-first.c b/sysdeps/mach/hurd/i386/init-first.c +index f9a7a58..60823bd 100644 +--- a/sysdeps/mach/hurd/i386/init-first.c ++++ b/sysdeps/mach/hurd/i386/init-first.c +@@ -92,7 +92,7 @@ posixland_init (int argc, char **argv, char **envp) + __getopt_clean_environment (envp); + #endif + +-#ifdef SHARED ++#if defined SHARED && !defined NO_CTORS_DTORS_SECTIONS + __libc_global_ctors (); + #endif + } +diff --git a/sysdeps/mach/hurd/powerpc/init-first.c b/sysdeps/mach/hurd/powerpc/init-first.c +index 20fa1d4..21b5054 100644 +--- a/sysdeps/mach/hurd/powerpc/init-first.c ++++ b/sysdeps/mach/hurd/powerpc/init-first.c +@@ -82,7 +82,7 @@ posixland_init (int argc, char **argv, char **envp) + __getopt_clean_environment (__environ); + #endif + +-#ifdef SHARED ++#if defined SHARED && !defined NO_CTORS_DTORS_SECTIONS + __libc_global_ctors (); + #endif + } +diff --git a/sysdeps/sh/init-first.c b/sysdeps/sh/init-first.c +index d816625..1f3a821 100644 +--- a/sysdeps/sh/init-first.c ++++ b/sysdeps/sh/init-first.c +@@ -59,7 +59,9 @@ _init (int argc, ...) + { + init (&argc); + ++#ifndef NO_CTORS_DTORS_SECTIONS + __libc_global_ctors (); ++#endif + } + #endif + +diff --git a/sysdeps/unix/sysv/linux/init-first.c b/sysdeps/unix/sysv/linux/init-first.c +index 7b2333d..a60212f 100644 +--- a/sysdeps/unix/sysv/linux/init-first.c ++++ b/sysdeps/unix/sysv/linux/init-first.c +@@ -93,7 +93,7 @@ _init (int argc, char **argv, char **envp) + __getopt_clean_environment (envp); + #endif + +-#ifdef SHARED ++#if defined SHARED && !defined NO_CTORS_DTORS_SECTIONS + __libc_global_ctors (); + #endif + } +-- +1.7.3.3 + This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. ------------------------------------------------------------------------------ Live Security Virtual Conference Exclusive live event will cover all the ways today's security and threat landscape has changed and how IT managers can respond. Discussions will include endpoint security, mobile security and the latest in malware threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ _______________________________________________ Ipcop-svn mailing list Ipcop-svn@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/ipcop-svn