toolchain/arc: update to the most recent release arc-2016.09
arc-2016.09 is the most recent toolchain for ARC cores and it is based on top of upstream Binutils 2.27 and GCC 6.2.1. With updated major version of GCC we copied all GCC 6.x patches for ARC as well as Bintils 2.27 patches. Note that toochain sports ARCv4 ABI and so must be used with 4.8+ Linux kernels. Even though it will build v4.4 kernel perfectly fine on attempt to run user-space apps they won't work with older kernel. That said previuosly sent RFC patches with Linux kernel update are required: [1] https://patchwork.ozlabs.org/patch/726686/ [2] https://patchwork.ozlabs.org/patch/726687/ Signed-off-by: Alexey Brodkin <Alexey.Brodkin@synopsys.com>v19.07.3_mercusys_ac12_duma
parent
2b27e62e74
commit
34e8393019
@ -1,13 +0,0 @@
|
||||
diff --git a/bfd/config.bfd b/bfd/config.bfd
|
||||
index 5145d4a..a9c9c99 100644
|
||||
--- a/bfd/config.bfd
|
||||
+++ b/bfd/config.bfd
|
||||
@@ -275,7 +275,7 @@ case "${targ}" in
|
||||
targ_defvec=am33_elf32_linux_vec
|
||||
;;
|
||||
|
||||
- arc*-*-elf* | arc*-*-linux-uclibc*)
|
||||
+ arc*-*-elf* | arc*-*-linux-*)
|
||||
targ_defvec=arc_elf32_le_vec
|
||||
targ_selvecs=arc_elf32_be_vec
|
||||
;;
|
@ -0,0 +1,22 @@
|
||||
--- a/ld/Makefile.am
|
||||
+++ b/ld/Makefile.am
|
||||
@@ -57,7 +57,7 @@ endif
|
||||
# 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@
|
||||
--- a/ld/Makefile.in
|
||||
+++ b/ld/Makefile.in
|
||||
@@ -451,7 +451,7 @@ AM_CFLAGS = $(WARN_CFLAGS) $(ELF_CLFAGS)
|
||||
# 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
|
@ -0,0 +1,20 @@
|
||||
--- a/ld/emultempl/elf32.em
|
||||
+++ b/ld/emultempl/elf32.em
|
||||
@@ -1244,6 +1244,8 @@ fragment <<EOF
|
||||
&& 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;
|
||||
@@ -1525,6 +1527,8 @@ gld${EMULATION_NAME}_before_allocation (
|
||||
rpath = command_line.rpath;
|
||||
if (rpath == NULL)
|
||||
rpath = (const char *) getenv ("LD_RUN_PATH");
|
||||
+ if ((rpath) && (strlen (rpath) == 0))
|
||||
+ rpath = NULL;
|
||||
|
||||
for (abfd = link_info.input_bfds; abfd; abfd = abfd->link.next)
|
||||
if (bfd_get_flavour (abfd) == bfd_target_elf_flavour)
|
@ -1,13 +1,13 @@
|
||||
config GCC_VERSION_4_8_ARC
|
||||
config GCC_VERSION_6_2_ARC
|
||||
default y if (!TOOLCHAINOPTS && arc)
|
||||
bool
|
||||
|
||||
config GCC_VERSION
|
||||
string
|
||||
default "arc-2016.03" if GCC_VERSION_4_8_ARC
|
||||
default "arc-2016.09-release" if GCC_VERSION_6_2_ARC
|
||||
default "6.3.0" if GCC_USE_VERSION_6
|
||||
default "5.4.0"
|
||||
|
||||
config GCC_VERSION_4_8
|
||||
config GCC_VERSION_6_2
|
||||
bool
|
||||
default y if GCC_VERSION_4_8_ARC
|
||||
default y if GCC_VERSION_6_2_ARC
|
||||
|
@ -1,42 +0,0 @@
|
||||
--- /dev/null
|
||||
+++ b/gcc/testsuite/gcc.dg/visibility-21.c
|
||||
@@ -0,0 +1,14 @@
|
||||
+/* PR target/32219 */
|
||||
+/* { dg-do run } */
|
||||
+/* { dg-require-visibility "" } */
|
||||
+/* { dg-options "-fPIC" { target fpic } } */
|
||||
+
|
||||
+extern void f() __attribute__((weak,visibility("hidden")));
|
||||
+extern int puts( char const* );
|
||||
+int main()
|
||||
+{
|
||||
+ if (f)
|
||||
+ f();
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
--- a/gcc/varasm.c
|
||||
+++ b/gcc/varasm.c
|
||||
@@ -6677,6 +6677,10 @@ default_binds_local_p_1 (const_tree exp,
|
||||
/* Static variables are always local. */
|
||||
else if (! TREE_PUBLIC (exp))
|
||||
local_p = true;
|
||||
+ /* hidden weak can't be overridden by something non-local, all
|
||||
+ that is possible is that it is not defined at all. */
|
||||
+ else if (DECL_WEAK (exp))
|
||||
+ local_p = false;
|
||||
/* A variable is local if the user has said explicitly that it will
|
||||
be. */
|
||||
else if ((DECL_VISIBILITY_SPECIFIED (exp)
|
||||
@@ -6690,11 +6694,6 @@ default_binds_local_p_1 (const_tree exp,
|
||||
local. */
|
||||
else if (DECL_VISIBILITY (exp) != VISIBILITY_DEFAULT)
|
||||
local_p = true;
|
||||
- /* Default visibility weak data can be overridden by a strong symbol
|
||||
- in another module and so are not local. */
|
||||
- else if (DECL_WEAK (exp)
|
||||
- && !resolved_locally)
|
||||
- local_p = false;
|
||||
/* If PIC, then assume that any global name can be overridden by
|
||||
symbols resolved from other modules. */
|
||||
else if (shlib)
|
@ -1,94 +0,0 @@
|
||||
--- a/gcc/c/c-typeck.c
|
||||
+++ b/gcc/c/c-typeck.c
|
||||
@@ -62,9 +62,9 @@ int in_typeof;
|
||||
if expr.original_code == SIZEOF_EXPR. */
|
||||
tree c_last_sizeof_arg;
|
||||
|
||||
-/* Nonzero if we've already printed a "missing braces around initializer"
|
||||
- message within this initializer. */
|
||||
-static int missing_braces_mentioned;
|
||||
+/* Nonzero if we might need to print a "missing braces around
|
||||
+ initializer" message within this initializer. */
|
||||
+static int found_missing_braces;
|
||||
|
||||
static int require_constant_value;
|
||||
static int require_constant_elements;
|
||||
@@ -6363,6 +6363,9 @@ static int constructor_nonconst;
|
||||
/* 1 if this constructor is erroneous so far. */
|
||||
static int constructor_erroneous;
|
||||
|
||||
+/* 1 if this constructor is the universal zero initializer { 0 }. */
|
||||
+static int constructor_zeroinit;
|
||||
+
|
||||
/* Structure for managing pending initializer elements, organized as an
|
||||
AVL tree. */
|
||||
|
||||
@@ -6524,7 +6527,7 @@ start_init (tree decl, tree asmspec_tree
|
||||
constructor_stack = 0;
|
||||
constructor_range_stack = 0;
|
||||
|
||||
- missing_braces_mentioned = 0;
|
||||
+ found_missing_braces = 0;
|
||||
|
||||
spelling_base = 0;
|
||||
spelling_size = 0;
|
||||
@@ -6619,6 +6622,7 @@ really_start_incremental_init (tree type
|
||||
constructor_type = type;
|
||||
constructor_incremental = 1;
|
||||
constructor_designated = 0;
|
||||
+ constructor_zeroinit = 1;
|
||||
designator_depth = 0;
|
||||
designator_erroneous = 0;
|
||||
|
||||
@@ -6816,11 +6820,8 @@ push_init_level (int implicit, struct ob
|
||||
set_nonincremental_init (braced_init_obstack);
|
||||
}
|
||||
|
||||
- if (implicit == 1 && warn_missing_braces && !missing_braces_mentioned)
|
||||
- {
|
||||
- missing_braces_mentioned = 1;
|
||||
- warning_init (OPT_Wmissing_braces, "missing braces around initializer");
|
||||
- }
|
||||
+ if (implicit == 1)
|
||||
+ found_missing_braces = 1;
|
||||
|
||||
if (TREE_CODE (constructor_type) == RECORD_TYPE
|
||||
|| TREE_CODE (constructor_type) == UNION_TYPE)
|
||||
@@ -6953,16 +6954,23 @@ pop_init_level (int implicit, struct obs
|
||||
}
|
||||
}
|
||||
|
||||
+ if (vec_safe_length (constructor_elements) != 1)
|
||||
+ constructor_zeroinit = 0;
|
||||
+
|
||||
+ /* Warn when some structs are initialized with direct aggregation. */
|
||||
+ if (!implicit && found_missing_braces && warn_missing_braces
|
||||
+ && !constructor_zeroinit)
|
||||
+ {
|
||||
+ warning_init (OPT_Wmissing_braces,
|
||||
+ "missing braces around initializer");
|
||||
+ }
|
||||
+
|
||||
/* Warn when some struct elements are implicitly initialized to zero. */
|
||||
if (warn_missing_field_initializers
|
||||
&& constructor_type
|
||||
&& TREE_CODE (constructor_type) == RECORD_TYPE
|
||||
&& constructor_unfilled_fields)
|
||||
{
|
||||
- bool constructor_zeroinit =
|
||||
- (vec_safe_length (constructor_elements) == 1
|
||||
- && integer_zerop ((*constructor_elements)[0].value));
|
||||
-
|
||||
/* Do not warn for flexible array members or zero-length arrays. */
|
||||
while (constructor_unfilled_fields
|
||||
&& (!DECL_SIZE (constructor_unfilled_fields)
|
||||
@@ -8077,6 +8085,9 @@ process_init_element (struct c_expr valu
|
||||
designator_depth = 0;
|
||||
designator_erroneous = 0;
|
||||
|
||||
+ if (!implicit && value.value && !integer_zerop (value.value))
|
||||
+ constructor_zeroinit = 0;
|
||||
+
|
||||
/* Handle superfluous braces around string cst as in
|
||||
char x[] = {"foo"}; */
|
||||
if (string_flag
|
@ -1,28 +0,0 @@
|
||||
--- a/gcc/calls.c
|
||||
+++ b/gcc/calls.c
|
||||
@@ -176,6 +176,12 @@ prepare_call_address (tree fndecl, rtx f
|
||||
&& targetm.small_register_classes_for_mode_p (FUNCTION_MODE))
|
||||
? force_not_mem (memory_address (FUNCTION_MODE, funexp))
|
||||
: memory_address (FUNCTION_MODE, funexp));
|
||||
+ else if (flag_pic && !flag_plt && fndecl
|
||||
+ && TREE_CODE (fndecl) == FUNCTION_DECL
|
||||
+ && !targetm.binds_local_p (fndecl))
|
||||
+ {
|
||||
+ funexp = force_reg (Pmode, funexp);
|
||||
+ }
|
||||
else if (! sibcallp)
|
||||
{
|
||||
#ifndef NO_FUNCTION_CSE
|
||||
--- a/gcc/common.opt
|
||||
+++ b/gcc/common.opt
|
||||
@@ -1617,6 +1617,10 @@ fpie
|
||||
Common Report Var(flag_pie,1) Negative(fPIC)
|
||||
Generate position-independent code for executables if possible (small mode)
|
||||
|
||||
+fplt
|
||||
+Common Report Var(flag_plt) Init(1)
|
||||
+Use PLT for PIC calls (-fno-plt: load the address from GOT at call site)
|
||||
+
|
||||
fplugin=
|
||||
Common Joined RejectNegative Var(common_deferred_options) Defer
|
||||
Specify a plugin to load
|
@ -1,11 +0,0 @@
|
||||
--- a/libsanitizer/interception/interception_type_test.cc
|
||||
+++ b/libsanitizer/interception/interception_type_test.cc
|
||||
@@ -31,7 +31,7 @@ COMPILER_CHECK(sizeof(OFF64_T) == sizeof
|
||||
// rest (they depend on _FILE_OFFSET_BITS setting when building an application).
|
||||
# if defined(__ANDROID__) || !defined _FILE_OFFSET_BITS || \
|
||||
_FILE_OFFSET_BITS != 64
|
||||
-COMPILER_CHECK(sizeof(OFF_T) == sizeof(off_t));
|
||||
+// COMPILER_CHECK(sizeof(OFF_T) == sizeof(off_t));
|
||||
# endif
|
||||
|
||||
#endif
|
@ -1,18 +0,0 @@
|
||||
diff --git a/libgcc/config.host b/libgcc/config.host
|
||||
index e768389..aec10c7 100644
|
||||
--- a/libgcc/config.host
|
||||
+++ b/libgcc/config.host
|
||||
@@ -320,11 +320,11 @@ alpha*-dec-*vms*)
|
||||
;;
|
||||
arc*-*-elf*)
|
||||
tmake_file="arc/t-arc-newlib arc/t-arc"
|
||||
- extra_parts="crti.o crtn.o crtend.o crtbegin.o crtendS.o crtbeginS.o libgmon.a crtg.o crtgend.o crttls_r25.o crttls_r30.o"
|
||||
+ extra_parts="crti.o crtn.o crtend.o crtbegin.o crtendS.o crtbeginS.o crtg.o crtgend.o crttls_r25.o crttls_r30.o"
|
||||
;;
|
||||
arc*-*-linux-uclibc*)
|
||||
tmake_file="${tmake_file} t-slibgcc-libgcc t-slibgcc-nolc-override arc/t-arc700-uClibc arc/t-arc"
|
||||
- extra_parts="crti.o crtn.o crtend.o crtbegin.o crtendS.o crtbeginS.o libgmon.a crtg.o crtgend.o"
|
||||
+ extra_parts="crti.o crtn.o crtend.o crtbegin.o crtendS.o crtbeginS.o crtg.o crtgend.o"
|
||||
;;
|
||||
arm-wrs-vxworks)
|
||||
tmake_file="$tmake_file arm/t-arm arm/t-vxworks t-softfp-sfdf t-softfp-excl arm/t-softfp t-softfp"
|
@ -1,42 +0,0 @@
|
||||
--- a/libgcc/unwind-dw2-fde-dip.c
|
||||
+++ b/libgcc/unwind-dw2-fde-dip.c
|
||||
@@ -46,33 +46,13 @@
|
||||
#include "unwind-compat.h"
|
||||
#include "gthr.h"
|
||||
|
||||
-#if !defined(inhibit_libc) && defined(HAVE_LD_EH_FRAME_HDR) \
|
||||
- && (__GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ > 2) \
|
||||
- || (__GLIBC__ == 2 && __GLIBC_MINOR__ == 2 && defined(DT_CONFIG)))
|
||||
-# define USE_PT_GNU_EH_FRAME
|
||||
-#endif
|
||||
-
|
||||
-#if !defined(inhibit_libc) && defined(HAVE_LD_EH_FRAME_HDR) \
|
||||
- && defined(__BIONIC__)
|
||||
-# define USE_PT_GNU_EH_FRAME
|
||||
-#endif
|
||||
-
|
||||
-#if !defined(inhibit_libc) && defined(HAVE_LD_EH_FRAME_HDR) \
|
||||
- && defined(__FreeBSD__) && __FreeBSD__ >= 7
|
||||
-# define ElfW __ElfN
|
||||
-# define USE_PT_GNU_EH_FRAME
|
||||
-#endif
|
||||
-
|
||||
-#if !defined(inhibit_libc) && defined(HAVE_LD_EH_FRAME_HDR) \
|
||||
- && defined(__OpenBSD__)
|
||||
-# define ElfW(type) Elf_##type
|
||||
-# define USE_PT_GNU_EH_FRAME
|
||||
-#endif
|
||||
-
|
||||
-#if !defined(inhibit_libc) && defined(HAVE_LD_EH_FRAME_HDR) \
|
||||
- && defined(TARGET_DL_ITERATE_PHDR) \
|
||||
- && defined(__sun__) && defined(__svr4__)
|
||||
+#if !defined(inhibit_libc) && defined(HAVE_LD_EH_FRAME_HDR)
|
||||
# define USE_PT_GNU_EH_FRAME
|
||||
+# ifdef __OpenBSD__
|
||||
+# define ElfW(type) Elf_##type
|
||||
+# elif defined(__FreeBSD__) && __FreeBSD__ >= 7
|
||||
+# define ElfW __ElfN
|
||||
+# endif
|
||||
#endif
|
||||
|
||||
#if defined(USE_PT_GNU_EH_FRAME)
|
@ -1,14 +0,0 @@
|
||||
--- a/gcc/gcc.c
|
||||
+++ b/gcc/gcc.c
|
||||
@@ -8029,7 +8029,10 @@ getenv_spec_function (int argc, const ch
|
||||
|
||||
value = getenv (argv[0]);
|
||||
if (!value)
|
||||
- fatal_error ("environment variable %qs not defined", argv[0]);
|
||||
+ {
|
||||
+ warning (0, "environment variable %qs not defined", argv[0]);
|
||||
+ value = "";
|
||||
+ }
|
||||
|
||||
/* We have to escape every character of the environment variable so
|
||||
they are not interpreted as active spec characters. A
|
@ -1,6 +1,6 @@
|
||||
--- a/gcc/Makefile.in
|
||||
+++ b/gcc/Makefile.in
|
||||
@@ -4327,18 +4327,10 @@ doc/gcc.info: $(TEXI_GCC_FILES)
|
||||
@@ -3021,18 +3021,10 @@ doc/gcc.info: $(TEXI_GCC_FILES)
|
||||
doc/gccint.info: $(TEXI_GCCINT_FILES)
|
||||
doc/cppinternals.info: $(TEXI_CPPINT_FILES)
|
||||
|
@ -0,0 +1,13 @@
|
||||
--- a/gcc/gcc.c
|
||||
+++ b/gcc/gcc.c
|
||||
@@ -858,7 +858,9 @@ proper position among the other output f
|
||||
#endif
|
||||
|
||||
#ifndef LINK_SSP_SPEC
|
||||
-#ifdef TARGET_LIBC_PROVIDES_SSP
|
||||
+#if DEFAULT_LIBC == LIBC_MUSL
|
||||
+#define LINK_SSP_SPEC "-lssp_nonshared"
|
||||
+#elif defined(TARGET_LIBC_PROVIDES_SSP)
|
||||
#define LINK_SSP_SPEC "%{fstack-protector|fstack-protector-all" \
|
||||
"|fstack-protector-strong|fstack-protector-explicit:}"
|
||||
#else
|
@ -0,0 +1,36 @@
|
||||
From 450fb05e2a7510d37744f044009f8237d902f65c Mon Sep 17 00:00:00 2001
|
||||
From: nsz <nsz@138bc75d-0d04-0410-961f-82ee72b054a4>
|
||||
Date: Tue, 30 Aug 2016 10:26:22 +0000
|
||||
Subject: [PATCH] disable ifunc on *-musl by default
|
||||
|
||||
gcc/
|
||||
* config.gcc (*-*-*musl*): Disable gnu-indirect-function.
|
||||
|
||||
|
||||
|
||||
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@239859 138bc75d-0d04-0410-961f-82ee72b054a4
|
||||
---
|
||||
gcc/ChangeLog | 4 ++++
|
||||
gcc/config.gcc | 4 ++--
|
||||
2 files changed, 6 insertions(+), 2 deletions(-)
|
||||
|
||||
--- a/gcc/config.gcc
|
||||
+++ b/gcc/config.gcc
|
||||
@@ -1495,7 +1495,7 @@ i[34567]86-*-linux* | i[34567]86-*-kfree
|
||||
extra_options="${extra_options} linux-android.opt"
|
||||
# Assume modern glibc if not targeting Android nor uclibc.
|
||||
case ${target} in
|
||||
- *-*-*android*|*-*-*uclibc*)
|
||||
+ *-*-*android*|*-*-*uclibc*|*-*-*musl*)
|
||||
;;
|
||||
*)
|
||||
default_gnu_indirect_function=yes
|
||||
@@ -1564,7 +1564,7 @@ x86_64-*-linux* | x86_64-*-kfreebsd*-gnu
|
||||
extra_options="${extra_options} linux-android.opt"
|
||||
# Assume modern glibc if not targeting Android nor uclibc.
|
||||
case ${target} in
|
||||
- *-*-*android*|*-*-*uclibc*)
|
||||
+ *-*-*android*|*-*-*uclibc*|*-*-*musl*)
|
||||
;;
|
||||
*)
|
||||
default_gnu_indirect_function=yes
|
@ -0,0 +1,11 @@
|
||||
--- a/gcc/config/mips/mips.c
|
||||
+++ b/gcc/config/mips/mips.c
|
||||
@@ -17928,7 +17928,7 @@ mips_option_override (void)
|
||||
flag_pcc_struct_return = 0;
|
||||
|
||||
/* Decide which rtx_costs structure to use. */
|
||||
- if (optimize_size)
|
||||
+ if (0 && optimize_size)
|
||||
mips_cost = &mips_rtx_cost_optimize_size;
|
||||
else
|
||||
mips_cost = &mips_rtx_cost_data[mips_tune];
|
@ -0,0 +1,11 @@
|
||||
--- a/gcc/config/arm/arm.h
|
||||
+++ b/gcc/config/arm/arm.h
|
||||
@@ -166,7 +166,7 @@ extern void (*arm_lang_output_object_att
|
||||
/* Thumb-1 only. */
|
||||
#define TARGET_THUMB1_ONLY (TARGET_THUMB1 && !arm_arch_notm)
|
||||
|
||||
-#define TARGET_LDRD (arm_arch5e && ARM_DOUBLEWORD_ALIGN \
|
||||
+#define TARGET_LDRD (arm_arch6 && ARM_DOUBLEWORD_ALIGN \
|
||||
&& !TARGET_THUMB1)
|
||||
|
||||
#define TARGET_CRC32 (arm_arch_crc)
|
@ -0,0 +1,25 @@
|
||||
--- a/libgcc/config/arm/t-linux
|
||||
+++ b/libgcc/config/arm/t-linux
|
||||
@@ -1,6 +1,10 @@
|
||||
LIB1ASMSRC = arm/lib1funcs.S
|
||||
LIB1ASMFUNCS = _udivsi3 _divsi3 _umodsi3 _modsi3 _dvmd_lnx _clzsi2 _clzdi2 \
|
||||
- _ctzsi2 _arm_addsubdf3 _arm_addsubsf3
|
||||
+ _ctzsi2 _arm_addsubdf3 _arm_addsubsf3 \
|
||||
+ _arm_negdf2 _arm_muldivdf3 _arm_cmpdf2 _arm_unorddf2 \
|
||||
+ _arm_fixdfsi _arm_fixunsdfsi _arm_truncdfsf2 \
|
||||
+ _arm_negsf2 _arm_muldivsf3 _arm_cmpsf2 _arm_unordsf2 \
|
||||
+ _arm_fixsfsi _arm_fixunssfsi
|
||||
|
||||
# Just for these, we omit the frame pointer since it makes such a big
|
||||
# difference.
|
||||
--- a/gcc/config/arm/linux-elf.h
|
||||
+++ b/gcc/config/arm/linux-elf.h
|
||||
@@ -60,8 +60,6 @@
|
||||
%{shared:-lc} \
|
||||
%{!shared:%{profile:-lc_p}%{!profile:-lc}}"
|
||||
|
||||
-#define LIBGCC_SPEC "%{mfloat-abi=soft*:-lfloat} -lgcc"
|
||||
-
|
||||
#define GLIBC_DYNAMIC_LINKER "/lib/ld-linux.so.2"
|
||||
|
||||
#define LINUX_TARGET_LINK_SPEC "%{h*} \
|
@ -0,0 +1,13 @@
|
||||
http://sourceware.org/ml/crossgcc/2008-05/msg00009.html
|
||||
|
||||
--- a/gcc/config/arm/linux-eabi.h
|
||||
+++ b/gcc/config/arm/linux-eabi.h
|
||||
@@ -45,7 +45,7 @@
|
||||
The ARM10TDMI core is the default for armv5t, so set
|
||||
SUBTARGET_CPU_DEFAULT to achieve this. */
|
||||
#undef SUBTARGET_CPU_DEFAULT
|
||||
-#define SUBTARGET_CPU_DEFAULT TARGET_CPU_arm10tdmi
|
||||
+#define SUBTARGET_CPU_DEFAULT TARGET_CPU_arm9tdmi
|
||||
|
||||
/* TARGET_BIG_ENDIAN_DEFAULT is set in
|
||||
config.gcc for big endian configurations. */
|
@ -0,0 +1,19 @@
|
||||
--- a/gcc/config/arm/linux-eabi.h
|
||||
+++ b/gcc/config/arm/linux-eabi.h
|
||||
@@ -94,10 +94,15 @@
|
||||
#define MUSL_DYNAMIC_LINKER \
|
||||
"/lib/ld-musl-arm" MUSL_DYNAMIC_LINKER_E "%{mfloat-abi=hard:hf}.so.1"
|
||||
|
||||
+/* For armv4 we pass --fix-v4bx to linker to support EABI */
|
||||
+#undef TARGET_FIX_V4BX_SPEC
|
||||
+#define TARGET_FIX_V4BX_SPEC " %{mcpu=arm8|mcpu=arm810|mcpu=strongarm*"\
|
||||
+ "|march=armv4|mcpu=fa526|mcpu=fa626:--fix-v4bx}"
|
||||
+
|
||||
/* At this point, bpabi.h will have clobbered LINK_SPEC. We want to
|
||||
use the GNU/Linux version, not the generic BPABI version. */
|
||||
#undef LINK_SPEC
|
||||
-#define LINK_SPEC EABI_LINK_SPEC \
|
||||
+#define LINK_SPEC EABI_LINK_SPEC TARGET_FIX_V4BX_SPEC \
|
||||
LINUX_OR_ANDROID_LD (LINUX_TARGET_LINK_SPEC, \
|
||||
LINUX_TARGET_LINK_SPEC " " ANDROID_LINK_SPEC)
|
||||
|
@ -1,6 +1,6 @@
|
||||
--- a/gcc/config/rs6000/rs6000.c
|
||||
+++ b/gcc/config/rs6000/rs6000.c
|
||||
@@ -17662,7 +17662,7 @@ rs6000_savres_strategy (rs6000_stack_t *
|
||||
@@ -24171,7 +24171,7 @@ rs6000_savres_strategy (rs6000_stack_t *
|
||||
/* Define cutoff for using out-of-line functions to save registers. */
|
||||
if (DEFAULT_ABI == ABI_V4 || TARGET_ELF)
|
||||
{
|
@ -1,6 +1,6 @@
|
||||
--- a/gcc/defaults.h
|
||||
+++ b/gcc/defaults.h
|
||||
@@ -380,7 +380,7 @@ see the files COPYING3 and COPYING.RUNTI
|
||||
@@ -395,7 +395,7 @@ see the files COPYING3 and COPYING.RUNTI
|
||||
/* If we have named section and we support weak symbols, then use the
|
||||
.jcr section for recording java classes which need to be registered
|
||||
at program start-up time. */
|
@ -0,0 +1,11 @@
|
||||
--- a/libgcc/crtstuff.c
|
||||
+++ b/libgcc/crtstuff.c
|
||||
@@ -152,7 +152,7 @@ call_ ## FUNC (void) \
|
||||
#endif
|
||||
|
||||
#if !defined(USE_TM_CLONE_REGISTRY) && defined(OBJECT_FORMAT_ELF)
|
||||
-# define USE_TM_CLONE_REGISTRY 1
|
||||
+# define USE_TM_CLONE_REGISTRY 0
|
||||
#endif
|
||||
|
||||
/* We do not want to add the weak attribute to the declarations of these
|
@ -0,0 +1,9 @@
|
||||
--- a/libgcc/config/mips/t-mips16
|
||||
+++ b/libgcc/config/mips/t-mips16
|
||||
@@ -43,3 +43,6 @@ SYNC_CFLAGS = -mno-mips16
|
||||
|
||||
# Version these symbols if building libgcc.so.
|
||||
SHLIB_MAPFILES += $(srcdir)/config/mips/libgcc-mips16.ver
|
||||
+
|
||||
+CRTSTUFF_T_CFLAGS += -mno-mips16
|
||||
+CRTSTUFF_T_CFLAGS_S += -mno-mips16
|
@ -0,0 +1,15 @@
|
||||
--- a/gcc/gcc.c
|
||||
+++ b/gcc/gcc.c
|
||||
@@ -9198,8 +9198,10 @@ getenv_spec_function (int argc, const ch
|
||||
value = varname;
|
||||
|
||||
if (!value)
|
||||
- fatal_error (input_location,
|
||||
- "environment variable %qs not defined", varname);
|
||||
+ {
|
||||
+ warning (input_location, "environment variable %qs not defined", varname);
|
||||
+ value = "";
|
||||
+ }
|
||||
|
||||
/* We have to escape every character of the environment variable so
|
||||
they are not interpreted as active spec characters. A
|
@ -1,6 +1,6 @@
|
||||
--- a/libstdc++-v3/include/Makefile.in
|
||||
+++ b/libstdc++-v3/include/Makefile.in
|
||||
@@ -1342,7 +1342,7 @@
|
||||
@@ -1459,7 +1459,7 @@ stamp-bits: ${bits_headers}
|
||||
@$(STAMP) stamp-bits
|
||||
|
||||
stamp-bits-sup: stamp-bits ${bits_sup_headers}
|
@ -0,0 +1,182 @@
|
||||
Forward ported from attachment to https://gcc.gnu.org/bugzilla/show_bug.cgi?id=47047
|
||||
|
||||
--- a/gcc/c-family/c-opts.c
|
||||
+++ b/gcc/c-family/c-opts.c
|
||||
@@ -574,6 +574,10 @@ c_common_handle_option (size_t scode, co
|
||||
add_path (xstrdup (arg), SYSTEM, 0, true);
|
||||
break;
|
||||
|
||||
+ case OPT_iremap:
|
||||
+ add_cpp_remap_path (arg);
|
||||
+ break;
|
||||
+
|
||||
case OPT_iwithprefix:
|
||||
add_prefixed_path (arg, SYSTEM);
|
||||
break;
|
||||
--- a/gcc/c-family/c.opt
|
||||
+++ b/gcc/c-family/c.opt
|
||||
@@ -1632,6 +1632,10 @@ iquote
|
||||
C ObjC C++ ObjC++ Joined Separate MissingArgError(missing path after %qs)
|
||||
-iquote <dir> Add <dir> to the end of the quote include path.
|
||||
|
||||
+iremap
|
||||
+C ObjC C++ ObjC++ Joined Separate
|
||||
+-iremap <src:dst> Convert <src> to <dst> if it occurs as prefix in __FILE__.
|
||||
+
|
||||
iwithprefix
|
||||
C ObjC C++ ObjC++ Joined Separate
|
||||
-iwithprefix <dir> Add <dir> to the end of the system include path.
|
||||
--- a/gcc/doc/cpp.texi
|
||||
+++ b/gcc/doc/cpp.texi
|
||||
@@ -4444,6 +4444,7 @@ without notice.
|
||||
@c man begin SYNOPSIS
|
||||
cpp [@option{-D}@var{macro}[=@var{defn}]@dots{}] [@option{-U}@var{macro}]
|
||||
[@option{-I}@var{dir}@dots{}] [@option{-iquote}@var{dir}@dots{}]
|
||||
+ [@option{-iremap}@var{src}:@var{dst}]
|
||||
[@option{-W}@var{warn}@dots{}]
|
||||
[@option{-M}|@option{-MM}] [@option{-MG}] [@option{-MF} @var{filename}]
|
||||
[@option{-MP}] [@option{-MQ} @var{target}@dots{}]
|
||||
--- a/gcc/doc/cppopts.texi
|
||||
+++ b/gcc/doc/cppopts.texi
|
||||
@@ -532,6 +532,12 @@ Search @var{dir} only for header files r
|
||||
If @var{dir} begins with @code{=}, then the @code{=} will be replaced
|
||||
by the sysroot prefix; see @option{--sysroot} and @option{-isysroot}.
|
||||
|
||||
+@item -iremap @var{src}:@var{dst}
|
||||
+@opindex iremap
|
||||
+Replace the prefix @var{src} in __FILE__ with @var{dst} at expansion time.
|
||||
+This option can be specified more than once. Processing stops at the first
|
||||
+match.
|
||||
+
|
||||
@item -fdirectives-only
|
||||
@opindex fdirectives-only
|
||||
When preprocessing, handle directives, but do not expand macros.
|
||||
--- a/gcc/doc/invoke.texi
|
||||
+++ b/gcc/doc/invoke.texi
|
||||
@@ -476,8 +476,8 @@ Objective-C and Objective-C++ Dialects}.
|
||||
@item Directory Options
|
||||
@xref{Directory Options,,Options for Directory Search}.
|
||||
@gccoptlist{-B@var{prefix} -I@var{dir} -iplugindir=@var{dir} @gol
|
||||
--iquote@var{dir} -L@var{dir} -no-canonical-prefixes -I- @gol
|
||||
---sysroot=@var{dir} --no-sysroot-suffix}
|
||||
+-iquote@var{dir} -iremap@var{src}:@var{dst} -L@var{dir} -no-canonical-prefixes @gol
|
||||
+-I- --sysroot=@var{dir} --no-sysroot-suffix}
|
||||
|
||||
@item Code Generation Options
|
||||
@xref{Code Gen Options,,Options for Code Generation Conventions}.
|
||||
@@ -10861,6 +10861,12 @@ be searched for header files only for th
|
||||
"@var{file}"}; they are not searched for @code{#include <@var{file}>},
|
||||
otherwise just like @option{-I}.
|
||||
|
||||
+@item -iremap @var{src}:@var{dst}
|
||||
+@opindex iremap
|
||||
+Replace the prefix @var{src} in __FILE__ with @var{dst} at expansion time.
|
||||
+This option can be specified more than once. Processing stops at the first
|
||||
+match.
|
||||
+
|
||||
@item -L@var{dir}
|
||||
@opindex L
|
||||
Add directory @var{dir} to the list of directories to be searched
|
||||
--- a/libcpp/include/cpplib.h
|
||||
+++ b/libcpp/include/cpplib.h
|
||||
@@ -760,6 +760,9 @@ extern void cpp_set_lang (cpp_reader *,
|
||||
/* Set the include paths. */
|
||||
extern void cpp_set_include_chains (cpp_reader *, cpp_dir *, cpp_dir *, int);
|
||||
|
||||
+/* Provide src:dst pair for __FILE__ remapping. */
|
||||
+extern void add_cpp_remap_path (const char *);
|
||||
+
|
||||
/* Call these to get pointers to the options, callback, and deps
|
||||
structures for a given reader. These pointers are good until you
|
||||
call cpp_finish on that reader. You can either edit the callbacks
|
||||
--- a/libcpp/macro.c
|
||||
+++ b/libcpp/macro.c
|
||||
@@ -227,6 +227,64 @@ static const char * const monthnames[] =
|
||||
"Jul", "Aug", "Sep", "Oct", "Nov", "Dec"
|
||||
};
|
||||
|
||||
+static size_t remap_pairs;
|
||||
+static char **remap_src;
|
||||
+static char **remap_dst;
|
||||
+
|
||||
+void
|
||||
+add_cpp_remap_path (const char *arg)
|
||||
+{
|
||||
+ const char *arg_dst;
|
||||
+ size_t len;
|
||||
+
|
||||
+ arg_dst = strchr(arg, ':');
|
||||
+ if (arg_dst == NULL)
|
||||
+ {
|
||||
+ fprintf(stderr, "Invalid argument for -iremap\n");
|
||||
+ exit(1);
|
||||
+ }
|
||||
+
|
||||
+ len = arg_dst - arg;
|
||||
+ ++arg_dst;
|
||||
+
|
||||
+ remap_src = (char **) xrealloc(remap_src, sizeof(char *) * (remap_pairs + 1));
|
||||
+ remap_dst = (char **) xrealloc(remap_dst, sizeof(char *) * (remap_pairs + 1));
|
||||
+
|
||||
+ remap_src[remap_pairs] = (char *) xmalloc(len + 1);
|
||||
+ memcpy(remap_src[remap_pairs], arg, len);
|
||||
+ remap_src[remap_pairs][len] = '\0';
|
||||
+ remap_dst[remap_pairs] = xstrdup(arg_dst);
|
||||
+ ++remap_pairs;
|
||||
+}
|
||||
+
|
||||
+static const char *
|
||||
+cpp_remap_file (const char *arg, char **tmp_name)
|
||||
+{
|
||||
+ char *result;
|
||||
+ size_t i, len;
|
||||
+
|
||||
+ for (i = 0; i < remap_pairs; ++i)
|
||||
+ {
|
||||
+ len = strlen (remap_src[i]);
|
||||
+ if (strncmp (remap_src[i], arg, len))
|
||||
+ continue;
|
||||
+ if (arg[len] == '\0')
|
||||
+ return xstrdup (remap_dst[i]);
|
||||
+ if (arg[len] != '/')
|
||||
+ continue;
|
||||
+ arg += len;
|
||||
+ len = strlen (remap_dst[i]);
|
||||
+ result = (char *) xmalloc (len + strlen (arg) + 1);
|
||||
+ memcpy(result, remap_dst[i], len);
|
||||
+ strcpy(result + len, arg);
|
||||
+ *tmp_name = result;
|
||||
+
|
||||
+ return result;
|
||||
+ }
|
||||
+
|
||||
+ return arg;
|
||||
+}
|
||||
+
|
||||
/* Helper function for builtin_macro. Returns the text generated by
|
||||
a builtin macro. */
|
||||
const uchar *
|
||||
@@ -290,6 +348,7 @@ _cpp_builtin_macro_text (cpp_reader *pfi
|
||||
{
|
||||
unsigned int len;
|
||||
const char *name;
|
||||
+ char *tmp_name = NULL;
|
||||
uchar *buf;
|
||||
|
||||
if (node->value.builtin == BT_FILE)
|
||||
@@ -301,6 +360,7 @@ _cpp_builtin_macro_text (cpp_reader *pfi
|
||||
if (!name)
|
||||
abort ();
|
||||
}
|
||||
+ name = cpp_remap_file (name, &tmp_name);
|
||||
len = strlen (name);
|
||||
buf = _cpp_unaligned_alloc (pfile, len * 2 + 3);
|
||||
result = buf;
|
||||
@@ -308,6 +368,7 @@ _cpp_builtin_macro_text (cpp_reader *pfi
|
||||
buf = cpp_quote_string (buf + 1, (const unsigned char *) name, len);
|
||||
*buf++ = '"';
|
||||
*buf = '\0';
|
||||
+ free (tmp_name);
|
||||
}
|
||||
break;
|
||||
|
Loading…
Reference in New Issue