From 94677a95e6258cc991482100ee34328ce76adc92 Mon Sep 17 00:00:00 2001 From: Stephan Raue Date: Thu, 25 Nov 2010 18:10:50 +0100 Subject: [PATCH] binutils: add autoreconf support Signed-off-by: Stephan Raue --- packages/toolchain/devel/binutils/build | 10 +++ packages/toolchain/devel/binutils/meta | 2 + .../binutils-2.21.51.0.1-visibility.patch | 71 +++++++++++++++++++ 3 files changed, 83 insertions(+) create mode 100644 packages/toolchain/devel/binutils/patches/binutils-2.21.51.0.1-visibility.patch diff --git a/packages/toolchain/devel/binutils/build b/packages/toolchain/devel/binutils/build index 6292ee8635..7bcf36f00f 100755 --- a/packages/toolchain/devel/binutils/build +++ b/packages/toolchain/devel/binutils/build @@ -8,6 +8,11 @@ fi setup_toolchain host +CPPFLAGS="" +CFLAGS="" +CXXFLAGS="" +LDFLAGS="" + cd $PKG_BUILD mkdir -p objdir && cd objdir ../configure --host=$HOST_NAME \ @@ -26,6 +31,9 @@ mkdir -p objdir && cd objdir --disable-libssp \ --enable-version-specific-runtime-libs \ $WITH_64B_BFD \ + --enable-plugins \ + --enable-gold=both/ld \ + --enable-lto \ --disable-nls make configure-host @@ -34,3 +42,5 @@ make cp -v ../include/libiberty.h $SYSROOT_PREFIX/usr/include make install + +cp $ROOT/$TOOLCHAIN/bin/$TARGET_NAME-ld.gold $ROOT/$TOOLCHAIN/bin/$TARGET_NAME-gold \ No newline at end of file diff --git a/packages/toolchain/devel/binutils/meta b/packages/toolchain/devel/binutils/meta index 5f7d7400a2..a225767dc3 100644 --- a/packages/toolchain/devel/binutils/meta +++ b/packages/toolchain/devel/binutils/meta @@ -12,3 +12,5 @@ PKG_SECTION="toolchain/devel" PKG_SHORTDESC="binutils: A GNU collection of binary utilities" PKG_LONGDESC="The GNU binutils are utilities of use when dealing with object files. the packages includes ld - the GNU linker, as - the GNU assembler, addr2line - converts addresses into filenames and line numbers, ar - a utility for creating, modifying and extracting from archives, c++filt - filter to demangle encoded C++ symbols, gprof - displays profiling information, nlmconv - converts object code into an NLM, nm - lists symbols from object files, objcopy - Copys and translates object files, objdump - displays information from object files, ranlib - generates an index to the contents of an archive, readelf - displays information from any ELF format object file, size - lists the section sizes of an object or archive file, strings - lists printable strings from files, strip - discards symbols as well as windres - a compiler for Windows resource files." PKG_IS_ADDON="no" + +PKG_AUTORECONF="no" diff --git a/packages/toolchain/devel/binutils/patches/binutils-2.21.51.0.1-visibility.patch b/packages/toolchain/devel/binutils/patches/binutils-2.21.51.0.1-visibility.patch new file mode 100644 index 0000000000..58067c1e86 --- /dev/null +++ b/packages/toolchain/devel/binutils/patches/binutils-2.21.51.0.1-visibility.patch @@ -0,0 +1,71 @@ +diff -Naur binutils-2.20.51.0.12-old/gold/plugin.cc binutils-2.20.51.0.12-new/gold/plugin.cc +--- binutils-2.20.51.0.12-old/gold/plugin.cc 2010-10-22 06:41:04.000000000 -0700 ++++ binutils-2.20.51.0.12-new/gold/plugin.cc 2010-10-23 06:03:56.000000000 -0700 +@@ -668,28 +668,50 @@ + break; + } + +- switch (isym->visibility) +- { +- case LDPV_PROTECTED: +- vis = elfcpp::STV_PROTECTED; +- break; +- case LDPV_INTERNAL: +- vis = elfcpp::STV_INTERNAL; +- break; +- case LDPV_HIDDEN: +- vis = elfcpp::STV_HIDDEN; +- break; +- case LDPV_DEFAULT: +- default: +- vis = elfcpp::STV_DEFAULT; +- break; +- } +- + if (isym->comdat_key != NULL + && isym->comdat_key[0] != '\0' + && !this->include_comdat_group(isym->comdat_key, layout)) + shndx = elfcpp::SHN_UNDEF; + ++ if (shndx == elfcpp::SHN_UNDEF) ++ { ++ switch (isym->visibility) ++ { ++ case LDPV_PROTECTED: ++ vis = elfcpp::STV_DEFAULT; ++ break; ++ case LDPV_INTERNAL: ++ vis = elfcpp::STV_DEFAULT; ++ break; ++ case LDPV_HIDDEN: ++ vis = elfcpp::STV_DEFAULT; ++ break; ++ case LDPV_DEFAULT: ++ default: ++ vis = elfcpp::STV_DEFAULT; ++ break; ++ } ++ } ++ else ++ { ++ switch (isym->visibility) ++ { ++ case LDPV_PROTECTED: ++ vis = elfcpp::STV_PROTECTED; ++ break; ++ case LDPV_INTERNAL: ++ vis = elfcpp::STV_INTERNAL; ++ break; ++ case LDPV_HIDDEN: ++ vis = elfcpp::STV_HIDDEN; ++ break; ++ case LDPV_DEFAULT: ++ default: ++ vis = elfcpp::STV_DEFAULT; ++ break; ++ } ++ } ++ + osym.put_st_name(0); + osym.put_st_value(0); + osym.put_st_size(static_cast(isym->size));