binutils: import 2.20.1 from yocto

Signed-off-by: Koen Kooi <koen@dominion.thruhere.net>
This commit is contained in:
Koen Kooi 2011-01-22 16:51:53 +01:00
parent 741d7a4eac
commit 68bf9ac203
19 changed files with 902 additions and 0 deletions

View File

@ -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

View File

@ -0,0 +1,18 @@
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 <leonw@mailcan.com>
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),

View File

@ -0,0 +1,67 @@
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

View File

@ -0,0 +1,29 @@
# "-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 <kevin.tian@intel.com>, 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))

View File

@ -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 <mark.hatle@windriver.com>
Code Merged from Sourcery G++ binutils 2.19 - 4.4-277
2008-07-02 Joseph Myers <joseph@codesourcery.com>
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 <joseph@codesourcery.com>
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 <joseph@codesourcery.com>
Merge from Sourcery G++ binutils 2.17:
2007-03-20 Joseph Myers <joseph@codesourcery.com>
Based on patch by Mark Hatle <mark.hatle@windriver.com>.
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=<type>],
[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=<type> 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

View File

@ -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)$'

View File

@ -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 <chris@debian.org>
## 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

View File

@ -0,0 +1,43 @@
#!/bin/sh -e
## 006_better_file_error.dpatch by David Kimdon <dwhedon@gordian.com>
##
## 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)

View File

@ -0,0 +1,47 @@
#!/bin/sh -e
## 012_check_ldrunpath_length.dpatch by Chris Chimelis <chris@debian.org>
##
## 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,

View File

@ -0,0 +1,38 @@
Source: Khem Raj <raj.khem@gmail.com>
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

View File

@ -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 <aurel32.debian.org>
## 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

View File

@ -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 <nitin.a.kamble@intel.com>
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

View File

@ -0,0 +1,21 @@
inherit cross-canadian
DESCRIPTION = "A GNU collection of cross-canadian binary utilities for ${TARGET_ARCH} target"
PN = "binutils-cross-canadian-${TRANSLATED_TARGET_ARCH}"
BPN = "binutils"
DEPENDS = "flex-native bison-native virtual/${HOST_PREFIX}gcc-crosssdk virtual/libc-nativesdk zlib-nativesdk gettext-nativesdk"
EXTRA_OECONF = "--with-sysroot=${SDKPATH}/sysroots/${TARGET_SYS} \
--program-prefix=${TARGET_PREFIX}"
do_install () {
autotools_do_install
# We're not interested in the libs or headers, these would come from the
# nativesdk or target version of the binutils recipe
rm -rf ${D}${prefix}/${TARGET_SYS}
rm -f ${D}${libdir}/libbfd*
rm -f ${D}${libdir}/libiberty*
rm -f ${D}${libdir}/libopcodes*
rm -f ${D}${includedir}/*.h
}

View File

@ -0,0 +1,3 @@
require binutils_${PV}.bb
require binutils-cross-canadian.inc
PR = "r6"

View File

@ -0,0 +1,26 @@
inherit cross
PROVIDES = "virtual/${TARGET_PREFIX}binutils"
EXTRA_OECONF = "--with-sysroot=${STAGING_DIR_TARGET} \
--program-prefix=${TARGET_PREFIX} \
--disable-install-libbfd \
--disable-werror \
--enable-poison-system-directories"
do_install () {
oe_runmake 'DESTDIR=${D}' install
# We don't really need these, so we'll remove them...
rm -rf ${D}${STAGING_DIR_NATIVE}${libdir_native}/libiberty.a
rm -rf ${D}${STAGING_DIR_NATIVE}${prefix_native}/${TARGET_SYS}
rm -rf ${D}${STAGING_DIR_NATIVE}${prefix_native}/lib/ldscripts
rm -rf ${D}${STAGING_DIR_NATIVE}${prefix_native}/share/info
rm -rf ${D}${STAGING_DIR_NATIVE}${prefix_native}/share/locale
rm -rf ${D}${STAGING_DIR_NATIVE}${prefix_native}/share/man
rmdir ${D}${STAGING_DIR_NATIVE}${prefix_native}/share || :
rmdir ${D}${STAGING_DIR_NATIVE}${prefix_native}/${libdir}/gcc-lib || :
rmdir ${D}${STAGING_DIR_NATIVE}${prefix_native}/${libdir}64/gcc-lib || :
rmdir ${D}${STAGING_DIR_NATIVE}${prefix_native}/${libdir} || :
rmdir ${D}${STAGING_DIR_NATIVE}${prefix_native}/${libdir}64 || :
rmdir ${D}${STAGING_DIR_NATIVE}${prefix_native}/${prefix} || :
}

View File

@ -0,0 +1,3 @@
require binutils_${PV}.bb
require binutils-cross.inc

View File

@ -0,0 +1,12 @@
require binutils-cross_${PV}.bb
inherit crosssdk
PROVIDES = "virtual/${TARGET_PREFIX}binutils-crosssdk"
PR = "r4"
do_configure_prepend () {
sed -i 's#/usr/local/lib /lib /usr/lib#${SDKPATHNATIVE}/lib ${SDKPATHNATIVE}/usr/lib /usr/local/lib /lib /usr/lib#' ${S}/ld/configure.tgt
}

View File

@ -0,0 +1,149 @@
SUMMARY = "A GNU collection of binary utilities"
DESCRIPTION = "The GNU Binutils are a collection of binary tools. \
The main ones are ld (GNU Linker), and as (GNU Assembler). This \
package also includes addition tools such as addr2line (Converts \
addresses into filenames and line numbers), ar (utility for creating, \
modifying and extracting archives), nm (list symbols in object \
files), objcopy (copy and translate object files), objdump (Display \
object information), and other tools and related libraries."
HOMEPAGE = "http://www.gnu.org/software/binutils/"
BUGTRACKER = "http://sourceware.org/bugzilla/"
SECTION = "devel"
LICENSE = "GPLv3"
DEPENDS = "flex-native bison-native"
inherit autotools gettext
PACKAGES += "${PN}-symlinks"
FILES_${PN} = " \
${bindir}/${TARGET_PREFIX}* \
${libdir}/lib*-*.so \
${prefix}/${TARGET_SYS}/bin/*"
FILES_${PN}-dev = " \
${includedir} \
${libdir}/*.a \
${libdir}/*.la \
${libdir}/libbfd.so \
${libdir}/libopcodes.so"
FILES_${PN}-symlinks = " \
${bindir}/addr2line \
${bindir}/as \
${bindir}/c++filt \
${bindir}/gprof \
${bindir}/ld \
${bindir}/nm \
${bindir}/objcopy \
${bindir}/objdump \
${bindir}/ranlib \
${bindir}/readelf \
${bindir}/size \
${bindir}/strip"
B = "${S}/build.${HOST_SYS}.${TARGET_SYS}"
EXTRA_OECONF = "--program-prefix=${TARGET_PREFIX} \
--enable-install-libbfd \
--enable-shared"
EXTRA_OECONF_virtclass-native = "--enable-target=all --enable-64-bit-bfd --enable-install-libbfd"
# This is necessary due to a bug in the binutils Makefiles
# EXTRA_OEMAKE = "configure-build-libiberty all"
export AR = "${HOST_PREFIX}ar"
export AS = "${HOST_PREFIX}as"
export LD = "${HOST_PREFIX}ld"
export NM = "${HOST_PREFIX}nm"
export RANLIB = "${HOST_PREFIX}ranlib"
export OBJCOPY = "${HOST_PREFIX}objcopy"
export OBJDUMP = "${HOST_PREFIX}objdump"
export AR_FOR_TARGET = "${TARGET_PREFIX}ar"
export AS_FOR_TARGET = "${TARGET_PREFIX}as"
export LD_FOR_TARGET = "${TARGET_PREFIX}ld"
export NM_FOR_TARGET = "${TARGET_PREFIX}nm"
export RANLIB_FOR_TARGET = "${TARGET_PREFIX}ranlib"
export CC_FOR_HOST = "${CCACHE}${HOST_PREFIX}gcc ${HOST_CC_ARCH}"
export CXX_FOR_HOST = "${CCACHE}${HOST_PREFIX}gcc ${HOST_CC_ARCH}"
export CC_FOR_BUILD = "${BUILD_CC}"
export CPP_FOR_BUILD = "${BUILD_CPP}"
export CFLAGS_FOR_BUILD = "${BUILD_CFLAGS}"
do_configure () {
(cd ${S}; gnu-configize) || die "Failed to run gnu-configize"
oe_runconf
#
# must prime config.cache to ensure the build of libiberty
#
mkdir -p ${B}/build-${BUILD_SYS}
for i in ${CONFIG_SITE}; do
cat $i >> ${B}/build-${BUILD_SYS}/config.cache
done
}
do_install () {
autotools_do_install
# We don't really need these, so we'll remove them...
rm -rf ${D}${libdir}/ldscripts
# Fix the /usr/${TARGET_SYS}/bin/* links
for l in ${D}${prefix}/${TARGET_SYS}/bin/*; do
rm -f $l
ln -sf `echo ${prefix}/${TARGET_SYS}/bin \
| tr -s / \
| sed -e 's,^/,,' -e 's,[^/]*,..,g'`${bindir}/${TARGET_PREFIX}`basename $l` $l
done
# Install the libiberty header
install -d ${D}${includedir}
install -m 644 ${S}/include/ansidecl.h ${D}${includedir}
install -m 644 ${S}/include/libiberty.h ${D}${includedir}
cd ${D}${bindir}
# Symlinks for ease of running these on the native target
for p in ${TARGET_SYS}-* ; do
ln -sf $p `echo $p | sed -e s,${TARGET_SYS}-,,`
done
rm ${D}${bindir}/ar ${D}${bindir}/strings
}
do_install_virtclass-native () {
autotools_do_install
# Install the libiberty header
install -d ${D}${includedir}
install -m 644 ${S}/include/ansidecl.h ${D}${includedir}
install -m 644 ${S}/include/libiberty.h ${D}${includedir}
# We only want libiberty, libbfd and libopcodes
rm -rf ${D}${bindir}
rm -rf ${D}${prefix}/${TARGET_SYS}
rm -rf ${D}${prefix}/lib/ldscripts
rm -rf ${D}${prefix}/share/info
rm -rf ${D}${prefix}/share/locale
rm -rf ${D}${prefix}/share/man
rmdir ${D}${prefix}/share || :
rmdir ${D}/${libdir}/gcc-lib || :
rmdir ${D}/${libdir}64/gcc-lib || :
rmdir ${D}/${libdir} || :
rmdir ${D}/${libdir}64 || :
}
pkg_postinst_${PN}-symlinks () {
update-alternatives --install ${bindir}/ar ar ${TARGET_SYS}-ar 100
update-alternatives --install ${bindir}/strings strings ${TARGET_SYS}-strings 100
}
pkg_prerm_${PN}-symlinks () {
update-alternatives --remove ar ${TARGET_SYS}-ar
update-alternatives --remove strings ${TARGET_SYS}-strings
}

View File

@ -0,0 +1,41 @@
require binutils.inc
PR = "r4"
LIC_FILES_CHKSUM="\
file://src-release;endline=17;md5=4830a9ef968f3b18dd5e9f2c00db2d35\
file://COPYING;md5=59530bdf33659b29e73d4adb9f9f6552\
file://COPYING.LIB;md5=9f604d8a4f8e74f4f5140845a21b6674\
file://COPYING3;md5=d32239bcb673463ab874e80d47fae504\
file://COPYING3.LIB;md5=6a6a8e020838b23406c81b19c1d46df6\
file://gas/COPYING;md5=d32239bcb673463ab874e80d47fae504\
file://include/COPYING;md5=59530bdf33659b29e73d4adb9f9f6552\
file://include/COPYING3;md5=d32239bcb673463ab874e80d47fae504\
file://libiberty/COPYING.LIB;md5=a916467b91076e631dd8edb7424769c7\
file://bfd/COPYING;md5=d32239bcb673463ab874e80d47fae504\
"
SRC_URI = "\
${GNU_MIRROR}/binutils/binutils-${PV}.tar.bz2;name=tarball \
file://binutils-uclibc-100-uclibc-conf.patch \
file://110-arm-eabi-conf.patch \
file://binutils-uclibc-300-001_ld_makefile_patch.patch \
file://binutils-uclibc-300-006_better_file_error.patch \
file://binutils-uclibc-300-012_check_ldrunpath_length.patch \
file://binutils-uclibc-gas-needs-libm.patch \
file://binutils-x86_64_i386_biarch.patch \
file://binutils-mips-pie.patch \
file://binutils-libtool.patch \
file://libiberty_path_fix.patch \
file://binutils-poison.patch \
"
SRC_URI[tarball.md5sum] = "9cdfb9d6ec0578c166d3beae5e15c4e5"
SRC_URI[tarball.sha256sum] = "228b84722d87e88e7fdd36869e590e649ab523a0800a7d53df906498afe6f6f8"
# powerpc patches
SRC_URI += "\
file://binutils-2.16.1-e300c2c3.patch \
"
BBCLASSEXTEND = "native"