update toolchain GCC to 7.3.0

This commit is contained in:
coolsnowwolf 2018-02-08 22:08:32 +08:00
parent 77caf08761
commit f5a44efb25
66 changed files with 713 additions and 322 deletions

View File

@ -41,7 +41,7 @@ menu "Global build settings"
default n
config BUILD_PATENTED
default y
default n
bool "Compile with support for patented functionality"
help
When this option is disabled, software which provides patented functionality
@ -184,6 +184,22 @@ menu "Global build settings"
this per package by adding PKG_CHECK_FORMAT_SECURITY:=0 in the package
Makefile.
config PKG_ASLR_PIE
bool
prompt "User space ASLR PIE compilation"
select BUSYBOX_DEFAULT_PIE
default n
help
Add -fPIC to CFLAGS and -specs=hardened-build-ld to LDFLAGS.
This enables package build as Position Independent Executables (PIE)
to protect against "return-to-text" attacks. This belongs to the
feature of Address Space Layout Randomisation (ASLR), which is
implemented by the kernel and the ELF loader by randomising the
location of memory allocations. This makes memory addresses harder
to predict when an attacker is attempting a memory-corruption exploit.
You can disable this per package by adding PKG_ASLR_PIE:=0 in the package
Makefile.
choice
prompt "User space Stack-Smashing Protection"
depends on USE_MUSL
@ -194,11 +210,11 @@ menu "Global build settings"
bool "None"
config PKG_CC_STACKPROTECTOR_REGULAR
bool "Regular"
select SSP_SUPPORT if !USE_MUSL
select GCC_LIBSSP if !USE_MUSL
depends on KERNEL_CC_STACKPROTECTOR_REGULAR
config PKG_CC_STACKPROTECTOR_STRONG
bool "Strong"
select SSP_SUPPORT if !USE_MUSL
select GCC_LIBSSP if !USE_MUSL
depends on !GCC_VERSION_4_8
depends on KERNEL_CC_STACKPROTECTOR_STRONG
endchoice

View File

@ -5,7 +5,7 @@
# See /LICENSE for more information.
#
PKG_DEFAULT_DEPENDS = +libc +SSP_SUPPORT:libssp +USE_GLIBC:librt +USE_GLIBC:libpthread
PKG_DEFAULT_DEPENDS = +libc +GCC_LIBSSP:libssp +USE_GLIBC:librt +USE_GLIBC:libpthread
ifneq ($(PKG_NAME),toolchain)
PKG_FIXUP_DEPENDS = $(if $(filter kmod-%,$(1)),$(2),$(PKG_DEFAULT_DEPENDS) $(filter-out $(PKG_DEFAULT_DEPENDS),$(2)))

View File

@ -83,7 +83,7 @@ endef
define Package/libssp
$(call Package/gcc/Default)
DEPENDS+=@SSP_SUPPORT
DEPENDS+=@GCC_LIBSSP
TITLE:=GCC support library
endef

View File

@ -286,6 +286,10 @@ config USE_MUSL
default y if !TOOLCHAINOPTS && !EXTERNAL_TOOLCHAIN && !NATIVE_TOOLCHAIN && !(arc || powerpc64)
bool
config SSP_SUPPORT
default y if USE_MUSL || GCC_LIBSSP
bool
config USE_EXTERNAL_LIBC
bool
default y if EXTERNAL_TOOLCHAIN || NATIVE_TOOLCHAIN

View File

@ -3,7 +3,7 @@
choice
prompt "Binutils Version" if TOOLCHAINOPTS
default BINUTILS_USE_VERSION_2_28 if !arc
default BINUTILS_USE_VERSION_2_28_ARC if arc
default BINUTILS_USE_VERSION_2_29_ARC if arc
help
Select the version of binutils you wish to use.
@ -17,10 +17,10 @@ choice
bool "Binutils 2.28"
select BINUTILS_VERSION_2_28
config BINUTILS_USE_VERSION_2_28_ARC
config BINUTILS_USE_VERSION_2_29_ARC
depends on arc
bool "ARC binutils 2.28"
select BINUTILS_VERSION_2_28_ARC
bool "ARC binutils 2.29"
select BINUTILS_VERSION_2_29_ARC
config BINUTILS_USE_VERSION_2_29_1
depends on !arc

View File

@ -5,7 +5,7 @@ config BINUTILS_VERSION_2_28
default y if (!TOOLCHAINOPTS && !arc)
bool
config BINUTILS_VERSION_2_28_ARC
config BINUTILS_VERSION_2_29_ARC
default y if (!TOOLCHAINOPTS && arc)
bool
@ -17,4 +17,4 @@ config BINUTILS_VERSION
default "2.27" if BINUTILS_VERSION_2_27
default "2.28" if BINUTILS_VERSION_2_28
default "2.29.1" if BINUTILS_VERSION_2_29_1
default "arc-2017.03" if BINUTILS_VERSION_2_28_ARC
default "arc-2017.09" if BINUTILS_VERSION_2_29_ARC

View File

@ -25,11 +25,11 @@ ifeq ($(PKG_VERSION),2.29.1)
PKG_HASH:=1509dff41369fb70aed23682351b663b56db894034773e6dbf7d5d6071fc55cc
endif
ifneq ($(CONFIG_BINUTILS_VERSION_2_28_ARC),)
PKG_REV:=arc-2017.03-release
ifneq ($(CONFIG_BINUTILS_VERSION_2_29_ARC),)
PKG_REV:=arc-2017.09-release
PKG_SOURCE_URL:=https://github.com/foss-for-synopsys-dwc-arc-processors/binutils-gdb/archive/$(PKG_REV)/
PKG_SOURCE:=$(PKG_NAME)-$(PKG_REV).tar.gz
PKG_HASH:=f9c1e09ef10aaf9619181f49587f464ba0a70d29b7f6f879047140acac852409
PKG_HASH:=2ea086fd5521e942926dd6ff6922ce31c29ee7ffc754fca3d06385e0f27600f8
BINUTILS_DIR:=$(PKG_NAME)-gdb-$(PKG_REV)
HOST_BUILD_DIR:=$(BUILD_DIR_TOOLCHAIN)/$(BINUTILS_DIR)
endif

View File

@ -0,0 +1,52 @@
From 2424aef3a744bc6ca4099a655065c70a63f0fb49 Mon Sep 17 00:00:00 2001
From: "Maciej W. Rozycki" <macro@imgtec.com>
Date: Wed, 26 Apr 2017 22:18:13 +0100
Subject: ELF/BFD: Limit `_bfd_elf_link_renumber_dynsyms' call in section GC
Consistently call `_bfd_elf_link_renumber_dynsyms' only if linking a
dynamic binary, complementing code in `bfd_elf_size_dynsym_hash_dynstr'
and commit ccabcbe51e85 ("New attempt at fixing MIPS --gc-sections et
al."), <https://sourceware.org/ml/binutils/2005-08/msg00258.html>.
bfd/
* elflink.c (elf_gc_sweep): Only call
`_bfd_elf_link_renumber_dynsyms' if dynamic sections have been
created.
(backported from commit c46cec3a8cfe02fbe0f6c67ba53abc5369c5c659)
---
bfd/ChangeLog | 6 ++++++
bfd/elflink.c | 3 ++-
2 files changed, 8 insertions(+), 1 deletion(-)
diff --git a/bfd/ChangeLog b/bfd/ChangeLog
index 85c6a817e5..537ebb5e2c 100644
--- a/bfd/ChangeLog
+++ b/bfd/ChangeLog
@@ -1,3 +1,9 @@
+2017-04-26 Maciej W. Rozycki <macro@imgtec.com>
+
+ * elflink.c (elf_gc_sweep): Only call
+ `_bfd_elf_link_renumber_dynsyms' if dynamic sections have been
+ created.
+
2017-03-02 Tristan Gingold <gingold@adacore.com>
* version.m4: Bump version to 2.28
diff --git a/bfd/elflink.c b/bfd/elflink.c
index 69b66f2831..75d6543dcc 100644
--- a/bfd/elflink.c
+++ b/bfd/elflink.c
@@ -12986,7 +12986,8 @@ elf_gc_sweep (bfd *abfd, struct bfd_link_info *info)
elf_link_hash_traverse (elf_hash_table (info), elf_gc_sweep_symbol,
&sweep_info);
- _bfd_elf_link_renumber_dynsyms (abfd, info, &section_sym_count);
+ if (elf_hash_table (info)->dynamic_sections_created)
+ _bfd_elf_link_renumber_dynsyms (abfd, info, &section_sym_count);
return TRUE;
}
--
2.11.0

View File

@ -0,0 +1,184 @@
From 51ffcfc2c67b4c4aa1620fb4c9834c38d150e1c5 Mon Sep 17 00:00:00 2001
From: "Maciej W. Rozycki" <macro@imgtec.com>
Date: Wed, 26 Apr 2017 22:23:44 +0100
Subject: PR ld/21334: Always call `_bfd_elf_link_renumber_dynsyms' if required
Complement commit e17b0c351f0b ("MIPS/BFD: Respect the ELF gABI dynamic
symbol table sort requirement") and correct an inconsistency in dynamic
symbol accounting data causing an assertion failure in the MIPS backend:
ld: BFD (GNU Binutils) 2.28.51.20170330 assertion fail
../../binutils-gdb/bfd/elfxx-mips.c:3860
in the course of making a GOT entry in a static binary to satisfy a GOT
relocation present in input, due to the local dynamic symbol count not
having been established.
To do so let backends request `_bfd_elf_link_renumber_dynsyms' to be
always called, rather than where a dynamic binary is linked only, and
then make this request in the MIPS backend.
bfd/
PR ld/21334
* elf-bfd.h (elf_backend_data): Add `always_renumber_dynsyms'
member.
* elfxx-target.h [!elf_backend_always_renumber_dynsyms]
(elf_backend_always_renumber_dynsyms): Define.
(elfNN_bed): Initialize `always_renumber_dynsyms' member.
* elfxx-mips.h (elf_backend_always_renumber_dynsyms): Define.
* elflink.c (bfd_elf_size_dynsym_hash_dynstr): Also call
`_bfd_elf_link_renumber_dynsyms' if the backend has requested
it.
(elf_gc_sweep): Likewise.
(backported from commit 23ec1e32b1ab714649a7c25e49b5d721fe3bd3db)
---
bfd/ChangeLog | 14 ++++++++++++++
bfd/elf-bfd.h | 4 ++++
bfd/elflink.c | 34 +++++++++++++++++++++++-----------
bfd/elfxx-mips.h | 1 +
bfd/elfxx-target.h | 6 +++++-
5 files changed, 47 insertions(+), 12 deletions(-)
diff --git a/bfd/ChangeLog b/bfd/ChangeLog
index 537ebb5e2c..3f10bc55f2 100644
--- a/bfd/ChangeLog
+++ b/bfd/ChangeLog
@@ -1,5 +1,19 @@
2017-04-26 Maciej W. Rozycki <macro@imgtec.com>
+ PR ld/21334
+ * elf-bfd.h (elf_backend_data): Add `always_renumber_dynsyms'
+ member.
+ * elfxx-target.h [!elf_backend_always_renumber_dynsyms]
+ (elf_backend_always_renumber_dynsyms): Define.
+ (elfNN_bed): Initialize `always_renumber_dynsyms' member.
+ * elfxx-mips.h (elf_backend_always_renumber_dynsyms): Define.
+ * elflink.c (bfd_elf_size_dynsym_hash_dynstr): Also call
+ `_bfd_elf_link_renumber_dynsyms' if the backend has requested
+ it.
+ (elf_gc_sweep): Likewise.
+
+2017-04-26 Maciej W. Rozycki <macro@imgtec.com>
+
* elflink.c (elf_gc_sweep): Only call
`_bfd_elf_link_renumber_dynsyms' if dynamic sections have been
created.
diff --git a/bfd/elf-bfd.h b/bfd/elf-bfd.h
index 5de9ab6ca6..dc4bd87f89 100644
--- a/bfd/elf-bfd.h
+++ b/bfd/elf-bfd.h
@@ -1478,6 +1478,10 @@ struct elf_backend_data
/* Address of protected data defined in the shared library may be
external, i.e., due to copy relocation. */
unsigned extern_protected_data : 1;
+
+ /* True if `_bfd_elf_link_renumber_dynsyms' must be called even for
+ static binaries. */
+ unsigned always_renumber_dynsyms : 1;
};
/* Information about reloc sections associated with a bfd_elf_section_data
diff --git a/bfd/elflink.c b/bfd/elflink.c
index 75d6543dcc..507f2b6259 100644
--- a/bfd/elflink.c
+++ b/bfd/elflink.c
@@ -6710,6 +6710,8 @@ bfd_boolean
bfd_elf_size_dynsym_hash_dynstr (bfd *output_bfd, struct bfd_link_info *info)
{
const struct elf_backend_data *bed;
+ unsigned long section_sym_count;
+ bfd_size_type dynsymcount;
if (!is_elf_hash_table (info->hash))
return TRUE;
@@ -6717,24 +6719,30 @@ bfd_elf_size_dynsym_hash_dynstr (bfd *output_bfd, struct bfd_link_info *info)
bed = get_elf_backend_data (output_bfd);
(*bed->elf_backend_init_index_section) (output_bfd, info);
+ /* Assign dynsym indices. In a shared library we generate a section
+ symbol for each output section, which come first. Next come all
+ of the back-end allocated local dynamic syms, followed by the rest
+ of the global symbols.
+
+ This is usually not needed for static binaries, however backends
+ can request to always do it, e.g. the MIPS backend uses dynamic
+ symbol counts to lay out GOT, which will be produced in the
+ presence of GOT relocations even in static binaries (holding fixed
+ data in that case, to satisfy those relocations). */
+
+ if (elf_hash_table (info)->dynamic_sections_created
+ || bed->always_renumber_dynsyms)
+ dynsymcount = _bfd_elf_link_renumber_dynsyms (output_bfd, info,
+ &section_sym_count);
+
if (elf_hash_table (info)->dynamic_sections_created)
{
bfd *dynobj;
asection *s;
- bfd_size_type dynsymcount;
- unsigned long section_sym_count;
unsigned int dtagcount;
dynobj = elf_hash_table (info)->dynobj;
- /* Assign dynsym indicies. In a shared library we generate a
- section symbol for each output section, which come first.
- Next come all of the back-end allocated local dynamic syms,
- followed by the rest of the global symbols. */
-
- dynsymcount = _bfd_elf_link_renumber_dynsyms (output_bfd, info,
- &section_sym_count);
-
/* Work out the size of the symbol version section. */
s = bfd_get_linker_section (dynobj, ".gnu.version");
BFD_ASSERT (s != NULL);
@@ -12986,7 +12994,11 @@ elf_gc_sweep (bfd *abfd, struct bfd_link_info *info)
elf_link_hash_traverse (elf_hash_table (info), elf_gc_sweep_symbol,
&sweep_info);
- if (elf_hash_table (info)->dynamic_sections_created)
+ /* We need to reassign dynsym indices now that symbols may have
+ been removed. See the call in `bfd_elf_size_dynsym_hash_dynstr'
+ for the details of the conditions used here. */
+ if (elf_hash_table (info)->dynamic_sections_created
+ || bed->always_renumber_dynsyms)
_bfd_elf_link_renumber_dynsyms (abfd, info, &section_sym_count);
return TRUE;
}
diff --git a/bfd/elfxx-mips.h b/bfd/elfxx-mips.h
index fa5b5d2de9..274129b2e5 100644
--- a/bfd/elfxx-mips.h
+++ b/bfd/elfxx-mips.h
@@ -196,3 +196,4 @@ literal_reloc_p (int r_type)
#define elf_backend_post_process_headers _bfd_mips_post_process_headers
#define elf_backend_compact_eh_encoding _bfd_mips_elf_compact_eh_encoding
#define elf_backend_cant_unwind_opcode _bfd_mips_elf_cant_unwind_opcode
+#define elf_backend_always_renumber_dynsyms TRUE
diff --git a/bfd/elfxx-target.h b/bfd/elfxx-target.h
index d063fb7f1b..d07600c15d 100644
--- a/bfd/elfxx-target.h
+++ b/bfd/elfxx-target.h
@@ -126,6 +126,9 @@
#ifndef elf_backend_extern_protected_data
#define elf_backend_extern_protected_data 0
#endif
+#ifndef elf_backend_always_renumber_dynsyms
+#define elf_backend_always_renumber_dynsyms FALSE
+#endif
#ifndef elf_backend_stack_align
#define elf_backend_stack_align 16
#endif
@@ -866,7 +869,8 @@ static struct elf_backend_data elfNN_bed =
elf_backend_no_page_alias,
elf_backend_default_execstack,
elf_backend_caches_rawsize,
- elf_backend_extern_protected_data
+ elf_backend_extern_protected_data,
+ elf_backend_always_renumber_dynsyms
};
/* Forward declaration for use when initialising alternative_target field. */
--
2.11.0

View File

@ -2,14 +2,14 @@
choice
prompt "GCC compiler Version" if TOOLCHAINOPTS
default GCC_USE_VERSION_6_3_ARC if arc
default GCC_USE_VERSION_7_1_ARC if arc
default GCC_USE_VERSION_5
help
Select the version of gcc you wish to use.
config GCC_USE_VERSION_6_3_ARC
select GCC_VERSION_6_3_ARC
bool "gcc 6.3.x with support of ARC cores"
config GCC_USE_VERSION_7_1_ARC
select GCC_VERSION_7_1_ARC
bool "gcc 7.1.x with support of ARC cores"
depends on arc
config GCC_USE_VERSION_5
@ -37,9 +37,24 @@ config EXTRA_GCC_CONFIG_OPTIONS
help
Any additional gcc options you may want to include....
config SSP_SUPPORT
config GCC_DEFAULT_PIE
bool
prompt "Enable Stack-Smashing Protection support" if TOOLCHAINOPTS
prompt "Build executable with PIE enabled by default" if TOOLCHAINOPTS
depends on !GCC_USE_VERSION_5
default n
help
Use gcc configure option --enable-default-pie to turn on -fPIE and -pie by default.
config GCC_DEFAULT_SSP
bool
prompt "Build executable with Stack-Smashing Protection enabled by default" if TOOLCHAINOPTS
default n
help
Use gcc configure option --enable-default-ssp to turn on -fstack-protector-strong by default.
config GCC_LIBSSP
bool
prompt "Build gcc libssp" if TOOLCHAINOPTS
depends on !USE_MUSL
default y if !USE_MUSL
help

View File

@ -1,14 +1,14 @@
config GCC_VERSION_6_3_ARC
config GCC_VERSION_7_1_ARC
default y if (!TOOLCHAINOPTS && arc)
bool
config GCC_VERSION
string
default "arc-2017.03-release" if GCC_VERSION_6_3_ARC
default "arc-2017.09-release" if GCC_VERSION_7_1_ARC
default "6.3.0" if GCC_USE_VERSION_6
default "7.2.0" if GCC_USE_VERSION_7
default "7.3.0" if GCC_USE_VERSION_7
default "5.5.0"
config GCC_VERSION_6_3
config GCC_VERSION_7_1
bool
default y if GCC_VERSION_6_3_ARC
default y if GCC_VERSION_7_1_ARC

View File

@ -37,16 +37,16 @@ ifeq ($(PKG_VERSION),6.3.0)
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
endif
ifeq ($(PKG_VERSION),7.2.0)
PKG_HASH:=1cf7adf8ff4b5aa49041c8734bbcf1ad18cc4c94d0029aae0f4e48841088479a
ifeq ($(PKG_VERSION),7.3.0)
PKG_HASH:=832ca6ae04636adbb430e865a1451adf6979ab44ca1c8374f61fba65645ce15c
endif
ifneq ($(CONFIG_GCC_VERSION_6_3_ARC),)
PKG_VERSION:=6.3.0
ifneq ($(CONFIG_GCC_VERSION_7_1_ARC),)
PKG_VERSION:=7.1.1
PKG_SOURCE_URL:=https://github.com/foss-for-synopsys-dwc-arc-processors/gcc/archive/$(GCC_VERSION)
PKG_SOURCE:=$(PKG_NAME)-$(GCC_VERSION).tar.gz
PKG_HASH:=b7223e134199b1a6f71de629da6aa845790e55d28e9892143dde09b1bc878110
PKG_REV:=2017.03-release
PKG_HASH:=90596af8b9c26a434cec0a3b3d37d0c7c755ab6a65496af6ca32529fab5a6cfe
PKG_REV:=2017.09-release
GCC_DIR:=gcc-arc-$(PKG_REV)
HOST_BUILD_DIR = $(BUILD_DIR_HOST)/$(PKG_NAME)-$(GCC_VERSION)
endif
@ -133,7 +133,17 @@ ifndef GCC_VERSION_4_8
GCC_CONFIGURE += --with-diagnostics-color=auto-if-env
endif
ifneq ($(CONFIG_SSP_SUPPORT),)
ifneq ($(CONFIG_GCC_DEFAULT_PIE),)
GCC_CONFIGURE+= \
--enable-default-pie
endif
ifneq ($(CONFIG_GCC_DEFAULT_SSP),)
GCC_CONFIGURE+= \
--enable-default-ssp
endif
ifneq ($(CONFIG_GCC_LIBSSP),)
GCC_CONFIGURE+= \
--enable-libssp
else

View File

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

View File

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

View File

@ -1,11 +0,0 @@
--- 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];

View File

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

View File

@ -1,13 +0,0 @@
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. */

View File

@ -1,11 +0,0 @@
--- a/gcc/config/rs6000/rs6000.c
+++ b/gcc/config/rs6000/rs6000.c
@@ -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)
{
- if (!optimize_size)
+ if (1)
{
strategy |= SAVE_INLINE_FPRS | REST_INLINE_FPRS;
strategy |= SAVE_INLINE_GPRS | REST_INLINE_GPRS;

View File

@ -1,11 +0,0 @@
--- a/gcc/defaults.h
+++ b/gcc/defaults.h
@@ -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. */
-#if defined (TARGET_ASM_NAMED_SECTION) && SUPPORTS_WEAK
+#if 0 && defined (TARGET_ASM_NAMED_SECTION) && SUPPORTS_WEAK
#ifndef JCR_SECTION_NAME
#define JCR_SECTION_NAME ".jcr"
#endif

View File

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

View File

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

View File

@ -1,11 +0,0 @@
--- a/libstdc++-v3/include/Makefile.in
+++ b/libstdc++-v3/include/Makefile.in
@@ -1459,7 +1459,7 @@ stamp-bits: ${bits_headers}
@$(STAMP) stamp-bits
stamp-bits-sup: stamp-bits ${bits_sup_headers}
- @-cd ${bits_builddir} && $(LN_S) $? . 2>/dev/null
+ @-cd ${bits_builddir} && $(LN_S) $(filter-out stamp-bits,$?) . 2>/dev/null
@$(STAMP) stamp-bits-sup
stamp-c_base: ${c_base_headers}

View File

@ -1,3 +1,15 @@
commit 31285a20390a5e53a74a2a71d1b5c82f366ddd5a
Author: Felix Fietkau <nbd@openwrt.org>
Date: Tue May 6 11:49:05 2014 +0000
gcc: revert an upstream patch that is causing a regression on powerpc
https://forum.openwrt.org/viewtopic.php?pid=232494#p232494
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
SVN-Revision: 40709
Revert of:
commit 275035b56823b26d5fb7e90fad945b998648edf2
@ -14,7 +26,7 @@ Date: Thu Sep 5 14:09:07 2013 +0000
--- a/gcc/reginfo.c
+++ b/gcc/reginfo.c
@@ -625,35 +625,40 @@ choose_hard_reg_mode (unsigned int regno
@@ -637,35 +637,40 @@ choose_hard_reg_mode (unsigned int regno
mode = GET_MODE_WIDER_MODE (mode))
if ((unsigned) hard_regno_nregs[regno][mode] == nregs
&& HARD_REGNO_MODE_OK (regno, mode)

View File

@ -1,3 +1,13 @@
commit 81cc26c706b2bc8c8c1eb1a322e5c5157900836e
Author: Felix Fietkau <nbd@openwrt.org>
Date: Sun Oct 19 21:45:51 2014 +0000
gcc: do not assume that the Mac OS X filesystem is case insensitive
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
SVN-Revision: 42973
--- a/include/filenames.h
+++ b/include/filenames.h
@@ -43,11 +43,6 @@ extern "C" {

View File

@ -1,6 +1,18 @@
commit 098bd91f5eae625c7d2ee621e10930fc4434e5e2
Author: Luka Perkov <luka@openwrt.org>
Date: Tue Feb 26 16:16:33 2013 +0000
gcc: don't build documentation
This closes #13039.
Signed-off-by: Luka Perkov <luka@openwrt.org>
SVN-Revision: 35807
--- a/gcc/Makefile.in
+++ b/gcc/Makefile.in
@@ -3021,18 +3021,10 @@ doc/gcc.info: $(TEXI_GCC_FILES)
@@ -3121,18 +3121,10 @@ doc/gcc.info: $(TEXI_GCC_FILES)
doc/gccint.info: $(TEXI_GCCINT_FILES)
doc/cppinternals.info: $(TEXI_CPPINT_FILES)

View File

@ -0,0 +1,28 @@
commit 1877bc9d8f2be143fbe530347a945850d0ecd234
Author: Steven Barth <cyrus@openwrt.org>
Date: Mon Jun 22 10:31:07 2015 +0000
gcc/musl: rework SSP-support
Make musl provide libssp_nonshared.a and make GCC link it unconditionally
if musl is used. This should be a no-op if SSP is disabled and seems to be
the only reliable way of dealing with SSP over all packages due to the mess
that is linkerflags handling in packages.
Signed-off-by: Steven Barth <steven@midlink.org>
SVN-Revision: 46108
--- a/gcc/gcc.c
+++ b/gcc/gcc.c
@@ -861,7 +861,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

View File

@ -0,0 +1,21 @@
commit ecf7671b769fe96f7b5134be442089f8bdba55d2
Author: Felix Fietkau <nbd@nbd.name>
Date: Thu Aug 4 20:29:45 2016 +0200
gcc: add a patch to generate better code with Os on mips
Also happens to reduce compressed code size a bit
Signed-off-by: Felix Fietkau <nbd@nbd.name>
--- a/gcc/config/mips/mips.c
+++ b/gcc/config/mips/mips.c
@@ -19784,7 +19784,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];

View File

@ -0,0 +1,32 @@
commit b050f87d13b5dc7ed82feb9a90f4529de58bdf25
Author: Felix Fietkau <nbd@openwrt.org>
Date: Wed Feb 19 19:20:10 2014 +0000
gcc: prevent the use of LDRD/STRD on ARMv5TE
These instructions are for 64-bit load/store. On ARMv5TE, the CPU
requires addresses to be aligned to 64-bit. When misaligned, behavior is
undefined (effectively either loads the same word twice on LDRD, or
corrupts surrounding memory on STRD).
On ARMv6 and newer, unaligned access is safe.
Removing these instructions for ARMv5TE is necessary, because GCC
ignores alignment information in pointers and does unsafe optimizations
that have shown up as bugs in various places.
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
SVN-Revision: 39638
--- a/gcc/config/arm/arm.h
+++ b/gcc/config/arm/arm.h
@@ -150,7 +150,7 @@ extern tree arm_fp16_type_node;
/* 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)

View File

@ -1,3 +1,11 @@
commit 8570c4be394cff7282f332f97da2ff569a927ddb
Author: Imre Kaloz <kaloz@openwrt.org>
Date: Wed Feb 2 20:06:12 2011 +0000
fixup arm soft-float symbols
SVN-Revision: 25325
--- a/libgcc/config/arm/t-linux
+++ b/libgcc/config/arm/t-linux
@@ -1,6 +1,10 @@
@ -14,7 +22,7 @@
# difference.
--- a/gcc/config/arm/linux-elf.h
+++ b/gcc/config/arm/linux-elf.h
@@ -60,8 +60,6 @@
@@ -58,8 +58,6 @@
%{shared:-lc} \
%{!shared:%{profile:-lc_p}%{!profile:-lc}}"

View File

@ -1,6 +1,14 @@
commit c96312958c0621e72c9b32da5bc224ffe2161384
Author: Felix Fietkau <nbd@openwrt.org>
Date: Mon Oct 19 23:26:09 2009 +0000
gcc: create a proper libgcc_pic.a static library for relinking (4.3.3+ for now, backport will follow)
SVN-Revision: 18086
--- a/libgcc/Makefile.in
+++ b/libgcc/Makefile.in
@@ -888,11 +888,12 @@ $(libgcov-driver-objects): %$(objext): $
@@ -920,11 +920,12 @@ $(libgcov-driver-objects): %$(objext): $
# Static libraries.
libgcc.a: $(libgcc-objects)
@ -14,7 +22,7 @@
-rm -f $@
objects="$(objects)"; \
@@ -913,7 +914,7 @@ all: libunwind.a
@@ -945,7 +946,7 @@ all: libunwind.a
endif
ifeq ($(enable_shared),yes)
@ -23,7 +31,7 @@
ifneq ($(LIBUNWIND),)
all: libunwind$(SHLIB_EXT)
libgcc_s$(SHLIB_EXT): libunwind$(SHLIB_EXT)
@@ -1115,6 +1116,10 @@ install-shared:
@@ -1151,6 +1152,10 @@ install-shared:
chmod 644 $(DESTDIR)$(inst_libdir)/libgcc_eh.a
$(RANLIB) $(DESTDIR)$(inst_libdir)/libgcc_eh.a

View File

@ -1,6 +1,15 @@
commit 7edc8ca5456d9743dd0075eb3cc5b04f4f24c8cc
Author: Imre Kaloz <kaloz@openwrt.org>
Date: Wed Feb 2 19:34:36 2011 +0000
add armv4 fixup patches
SVN-Revision: 25322
--- a/gcc/config/arm/linux-eabi.h
+++ b/gcc/config/arm/linux-eabi.h
@@ -94,10 +94,15 @@
@@ -88,10 +88,15 @@
#define MUSL_DYNAMIC_LINKER \
"/lib/ld-musl-arm" MUSL_DYNAMIC_LINKER_E "%{mfloat-abi=hard:hf}.so.1"

View File

@ -1,6 +1,13 @@
commit dcfc40358b5a3cae7320c17f8d1cebd5ad5540cd
Author: Felix Fietkau <nbd@openwrt.org>
Date: Sun Feb 12 20:25:47 2012 +0000
gcc 4.6: port over the missing patch 850-use_shared_libgcc.patch to prevent libgcc crap from leaking into every single binary
SVN-Revision: 30486
--- a/gcc/config/arm/linux-eabi.h
+++ b/gcc/config/arm/linux-eabi.h
@@ -132,10 +132,6 @@
@@ -126,10 +126,6 @@
"%{Ofast|ffast-math|funsafe-math-optimizations:crtfastmath.o%s} " \
LINUX_OR_ANDROID_LD (GNU_USER_TARGET_ENDFILE_SPEC, ANDROID_ENDFILE_SPEC)
@ -26,7 +33,7 @@
-muclibc or -mglibc or -mbionic or -mmusl has been passed to change
--- a/libgcc/mkmap-symver.awk
+++ b/libgcc/mkmap-symver.awk
@@ -132,5 +132,5 @@ function output(lib) {
@@ -136,5 +136,5 @@ function output(lib) {
else if (inherit[lib])
printf("} %s;\n", inherit[lib]);
else

View File

@ -1,3 +1,13 @@
commit 64661de100da1ec1061ef3e5e400285dce115e6b
Author: Felix Fietkau <nbd@openwrt.org>
Date: Sun May 10 13:16:35 2015 +0000
gcc: add some size optimization patches
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
SVN-Revision: 45664
--- a/libgcc/config/t-libunwind
+++ b/libgcc/config/t-libunwind
@@ -2,8 +2,7 @@

View File

@ -0,0 +1,18 @@
commit d8c570a1531035c3e26bcd94741e5f5b9c36b5d9
Author: Felix Fietkau <nbd@openwrt.org>
Date: Mon Mar 5 00:51:01 2012 +0000
gcc: do not emit references to _savegpr_* and _restgpr_* on powerpc, as they are tricky to deal with wrt. libgcc. they cannot be linked dynamically
SVN-Revision: 30814
--- a/gcc/config/rs6000/rs6000.c
+++ b/gcc/config/rs6000/rs6000.c
@@ -26936,7 +26936,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)
{
- if (!optimize_size)
+ if (1)
{
strategy |= SAVE_INLINE_FPRS | REST_INLINE_FPRS;
strategy |= SAVE_INLINE_GPRS | REST_INLINE_GPRS;

View File

@ -0,0 +1,22 @@
commit 565988ab47bd9b96b50608564aee2104aeb4b7ae
Author: Felix Fietkau <nbd@nbd.name>
Date: Tue Dec 13 14:20:49 2016 +0100
gcc: rip out transactional memory related bloat from crtbegin
Slightly improves compression for each executable, saving about 4k from
the default ar71xx rootfs
Signed-off-by: Felix Fietkau <nbd@nbd.name>
--- 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

View File

@ -0,0 +1,30 @@
commit 9dc38e48f7a6f88b7ac7bfaced91f53660204e46
Author: Florian Fainelli <florian@openwrt.org>
Date: Fri Apr 5 12:36:06 2013 +0000
toolchain/gcc: .init and .fini need to pick one ISA
The .init and .fini sections are built by concatenating code
fragments. Putting mips16 code in the middle of a mips32 code block
doesn't work. Make gcc built the magic crt stuff in no-mips16 mode.
This is specific to 4.6-linaro but is probably portable to other gcc
flavors. Adding this to the t-libgcc-mips16 makefile fragment is a
hack not suitable for pushing upstream, but there is no mips/t-linux
or mips/t-uclibc and I am not going to touch gcc/configure for two
lines.
Signed-off-by: Jay Carlson <nop@nop.com>
Signed-off-by: Florian Fainelli <florian@openwrt.org>
SVN-Revision: 36200
--- 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

View File

@ -1,22 +1,23 @@
commit 99368862e44740ff4fd33760893f04e14f9dbdf1
Author: Felix Fietkau <nbd@openwrt.org>
Date: Tue Jul 31 00:52:27 2007 +0000
This patch brings over a few features from MirBSD:
Port the mbsd_multi patch from freewrt, which adds -fhonour-copts. This will emit warnings in packages that don't use our target cflags properly
SVN-Revision: 8256
This patch brings over a feature from MirBSD:
* -fhonour-copts
If this option is not given, it's warned (depending
on environment variables). This is to catch errors
of misbuilt packages which override CFLAGS themselves.
* -Werror-maybe-reset
Has the effect of -Wno-error if GCC_NO_WERROR is
set and not '0', a no-operation otherwise. This is
to be able to use -Werror in "make" but prevent
GNU autoconf generated configure scripts from
freaking out.
This patch was authored by Thorsten Glaser <tg at mirbsd.de>
with copyright assignment to the FSF in effect.
--- a/gcc/c-family/c-opts.c
+++ b/gcc/c-family/c-opts.c
@@ -107,6 +107,9 @@ static int class_dump_flags;
@@ -108,6 +108,9 @@ static int class_dump_flags;
/* Whether any standard preincluded header has been preincluded. */
static bool done_preinclude;
@ -26,7 +27,7 @@
static void handle_OPT_d (const char *);
static void set_std_cxx98 (int);
static void set_std_cxx11 (int);
@@ -442,6 +445,12 @@ c_common_handle_option (size_t scode, co
@@ -456,6 +459,12 @@ c_common_handle_option (size_t scode, co
flag_no_builtin = !value;
break;
@ -39,7 +40,7 @@
case OPT_fconstant_string_class_:
constant_string_class_name = arg;
break;
@@ -1041,6 +1050,47 @@ c_common_init (void)
@@ -1084,6 +1093,47 @@ c_common_init (void)
return false;
}
@ -89,18 +90,7 @@
--- a/gcc/c-family/c.opt
+++ b/gcc/c-family/c.opt
@@ -438,6 +438,10 @@ Wfloat-conversion
C ObjC C++ ObjC++ Var(warn_float_conversion) Warning LangEnabledBy(C ObjC C++ ObjC++,Wconversion)
Warn for implicit type conversions that cause loss of floating point precision.
+Werror-maybe-reset
+C ObjC C++ ObjC++
+; Documented in common.opt
+
Wfloat-equal
C ObjC C++ ObjC++ Var(warn_float_equal) Warning
Warn if testing floating point numbers for equality.
@@ -1252,6 +1256,9 @@ C++ ObjC++ Optimization Alias(fexception
@@ -1412,6 +1412,9 @@ C++ ObjC++ Optimization Alias(fexception
fhonor-std
C++ ObjC++ Ignore Warn(switch %qs is no longer supported)
@ -112,18 +102,7 @@
Assume normal C execution environment.
--- a/gcc/common.opt
+++ b/gcc/common.opt
@@ -581,6 +581,10 @@ Werror=
Common Joined
Treat specified warning as error.
+Werror-maybe-reset
+Common
+If environment variable GCC_NO_WERROR is set, act as -Wno-error
+
Wextra
Common Var(extra_warnings) Warning
Print extra (possibly unwanted) warnings.
@@ -1432,6 +1436,9 @@ fguess-branch-probability
@@ -1510,6 +1510,9 @@ fguess-branch-probability
Common Report Var(flag_guess_branch_prob) Optimization
Enable guessing of branch probabilities.
@ -135,60 +114,24 @@
; On SVR4 targets, it also controls whether or not to emit a
--- a/gcc/opts.c
+++ b/gcc/opts.c
@@ -1783,6 +1783,17 @@ common_handle_option (struct gcc_options
@@ -1928,6 +1928,9 @@ common_handle_option (struct gcc_options
opts, opts_set, loc, dc);
break;
+ case OPT_Werror_maybe_reset:
+ {
+ char *ev = getenv ("GCC_NO_WERROR");
+ if ((ev != NULL) && (*ev != '0'))
+ warnings_are_errors = 0;
+ }
+ break;
+
+ case OPT_fhonour_copts:
+ break;
+
case OPT_Wlarger_than_:
opts->x_larger_than_size = value;
opts->x_warn_larger_than = value != -1;
--- a/gcc/doc/cppopts.texi
+++ b/gcc/doc/cppopts.texi
@@ -163,6 +163,11 @@ in older programs. This warning is on b
Make all warnings into hard errors. Source code which triggers warnings
will be rejected.
+ at item -Werror-maybe-reset
+ at opindex Werror-maybe-reset
+Act like @samp{-Wno-error} if the @env{GCC_NO_WERROR} environment
+variable is set to anything other than 0 or empty.
+
@item -Wsystem-headers
@opindex Wsystem-headers
Issue warnings for code in system headers. These are normally unhelpful
--- a/gcc/doc/invoke.texi
+++ b/gcc/doc/invoke.texi
@@ -263,7 +263,7 @@ Objective-C and Objective-C++ Dialects}.
-Wno-discarded-qualifiers -Wno-discarded-array-qualifiers @gol
-Wno-div-by-zero -Wdouble-promotion -Wduplicated-cond @gol
-Wempty-body -Wenum-compare -Wno-endif-labels @gol
--Werror -Werror=* -Wfatal-errors -Wfloat-equal -Wformat -Wformat=2 @gol
+-Werror -Werror=* -Werror-maybe-reset -Wfatal-errors -Wfloat-equal -Wformat -Wformat=2 @gol
-Wno-format-contains-nul -Wno-format-extra-args -Wformat-nonliteral @gol
-Wformat-security -Wformat-signedness -Wformat-y2k -Wframe-address @gol
-Wframe-larger-than=@var{len} -Wno-free-nonheap-object -Wjump-misses-init @gol
@@ -5737,6 +5737,22 @@ This option is only supported for C and
@@ -6567,6 +6567,17 @@ This option is only supported for C and
@option{-Wall} and by @option{-Wpedantic}, which can be disabled with
@option{-Wno-pointer-sign}.
+ at item -Werror-maybe-reset
+ at opindex Werror-maybe-reset
+Act like @samp{-Wno-error} if the @env{GCC_NO_WERROR} environment
+variable is set to anything other than 0 or empty.
+
+ at item -fhonour-copts
+ at opindex fhonour-copts
+@item -fhonour-copts
+@opindex fhonour-copts
+If @env{GCC_HONOUR_COPTS} is set to 1, abort if this option is not
+given at least once, and warn if it is given more than once.
+If @env{GCC_HONOUR_COPTS} is set to 2, abort if this option is not
@ -201,22 +144,3 @@
@item -Wstack-protector
@opindex Wstack-protector
@opindex Wno-stack-protector
@@ -6605,7 +6621,7 @@ so, the first branch is redirected to ei
second branch or a point immediately following it, depending on whether
the condition is known to be true or false.
-Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
+Enabled at levels @option{-O3}.
@item -fsplit-wide-types
@opindex fsplit-wide-types
--- a/gcc/java/jvspec.c
+++ b/gcc/java/jvspec.c
@@ -629,6 +629,7 @@ lang_specific_pre_link (void)
class name. Append dummy `.c' that can be stripped by set_input so %b
is correct. */
set_input (concat (main_class_name, "main.c", NULL));
+ putenv ("GCC_HONOUR_COPTS=s"); /* XXX hack! */
err = do_spec (jvgenmain_spec);
if (err == 0)
{

View File

@ -1,6 +1,13 @@
Author: Jo-Philipp Wich <jow@openwrt.org>
Date: Sat Apr 21 03:02:39 2012 +0000
gcc: add patch to make the getenv() spec function nonfatal if requested environment variable is unset
SVN-Revision: 31390
--- a/gcc/gcc.c
+++ b/gcc/gcc.c
@@ -9198,8 +9198,10 @@ getenv_spec_function (int argc, const ch
@@ -9280,8 +9280,10 @@ getenv_spec_function (int argc, const ch
value = varname;
if (!value)

View File

@ -48,9 +48,9 @@ sellcey@mips.com
--- a/gcc/config/mips/mips.c
+++ b/gcc/config/mips/mips.c
@@ -20228,6 +20228,9 @@ mips_promote_function_mode (const_tree t
#undef TARGET_HARD_REGNO_SCRATCH_OK
#define TARGET_HARD_REGNO_SCRATCH_OK mips_hard_regno_scratch_ok
@@ -22561,6 +22561,9 @@ mips_promote_function_mode (const_tree t
#undef TARGET_CUSTOM_FUNCTION_DESCRIPTORS
#define TARGET_CUSTOM_FUNCTION_DESCRIPTORS 2
+#undef TARGET_ASM_FILE_END
+#define TARGET_ASM_FILE_END file_end_indicate_exec_stack

View File

@ -0,0 +1,33 @@
commit 548d9a008ff265e9eaa3c7e0e6e301c6bd5645e6
Author: Felix Fietkau <nbd@openwrt.org>
Date: Fri Dec 12 17:01:57 2014 +0000
gcc: don't clobber stamp-bits with a symlink to itself
Several versions of gcc have an issue in libstdc++v3 where the build may
clobber stamp-bits with a link to itself. This doesn't manifest itself
on all systems. On several Ubuntu systems, this doesn't appear to be a
problem, but it is an issue on Fedora 16 systems.
To fix the issue, we'll simply filter out stamp-bits from the symlinks
to be generated.
Note: gcc 4.4.7 is unaffected by this issue, so no fix is necessary
there.
Signed-off-by: John Szakmeister <john@szakmeister.net>
SVN-Revision: 43669
--- a/libstdc++-v3/include/Makefile.in
+++ b/libstdc++-v3/include/Makefile.in
@@ -1476,7 +1476,7 @@ stamp-bits: ${bits_headers}
@$(STAMP) stamp-bits
stamp-bits-sup: stamp-bits ${bits_sup_headers}
- @-cd ${bits_builddir} && $(LN_S) $? . 2>/dev/null
+ @-cd ${bits_builddir} && $(LN_S) $(filter-out stamp-bits,$?) . 2>/dev/null
@$(STAMP) stamp-bits-sup
stamp-c_base: ${c_base_headers}

View File

@ -1,8 +1,18 @@
commit 331735a357a73c7b8adc205241ac3cc6543d985e
Author: Felix Fietkau <nbd@openwrt.org>
Date: Tue Nov 17 12:38:22 2015 +0000
gcc: add a patch to 5.x that supports translation of __FILE__ paths
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
SVN-Revision: 47490
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
@@ -588,6 +588,10 @@ c_common_handle_option (size_t scode, co
add_path (xstrdup (arg), SYSTEM, 0, true);
break;
@ -15,7 +25,7 @@ Forward ported from attachment to https://gcc.gnu.org/bugzilla/show_bug.cgi?id=4
break;
--- a/gcc/c-family/c.opt
+++ b/gcc/c-family/c.opt
@@ -1632,6 +1632,10 @@ iquote
@@ -1825,6 +1825,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.
@ -28,19 +38,19 @@ Forward ported from attachment to https://gcc.gnu.org/bugzilla/show_bug.cgi?id=4
-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.
@@ -4272,6 +4272,7 @@ Refer to the GCC manual for full documen
@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{}]
[@option{-MT} @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}.
@@ -220,6 +220,12 @@ extensions @samp{.i}, @samp{.ii} or @sam
extensions that GCC uses for preprocessed files created by
@option{-save-temps}.
+@item -iremap @var{src}:@var{dst}
+@opindex iremap
@ -53,20 +63,9 @@ Forward ported from attachment to https://gcc.gnu.org/bugzilla/show_bug.cgi?id=4
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}.
@@ -11863,6 +11863,12 @@ by @option{-fplugin=@var{name}} instead
@option{-fplugin=@var{path}/@var{name}.so}. This option is not meant
to be used by the user, but only passed by the driver.
+@item -iremap @var{src}:@var{dst}
+@opindex iremap
@ -79,7 +78,7 @@ Forward ported from attachment to https://gcc.gnu.org/bugzilla/show_bug.cgi?id=4
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 *,
@@ -820,6 +820,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);

View File

@ -9,11 +9,11 @@ include $(TOPDIR)/rules.mk
PKG_NAME:=gdb
ifeq ($(CONFIG_arc),y)
PKG_VERSION:=arc-2017.03-gdb
PKG_VERSION:=arc-2017.09-gdb
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=https://github.com/foss-for-synopsys-dwc-arc-processors/binutils-gdb/archive/arc-2017.03-gdb
PKG_HASH:=f47930161e9e99c46ab018dabbf56024739dda29c51f92495eaa0d4d7e3511f6
PKG_SOURCE_URL:=https://github.com/foss-for-synopsys-dwc-arc-processors/binutils-gdb/archive/arc-2017.09-gdb
PKG_HASH:=7e3c2a763bf500a40c5c4591a7e22c591dafc1f214b1d514895c1096e85c883a
GDB_DIR:=binutils-$(PKG_NAME)-$(PKG_VERSION)
PATCH_DIR:=./patches-arc
else

View File

@ -17,7 +17,13 @@ include $(INCLUDE_DIR)/kernel.mk
PKG_NAME:=linux
PKG_VERSION:=$(LINUX_VERSION)
PKG_SOURCE:=$(LINUX_SOURCE)
ifneq ($(strip $(CONFIG_KERNEL_GIT_CLONE_URI)),"")
PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL:=$(call qstrip,$(CONFIG_KERNEL_GIT_CLONE_URI))
PKG_SOURCE_VERSION:=$(CONFIG_KERNEL_GIT_REF)
else
PKG_SOURCE_URL:=$(LINUX_SITE)
endif
HOST_BUILD_DIR:=$(KERNEL_BUILD_DIR)/linux-$(LINUX_VERSION)
PKG_HASH:=$(LINUX_KERNEL_HASH)
LINUX_DIR := $(HOST_BUILD_DIR)

View File

@ -9,7 +9,7 @@ include $(INCLUDE_DIR)/target.mk
PKG_NAME:=musl
PKG_VERSION:=1.1.18
PKG_RELEASE=1
PKG_RELEASE=2
PKG_SOURCE_PROTO:=git
PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
@ -21,9 +21,11 @@ PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.xz
LIBC_SO_VERSION:=$(PKG_VERSION)
PATCH_DIR:=$(PATH_PREFIX)/patches
BUILD_DIR_HOST:=$(BUILD_DIR_TOOLCHAIN)
HOST_BUILD_PREFIX:=$(TOOLCHAIN_DIR)
HOST_BUILD_DIR:=$(BUILD_DIR_TOOLCHAIN)/$(PKG_NAME)-$(PKG_VERSION)
include $(INCLUDE_DIR)/toolchain-build.mk
include $(INCLUDE_DIR)/host-build.mk
include $(INCLUDE_DIR)/hardening.mk
MUSL_CONFIGURE:= \
@ -37,18 +39,8 @@ MUSL_CONFIGURE:= \
--disable-gcc-wrapper \
--enable-debug
define Host/Prepare
$(call Host/Prepare/Default)
$(if $(strip $(QUILT)), \
cd $(HOST_BUILD_DIR); \
if $(QUILT_CMD) next >/dev/null 2>&1; then \
$(QUILT_CMD) push -a; \
fi
)
ln -snf $(PKG_NAME)-$(PKG_VERSION) $(BUILD_DIR_TOOLCHAIN)/$(PKG_NAME)
endef
define Host/Configure
ln -snf $(PKG_NAME)-$(PKG_VERSION) $(BUILD_DIR_TOOLCHAIN)/$(PKG_NAME)
( cd $(HOST_BUILD_DIR); rm -f config.cache; \
$(MUSL_CONFIGURE) \
);

View File

@ -0,0 +1,59 @@
From 8e85d2c268000b51cc690f3a55a820d8f8a6c0bc Mon Sep 17 00:00:00 2001
From: Hauke Mehrtens <hauke@hauke-m.de>
Date: Thu, 22 Jun 2017 22:04:28 +0200
Subject: [PATCH] Add additional uapi guards for Linux kernel header files
With Linux kernel 4.15 it will be possible to guard more parts of the
Linux header files from a libc. Make use of this in musl to guard all
the structures and other definitions from the Linux header files which
are also defined by the header files provided by musl. This will make
musl compile with the unmodified Linux kernel user space headers.
This extends the definitions done in commit 04983f227238 ("make
netinet/in.h suppress clashing definitions from kernel headers")
The needed patches were recently accepted for Linux 4.15:
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=c0bace798436bca0fdc221ff61143f1376a9c3de
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=6926e041a8920c8ec27e4e155efa760aa01551fd
---
include/net/if.h | 7 +++++++
include/netinet/if_ether.h | 1 +
include/sys/xattr.h | 2 ++
3 files changed, 10 insertions(+)
--- a/include/net/if.h
+++ b/include/net/if.h
@@ -125,6 +125,13 @@ struct ifconf {
#define ifc_req ifc_ifcu.ifcu_req
#define _IOT_ifconf _IOT(_IOTS(struct ifconf),1,0,0,0,0)
+#define __UAPI_DEF_IF_IFCONF 0
+#define __UAPI_DEF_IF_IFMAP 0
+#define __UAPI_DEF_IF_IFNAMSIZ 0
+#define __UAPI_DEF_IF_IFREQ 0
+#define __UAPI_DEF_IF_NET_DEVICE_FLAGS 0
+#define __UAPI_DEF_IF_NET_DEVICE_FLAGS_LOWER_UP_DORMANT_ECHO 0
+
#endif
#ifdef __cplusplus
--- a/include/netinet/if_ether.h
+++ b/include/netinet/if_ether.h
@@ -133,5 +133,6 @@ do { \
(enaddr)[5] = ((uint8_t *)ipaddr)[3]; \
} while(0)
+#define __UAPI_DEF_ETHHDR 0
#endif
--- a/include/sys/xattr.h
+++ b/include/sys/xattr.h
@@ -24,6 +24,8 @@ int removexattr(const char *, const char
int lremovexattr(const char *, const char *);
int fremovexattr(int, const char *);
+#define __UAPI_DEF_XATTR 0
+
#ifdef __cplusplus
}
#endif

View File

@ -45,11 +45,7 @@ Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
+#else
+#define __fp(x, y)
+#endif
-_Noreturn void err(int, const char *, ...);
-_Noreturn void verr(int, const char *, va_list);
-_Noreturn void errx(int, const char *, ...);
-_Noreturn void verrx(int, const char *, va_list);
+
+void warn(const char *, ...) __fp(1, 2);
+void vwarn(const char *, va_list) __fp(1, 0);
+void warnx(const char *, ...) __fp(1, 2);
@ -59,7 +55,11 @@ Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
+_Noreturn void verr(int, const char *, va_list) __fp(2, 0);
+_Noreturn void errx(int, const char *, ...) __fp(2, 3);
+_Noreturn void verrx(int, const char *, va_list) __fp(2, 0);
+
-_Noreturn void err(int, const char *, ...);
-_Noreturn void verr(int, const char *, va_list);
-_Noreturn void errx(int, const char *, ...);
-_Noreturn void verrx(int, const char *, va_list);
+#undef __fp
#ifdef __cplusplus

View File

@ -7,7 +7,7 @@
include $(TOPDIR)/rules.mk
include $(INCLUDE_DIR)/target.mk
PKG_VERSION:=1.0.22
PKG_VERSION:=1.0.28
PKG_NAME:=uClibc-ng
PKG_SOURCE_URL = http://downloads.uclibc-ng.org/releases/$(PKG_VERSION)/
@ -16,7 +16,7 @@ CONFIG_DIR:=$(PATH_PREFIX)/config
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
LIBC_SO_VERSION:=$(PKG_VERSION)
PKG_HASH:=f2004c85db8e07e9f1c2e8b7c513fa7c237bc9f9685d8e1bfc89535b8a85449b
PKG_HASH:=a1504ddc34a29cc9bfd1f5a7419c4b63bb510d9e2faed81618d1b596ceb0a5a9
HOST_BUILD_DIR:=$(BUILD_DIR_TOOLCHAIN)/$(PKG_NAME)-$(PKG_VERSION)