mirror of
https://gitdl.cn/https://github.com/chakralinux/core.git
synced 2025-02-09 22:27:14 +08:00
binutils: TC update
This commit is contained in:
parent
eaccc2f503
commit
a246ddd317
@ -1,8 +1,8 @@
|
||||
# maintainer: Manuel Tortosa <manutortosa[at]chakra-project[dot]org>
|
||||
|
||||
pkgname=binutils
|
||||
pkgver=2.23.2
|
||||
pkgrel=5
|
||||
pkgver=2.24
|
||||
pkgrel=1
|
||||
pkgdesc="A set of programs to assemble and manipulate binary and object files"
|
||||
arch=('x86_64')
|
||||
url="http://www.gnu.org/software/binutils/"
|
||||
@ -10,24 +10,28 @@ license=('GPL')
|
||||
groups=('base-devel')
|
||||
depends=('glibc>=2.18' 'zlib')
|
||||
checkdepends=('dejagnu' 'bc')
|
||||
options=('!libtool' '!distcc' '!ccache')
|
||||
options=('!libtool' '!distcc' '!ccache' 'staticlibs')
|
||||
install=binutils.install
|
||||
source=(ftp://ftp.gnu.org/gnu/binutils/binutils-${pkgver}.tar.bz2{,.sig}
|
||||
binutils-2.23.2-texinfo-5.0.patch)
|
||||
md5sums=('4f8fa651e35ef262edc01d60fb45702e'
|
||||
'dfde4428f08d91f309cdcfe92bf28d08'
|
||||
'34e439ce23213a91e2af872dfbb5094c')
|
||||
binutils-2.24-lto-testsuite.patch
|
||||
binutils-2.24-static-pie-hang.patch)
|
||||
md5sums=('e0f71a7b2ddab0f8612336ac81d9636b'
|
||||
'SKIP'
|
||||
'b16e895c24ff80acd98a21021eccefad'
|
||||
'4d2cf591560c3d25265778146bbe1941')
|
||||
|
||||
prepare() {
|
||||
cd ${srcdir}/binutils-${pkgver}
|
||||
|
||||
# http://sourceware.org/git/?p=binutils.git;a=patch;h=e02bf935
|
||||
# http://sourceware.org/git/?p=binutils.git;a=patch;h=935f8542
|
||||
patch -p1 -i ${srcdir}/binutils-2.23.2-texinfo-5.0.patch
|
||||
|
||||
# hack! - libiberty configure tests for header files using "$CPP $CPPFLAGS"
|
||||
sed -i "/ac_cpp=/s/\$CPPFLAGS/\$CPPFLAGS -O2/" libiberty/configure
|
||||
|
||||
# fix lto testsuite with gcc-4.9 - commit b35d44f1
|
||||
patch -p1 -i $srcdir/binutils-2.24-lto-testsuite.patch
|
||||
|
||||
# fix autoconf hang with -static -fPIE -pie - commits d1ec1e40 and 818d220a
|
||||
patch -p1 -i $srcdir/binutils-2.24-static-pie-hang.patch
|
||||
|
||||
mkdir ${srcdir}/binutils-build
|
||||
}
|
||||
|
||||
@ -37,11 +41,11 @@ build() {
|
||||
|
||||
${srcdir}/binutils-${pkgver}/configure --prefix=/usr \
|
||||
--with-lib-path=/usr/lib:/usr/local/lib \
|
||||
--with-bugurl=http://chakra-project.org/bugs \
|
||||
--with-bugurl=http://chakraos.org/bugs \
|
||||
--enable-ld=default --enable-gold \
|
||||
--enable-plugins --enable-threads \
|
||||
--with-pic --enable-shared \
|
||||
--disable-werror --disable-multilib
|
||||
--enable-shared \
|
||||
--disable-werror
|
||||
|
||||
# check the host environment and makes sure all the necessary tools are available
|
||||
make configure-host
|
||||
@ -61,13 +65,6 @@ package() {
|
||||
cd ${srcdir}/binutils-build
|
||||
make prefix=${pkgdir}/usr tooldir=${pkgdir}/usr install
|
||||
|
||||
# Add some useful headers
|
||||
install -m644 ${srcdir}/binutils-${pkgver}/include/libiberty.h ${pkgdir}/usr/include
|
||||
install -m644 ${srcdir}/binutils-${pkgver}/include/demangle.h ${pkgdir}/usr/include
|
||||
|
||||
# Install PIC libiberty.a
|
||||
install -m644 libiberty/pic/libiberty.a ${pkgdir}/usr/lib
|
||||
|
||||
# Remove unwanted files
|
||||
rm ${pkgdir}/usr/share/man/man1/{dlltool,nlmconv,windres,windmc}*
|
||||
rm ${pkgdir}/usr/share/info/{configure,standards}.info
|
||||
|
53
binutils/binutils-2.24-lto-testsuite.patch
Normal file
53
binutils/binutils-2.24-lto-testsuite.patch
Normal file
@ -0,0 +1,53 @@
|
||||
index c5249f0..69946de 100644
|
||||
--- a/ld/testsuite/ld-plugin/lto.exp
|
||||
+++ b/ld/testsuite/ld-plugin/lto.exp
|
||||
@@ -57,7 +57,7 @@ set lto_link_tests {
|
||||
"" "-O2"
|
||||
{lto-3c.c} {} "libdummy.a"}
|
||||
{"Build liblto-3.a"
|
||||
- "" "-flto"
|
||||
+ "" "-flto -ffat-lto-objects"
|
||||
{lto-3b.c} {} "liblto-3.a"}
|
||||
{"Build libdummy.a 5a"
|
||||
"" "-flto"
|
||||
@@ -111,7 +111,7 @@ set lto_link_tests {
|
||||
"" ""
|
||||
{pr12758a.s} {} "libdummy.a"}
|
||||
{"Build libpr12758.a"
|
||||
- "" "-flto -O2"
|
||||
+ "" "-flto -O2 -ffat-lto-objects"
|
||||
{pr12758b.c} {} "libpr12758.a"}
|
||||
{"PR ld/12758"
|
||||
"-O2 -Wl,-e,foo -nostdlib -flto -fuse-linker-plugin tmpdir/pr12758a.o -Wl,--start-group tmpdir/libpr12758.a -Wl,--end-group" ""
|
||||
@@ -120,13 +120,13 @@ set lto_link_tests {
|
||||
"" ""
|
||||
{pr12760a.c} {} "libdummy.a"}
|
||||
{"Build libpr12760.a"
|
||||
- "" "-flto -O2"
|
||||
+ "" "-flto -O2 -ffat-lto-objects"
|
||||
{pr12760b.c} {} "libpr12760.a"}
|
||||
{"PR ld/12760"
|
||||
"-O2 -Wl,-e,foo -nostdlib -flto -fuse-linker-plugin tmpdir/pr12760a.o -Wl,--start-group tmpdir/libpr12760.a -Wl,--end-group" ""
|
||||
{dummy.c} {} "pr12760.exe" "c" "warning: Bad bar"}
|
||||
{"Build libpr13183.a"
|
||||
- "-T" "-flto -O2"
|
||||
+ "-T" "-flto -O2 -ffat-lto-objects"
|
||||
{pr13183a.c} {} "libpr13183.a"}
|
||||
{"Build libdummy.a PR ld/13183"
|
||||
"" "-flto -O2"
|
||||
diff --git a/ld/testsuite/lib/ld-lib.exp b/ld/testsuite/lib/ld-lib.exp
|
||||
index 8df42ae..175449a 100644
|
||||
--- a/ld/testsuite/lib/ld-lib.exp
|
||||
+++ b/ld/testsuite/lib/ld-lib.exp
|
||||
@@ -1643,7 +1643,7 @@ proc check_lto_available { } {
|
||||
set f [open $src "w"]
|
||||
puts $f ""
|
||||
close $f
|
||||
- set status [remote_exec host $CC "-shared -B[pwd]/tmpdir/ld/ -flto -fuse-linker-plugin $src -o $output"]
|
||||
+ set status [remote_exec host $CC "-shared -B[pwd]/tmpdir/ld/ -flto -ffat-lto-objects -fuse-linker-plugin $src -o $output"]
|
||||
if { [lindex $status 0] == 0 } {
|
||||
set lto_available_saved 1
|
||||
} else {
|
||||
--
|
||||
1.7.1
|
||||
|
78
binutils/binutils-2.24-static-pie-hang.patch
Normal file
78
binutils/binutils-2.24-static-pie-hang.patch
Normal file
@ -0,0 +1,78 @@
|
||||
diff --git a/bfd/elf32-i386.c b/bfd/elf32-i386.c
|
||||
index 4d391e1..d7f59e5 100644
|
||||
--- a/bfd/elf32-i386.c
|
||||
+++ b/bfd/elf32-i386.c
|
||||
@@ -2368,8 +2368,13 @@ elf_i386_allocate_dynrelocs (struct elf_link_hash_entry *h, void *inf)
|
||||
|
||||
for (pp = &eh->dyn_relocs; (p = *pp) != NULL; )
|
||||
{
|
||||
- p->count -= p->pc_count;
|
||||
- p->pc_count = 0;
|
||||
+ /* Don't update reloc count if there are any non
|
||||
+ pc-relative relocs. */
|
||||
+ if (!h->pointer_equality_needed)
|
||||
+ {
|
||||
+ p->count -= p->pc_count;
|
||||
+ p->pc_count = 0;
|
||||
+ }
|
||||
if (p->count == 0)
|
||||
*pp = p->next;
|
||||
else
|
||||
diff --git a/bfd/elf64-x86-64.c b/bfd/elf64-x86-64.c
|
||||
index edee8ec..999011b 100644
|
||||
--- a/bfd/elf64-x86-64.c
|
||||
+++ b/bfd/elf64-x86-64.c
|
||||
@@ -2463,8 +2463,13 @@ elf_x86_64_allocate_dynrelocs (struct elf_link_hash_entry *h, void * inf)
|
||||
|
||||
for (pp = &eh->dyn_relocs; (p = *pp) != NULL; )
|
||||
{
|
||||
- p->count -= p->pc_count;
|
||||
- p->pc_count = 0;
|
||||
+ /* Don't update reloc count if there are any non
|
||||
+ pc-relative relocs. */
|
||||
+ if (!h->pointer_equality_needed)
|
||||
+ {
|
||||
+ p->count -= p->pc_count;
|
||||
+ p->pc_count = 0;
|
||||
+ }
|
||||
if (p->count == 0)
|
||||
*pp = p->next;
|
||||
else
|
||||
diff --git a/bfd/elf32-i386.c b/bfd/elf32-i386.c
|
||||
index 4d391e1..e834a5a 100644
|
||||
--- a/bfd/elf32-i386.c
|
||||
+++ b/bfd/elf32-i386.c
|
||||
@@ -2390,9 +2390,12 @@ elf_i386_allocate_dynrelocs (struct elf_link_hash_entry *h, void *inf)
|
||||
}
|
||||
|
||||
/* Also discard relocs on undefined weak syms with non-default
|
||||
- visibility. */
|
||||
+ visibility. Don't discard relocs against __ehdr_start which
|
||||
+ will be defined by assign_file_positions_for_non_load_sections
|
||||
+ later. */
|
||||
if (eh->dyn_relocs != NULL
|
||||
- && h->root.type == bfd_link_hash_undefweak)
|
||||
+ && h->root.type == bfd_link_hash_undefweak
|
||||
+ && strcmp (h->root.root.string, "__ehdr_start") != 0)
|
||||
{
|
||||
if (ELF_ST_VISIBILITY (h->other) != STV_DEFAULT)
|
||||
eh->dyn_relocs = NULL;
|
||||
diff --git a/bfd/elf64-x86-64.c b/bfd/elf64-x86-64.c
|
||||
index edee8ec..f364fe4 100644
|
||||
--- a/bfd/elf64-x86-64.c
|
||||
+++ b/bfd/elf64-x86-64.c
|
||||
@@ -2473,9 +2473,12 @@ elf_x86_64_allocate_dynrelocs (struct elf_link_hash_entry *h, void * inf)
|
||||
}
|
||||
|
||||
/* Also discard relocs on undefined weak syms with non-default
|
||||
- visibility. */
|
||||
+ visibility. Don't discard relocs against __ehdr_start which
|
||||
+ will be defined by assign_file_positions_for_non_load_sections
|
||||
+ later. */
|
||||
if (eh->dyn_relocs != NULL
|
||||
- && h->root.type == bfd_link_hash_undefweak)
|
||||
+ && h->root.type == bfd_link_hash_undefweak
|
||||
+ && strcmp (h->root.root.string, "__ehdr_start") != 0)
|
||||
{
|
||||
if (ELF_ST_VISIBILITY (h->other) != STV_DEFAULT)
|
||||
eh->dyn_relocs = NULL;
|
Loading…
Reference in New Issue
Block a user