Commit db228511 authored by Jean-Baptiste Kempf's avatar Jean-Baptiste Kempf

Stop using a gcc 4.6 patch

We require 4.8 anyway
parent d32fe528
2012-10-10 Rafaël Carré <funman@videolan.org>
Fix compilation with g++ 4.7
--- src/binutils/binutils-2.21/gold/resolve.cc.orig 2012-10-10 17:39:32.416675108 +0200
+++ src/binutils/binutils-2.21/gold/resolve.cc 2012-10-10 17:39:34.256675092 +0200
@@ -322,9 +322,9 @@
&& to->name()[0] == '_' && to->name()[1] == 'Z')
{
Symbol_location fromloc
- = { object, orig_st_shndx, sym.get_st_value() };
+ = { object, orig_st_shndx, (off_t)sym.get_st_value() };
Symbol_location toloc = { to->object(), to->shndx(&to_is_ordinary),
- to->value() };
+ (off_t)to->value() };
this->candidate_odr_violations_[to->name()].insert(fromloc);
this->candidate_odr_violations_[to->name()].insert(toloc);
}
--- src/binutils/binutils-2.21/gold/dwarf_reader.cc.orig 2012-10-10 17:36:53.072676495 +0200
+++ src/binutils/binutils-2.21/gold/dwarf_reader.cc 2012-10-10 17:35:42.952677106 +0200
@@ -495,8 +495,8 @@
&& (shndx == -1U || lsm.shndx == -1U || shndx == lsm.shndx))
{
Offset_to_lineno_entry entry
- = { lsm.address, this->current_header_index_,
- lsm.file_num, true, lsm.line_num };
+ = { (off_t)lsm.address, this->current_header_index_,
+ (unsigned int)lsm.file_num, true, lsm.line_num };
std::vector<Offset_to_lineno_entry>&
map(this->line_number_map_[lsm.shndx]);
// If we see two consecutive entries with the same
--- src/binutils/binutils-2.21/gold/x86_64.cc.orig 2012-10-10 17:46:53.268671267 +0200
+++ src/binutils/binutils-2.21/gold/x86_64.cc 2012-10-10 17:47:14.128671085 +0200
@@ -3488,50 +3488,50 @@
}
// Nop sequences of various lengths.
- const char nop1[1] = { 0x90 }; // nop
- const char nop2[2] = { 0x66, 0x90 }; // xchg %ax %ax
- const char nop3[3] = { 0x0f, 0x1f, 0x00 }; // nop (%rax)
- const char nop4[4] = { 0x0f, 0x1f, 0x40, 0x00}; // nop 0(%rax)
- const char nop5[5] = { 0x0f, 0x1f, 0x44, 0x00, // nop 0(%rax,%rax,1)
+ static const unsigned char nop1[1] = { 0x90 }; // nop
+ static const unsigned char nop2[2] = { 0x66, 0x90 }; // xchg %ax %ax
+ static const unsigned char nop3[3] = { 0x0f, 0x1f, 0x00 }; // nop (%rax)
+ static const unsigned char nop4[4] = { 0x0f, 0x1f, 0x40, 0x00}; // nop 0(%rax)
+ static const unsigned char nop5[5] = { 0x0f, 0x1f, 0x44, 0x00, // nop 0(%rax,%rax,1)
0x00 };
- const char nop6[6] = { 0x66, 0x0f, 0x1f, 0x44, // nopw 0(%rax,%rax,1)
+ static const unsigned char nop6[6] = { 0x66, 0x0f, 0x1f, 0x44, // nopw 0(%rax,%rax,1)
0x00, 0x00 };
- const char nop7[7] = { 0x0f, 0x1f, 0x80, 0x00, // nopl 0L(%rax)
+ static const unsigned char nop7[7] = { 0x0f, 0x1f, 0x80, 0x00, // nopl 0L(%rax)
0x00, 0x00, 0x00 };
- const char nop8[8] = { 0x0f, 0x1f, 0x84, 0x00, // nopl 0L(%rax,%rax,1)
+ static const unsigned char nop8[8] = { 0x0f, 0x1f, 0x84, 0x00, // nopl 0L(%rax,%rax,1)
0x00, 0x00, 0x00, 0x00 };
- const char nop9[9] = { 0x66, 0x0f, 0x1f, 0x84, // nopw 0L(%rax,%rax,1)
+ static const unsigned char nop9[9] = { 0x66, 0x0f, 0x1f, 0x84, // nopw 0L(%rax,%rax,1)
0x00, 0x00, 0x00, 0x00,
0x00 };
- const char nop10[10] = { 0x66, 0x2e, 0x0f, 0x1f, // nopw %cs:0L(%rax,%rax,1)
+ static const unsigned char nop10[10] = { 0x66, 0x2e, 0x0f, 0x1f, // nopw %cs:0L(%rax,%rax,1)
0x84, 0x00, 0x00, 0x00,
0x00, 0x00 };
- const char nop11[11] = { 0x66, 0x66, 0x2e, 0x0f, // data16
+ static const unsigned char nop11[11] = { 0x66, 0x66, 0x2e, 0x0f, // data16
0x1f, 0x84, 0x00, 0x00, // nopw %cs:0L(%rax,%rax,1)
0x00, 0x00, 0x00 };
- const char nop12[12] = { 0x66, 0x66, 0x66, 0x2e, // data16; data16
+ static const unsigned char nop12[12] = { 0x66, 0x66, 0x66, 0x2e, // data16; data16
0x0f, 0x1f, 0x84, 0x00, // nopw %cs:0L(%rax,%rax,1)
0x00, 0x00, 0x00, 0x00 };
- const char nop13[13] = { 0x66, 0x66, 0x66, 0x66, // data16; data16; data16
+ static const unsigned char nop13[13] = { 0x66, 0x66, 0x66, 0x66, // data16; data16; data16
0x2e, 0x0f, 0x1f, 0x84, // nopw %cs:0L(%rax,%rax,1)
0x00, 0x00, 0x00, 0x00,
0x00 };
- const char nop14[14] = { 0x66, 0x66, 0x66, 0x66, // data16; data16; data16
+ static const unsigned char nop14[14] = { 0x66, 0x66, 0x66, 0x66, // data16; data16; data16
0x66, 0x2e, 0x0f, 0x1f, // data16
0x84, 0x00, 0x00, 0x00, // nopw %cs:0L(%rax,%rax,1)
0x00, 0x00 };
- const char nop15[15] = { 0x66, 0x66, 0x66, 0x66, // data16; data16; data16
+ static const unsigned char nop15[15] = { 0x66, 0x66, 0x66, 0x66, // data16; data16; data16
0x66, 0x66, 0x2e, 0x0f, // data16; data16
0x1f, 0x84, 0x00, 0x00, // nopw %cs:0L(%rax,%rax,1)
0x00, 0x00, 0x00 };
- const char* nops[16] = {
+ static const unsigned char* nops[16] = {
NULL,
nop1, nop2, nop3, nop4, nop5, nop6, nop7,
nop8, nop9, nop10, nop11, nop12, nop13, nop14, nop15
};
- return std::string(nops[length], length);
+ return std::string((const char *)nops[length], length);
}
// Return the addend to use for a target specific relocation. The
--- src/binutils/binutils-2.21/gold/options.cc.orig 2012-10-10 17:37:14.588676309 +0200
+++ src/binutils/binutils-2.21/gold/options.cc 2012-10-10 17:37:36.312676120 +0200
@@ -198,7 +198,7 @@
{
char* endptr;
*retval = strtol(arg, &endptr, 0);
- if (*endptr != '\0' || retval < 0)
+ if (*endptr != '\0' || *retval < 0)
gold_fatal(_("%s: invalid option value (expected an integer): %s"),
option_name, arg);
}
--- src/binutils/binutils-2.21/gold/i386.cc.orig 2012-10-10 17:41:07.548674279 +0200
+++ src/binutils/binutils-2.21/gold/i386.cc 2012-10-10 17:46:39.264671388 +0200
@@ -3163,50 +3163,50 @@
}
// Nop sequences of various lengths.
- const char nop1[1] = { 0x90 }; // nop
- const char nop2[2] = { 0x66, 0x90 }; // xchg %ax %ax
- const char nop3[3] = { 0x8d, 0x76, 0x00 }; // leal 0(%esi),%esi
- const char nop4[4] = { 0x8d, 0x74, 0x26, 0x00}; // leal 0(%esi,1),%esi
- const char nop5[5] = { 0x90, 0x8d, 0x74, 0x26, // nop
+ static const unsigned char nop1[1] = { 0x90 }; // nop
+ static const unsigned char nop2[2] = { 0x66, 0x90 }; // xchg %ax %ax
+ static const unsigned char nop3[3] = { 0x8d, 0x76, 0x00 }; // leal 0(%esi),%esi
+ static const unsigned char nop4[4] = { 0x8d, 0x74, 0x26, 0x00}; // leal 0(%esi,1),%esi
+ static const unsigned char nop5[5] = { 0x90, 0x8d, 0x74, 0x26, // nop
0x00 }; // leal 0(%esi,1),%esi
- const char nop6[6] = { 0x8d, 0xb6, 0x00, 0x00, // leal 0L(%esi),%esi
+ static const unsigned char nop6[6] = { 0x8d, 0xb6, 0x00, 0x00, // leal 0L(%esi),%esi
0x00, 0x00 };
- const char nop7[7] = { 0x8d, 0xb4, 0x26, 0x00, // leal 0L(%esi,1),%esi
+ static const unsigned char nop7[7] = { 0x8d, 0xb4, 0x26, 0x00, // leal 0L(%esi,1),%esi
0x00, 0x00, 0x00 };
- const char nop8[8] = { 0x90, 0x8d, 0xb4, 0x26, // nop
+ static const unsigned char nop8[8] = { 0x90, 0x8d, 0xb4, 0x26, // nop
0x00, 0x00, 0x00, 0x00 }; // leal 0L(%esi,1),%esi
- const char nop9[9] = { 0x89, 0xf6, 0x8d, 0xbc, // movl %esi,%esi
+ static const unsigned char nop9[9] = { 0x89, 0xf6, 0x8d, 0xbc, // movl %esi,%esi
0x27, 0x00, 0x00, 0x00, // leal 0L(%edi,1),%edi
0x00 };
- const char nop10[10] = { 0x8d, 0x76, 0x00, 0x8d, // leal 0(%esi),%esi
+ static const unsigned char nop10[10] = { 0x8d, 0x76, 0x00, 0x8d, // leal 0(%esi),%esi
0xbc, 0x27, 0x00, 0x00, // leal 0L(%edi,1),%edi
0x00, 0x00 };
- const char nop11[11] = { 0x8d, 0x74, 0x26, 0x00, // leal 0(%esi,1),%esi
+ static const unsigned char nop11[11] = { 0x8d, 0x74, 0x26, 0x00, // leal 0(%esi,1),%esi
0x8d, 0xbc, 0x27, 0x00, // leal 0L(%edi,1),%edi
0x00, 0x00, 0x00 };
- const char nop12[12] = { 0x8d, 0xb6, 0x00, 0x00, // leal 0L(%esi),%esi
+ static const unsigned char nop12[12] = { 0x8d, 0xb6, 0x00, 0x00, // leal 0L(%esi),%esi
0x00, 0x00, 0x8d, 0xbf, // leal 0L(%edi),%edi
0x00, 0x00, 0x00, 0x00 };
- const char nop13[13] = { 0x8d, 0xb6, 0x00, 0x00, // leal 0L(%esi),%esi
+ static const unsigned char nop13[13] = { 0x8d, 0xb6, 0x00, 0x00, // leal 0L(%esi),%esi
0x00, 0x00, 0x8d, 0xbc, // leal 0L(%edi,1),%edi
0x27, 0x00, 0x00, 0x00,
0x00 };
- const char nop14[14] = { 0x8d, 0xb4, 0x26, 0x00, // leal 0L(%esi,1),%esi
+ static const unsigned char nop14[14] = { 0x8d, 0xb4, 0x26, 0x00, // leal 0L(%esi,1),%esi
0x00, 0x00, 0x00, 0x8d, // leal 0L(%edi,1),%edi
0xbc, 0x27, 0x00, 0x00,
0x00, 0x00 };
- const char nop15[15] = { 0xeb, 0x0d, 0x90, 0x90, // jmp .+15
+ static const unsigned char nop15[15] = { 0xeb, 0x0d, 0x90, 0x90, // jmp .+15
0x90, 0x90, 0x90, 0x90, // nop,nop,nop,...
0x90, 0x90, 0x90, 0x90,
0x90, 0x90, 0x90 };
- const char* nops[16] = {
+ static const unsigned char* nops[16] = {
NULL,
nop1, nop2, nop3, nop4, nop5, nop6, nop7,
nop8, nop9, nop10, nop11, nop12, nop13, nop14, nop15
};
- return std::string(nops[length], length);
+ return std::string((const char*)nops[length], length);
}
// Return whether SYM should be treated as a call to a non-split
2012-02-09 Jakub Jelinek <jakub@redhat.com>
PR c/52181
* c-decl.c (merge_decls): Copy DECL_USER_ALIGN bit from olddecl to
newdecl.
* decl.c (duplicate_decls): If olddecl has bigger DECL_ALIGN than
newdecl, copy DECL_ALIGN to newdecl and or DECL_USER_ALIGN bits.
* c-c++-common/pr52181.c: New test.
--- gcc/cp/decl.c.jj 2012-01-26 09:22:19.000000000 +0100
+++ gcc/cp/decl.c 2012-02-09 09:56:42.129108618 +0100
@@ -2214,7 +2214,12 @@ duplicate_decls (tree newdecl, tree oldd
SET_DECL_INIT_PRIORITY (olddecl, DECL_INIT_PRIORITY (newdecl));
DECL_HAS_INIT_PRIORITY_P (olddecl) = 1;
}
- /* Likewise for DECL_USER_ALIGN and DECL_PACKED. */
+ /* Likewise for DECL_ALIGN, DECL_USER_ALIGN and DECL_PACKED. */
+ if (DECL_ALIGN (olddecl) > DECL_ALIGN (newdecl))
+ {
+ DECL_ALIGN (newdecl) = DECL_ALIGN (olddecl);
+ DECL_USER_ALIGN (newdecl) |= DECL_USER_ALIGN (olddecl);
+ }
DECL_USER_ALIGN (olddecl) = DECL_USER_ALIGN (newdecl);
if (TREE_CODE (newdecl) == FIELD_DECL)
DECL_PACKED (olddecl) = DECL_PACKED (newdecl);
--- gcc/testsuite/c-c++-common/pr52181.c.jj 2012-02-09 09:36:36.332028377 +0100
+++ gcc/testsuite/c-c++-common/pr52181.c 2012-02-09 09:36:04.000000000 +0100
@@ -0,0 +1,13 @@
+/* PR c/52181 */
+/* { dg-do compile } */
+
+extern const int v1[];
+const int __attribute__((aligned(16))) v1[] = { 1 };
+extern const int __attribute__((aligned(16))) v2[];
+const int v2[] = { 1 };
+extern const int __attribute__((aligned(16))) v3[];
+const int __attribute__((aligned(16))) v3[] = { 1 };
+const int __attribute__((aligned(16))) v4[] = { 1 };
+int test[(__alignof__ (v4) != __alignof__ (v1) /* { dg-bogus "is negative" } */
+ || __alignof__ (v4) != __alignof__ (v2)
+ || __alignof__ (v4) != __alignof__ (v3)) ? -1 : 0];
--- gcc/c-decl.c.orig 2012-10-10 16:16:19.000000000 +0200
+++ gcc/c-decl.c 2012-10-10 16:22:07.884715576 +0200
@@ -2486,6 +2486,7 @@
memcpy ((char *) olddecl + sizeof (struct tree_common),
(char *) newdecl + sizeof (struct tree_common),
sizeof (struct tree_decl_common) - sizeof (struct tree_common));
+ DECL_USER_ALIGN (olddecl) = DECL_USER_ALIGN (newdecl);
switch (TREE_CODE (olddecl))
{
case FUNCTION_DECL:
#!/bin/sh
set -e
if test -z "$ANDROID_NDK"
then
echo "Set ANDROID_NDK"
exit 1
fi
PATCHDIR="`dirname $0`"
cd $ANDROID_NDK
ls -l ./build/tools/download-toolchain-sources.sh src
patch -p0 < "$PATCHDIR"/binutils-2.21.diff
(cd src/gcc/gcc-4.6/ patch -p0 < "$PATCHDIR"/../../../gcc/gcc-4.6.patch)
ls -l ./build/tools/build-gcc.sh $(pwd)/src $(pwd) arm-linux-androideabi-4.6
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment