From c15f20a124cdc4966014ff624a06ab5a325042cd Mon Sep 17 00:00:00 2001 From: Scott Garman Date: Wed, 22 Dec 2010 10:10:33 -0800 Subject: binutils: upgrade to 2.21 and add libtool sysroot support * Upgraded binutils to v2.21 * Incorporated libtool sysroot patches from OE * Removed patches no longer needed or obsoleted by OE patches Signed-off-by: Scott Garman --- .../binutils-2.20.1/110-arm-eabi-conf.patch | 22 - .../binutils-2.20.1/binutils-2.16.1-e300c2c3.patch | 18 - .../binutils-2.20.1/binutils-libtool.patch | 67 - .../binutils-2.20.1/binutils-mips-pie.patch | 29 - .../binutils/binutils-2.20.1/binutils-poison.patch | 253 - .../binutils-uclibc-100-uclibc-conf.patch | 34 - ...binutils-uclibc-300-001_ld_makefile_patch.patch | 50 - ...binutils-uclibc-300-006_better_file_error.patch | 43 - ...ils-uclibc-300-012_check_ldrunpath_length.patch | 47 - .../binutils-uclibc-gas-needs-libm.patch | 38 - .../binutils-x86_64_i386_biarch.patch | 26 - .../binutils-2.20.1/libiberty_path_fix.patch | 20 - .../binutils/binutils-2.21/110-arm-eabi-conf.patch | 22 + .../binutils-2.21/binutils-2.19.1-ld-sysroot.patch | 37 + .../binutils/binutils-2.21/binutils-poison.patch | 253 + .../binutils-uclibc-100-uclibc-conf.patch | 34 + ...binutils-uclibc-300-001_ld_makefile_patch.patch | 50 + ...binutils-uclibc-300-006_better_file_error.patch | 43 + ...ils-uclibc-300-012_check_ldrunpath_length.patch | 48 + .../binutils-uclibc-gas-needs-libm.patch | 38 + .../binutils-x86_64_i386_biarch.patch | 26 + .../binutils-2.21/libiberty_path_fix.patch | 20 + .../binutils-2.21/libtool-2.4-update.patch | 18675 +++++++++++++++++++ .../binutils/binutils-cross-canadian_2.20.1.bb | 3 - .../binutils/binutils-cross-canadian_2.21.bb | 3 + .../binutils/binutils-cross_2.20.1.bb | 3 - .../binutils/binutils-cross_2.21.bb | 2 + .../binutils/binutils-crosssdk_2.20.1.bb | 12 - .../binutils/binutils-crosssdk_2.21.bb | 12 + meta/recipes-devtools/binutils/binutils_2.20.1.bb | 41 - meta/recipes-devtools/binutils/binutils_2.21.bb | 37 + 31 files changed, 19300 insertions(+), 706 deletions(-) delete mode 100644 meta/recipes-devtools/binutils/binutils-2.20.1/110-arm-eabi-conf.patch delete mode 100644 meta/recipes-devtools/binutils/binutils-2.20.1/binutils-2.16.1-e300c2c3.patch delete mode 100644 meta/recipes-devtools/binutils/binutils-2.20.1/binutils-libtool.patch delete mode 100644 meta/recipes-devtools/binutils/binutils-2.20.1/binutils-mips-pie.patch delete mode 100644 meta/recipes-devtools/binutils/binutils-2.20.1/binutils-poison.patch delete mode 100644 meta/recipes-devtools/binutils/binutils-2.20.1/binutils-uclibc-100-uclibc-conf.patch delete mode 100644 meta/recipes-devtools/binutils/binutils-2.20.1/binutils-uclibc-300-001_ld_makefile_patch.patch delete mode 100644 meta/recipes-devtools/binutils/binutils-2.20.1/binutils-uclibc-300-006_better_file_error.patch delete mode 100644 meta/recipes-devtools/binutils/binutils-2.20.1/binutils-uclibc-300-012_check_ldrunpath_length.patch delete mode 100644 meta/recipes-devtools/binutils/binutils-2.20.1/binutils-uclibc-gas-needs-libm.patch delete mode 100644 meta/recipes-devtools/binutils/binutils-2.20.1/binutils-x86_64_i386_biarch.patch delete mode 100644 meta/recipes-devtools/binutils/binutils-2.20.1/libiberty_path_fix.patch create mode 100644 meta/recipes-devtools/binutils/binutils-2.21/110-arm-eabi-conf.patch create mode 100644 meta/recipes-devtools/binutils/binutils-2.21/binutils-2.19.1-ld-sysroot.patch create mode 100644 meta/recipes-devtools/binutils/binutils-2.21/binutils-poison.patch create mode 100644 meta/recipes-devtools/binutils/binutils-2.21/binutils-uclibc-100-uclibc-conf.patch create mode 100644 meta/recipes-devtools/binutils/binutils-2.21/binutils-uclibc-300-001_ld_makefile_patch.patch create mode 100644 meta/recipes-devtools/binutils/binutils-2.21/binutils-uclibc-300-006_better_file_error.patch create mode 100644 meta/recipes-devtools/binutils/binutils-2.21/binutils-uclibc-300-012_check_ldrunpath_length.patch create mode 100644 meta/recipes-devtools/binutils/binutils-2.21/binutils-uclibc-gas-needs-libm.patch create mode 100644 meta/recipes-devtools/binutils/binutils-2.21/binutils-x86_64_i386_biarch.patch create mode 100644 meta/recipes-devtools/binutils/binutils-2.21/libiberty_path_fix.patch create mode 100644 meta/recipes-devtools/binutils/binutils-2.21/libtool-2.4-update.patch delete mode 100644 meta/recipes-devtools/binutils/binutils-cross-canadian_2.20.1.bb create mode 100644 meta/recipes-devtools/binutils/binutils-cross-canadian_2.21.bb delete mode 100644 meta/recipes-devtools/binutils/binutils-cross_2.20.1.bb create mode 100644 meta/recipes-devtools/binutils/binutils-cross_2.21.bb delete mode 100644 meta/recipes-devtools/binutils/binutils-crosssdk_2.20.1.bb create mode 100644 meta/recipes-devtools/binutils/binutils-crosssdk_2.21.bb delete mode 100644 meta/recipes-devtools/binutils/binutils_2.20.1.bb create mode 100644 meta/recipes-devtools/binutils/binutils_2.21.bb (limited to 'meta') diff --git a/meta/recipes-devtools/binutils/binutils-2.20.1/110-arm-eabi-conf.patch b/meta/recipes-devtools/binutils/binutils-2.20.1/110-arm-eabi-conf.patch deleted file mode 100644 index 2623301da0..0000000000 --- a/meta/recipes-devtools/binutils/binutils-2.20.1/110-arm-eabi-conf.patch +++ /dev/null @@ -1,22 +0,0 @@ ---- /tmp/configure.ac 2008-06-22 14:14:59.000000000 +0200 -+++ binutils-2.18.50.0.7/configure.ac 2008-06-22 14:15:30.000000000 +0200 -@@ -561,7 +561,7 @@ - noconfigdirs="$noconfigdirs target-libffi target-qthreads" - libgloss_dir=arm - ;; -- arm*-*-linux-gnueabi) -+ arm*-*-linux-gnueabi | arm*-*-linux-uclibcgnueabi) - noconfigdirs="$noconfigdirs target-qthreads" - noconfigdirs="$noconfigdirs target-libobjc" - case ${with_newlib} in ---- /tmp/configure 2008-06-22 14:17:11.000000000 +0200 -+++ binutils-2.18.50.0.7/configure 2008-06-22 14:17:56.000000000 +0200 -@@ -2307,7 +2307,7 @@ - noconfigdirs="$noconfigdirs target-libffi target-qthreads" - libgloss_dir=arm - ;; -- arm*-*-linux-gnueabi) -+ arm*-*-linux-gnueabi | arm*-*-linux-uclibcgnueabi) - noconfigdirs="$noconfigdirs target-qthreads" - noconfigdirs="$noconfigdirs target-libobjc" - case ${with_newlib} in diff --git a/meta/recipes-devtools/binutils/binutils-2.20.1/binutils-2.16.1-e300c2c3.patch b/meta/recipes-devtools/binutils/binutils-2.20.1/binutils-2.16.1-e300c2c3.patch deleted file mode 100644 index dfe9b18e17..0000000000 --- a/meta/recipes-devtools/binutils/binutils-2.20.1/binutils-2.16.1-e300c2c3.patch +++ /dev/null @@ -1,18 +0,0 @@ -Adds support for Freescale Power architecture e300c2 and e300c3 cores. -http://www.bitshrine.org/gpp/tc-fsl-x86lnx-e300c3-nptl-4.0.2-2.src.rpm - -Leon Woestenberg - -Index: binutils-2.19.51.0.3/opcodes/ppc-dis.c -=================================================================== ---- binutils-2.19.51.0.3.orig/opcodes/ppc-dis.c 2009-04-16 00:38:45.000000000 -0700 -+++ binutils-2.19.51.0.3/opcodes/ppc-dis.c 2009-04-16 00:43:56.000000000 -0700 -@@ -132,6 +132,8 @@ - | PPC_OPCODE_POWER6 | PPC_OPCODE_POWER7 | PPC_OPCODE_ALTIVEC - | PPC_OPCODE_VSX), - 0 }, -+ { "pmr", (PPC_OPCODE_PMR), -+ 0 }, - { "ppc", (PPC_OPCODE_PPC | PPC_OPCODE_CLASSIC | PPC_OPCODE_32), - 0 }, - { "ppc32", (PPC_OPCODE_PPC | PPC_OPCODE_CLASSIC | PPC_OPCODE_32), diff --git a/meta/recipes-devtools/binutils/binutils-2.20.1/binutils-libtool.patch b/meta/recipes-devtools/binutils/binutils-2.20.1/binutils-libtool.patch deleted file mode 100644 index 61517d1d4c..0000000000 --- a/meta/recipes-devtools/binutils/binutils-2.20.1/binutils-libtool.patch +++ /dev/null @@ -1,67 +0,0 @@ -This is because libdir has a trailing slash which breaks the comparision. - -RP 2/1/10 - -Index: binutils-2.20.1/ltmain.sh -=================================================================== ---- binutils-2.20.1.orig/ltmain.sh 2009-09-01 00:59:32.000000000 +0800 -+++ binutils-2.20.1/ltmain.sh 2010-07-29 09:41:14.000000000 +0800 -@@ -2156,8 +2156,12 @@ - dir="$dir$objdir" - - if test -n "$relink_command"; then -+ # Strip any trailing slash from the destination. -+ func_stripname '' '/' "$libdir" -+ destlibdir=$func_stripname_result -+ - # Determine the prefix the user has applied to our future dir. -- inst_prefix_dir=`$ECHO "X$destdir" | $Xsed -e "s%$libdir\$%%"` -+ inst_prefix_dir=`$ECHO "X$destdir" | $Xsed -e "s%$destlibdir\$%%"` - - # Don't allow the user to place us outside of our expected - # location b/c this prevents finding dependent libraries that -@@ -5570,8 +5574,14 @@ - absdir="$abs_ladir" - libdir="$abs_ladir" - else -- dir="$libdir" -- absdir="$libdir" -+ # Adding 'libdir' from the .la file to our library search paths -+ # breaks crosscompilation horribly. We cheat here and don't add -+ # it, instead adding the path where we found the .la. -CL -+ dir="$abs_ladir" -+ absdir="$abs_ladir" -+ libdir="$abs_ladir" -+ #dir="$libdir" -+ #absdir="$libdir" - fi - test "X$hardcode_automatic" = Xyes && avoidtemprpath=yes - else -@@ -5942,8 +5952,6 @@ - add="$libdir/$linklib" - fi - else -- # We cannot seem to hardcode it, guess we'll fake it. -- add_dir="-L$libdir" - # Try looking first in the location we're being installed to. - if test -n "$inst_prefix_dir"; then - case $libdir in -@@ -6089,7 +6097,17 @@ - fi - ;; - *) -- path="-L$absdir/$objdir" -+ # OE sets installed=no in staging. We need to look in $objdir and $absdir, -+ # preferring $objdir. RP 31/04/2008 -+ if test -f "$absdir/$objdir/$depdepl" ; then -+ depdepl="$absdir/$objdir/$depdepl" -+ path="-L$absdir/$objdir" -+ elif test -f "$absdir/$depdepl" ; then -+ depdepl="$absdir/$depdepl" -+ path="-L$absdir" -+ else -+ path="-L$absdir/$objdir" -+ fi - ;; - esac - else diff --git a/meta/recipes-devtools/binutils/binutils-2.20.1/binutils-mips-pie.patch b/meta/recipes-devtools/binutils/binutils-2.20.1/binutils-mips-pie.patch deleted file mode 100644 index c71f0ad4db..0000000000 --- a/meta/recipes-devtools/binutils/binutils-2.20.1/binutils-mips-pie.patch +++ /dev/null @@ -1,29 +0,0 @@ -# "-fPIE" always triggers segmentation fault in ld.so.1 on mips platform, -# which was first saw on dbus-daemon. Below borrow the binutils fix from -# binutils bugzilla: -# -# http://sourceware.org/bugzilla/show_bug.cgi?id=10858 -# -# Its commit message says: -# * elfxx-mips.c (mips_elf_create_dynamic_relocation): Use section -# sym dynindx for relocs against defined syms in PIEs. -# -# It's in upstream CVS now (rev 1.267), but not in current release -# -# By Kevin Tian , 2010-07-15 - -diff --git a/elfxx-mips.c b/elfxx-mips.c -index 3a1c8ba..f6c2c1c 100644 ---- binutils-2.20.1.orig/bfd/elfxx-mips.c -+++ binutils-2.20.1/bfd/elfxx-mips.c -@@ -5688,9 +5688,7 @@ mips_elf_create_dynamic_relocation (bfd *output_bfd, - - /* We must now calculate the dynamic symbol table index to use - in the relocation. */ -- if (h != NULL -- && (!h->root.def_regular -- || (info->shared && !info->symbolic && !h->root.forced_local))) -+ if (h != NULL && ! SYMBOL_REFERENCES_LOCAL (info, &h->root)) - { - indx = h->root.dynindx; - if (SGI_COMPAT (output_bfd)) diff --git a/meta/recipes-devtools/binutils/binutils-2.20.1/binutils-poison.patch b/meta/recipes-devtools/binutils/binutils-2.20.1/binutils-poison.patch deleted file mode 100644 index c2f19276f8..0000000000 --- a/meta/recipes-devtools/binutils/binutils-2.20.1/binutils-poison.patch +++ /dev/null @@ -1,253 +0,0 @@ -This patch is recived from Mark Hatle - -purpose: warn for uses of system directories when cross linking - -Signed-Off-By: Mark Hatle - -Code Merged from Sourcery G++ binutils 2.19 - 4.4-277 - -2008-07-02 Joseph Myers - - ld/ - * ld.h (args_type): Add error_poison_system_directories. - * ld.texinfo (--error-poison-system-directories): Document. - * ldfile.c (ldfile_add_library_path): Check - command_line.error_poison_system_directories. - * ldmain.c (main): Initialize - command_line.error_poison_system_directories. - * lexsup.c (enum option_values): Add - OPTION_ERROR_POISON_SYSTEM_DIRECTORIES. - (ld_options): Add --error-poison-system-directories. - (parse_args): Handle new option. - -2007-06-13 Joseph Myers - - ld/ - * config.in: Regenerate. - * ld.h (args_type): Add poison_system_directories. - * ld.texinfo (--no-poison-system-directories): Document. - * ldfile.c (ldfile_add_library_path): Check - command_line.poison_system_directories. - * ldmain.c (main): Initialize - command_line.poison_system_directories. - * lexsup.c (enum option_values): Add - OPTION_NO_POISON_SYSTEM_DIRECTORIES. - (ld_options): Add --no-poison-system-directories. - (parse_args): Handle new option. - -2007-04-20 Joseph Myers - - Merge from Sourcery G++ binutils 2.17: - - 2007-03-20 Joseph Myers - Based on patch by Mark Hatle . - ld/ - * configure.in (--enable-poison-system-directories): New option. - * configure, config.in: Regenerate. - * ldfile.c (ldfile_add_library_path): If - ENABLE_POISON_SYSTEM_DIRECTORIES defined, warn for use of /lib, - /usr/lib, /usr/local/lib or /usr/X11R6/lib. - -Index: binutils-2.20.1/ld/config.in -=================================================================== ---- binutils-2.20.1.orig/ld/config.in -+++ binutils-2.20.1/ld/config.in -@@ -4,6 +4,9 @@ - language is requested. */ - #undef ENABLE_NLS - -+/* Define to warn for use of native system library directories */ -+#undef ENABLE_POISON_SYSTEM_DIRECTORIES -+ - /* Additional extension a shared object might have. */ - #undef EXTRA_SHLIB_EXTENSION - -Index: binutils-2.20.1/ld/configure.in -=================================================================== ---- binutils-2.20.1.orig/ld/configure.in -+++ binutils-2.20.1/ld/configure.in -@@ -69,6 +69,16 @@ AC_SUBST(use_sysroot) - AC_SUBST(TARGET_SYSTEM_ROOT) - AC_SUBST(TARGET_SYSTEM_ROOT_DEFINE) - -+AC_ARG_ENABLE([poison-system-directories], -+ AS_HELP_STRING([--enable-poison-system-directories], -+ [warn for use of native system library directories]),, -+ [enable_poison_system_directories=no]) -+if test "x${enable_poison_system_directories}" = "xyes"; then -+ AC_DEFINE([ENABLE_POISON_SYSTEM_DIRECTORIES], -+ [1], -+ [Define to warn for use of native system library directories]) -+fi -+ - AC_ARG_ENABLE([got], - AS_HELP_STRING([--enable-got=], - [GOT handling scheme (target, single, negative, multigot)]), -Index: binutils-2.20.1/ld/ld.h -=================================================================== ---- binutils-2.20.1.orig/ld/ld.h -+++ binutils-2.20.1/ld/ld.h -@@ -176,6 +176,14 @@ typedef struct { - input files. */ - bfd_boolean accept_unknown_input_arch; - -+ /* If TRUE (the default) warn for uses of system directories when -+ cross linking. */ -+ bfd_boolean poison_system_directories; -+ -+ /* If TRUE (default FALSE) give an error for uses of system -+ directories when cross linking instead of a warning. */ -+ bfd_boolean error_poison_system_directories; -+ - /* Big or little endian as set on command line. */ - enum endian_enum endian; - -Index: binutils-2.20.1/ld/ld.texinfo -=================================================================== ---- binutils-2.20.1.orig/ld/ld.texinfo -+++ binutils-2.20.1/ld/ld.texinfo -@@ -2084,6 +2084,18 @@ string identifying the original linked f - - Passing @code{none} for @var{style} disables the setting from any - @code{--build-id} options earlier on the command line. -+ -+@kindex --no-poison-system-directories -+@item --no-poison-system-directories -+Do not warn for @option{-L} options using system directories such as -+@file{/usr/lib} when cross linking. This option is intended for use -+in chroot environments when such directories contain the correct -+libraries for the target system rather than the host. -+ -+@kindex --error-poison-system-directories -+@item --error-poison-system-directories -+Give an error instead of a warning for @option{-L} options using -+system directories when cross linking. - @end table - - @c man end -Index: binutils-2.20.1/ld/ldfile.c -=================================================================== ---- binutils-2.20.1.orig/ld/ldfile.c -+++ binutils-2.20.1/ld/ldfile.c -@@ -120,6 +120,23 @@ ldfile_add_library_path (const char *nam - { - new_dirs->name = xstrdup (name); - new_dirs->sysrooted = is_sysrooted_pathname (name, FALSE); -+ -+#ifdef ENABLE_POISON_SYSTEM_DIRECTORIES -+ if (command_line.poison_system_directories -+ && ((!strncmp (name, "/lib", 4)) -+ || (!strncmp (name, "/usr/lib", 8)) -+ || (!strncmp (name, "/usr/local/lib", 14)) -+ || (!strncmp (name, "/usr/X11R6/lib", 14)))) -+ { -+ if (command_line.error_poison_system_directories) -+ einfo (_("%X%P: error: library search path \"%s\" is unsafe for " -+ "cross-compilation\n"), name); -+ else -+ einfo (_("%P: warning: library search path \"%s\" is unsafe for " -+ "cross-compilation\n"), name); -+ } -+#endif -+ - } - } - -Index: binutils-2.20.1/ld/ldmain.c -=================================================================== ---- binutils-2.20.1.orig/ld/ldmain.c -+++ binutils-2.20.1/ld/ldmain.c -@@ -252,6 +252,8 @@ main (int argc, char **argv) - command_line.warn_mismatch = TRUE; - command_line.warn_search_mismatch = TRUE; - command_line.check_section_addresses = -1; -+ command_line.poison_system_directories = TRUE; -+ command_line.error_poison_system_directories = FALSE; - - /* We initialize DEMANGLING based on the environment variable - COLLECT_NO_DEMANGLE. The gcc collect2 program will demangle the -Index: binutils-2.20.1/ld/lexsup.c -=================================================================== ---- binutils-2.20.1.orig/ld/lexsup.c -+++ binutils-2.20.1/ld/lexsup.c -@@ -166,7 +166,9 @@ enum option_values - OPTION_WARN_SHARED_TEXTREL, - OPTION_WARN_ALTERNATE_EM, - OPTION_REDUCE_MEMORY_OVERHEADS, -- OPTION_DEFAULT_SCRIPT -+ OPTION_DEFAULT_SCRIPT, -+ OPTION_NO_POISON_SYSTEM_DIRECTORIES, -+ OPTION_ERROR_POISON_SYSTEM_DIRECTORIES - }; - - /* The long options. This structure is used for both the option -@@ -575,6 +577,14 @@ static const struct ld_option ld_options - TWO_DASHES }, - { {"wrap", required_argument, NULL, OPTION_WRAP}, - '\0', N_("SYMBOL"), N_("Use wrapper functions for SYMBOL"), TWO_DASHES }, -+ { {"no-poison-system-directories", no_argument, NULL, -+ OPTION_NO_POISON_SYSTEM_DIRECTORIES}, -+ '\0', NULL, N_("Do not warn for -L options using system directories"), -+ TWO_DASHES }, -+ { {"error-poison-system-directories", no_argument, NULL, -+ OPTION_ERROR_POISON_SYSTEM_DIRECTORIES}, -+ '\0', NULL, N_("Give an error for -L options using system directories"), -+ TWO_DASHES }, - }; - - #define OPTION_COUNT ARRAY_SIZE (ld_options) -@@ -1480,6 +1490,14 @@ parse_args (unsigned argc, char **argv) - einfo (_("%P%X: --hash-size needs a numeric argument\n")); - } - break; -+ -+ case OPTION_NO_POISON_SYSTEM_DIRECTORIES: -+ command_line.poison_system_directories = FALSE; -+ break; -+ -+ case OPTION_ERROR_POISON_SYSTEM_DIRECTORIES: -+ command_line.error_poison_system_directories = TRUE; -+ break; - } - } - -diff -ur binutils-2.20.1.orig/ld/configure binutils-2.20.1/ld/configure ---- binutils-2.20.1.orig/ld/configure 2010-03-03 08:06:22.000000000 -0600 -+++ binutils-2.20.1/ld/configure 2010-09-30 11:19:35.776990594 -0500 -@@ -901,6 +904,7 @@ - enable_targets - enable_64_bit_bfd - with_sysroot -+enable_poison_system_directories - enable_got - enable_werror - enable_build_warnings -@@ -1548,6 +1552,8 @@ - (and sometimes confusing) to the casual installer - --enable-targets alternative target configurations - --enable-64-bit-bfd 64-bit support (on hosts with narrower word sizes) -+ --enable-poison-system-directories -+ warn for use of native system library directories - --enable-got= GOT handling scheme (target, single, negative, - multigot) - --enable-werror treat compile warnings as errors -@@ -4302,6 +4334,19 @@ - - - -+# Check whether --enable-poison-system-directories was given. -+if test "${enable_poison_system_directories+set}" = set; then : -+ enableval=$enable_poison_system_directories; -+else -+ enable_poison_system_directories=no -+fi -+ -+if test "x${enable_poison_system_directories}" = "xyes"; then -+ -+$as_echo "#define ENABLE_POISON_SYSTEM_DIRECTORIES 1" >>confdefs.h -+ -+fi -+ - # Check whether --enable-got was given. - if test "${enable_got+set}" = set; then : - enableval=$enable_got; case "${enableval}" in diff --git a/meta/recipes-devtools/binutils/binutils-2.20.1/binutils-uclibc-100-uclibc-conf.patch b/meta/recipes-devtools/binutils/binutils-2.20.1/binutils-uclibc-100-uclibc-conf.patch deleted file mode 100644 index 8de04e0fe0..0000000000 --- a/meta/recipes-devtools/binutils/binutils-2.20.1/binutils-uclibc-100-uclibc-conf.patch +++ /dev/null @@ -1,34 +0,0 @@ ---- binutils-2.18.orig/configure -+++ binutils-2.18/configure -@@ -2206,7 +2206,7 @@ - am33_2.0-*-linux*) - noconfigdirs="$noconfigdirs ${libgcj} target-newlib target-libgloss" - ;; -- sh-*-linux*) -+ sh*-*-linux*) - noconfigdirs="$noconfigdirs ${libgcj} target-newlib target-libgloss" - ;; - sh*-*-pe|mips*-*-pe|*arm-wince-pe) -@@ -2504,7 +2504,7 @@ - romp-*-*) - noconfigdirs="$noconfigdirs bfd binutils ld gas opcodes target-libgloss ${libgcj}" - ;; -- sh-*-* | sh64-*-*) -+ sh*-*-* | sh64-*-*) - case "${host}" in - i[3456789]86-*-vsta) ;; # don't add gprof back in - i[3456789]86-*-go32*) ;; # don't add gprof back in ---- binutils-2.18.orig/gprof/configure -+++ binutils-2.18/gprof/configure -@@ -4124,6 +4124,11 @@ - lt_cv_deplibs_check_method=pass_all - ;; - -+linux-uclibc*) -+ lt_cv_deplibs_check_method=pass_all -+ lt_cv_file_magic_test_file=`echo /lib/libuClibc-*.so` -+ ;; -+ - netbsd*) - if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then - lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$' diff --git a/meta/recipes-devtools/binutils/binutils-2.20.1/binutils-uclibc-300-001_ld_makefile_patch.patch b/meta/recipes-devtools/binutils/binutils-2.20.1/binutils-uclibc-300-001_ld_makefile_patch.patch deleted file mode 100644 index 04a7e61e25..0000000000 --- a/meta/recipes-devtools/binutils/binutils-2.20.1/binutils-uclibc-300-001_ld_makefile_patch.patch +++ /dev/null @@ -1,50 +0,0 @@ -#!/bin/sh -e -## 001_ld_makefile_patch.dpatch -## -## All lines beginning with `## DP:' are a description of the patch. -## DP: Description: correct where ld scripts are installed -## DP: Author: Chris Chimelis -## DP: Upstream status: N/A -## DP: Date: ?? - -if [ $# -ne 1 ]; then - echo >&2 "`basename $0`: script expects -patch|-unpatch as argument" - exit 1 -fi - -[ -f debian/patches/00patch-opts ] && . debian/patches/00patch-opts -patch_opts="${patch_opts:--f --no-backup-if-mismatch}" - -case "$1" in - -patch) patch $patch_opts -p1 < $0;; - -unpatch) patch $patch_opts -p1 -R < $0;; - *) - echo >&2 "`basename $0`: script expects -patch|-unpatch as argument" - exit 1;; -esac - -exit 0 - -@DPATCH@ ---- binutils-2.16.91.0.1/ld/Makefile.am -+++ binutils-2.16.91.0.1/ld/Makefile.am -@@ -20,7 +20,7 @@ - # We put the scripts in the directory $(scriptdir)/ldscripts. - # We can't put the scripts in $(datadir) because the SEARCH_DIR - # directives need to be different for native and cross linkers. --scriptdir = $(tooldir)/lib -+scriptdir = $(libdir) - - EMUL = @EMUL@ - EMULATION_OFILES = @EMULATION_OFILES@ ---- binutils-2.16.91.0.1/ld/Makefile.in -+++ binutils-2.16.91.0.1/ld/Makefile.in -@@ -268,7 +268,7 @@ - # We put the scripts in the directory $(scriptdir)/ldscripts. - # We can't put the scripts in $(datadir) because the SEARCH_DIR - # directives need to be different for native and cross linkers. --scriptdir = $(tooldir)/lib -+scriptdir = $(libdir) - BASEDIR = $(srcdir)/.. - BFDDIR = $(BASEDIR)/bfd - INCDIR = $(BASEDIR)/include diff --git a/meta/recipes-devtools/binutils/binutils-2.20.1/binutils-uclibc-300-006_better_file_error.patch b/meta/recipes-devtools/binutils/binutils-2.20.1/binutils-uclibc-300-006_better_file_error.patch deleted file mode 100644 index f337611edf..0000000000 --- a/meta/recipes-devtools/binutils/binutils-2.20.1/binutils-uclibc-300-006_better_file_error.patch +++ /dev/null @@ -1,43 +0,0 @@ -#!/bin/sh -e -## 006_better_file_error.dpatch by David Kimdon -## -## All lines beginning with `## DP:' are a description of the patch. -## DP: Specify which filename is causing an error if the filename is a -## DP: directory. (#45832) - -if [ $# -ne 1 ]; then - echo >&2 "`basename $0`: script expects -patch|-unpatch as argument" - exit 1 -fi - -[ -f debian/patches/00patch-opts ] && . debian/patches/00patch-opts -patch_opts="${patch_opts:--f --no-backup-if-mismatch}" - -case "$1" in - -patch) patch $patch_opts -p1 < $0;; - -unpatch) patch $patch_opts -p1 -R < $0;; - *) - echo >&2 "`basename $0`: script expects -patch|-unpatch as argument" - exit 1;; -esac - -exit 0 - -@DPATCH@ -diff -urNad /home/james/debian/packages/binutils/binutils-2.14.90.0.6/bfd/opncls.c binutils-2.14.90.0.6/bfd/opncls.c ---- /home/james/debian/packages/binutils/binutils-2.14.90.0.6/bfd/opncls.c 2003-07-23 16:08:09.000000000 +0100 -+++ binutils-2.14.90.0.6/bfd/opncls.c 2003-09-10 22:35:00.000000000 +0100 -@@ -150,6 +150,13 @@ - { - bfd *nbfd; - const bfd_target *target_vec; -+ struct stat s; -+ -+ if (stat (filename, &s) == 0) -+ if (S_ISDIR(s.st_mode)) { -+ bfd_set_error (bfd_error_file_not_recognized); -+ return NULL; -+ } - - nbfd = _bfd_new_bfd (); - if (nbfd == NULL) diff --git a/meta/recipes-devtools/binutils/binutils-2.20.1/binutils-uclibc-300-012_check_ldrunpath_length.patch b/meta/recipes-devtools/binutils/binutils-2.20.1/binutils-uclibc-300-012_check_ldrunpath_length.patch deleted file mode 100644 index 498651a90c..0000000000 --- a/meta/recipes-devtools/binutils/binutils-2.20.1/binutils-uclibc-300-012_check_ldrunpath_length.patch +++ /dev/null @@ -1,47 +0,0 @@ -#!/bin/sh -e -## 012_check_ldrunpath_length.dpatch by Chris Chimelis -## -## All lines beginning with `## DP:' are a description of the patch. -## DP: Only generate an RPATH entry if LD_RUN_PATH is not empty, for -## DP: cases where -rpath isn't specified. (#151024) - -if [ $# -ne 1 ]; then - echo >&2 "`basename $0`: script expects -patch|-unpatch as argument" - exit 1 -fi - -[ -f debian/patches/00patch-opts ] && . debian/patches/00patch-opts -patch_opts="${patch_opts:--f --no-backup-if-mismatch}" - -case "$1" in - -patch) patch $patch_opts -p1 < $0;; - -unpatch) patch $patch_opts -p1 -R < $0;; - *) - echo >&2 "`basename $0`: script expects -patch|-unpatch as argument" - exit 1;; -esac - -exit 0 - -@DPATCH@ -diff -urNad /home/james/debian/packages/binutils/new/binutils-2.15/ld/emultempl/elf32.em binutils-2.15/ld/emultempl/elf32.em ---- /home/james/debian/packages/binutils/new/binutils-2.15/ld/emultempl/elf32.em 2004-05-21 23:12:58.000000000 +0100 -+++ binutils-2.15/ld/emultempl/elf32.em 2004-05-21 23:12:59.000000000 +0100 -@@ -692,6 +692,8 @@ - && command_line.rpath == NULL) - { - lib_path = (const char *) getenv ("LD_RUN_PATH"); -+ if ((lib_path) && (strlen (lib_path) == 0)) -+ lib_path = NULL; - if (gld${EMULATION_NAME}_search_needed (lib_path, &n, - force)) - break; -@@ -871,6 +873,8 @@ - rpath = command_line.rpath; - if (rpath == NULL) - rpath = (const char *) getenv ("LD_RUN_PATH"); -+ if ((rpath) && (strlen (rpath) == 0)) -+ rpath = NULL; - if (! (bfd_elf_size_dynamic_sections - (output_bfd, command_line.soname, rpath, - command_line.filter_shlib, diff --git a/meta/recipes-devtools/binutils/binutils-2.20.1/binutils-uclibc-gas-needs-libm.patch b/meta/recipes-devtools/binutils/binutils-2.20.1/binutils-uclibc-gas-needs-libm.patch deleted file mode 100644 index db838cf20c..0000000000 --- a/meta/recipes-devtools/binutils/binutils-2.20.1/binutils-uclibc-gas-needs-libm.patch +++ /dev/null @@ -1,38 +0,0 @@ -Source: Khem Raj -Disposition: submit upstream. - -Description: - -We do not need to have the libtool patch anymore for binutils after -libtool has been updated upstream it include support for it. However -for building gas natively on uclibc systems we have to link it with --lm so that it picks up missing symbols. - -/local/build_area/BUILD/arm_v5t_le_uclibc/binutils-2.17.50/objdir/libiberty/pic/libiberty.a(floatformat.o): In function `floatformat_from_double': -floatformat.c:(.text+0x1ec): undefined reference to `frexp' -floatformat.c:(.text+0x2f8): undefined reference to `ldexp' -/local/build_area/BUILD/arm_v5t_le_uclibc/binutils-2.17.50/objdir/libiberty/pic/libiberty.a(floatformat.o): In function `floatformat_to_double': -floatformat.c:(.text+0x38a): undefined reference to `ldexp' -floatformat.c:(.text+0x3d2): undefined reference to `ldexp' -floatformat.c:(.text+0x43e): undefined reference to `ldexp' floatformat.c:(.text+0x4e2): undefined reference to `ldexp' -collect2: ld returned 1 exit status -make[4]: *** [as-new] Error 1 - -Index: binutils-2.17.50/gas/configure.tgt -=================================================================== ---- binutils-2.17.50.orig/gas/configure.tgt -+++ binutils-2.17.50/gas/configure.tgt -@@ -408,6 +408,12 @@ case ${generic_target} in - *-*-netware) fmt=elf em=netware ;; - esac - -+case ${generic_target} in -+ arm-*-*uclibc*) -+ need_libm=yes -+ ;; -+esac -+ - case ${cpu_type} in - alpha | arm | i386 | ia64 | mips | ns32k | pdp11 | ppc | sparc | z80 | z8k) - bfd_gas=yes - diff --git a/meta/recipes-devtools/binutils/binutils-2.20.1/binutils-x86_64_i386_biarch.patch b/meta/recipes-devtools/binutils/binutils-2.20.1/binutils-x86_64_i386_biarch.patch deleted file mode 100644 index 4cd9e22438..0000000000 --- a/meta/recipes-devtools/binutils/binutils-2.20.1/binutils-x86_64_i386_biarch.patch +++ /dev/null @@ -1,26 +0,0 @@ -#!/bin/sh -e -## 127_x86_64_i386_biarch.dpatch -## -## DP: Description: Add (/usr)/lib32 to the search paths on x86_64. -## DP: Author: Aurelien Jarno -## DP: Upstream status: Debian specific -# -# Hacked to apply with quilt -# Adapted to binutils 2.18.50.0.7 - ---- binutils/ld/emulparams/elf_i386.sh -+++ binutils/ld/emulparams/elf_i386.sh -@@ -12,3 +12,13 @@ - SEPARATE_GOTPLT=12 - SHARABLE_SECTIONS=yes - IREL_IN_PLT= -+ -+# Linux modify the default library search path to first include -+# a 32-bit specific directory. -+case "$target" in -+ x86_64*-linux* | i[3-7]86*-linux* | x86_64*-kfreebsd*-gnu | i[3-7]86*-kfreebsd*-gnu) -+ case "$EMULATION_NAME" in -+ *i386*) LIBPATH_SUFFIX=32 ;; -+ esac -+ ;; -+esac diff --git a/meta/recipes-devtools/binutils/binutils-2.20.1/libiberty_path_fix.patch b/meta/recipes-devtools/binutils/binutils-2.20.1/libiberty_path_fix.patch deleted file mode 100644 index 36a14d7a18..0000000000 --- a/meta/recipes-devtools/binutils/binutils-2.20.1/libiberty_path_fix.patch +++ /dev/null @@ -1,20 +0,0 @@ -don't let the distro compiler point to the wrong installation location - -Thanks to RP for helping find the source code causing the issue. - -2010/08/13 -Nitin A Kamble -Index: binutils-2.20.1/libiberty/Makefile.in -=================================================================== ---- binutils-2.20.1.orig/libiberty/Makefile.in -+++ binutils-2.20.1/libiberty/Makefile.in -@@ -327,7 +327,8 @@ install: install_to_$(INSTALL_DEST) inst - # multilib-specific flags, it's overridden by FLAGS_TO_PASS from the - # default multilib, so we have to take CFLAGS into account as well, - # since it will be passed the multilib flags. --MULTIOSDIR = `$(CC) $(CFLAGS) -print-multi-os-directory` -+#MULTIOSDIR = `$(CC) $(CFLAGS) -print-multi-os-directory` -+MULTIOSDIR = "" - install_to_libdir: all - ${mkinstalldirs} $(DESTDIR)$(libdir)/$(MULTIOSDIR) - $(INSTALL_DATA) $(TARGETLIB) $(DESTDIR)$(libdir)/$(MULTIOSDIR)/$(TARGETLIB)n diff --git a/meta/recipes-devtools/binutils/binutils-2.21/110-arm-eabi-conf.patch b/meta/recipes-devtools/binutils/binutils-2.21/110-arm-eabi-conf.patch new file mode 100644 index 0000000000..2623301da0 --- /dev/null +++ b/meta/recipes-devtools/binutils/binutils-2.21/110-arm-eabi-conf.patch @@ -0,0 +1,22 @@ +--- /tmp/configure.ac 2008-06-22 14:14:59.000000000 +0200 ++++ binutils-2.18.50.0.7/configure.ac 2008-06-22 14:15:30.000000000 +0200 +@@ -561,7 +561,7 @@ + noconfigdirs="$noconfigdirs target-libffi target-qthreads" + libgloss_dir=arm + ;; +- arm*-*-linux-gnueabi) ++ arm*-*-linux-gnueabi | arm*-*-linux-uclibcgnueabi) + noconfigdirs="$noconfigdirs target-qthreads" + noconfigdirs="$noconfigdirs target-libobjc" + case ${with_newlib} in +--- /tmp/configure 2008-06-22 14:17:11.000000000 +0200 ++++ binutils-2.18.50.0.7/configure 2008-06-22 14:17:56.000000000 +0200 +@@ -2307,7 +2307,7 @@ + noconfigdirs="$noconfigdirs target-libffi target-qthreads" + libgloss_dir=arm + ;; +- arm*-*-linux-gnueabi) ++ arm*-*-linux-gnueabi | arm*-*-linux-uclibcgnueabi) + noconfigdirs="$noconfigdirs target-qthreads" + noconfigdirs="$noconfigdirs target-libobjc" + case ${with_newlib} in diff --git a/meta/recipes-devtools/binutils/binutils-2.21/binutils-2.19.1-ld-sysroot.patch b/meta/recipes-devtools/binutils/binutils-2.21/binutils-2.19.1-ld-sysroot.patch new file mode 100644 index 0000000000..adcabb4f66 --- /dev/null +++ b/meta/recipes-devtools/binutils/binutils-2.21/binutils-2.19.1-ld-sysroot.patch @@ -0,0 +1,37 @@ +http://sourceware.org/bugzilla/show_bug.cgi?id=10340 + +Signed-off-by: Sven Rebhan + +Always try to prepend the sysroot prefix to absolute filenames first. + +Index: binutils-2.21/ld/ldfile.c +=================================================================== +--- binutils-2.21.orig/ld/ldfile.c ++++ binutils-2.21/ld/ldfile.c +@@ -372,18 +372,24 @@ ldfile_open_file_search (const char *arc + directory first. */ + if (! entry->is_archive) + { +- if (entry->sysrooted && IS_ABSOLUTE_PATH (entry->filename)) ++ /* For absolute pathnames, try to always open the file in the ++ sysroot first. If this fails, try to open the file at the ++ given location. */ ++ entry->sysrooted = is_sysrooted_pathname(entry->filename, FALSE); ++ if (IS_ABSOLUTE_PATH (entry->filename) && ld_sysroot && ! entry->sysrooted) + { + char *name = concat (ld_sysroot, entry->filename, + (const char *) NULL); + if (ldfile_try_open_bfd (name, entry)) + { + entry->filename = name; ++ entry->sysrooted = TRUE; + return TRUE; + } + free (name); + } +- else if (ldfile_try_open_bfd (entry->filename, entry)) ++ ++ if (ldfile_try_open_bfd (entry->filename, entry)) + { + entry->sysrooted = IS_ABSOLUTE_PATH (entry->filename) + && is_sysrooted_pathname (entry->filename, TRUE); diff --git a/meta/recipes-devtools/binutils/binutils-2.21/binutils-poison.patch b/meta/recipes-devtools/binutils/binutils-2.21/binutils-poison.patch new file mode 100644 index 0000000000..c2f19276f8 --- /dev/null +++ b/meta/recipes-devtools/binutils/binutils-2.21/binutils-poison.patch @@ -0,0 +1,253 @@ +This patch is recived from Mark Hatle + +purpose: warn for uses of system directories when cross linking + +Signed-Off-By: Mark Hatle + +Code Merged from Sourcery G++ binutils 2.19 - 4.4-277 + +2008-07-02 Joseph Myers + + ld/ + * ld.h (args_type): Add error_poison_system_directories. + * ld.texinfo (--error-poison-system-directories): Document. + * ldfile.c (ldfile_add_library_path): Check + command_line.error_poison_system_directories. + * ldmain.c (main): Initialize + command_line.error_poison_system_directories. + * lexsup.c (enum option_values): Add + OPTION_ERROR_POISON_SYSTEM_DIRECTORIES. + (ld_options): Add --error-poison-system-directories. + (parse_args): Handle new option. + +2007-06-13 Joseph Myers + + ld/ + * config.in: Regenerate. + * ld.h (args_type): Add poison_system_directories. + * ld.texinfo (--no-poison-system-directories): Document. + * ldfile.c (ldfile_add_library_path): Check + command_line.poison_system_directories. + * ldmain.c (main): Initialize + command_line.poison_system_directories. + * lexsup.c (enum option_values): Add + OPTION_NO_POISON_SYSTEM_DIRECTORIES. + (ld_options): Add --no-poison-system-directories. + (parse_args): Handle new option. + +2007-04-20 Joseph Myers + + Merge from Sourcery G++ binutils 2.17: + + 2007-03-20 Joseph Myers + Based on patch by Mark Hatle . + ld/ + * configure.in (--enable-poison-system-directories): New option. + * configure, config.in: Regenerate. + * ldfile.c (ldfile_add_library_path): If + ENABLE_POISON_SYSTEM_DIRECTORIES defined, warn for use of /lib, + /usr/lib, /usr/local/lib or /usr/X11R6/lib. + +Index: binutils-2.20.1/ld/config.in +=================================================================== +--- binutils-2.20.1.orig/ld/config.in ++++ binutils-2.20.1/ld/config.in +@@ -4,6 +4,9 @@ + language is requested. */ + #undef ENABLE_NLS + ++/* Define to warn for use of native system library directories */ ++#undef ENABLE_POISON_SYSTEM_DIRECTORIES ++ + /* Additional extension a shared object might have. */ + #undef EXTRA_SHLIB_EXTENSION + +Index: binutils-2.20.1/ld/configure.in +=================================================================== +--- binutils-2.20.1.orig/ld/configure.in ++++ binutils-2.20.1/ld/configure.in +@@ -69,6 +69,16 @@ AC_SUBST(use_sysroot) + AC_SUBST(TARGET_SYSTEM_ROOT) + AC_SUBST(TARGET_SYSTEM_ROOT_DEFINE) + ++AC_ARG_ENABLE([poison-system-directories], ++ AS_HELP_STRING([--enable-poison-system-directories], ++ [warn for use of native system library directories]),, ++ [enable_poison_system_directories=no]) ++if test "x${enable_poison_system_directories}" = "xyes"; then ++ AC_DEFINE([ENABLE_POISON_SYSTEM_DIRECTORIES], ++ [1], ++ [Define to warn for use of native system library directories]) ++fi ++ + AC_ARG_ENABLE([got], + AS_HELP_STRING([--enable-got=], + [GOT handling scheme (target, single, negative, multigot)]), +Index: binutils-2.20.1/ld/ld.h +=================================================================== +--- binutils-2.20.1.orig/ld/ld.h ++++ binutils-2.20.1/ld/ld.h +@@ -176,6 +176,14 @@ typedef struct { + input files. */ + bfd_boolean accept_unknown_input_arch; + ++ /* If TRUE (the default) warn for uses of system directories when ++ cross linking. */ ++ bfd_boolean poison_system_directories; ++ ++ /* If TRUE (default FALSE) give an error for uses of system ++ directories when cross linking instead of a warning. */ ++ bfd_boolean error_poison_system_directories; ++ + /* Big or little endian as set on command line. */ + enum endian_enum endian; + +Index: binutils-2.20.1/ld/ld.texinfo +=================================================================== +--- binutils-2.20.1.orig/ld/ld.texinfo ++++ binutils-2.20.1/ld/ld.texinfo +@@ -2084,6 +2084,18 @@ string identifying the original linked f + + Passing @code{none} for @var{style} disables the setting from any + @code{--build-id} options earlier on the command line. ++ ++@kindex --no-poison-system-directories ++@item --no-poison-system-directories ++Do not warn for @option{-L} options using system directories such as ++@file{/usr/lib} when cross linking. This option is intended for use ++in chroot environments when such directories contain the correct ++libraries for the target system rather than the host. ++ ++@kindex --error-poison-system-directories ++@item --error-poison-system-directories ++Give an error instead of a warning for @option{-L} options using ++system directories when cross linking. + @end table + + @c man end +Index: binutils-2.20.1/ld/ldfile.c +=================================================================== +--- binutils-2.20.1.orig/ld/ldfile.c ++++ binutils-2.20.1/ld/ldfile.c +@@ -120,6 +120,23 @@ ldfile_add_library_path (const char *nam + { + new_dirs->name = xstrdup (name); + new_dirs->sysrooted = is_sysrooted_pathname (name, FALSE); ++ ++#ifdef ENABLE_POISON_SYSTEM_DIRECTORIES ++ if (command_line.poison_system_directories ++ && ((!strncmp (name, "/lib", 4)) ++ || (!strncmp (name, "/usr/lib", 8)) ++ || (!strncmp (name, "/usr/local/lib", 14)) ++ || (!strncmp (name, "/usr/X11R6/lib", 14)))) ++ { ++ if (command_line.error_poison_system_directories) ++ einfo (_("%X%P: error: library search path \"%s\" is unsafe for " ++ "cross-compilation\n"), name); ++ else ++ einfo (_("%P: warning: library search path \"%s\" is unsafe for " ++ "cross-compilation\n"), name); ++ } ++#endif ++ + } + } + +Index: binutils-2.20.1/ld/ldmain.c +=================================================================== +--- binutils-2.20.1.orig/ld/ldmain.c ++++ binutils-2.20.1/ld/ldmain.c +@@ -252,6 +252,8 @@ main (int argc, char **argv) + command_line.warn_mismatch = TRUE; + command_line.warn_search_mismatch = TRUE; + command_line.check_section_addresses = -1; ++ command_line.poison_system_directories = TRUE; ++ command_line.error_poison_system_directories = FALSE; + + /* We initialize DEMANGLING based on the environment variable + COLLECT_NO_DEMANGLE. The gcc collect2 program will demangle the +Index: binutils-2.20.1/ld/lexsup.c +=================================================================== +--- binutils-2.20.1.orig/ld/lexsup.c ++++ binutils-2.20.1/ld/lexsup.c +@@ -166,7 +166,9 @@ enum option_values + OPTION_WARN_SHARED_TEXTREL, + OPTION_WARN_ALTERNATE_EM, + OPTION_REDUCE_MEMORY_OVERHEADS, +- OPTION_DEFAULT_SCRIPT ++ OPTION_DEFAULT_SCRIPT, ++ OPTION_NO_POISON_SYSTEM_DIRECTORIES, ++ OPTION_ERROR_POISON_SYSTEM_DIRECTORIES + }; + + /* The long options. This structure is used for both the option +@@ -575,6 +577,14 @@ static const struct ld_option ld_options + TWO_DASHES }, + { {"wrap", required_argument, NULL, OPTION_WRAP}, + '\0', N_("SYMBOL"), N_("Use wrapper functions for SYMBOL"), TWO_DASHES }, ++ { {"no-poison-system-directories", no_argument, NULL, ++ OPTION_NO_POISON_SYSTEM_DIRECTORIES}, ++ '\0', NULL, N_("Do not warn for -L options using system directories"), ++ TWO_DASHES }, ++ { {"error-poison-system-directories", no_argument, NULL, ++ OPTION_ERROR_POISON_SYSTEM_DIRECTORIES}, ++ '\0', NULL, N_("Give an error for -L options using system directories"), ++ TWO_DASHES }, + }; + + #define OPTION_COUNT ARRAY_SIZE (ld_options) +@@ -1480,6 +1490,14 @@ parse_args (unsigned argc, char **argv) + einfo (_("%P%X: --hash-size needs a numeric argument\n")); + } + break; ++ ++ case OPTION_NO_POISON_SYSTEM_DIRECTORIES: ++ command_line.poison_system_directories = FALSE; ++ break; ++ ++ case OPTION_ERROR_POISON_SYSTEM_DIRECTORIES: ++ command_line.error_poison_system_directories = TRUE; ++ break; + } + } + +diff -ur binutils-2.20.1.orig/ld/configure binutils-2.20.1/ld/configure +--- binutils-2.20.1.orig/ld/configure 2010-03-03 08:06:22.000000000 -0600 ++++ binutils-2.20.1/ld/configure 2010-09-30 11:19:35.776990594 -0500 +@@ -901,6 +904,7 @@ + enable_targets + enable_64_bit_bfd + with_sysroot ++enable_poison_system_directories + enable_got + enable_werror + enable_build_warnings +@@ -1548,6 +1552,8 @@ + (and sometimes confusing) to the casual installer + --enable-targets alternative target configurations + --enable-64-bit-bfd 64-bit support (on hosts with narrower word sizes) ++ --enable-poison-system-directories ++ warn for use of native system library directories + --enable-got= GOT handling scheme (target, single, negative, + multigot) + --enable-werror treat compile warnings as errors +@@ -4302,6 +4334,19 @@ + + + ++# Check whether --enable-poison-system-directories was given. ++if test "${enable_poison_system_directories+set}" = set; then : ++ enableval=$enable_poison_system_directories; ++else ++ enable_poison_system_directories=no ++fi ++ ++if test "x${enable_poison_system_directories}" = "xyes"; then ++ ++$as_echo "#define ENABLE_POISON_SYSTEM_DIRECTORIES 1" >>confdefs.h ++ ++fi ++ + # Check whether --enable-got was given. + if test "${enable_got+set}" = set; then : + enableval=$enable_got; case "${enableval}" in diff --git a/meta/recipes-devtools/binutils/binutils-2.21/binutils-uclibc-100-uclibc-conf.patch b/meta/recipes-devtools/binutils/binutils-2.21/binutils-uclibc-100-uclibc-conf.patch new file mode 100644 index 0000000000..8de04e0fe0 --- /dev/null +++ b/meta/recipes-devtools/binutils/binutils-2.21/binutils-uclibc-100-uclibc-conf.patch @@ -0,0 +1,34 @@ +--- binutils-2.18.orig/configure ++++ binutils-2.18/configure +@@ -2206,7 +2206,7 @@ + am33_2.0-*-linux*) + noconfigdirs="$noconfigdirs ${libgcj} target-newlib target-libgloss" + ;; +- sh-*-linux*) ++ sh*-*-linux*) + noconfigdirs="$noconfigdirs ${libgcj} target-newlib target-libgloss" + ;; + sh*-*-pe|mips*-*-pe|*arm-wince-pe) +@@ -2504,7 +2504,7 @@ + romp-*-*) + noconfigdirs="$noconfigdirs bfd binutils ld gas opcodes target-libgloss ${libgcj}" + ;; +- sh-*-* | sh64-*-*) ++ sh*-*-* | sh64-*-*) + case "${host}" in + i[3456789]86-*-vsta) ;; # don't add gprof back in + i[3456789]86-*-go32*) ;; # don't add gprof back in +--- binutils-2.18.orig/gprof/configure ++++ binutils-2.18/gprof/configure +@@ -4124,6 +4124,11 @@ + lt_cv_deplibs_check_method=pass_all + ;; + ++linux-uclibc*) ++ lt_cv_deplibs_check_method=pass_all ++ lt_cv_file_magic_test_file=`echo /lib/libuClibc-*.so` ++ ;; ++ + netbsd*) + if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then + lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$' diff --git a/meta/recipes-devtools/binutils/binutils-2.21/binutils-uclibc-300-001_ld_makefile_patch.patch b/meta/recipes-devtools/binutils/binutils-2.21/binutils-uclibc-300-001_ld_makefile_patch.patch new file mode 100644 index 0000000000..04a7e61e25 --- /dev/null +++ b/meta/recipes-devtools/binutils/binutils-2.21/binutils-uclibc-300-001_ld_makefile_patch.patch @@ -0,0 +1,50 @@ +#!/bin/sh -e +## 001_ld_makefile_patch.dpatch +## +## All lines beginning with `## DP:' are a description of the patch. +## DP: Description: correct where ld scripts are installed +## DP: Author: Chris Chimelis +## DP: Upstream status: N/A +## DP: Date: ?? + +if [ $# -ne 1 ]; then + echo >&2 "`basename $0`: script expects -patch|-unpatch as argument" + exit 1 +fi + +[ -f debian/patches/00patch-opts ] && . debian/patches/00patch-opts +patch_opts="${patch_opts:--f --no-backup-if-mismatch}" + +case "$1" in + -patch) patch $patch_opts -p1 < $0;; + -unpatch) patch $patch_opts -p1 -R < $0;; + *) + echo >&2 "`basename $0`: script expects -patch|-unpatch as argument" + exit 1;; +esac + +exit 0 + +@DPATCH@ +--- binutils-2.16.91.0.1/ld/Makefile.am ++++ binutils-2.16.91.0.1/ld/Makefile.am +@@ -20,7 +20,7 @@ + # We put the scripts in the directory $(scriptdir)/ldscripts. + # We can't put the scripts in $(datadir) because the SEARCH_DIR + # directives need to be different for native and cross linkers. +-scriptdir = $(tooldir)/lib ++scriptdir = $(libdir) + + EMUL = @EMUL@ + EMULATION_OFILES = @EMULATION_OFILES@ +--- binutils-2.16.91.0.1/ld/Makefile.in ++++ binutils-2.16.91.0.1/ld/Makefile.in +@@ -268,7 +268,7 @@ + # We put the scripts in the directory $(scriptdir)/ldscripts. + # We can't put the scripts in $(datadir) because the SEARCH_DIR + # directives need to be different for native and cross linkers. +-scriptdir = $(tooldir)/lib ++scriptdir = $(libdir) + BASEDIR = $(srcdir)/.. + BFDDIR = $(BASEDIR)/bfd + INCDIR = $(BASEDIR)/include diff --git a/meta/recipes-devtools/binutils/binutils-2.21/binutils-uclibc-300-006_better_file_error.patch b/meta/recipes-devtools/binutils/binutils-2.21/binutils-uclibc-300-006_better_file_error.patch new file mode 100644 index 0000000000..f337611edf --- /dev/null +++ b/meta/recipes-devtools/binutils/binutils-2.21/binutils-uclibc-300-006_better_file_error.patch @@ -0,0 +1,43 @@ +#!/bin/sh -e +## 006_better_file_error.dpatch by David Kimdon +## +## All lines beginning with `## DP:' are a description of the patch. +## DP: Specify which filename is causing an error if the filename is a +## DP: directory. (#45832) + +if [ $# -ne 1 ]; then + echo >&2 "`basename $0`: script expects -patch|-unpatch as argument" + exit 1 +fi + +[ -f debian/patches/00patch-opts ] && . debian/patches/00patch-opts +patch_opts="${patch_opts:--f --no-backup-if-mismatch}" + +case "$1" in + -patch) patch $patch_opts -p1 < $0;; + -unpatch) patch $patch_opts -p1 -R < $0;; + *) + echo >&2 "`basename $0`: script expects -patch|-unpatch as argument" + exit 1;; +esac + +exit 0 + +@DPATCH@ +diff -urNad /home/james/debian/packages/binutils/binutils-2.14.90.0.6/bfd/opncls.c binutils-2.14.90.0.6/bfd/opncls.c +--- /home/james/debian/packages/binutils/binutils-2.14.90.0.6/bfd/opncls.c 2003-07-23 16:08:09.000000000 +0100 ++++ binutils-2.14.90.0.6/bfd/opncls.c 2003-09-10 22:35:00.000000000 +0100 +@@ -150,6 +150,13 @@ + { + bfd *nbfd; + const bfd_target *target_vec; ++ struct stat s; ++ ++ if (stat (filename, &s) == 0) ++ if (S_ISDIR(s.st_mode)) { ++ bfd_set_error (bfd_error_file_not_recognized); ++ return NULL; ++ } + + nbfd = _bfd_new_bfd (); + if (nbfd == NULL) diff --git a/meta/recipes-devtools/binutils/binutils-2.21/binutils-uclibc-300-012_check_ldrunpath_length.patch b/meta/recipes-devtools/binutils/binutils-2.21/binutils-uclibc-300-012_check_ldrunpath_length.patch new file mode 100644 index 0000000000..b6f5a25ceb --- /dev/null +++ b/meta/recipes-devtools/binutils/binutils-2.21/binutils-uclibc-300-012_check_ldrunpath_length.patch @@ -0,0 +1,48 @@ +#!/bin/sh -e +## 012_check_ldrunpath_length.dpatch by Chris Chimelis +## +## All lines beginning with `## DP:' are a description of the patch. +## DP: Only generate an RPATH entry if LD_RUN_PATH is not empty, for +## DP: cases where -rpath isn't specified. (#151024) + +if [ $# -ne 1 ]; then + echo >&2 "`basename $0`: script expects -patch|-unpatch as argument" + exit 1 +fi + +[ -f debian/patches/00patch-opts ] && . debian/patches/00patch-opts +patch_opts="${patch_opts:--f --no-backup-if-mismatch}" + +case "$1" in + -patch) patch $patch_opts -p1 < $0;; + -unpatch) patch $patch_opts -p1 -R < $0;; + *) + echo >&2 "`basename $0`: script expects -patch|-unpatch as argument" + exit 1;; +esac + +exit 0 + +@DPATCH@ +Index: src/ld/emultempl/elf32.em +=================================================================== +--- src.orig/ld/emultempl/elf32.em 2009-09-23 06:54:28.000000000 -0700 ++++ src/ld/emultempl/elf32.em 2009-10-06 10:58:16.883414592 -0700 +@@ -1237,6 +1237,8 @@ fragment <link_next) + { diff --git a/meta/recipes-devtools/binutils/binutils-2.21/binutils-uclibc-gas-needs-libm.patch b/meta/recipes-devtools/binutils/binutils-2.21/binutils-uclibc-gas-needs-libm.patch new file mode 100644 index 0000000000..db838cf20c --- /dev/null +++ b/meta/recipes-devtools/binutils/binutils-2.21/binutils-uclibc-gas-needs-libm.patch @@ -0,0 +1,38 @@ +Source: Khem Raj +Disposition: submit upstream. + +Description: + +We do not need to have the libtool patch anymore for binutils after +libtool has been updated upstream it include support for it. However +for building gas natively on uclibc systems we have to link it with +-lm so that it picks up missing symbols. + +/local/build_area/BUILD/arm_v5t_le_uclibc/binutils-2.17.50/objdir/libiberty/pic/libiberty.a(floatformat.o): In function `floatformat_from_double': +floatformat.c:(.text+0x1ec): undefined reference to `frexp' +floatformat.c:(.text+0x2f8): undefined reference to `ldexp' +/local/build_area/BUILD/arm_v5t_le_uclibc/binutils-2.17.50/objdir/libiberty/pic/libiberty.a(floatformat.o): In function `floatformat_to_double': +floatformat.c:(.text+0x38a): undefined reference to `ldexp' +floatformat.c:(.text+0x3d2): undefined reference to `ldexp' +floatformat.c:(.text+0x43e): undefined reference to `ldexp' floatformat.c:(.text+0x4e2): undefined reference to `ldexp' +collect2: ld returned 1 exit status +make[4]: *** [as-new] Error 1 + +Index: binutils-2.17.50/gas/configure.tgt +=================================================================== +--- binutils-2.17.50.orig/gas/configure.tgt ++++ binutils-2.17.50/gas/configure.tgt +@@ -408,6 +408,12 @@ case ${generic_target} in + *-*-netware) fmt=elf em=netware ;; + esac + ++case ${generic_target} in ++ arm-*-*uclibc*) ++ need_libm=yes ++ ;; ++esac ++ + case ${cpu_type} in + alpha | arm | i386 | ia64 | mips | ns32k | pdp11 | ppc | sparc | z80 | z8k) + bfd_gas=yes + diff --git a/meta/recipes-devtools/binutils/binutils-2.21/binutils-x86_64_i386_biarch.patch b/meta/recipes-devtools/binutils/binutils-2.21/binutils-x86_64_i386_biarch.patch new file mode 100644 index 0000000000..4cd9e22438 --- /dev/null +++ b/meta/recipes-devtools/binutils/binutils-2.21/binutils-x86_64_i386_biarch.patch @@ -0,0 +1,26 @@ +#!/bin/sh -e +## 127_x86_64_i386_biarch.dpatch +## +## DP: Description: Add (/usr)/lib32 to the search paths on x86_64. +## DP: Author: Aurelien Jarno +## DP: Upstream status: Debian specific +# +# Hacked to apply with quilt +# Adapted to binutils 2.18.50.0.7 + +--- binutils/ld/emulparams/elf_i386.sh ++++ binutils/ld/emulparams/elf_i386.sh +@@ -12,3 +12,13 @@ + SEPARATE_GOTPLT=12 + SHARABLE_SECTIONS=yes + IREL_IN_PLT= ++ ++# Linux modify the default library search path to first include ++# a 32-bit specific directory. ++case "$target" in ++ x86_64*-linux* | i[3-7]86*-linux* | x86_64*-kfreebsd*-gnu | i[3-7]86*-kfreebsd*-gnu) ++ case "$EMULATION_NAME" in ++ *i386*) LIBPATH_SUFFIX=32 ;; ++ esac ++ ;; ++esac diff --git a/meta/recipes-devtools/binutils/binutils-2.21/libiberty_path_fix.patch b/meta/recipes-devtools/binutils/binutils-2.21/libiberty_path_fix.patch new file mode 100644 index 0000000000..36a14d7a18 --- /dev/null +++ b/meta/recipes-devtools/binutils/binutils-2.21/libiberty_path_fix.patch @@ -0,0 +1,20 @@ +don't let the distro compiler point to the wrong installation location + +Thanks to RP for helping find the source code causing the issue. + +2010/08/13 +Nitin A Kamble +Index: binutils-2.20.1/libiberty/Makefile.in +=================================================================== +--- binutils-2.20.1.orig/libiberty/Makefile.in ++++ binutils-2.20.1/libiberty/Makefile.in +@@ -327,7 +327,8 @@ install: install_to_$(INSTALL_DEST) inst + # multilib-specific flags, it's overridden by FLAGS_TO_PASS from the + # default multilib, so we have to take CFLAGS into account as well, + # since it will be passed the multilib flags. +-MULTIOSDIR = `$(CC) $(CFLAGS) -print-multi-os-directory` ++#MULTIOSDIR = `$(CC) $(CFLAGS) -print-multi-os-directory` ++MULTIOSDIR = "" + install_to_libdir: all + ${mkinstalldirs} $(DESTDIR)$(libdir)/$(MULTIOSDIR) + $(INSTALL_DATA) $(TARGETLIB) $(DESTDIR)$(libdir)/$(MULTIOSDIR)/$(TARGETLIB)n diff --git a/meta/recipes-devtools/binutils/binutils-2.21/libtool-2.4-update.patch b/meta/recipes-devtools/binutils/binutils-2.21/libtool-2.4-update.patch new file mode 100644 index 0000000000..7b4d3903dc --- /dev/null +++ b/meta/recipes-devtools/binutils/binutils-2.21/libtool-2.4-update.patch @@ -0,0 +1,18675 @@ +Index: binutils-2.21/libtool.m4 +=================================================================== +--- binutils-2.21.orig/libtool.m4 ++++ binutils-2.21/libtool.m4 +@@ -1,7 +1,8 @@ + # libtool.m4 - Configure libtool for the host system. -*-Autoconf-*- + # + # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, +-# 2006, 2007, 2008, 2009 Free Software Foundation, Inc. ++# 2006, 2007, 2008, 2009, 2010 Free Software Foundation, ++# Inc. + # Written by Gordon Matzigkeit, 1996 + # + # This file is free software; the Free Software Foundation gives +@@ -10,7 +11,8 @@ + + m4_define([_LT_COPYING], [dnl + # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, +-# 2006, 2007, 2008, 2009 Free Software Foundation, Inc. ++# 2006, 2007, 2008, 2009, 2010 Free Software Foundation, ++# Inc. + # Written by Gordon Matzigkeit, 1996 + # + # This file is part of GNU Libtool. +@@ -37,7 +39,7 @@ m4_define([_LT_COPYING], [dnl + # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + ]) + +-# serial 56 LT_INIT ++# serial 57 LT_INIT + + + # LT_PREREQ(VERSION) +@@ -92,7 +94,8 @@ _LT_SET_OPTIONS([$0], [$1]) + LIBTOOL_DEPS="$ltmain" + + # Always use our own libtool. +-LIBTOOL='$(SHELL) $(top_builddir)/libtool' ++LIBTOOL='$(SHELL) $(top_builddir)' ++LIBTOOL="$LIBTOOL/${host_alias}-libtool" + AC_SUBST(LIBTOOL)dnl + + _LT_SETUP +@@ -166,10 +169,13 @@ _LT_DECL([], [exeext], [0], [Executable + dnl + m4_require([_LT_FILEUTILS_DEFAULTS])dnl + m4_require([_LT_CHECK_SHELL_FEATURES])dnl ++m4_require([_LT_PATH_CONVERSION_FUNCTIONS])dnl + m4_require([_LT_CMD_RELOAD])dnl + m4_require([_LT_CHECK_MAGIC_METHOD])dnl ++m4_require([_LT_CHECK_SHAREDLIB_FROM_LINKLIB])dnl + m4_require([_LT_CMD_OLD_ARCHIVE])dnl + m4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl ++m4_require([_LT_WITH_SYSROOT])dnl + + _LT_CONFIG_LIBTOOL_INIT([ + # See if we are running on zsh, and set the options which allow our +@@ -199,7 +205,7 @@ aix3*) + esac + + # Global variables: +-ofile=libtool ++ofile=${host_alias}-libtool + can_build_shared=yes + + # All known linkers require a `.a' archive for static linking (except MSVC, +@@ -632,7 +638,7 @@ m4_ifset([AC_PACKAGE_NAME], [AC_PACKAGE_ + m4_ifset([AC_PACKAGE_VERSION], [ AC_PACKAGE_VERSION]) + configured by $[0], generated by m4_PACKAGE_STRING. + +-Copyright (C) 2009 Free Software Foundation, Inc. ++Copyright (C) 2010 Free Software Foundation, Inc. + This config.lt script is free software; the Free Software Foundation + gives unlimited permision to copy, distribute and modify it." + +@@ -746,15 +752,12 @@ _LT_EOF + # if finds mixed CR/LF and LF-only lines. Since sed operates in + # text mode, it properly converts lines to CR/LF. This bash problem + # is reportedly fixed, but why not run on old versions too? +- sed '/^# Generated shell functions inserted here/q' "$ltmain" >> "$cfgfile" \ +- || (rm -f "$cfgfile"; exit 1) ++ sed '$q' "$ltmain" >> "$cfgfile" \ ++ || (rm -f "$cfgfile"; exit 1) + +- _LT_PROG_XSI_SHELLFNS ++ _LT_PROG_REPLACE_SHELLFNS + +- sed -n '/^# Generated shell functions inserted here/,$p' "$ltmain" >> "$cfgfile" \ +- || (rm -f "$cfgfile"; exit 1) +- +- mv -f "$cfgfile" "$ofile" || ++ mv -f "$cfgfile" "$ofile" || + (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile") + chmod +x "$ofile" + ], +@@ -980,6 +983,8 @@ _LT_EOF + $LTCC $LTCFLAGS -c -o conftest.o conftest.c 2>&AS_MESSAGE_LOG_FD + echo "$AR cru libconftest.a conftest.o" >&AS_MESSAGE_LOG_FD + $AR cru libconftest.a conftest.o 2>&AS_MESSAGE_LOG_FD ++ echo "$RANLIB libconftest.a" >&AS_MESSAGE_LOG_FD ++ $RANLIB libconftest.a 2>&AS_MESSAGE_LOG_FD + cat > conftest.c << _LT_EOF + int main() { return 0;} + _LT_EOF +@@ -1069,30 +1074,41 @@ m4_defun([_LT_DARWIN_LINKER_FEATURES], + fi + ]) + +-# _LT_SYS_MODULE_PATH_AIX +-# ----------------------- ++# _LT_SYS_MODULE_PATH_AIX([TAGNAME]) ++# ---------------------------------- + # Links a minimal program and checks the executable + # for the system default hardcoded library path. In most cases, + # this is /usr/lib:/lib, but when the MPI compilers are used + # the location of the communication and MPI libs are included too. + # If we don't find anything, use the default library path according + # to the aix ld manual. ++# Store the results from the different compilers for each TAGNAME. ++# Allow to override them for all tags through lt_cv_aix_libpath. + m4_defun([_LT_SYS_MODULE_PATH_AIX], + [m4_require([_LT_DECL_SED])dnl +-AC_LINK_IFELSE(AC_LANG_PROGRAM,[ +-lt_aix_libpath_sed=' +- /Import File Strings/,/^$/ { +- /^0/ { +- s/^0 *\(.*\)$/\1/ +- p +- } +- }' +-aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` +-# Check for a 64-bit object if we didn't find anything. +-if test -z "$aix_libpath"; then +- aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` +-fi],[]) +-if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi ++if test "${lt_cv_aix_libpath+set}" = set; then ++ aix_libpath=$lt_cv_aix_libpath ++else ++ AC_CACHE_VAL([_LT_TAGVAR([lt_cv_aix_libpath_], [$1])], ++ [AC_LINK_IFELSE([AC_LANG_PROGRAM],[ ++ lt_aix_libpath_sed='[ ++ /Import File Strings/,/^$/ { ++ /^0/ { ++ s/^0 *\([^ ]*\) *$/\1/ ++ p ++ } ++ }]' ++ _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` ++ # Check for a 64-bit object if we didn't find anything. ++ if test -z "$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])"; then ++ _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` ++ fi],[]) ++ if test -z "$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])"; then ++ _LT_TAGVAR([lt_cv_aix_libpath_], [$1])="/usr/lib:/lib" ++ fi ++ ]) ++ aix_libpath=$_LT_TAGVAR([lt_cv_aix_libpath_], [$1]) ++fi + ])# _LT_SYS_MODULE_PATH_AIX + + +@@ -1117,7 +1133,7 @@ ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO + + AC_MSG_CHECKING([how to print strings]) + # Test print first, because it will be a builtin if present. +-if test "X`print -r -- -n 2>/dev/null`" = X-n && \ ++if test "X`( print -r -- -n ) 2>/dev/null`" = X-n && \ + test "X`print -r -- $ECHO 2>/dev/null`" = "X$ECHO"; then + ECHO='print -r --' + elif test "X`printf %s $ECHO 2>/dev/null`" = "X$ECHO"; then +@@ -1161,6 +1177,39 @@ _LT_DECL([], [ECHO], [1], [An echo progr + ])# _LT_PROG_ECHO_BACKSLASH + + ++# _LT_WITH_SYSROOT ++# ---------------- ++AC_DEFUN([_LT_WITH_SYSROOT], ++[AC_MSG_CHECKING([for sysroot]) ++AC_ARG_WITH([libtool-sysroot], ++[ --with-libtool-sysroot[=DIR] Search for dependent libraries within DIR ++ (or the compiler's sysroot if not specified).], ++[], [with_libtool_sysroot=no]) ++ ++dnl lt_sysroot will always be passed unquoted. We quote it here ++dnl in case the user passed a directory name. ++lt_sysroot= ++case ${with_libtool_sysroot} in #( ++ yes) ++ if test "$GCC" = yes; then ++ lt_sysroot=`$CC --print-sysroot 2>/dev/null` ++ fi ++ ;; #( ++ /*) ++ lt_sysroot=`echo "$with_libtool_sysroot" | sed -e "$sed_quote_subst"` ++ ;; #( ++ no|'') ++ ;; #( ++ *) ++ AC_MSG_RESULT([${with_libtool_sysroot}]) ++ AC_MSG_ERROR([The sysroot must be an absolute path.]) ++ ;; ++esac ++ ++ AC_MSG_RESULT([${lt_sysroot:-no}]) ++_LT_DECL([], [lt_sysroot]