Commit 6e1b72b5 authored by Timo Teräs's avatar Timo Teräs Committed by Natanael Copa

main/gcc: upgrade to gcc 5.1.0

parent 6dd6cf53
Add support for external spec file via the GCC_SPECS env var. This
allows us to easily control pie/ssp defaults with gcc-config profiles.
2013-08-22 Magnus Granberg <zorry@gentoo.org>
* gcc/gcc.c (main): Add support for external spec file via the GCC_SPECS env var
and move the process of the user specifed specs.
This allows us to easily control pie/ssp defaults with gcc-config profiles.
Original patch by Rob Holland
Extended to support multiple entries separated by ':' by Kevin F. Quinn
Modified to use getenv instead of poisoned GET_ENVIRONMENT by Ryan Hill
Modified to process the GCC_SPECS env var befor DRIVER_SELF_SPECS by Magnus Granberg
--- gcc-4/gcc/gcc.c
+++ gcc-4/gcc/gcc.c
@@ -6482,6 +6482,32 @@
--- a/gcc/gcc.c
+++ b/gcc/gcc.c
@@ -6427,6 +6428,48 @@ main (int argc, char **argv)
do_option_spec (option_default_specs[i].name,
option_default_specs[i].spec);
/* Process any user specified specs in the order given on the command
line. */
+#if !(defined (__MSDOS__) || defined (OS2) || defined (VMS) || defined (WIN32))
+ /* Add specs listed in GCC_SPECS. Note; in the process of separating
+ * each spec listed, the string is overwritten at token boundaries
......@@ -26,7 +30,6 @@
+ {
+ struct user_specs *user = (struct user_specs *)
+ xmalloc (sizeof (struct user_specs));
+
+ user->next = (struct user_specs *) 0;
+ user->filename = spec;
+ if (user_specs_tail)
......@@ -37,6 +40,48 @@
+ }
+ }
+#endif
for (uptr = user_specs_head; uptr; uptr = uptr->next)
+ /* Process any user specified specs in the order given on the command
+ * line. */
+ for (struct user_specs *uptr = user_specs_head; uptr; uptr = uptr->next)
+ {
+ char *filename = find_a_file (&startfile_prefixes, uptr->filename,
+ R_OK, true);
+ read_specs (filename ? filename : uptr->filename, false, true);
+ }
+ /* Process any user self specs. */
+ {
+ struct spec_list *sl;
+ for (sl = specs; sl; sl = sl->next)
+ if (sl->name_len == sizeof "self_spec" - 1
+ && !strcmp (sl->name, "self_spec"))
+ do_self_spec (*sl->ptr_spec);
+ }
+
/* Process DRIVER_SELF_SPECS, adding any new options to the end
of the command line. */
@@ -6535,24 +6578,6 @@ main (int argc, char **argv)
PREFIX_PRIORITY_LAST, 0, 1);
}
- /* Process any user specified specs in the order given on the command
- line. */
- for (struct user_specs *uptr = user_specs_head; uptr; uptr = uptr->next)
- {
- char *filename = find_a_file (&startfile_prefixes, uptr->filename,
- R_OK, true);
- read_specs (filename ? filename : uptr->filename, false, true);
- }
-
- /* Process any user self specs. */
- {
- struct spec_list *sl;
- for (sl = specs; sl; sl = sl->next)
- if (sl->name_len == sizeof "self_spec" - 1
- && !strcmp (sl->name, "self_spec"))
- do_self_spec (*sl->ptr_spec);
- }
-
if (compare_debug)
{
char *filename = find_a_file (&startfile_prefixes, uptr->filename,
enum save_temps save;
Enable -D_FORTIFY_SOURCE=2 by default.
Original patch from:
http://sources.gentoo.org/cgi-bin/viewvc.cgi/gentoo/src/patchsets/gcc/4.9.2/gentoo/10_all_default-fortify-source.patch
--- a/gcc/c-family/c-cppbuiltin.c
+++ b/gcc/c-family/c-cppbuiltin.c
......@@ -21,8 +19,8 @@ http://sources.gentoo.org/cgi-bin/viewvc.cgi/gentoo/src/patchsets/gcc/4.9.2/gent
Please note the warning under '-fgcse' about invoking '-O2' on
programs that use computed gotos.
+ NOTE: In Alpine Linux, `-D_FORTIFY_SOURCE=2' is set by default, and is
+ activated when `-Os' or `-O1' or higher is used. This enables additional
+ NOTE: In Gentoo, `-D_FORTIFY_SOURCE=2' is set by default, and is
+ activated when `-O' is set to 2 or higher. This enables additional
+ compile-time and run-time checks for several libc functions. To disable,
+ specify either `-U_FORTIFY_SOURCE' or `-D_FORTIFY_SOURCE=0'.
+
......
Enable -Wformat and -Wformat-security by default.
--- a/gcc/c-family/c.opt
+++ b/gcc/c-family/c.opt
@@ -412,7 +412,7 @@ C ObjC C++ ObjC++ Var(warn_format_nonliteral) Warning LangEnabledBy(C ObjC C++ O
Warn about format strings that are not literals
Wformat-security
-C ObjC C++ ObjC++ Var(warn_format_security) Warning LangEnabledBy(C ObjC C++ ObjC++,Wformat=, warn_format >= 2, 0)
+C ObjC C++ ObjC++ Var(warn_format_security) Init(1) Warning LangEnabledBy(C ObjC C++ ObjC++,Wformat=, warn_format >= 2, 0)
Warn about possible security problems with format functions
Wformat-y2k
@@ -424,7 +424,7 @@ C ObjC C++ ObjC++ Var(warn_format_zero_length) Warning LangEnabledBy(C ObjC C++
Warn about zero-length formats
Wformat=
-C ObjC C++ ObjC++ Joined RejectNegative UInteger Var(warn_format) Warning LangEnabledBy(C ObjC C++ ObjC++,Wall, 1, 0)
+C ObjC C++ ObjC++ Joined RejectNegative UInteger Var(warn_format) Init(1) Warning LangEnabledBy(C ObjC C++ ObjC++,Wall, 1, 0)
Warn about printf/scanf/strftime/strfmon format string anomalies
Wignored-qualifiers
--- a/gcc/doc/gcc.info
+++ b/gcc/doc/gcc.info
@@ -3451,6 +3451,8 @@ compiler warns that an unrecognized option is present.
'-Wno-format-contains-nul', '-Wno-format-extra-args', and
'-Wno-format-zero-length'. '-Wformat' is enabled by '-Wall'.
+ This option is enabled by default in Gentoo.
+
'-Wno-format-contains-nul'
If '-Wformat' is specified, do not warn about format strings
that contain NUL bytes.
@@ -3496,6 +3498,8 @@ compiler warns that an unrecognized option is present.
future warnings may be added to '-Wformat-security' that are
not included in '-Wformat-nonliteral'.)
+ This option is enabled by default in Gentoo.
+
'-Wformat-y2k'
If '-Wformat' is specified, also warn about 'strftime' formats
that may yield only a two-digit year.
Enable -Wtrampolines by default.
--- a/gcc/common.opt
+++ b/gcc/common.opt
@@ -640,7 +640,7 @@ Common Var(warn_system_headers) Warning
@@ -648,7 +648,7 @@ Common Var(warn_system_headers) Warning
Do not suppress warnings from system headers
Wtrampolines
......@@ -11,14 +12,14 @@ Enable -Wtrampolines by default.
Warn whenever a trampoline is generated
Wtype-limits
--- a/gcc/doc/invoke.texi
+++ b/gcc/doc/invoke.texi
@@ -4007,6 +4007,8 @@ headers---for that, @option{-Wunknown-pragmas} must also be used.
for most targets, it is made up of code and thus requires the stack
to be made executable in order for the program to work properly.
--- a/gcc/doc/gcc.info
+++ b/gcc/doc/gcc.info
@@ -4021,6 +4021,8 @@ compiler warns that an unrecognized option is present.
and thus requires the stack to be made executable in order for the
program to work properly.
+ This warning is enabled by default in Gentoo.
+
@item -Wfloat-equal
@opindex Wfloat-equal
@opindex Wno-float-equal
'-Wfloat-equal'
Warn if floating-point values are used in equality comparisons.
Ensure that msgfmt doesn't encounter problems during gcc bootstrapping.
Solves error messages like the following:
msgfmt: /var/tmp/portage/sys-devel/gcc-4.1.2/work/build/./gcc/libgcc_s.so.1: version `GCC_4.2.0' not found (required by /usr/lib/gcc/x86_64-pc-linux-gnu/4.5.3/libstdc++.so.6)
The libgcc_s.so used during build doesn't satisfy the needs of the
libstdc++.so that msgfmt is linked against. On the other hand, msgfmt
is used as a stand-alone application here, and what library it uses
behind the scenes is of no concern to the gcc build process.
Therefore, simply invoking it "as usual", i.e. without any special
library path, will make it work as expected here.
2011-09-19 Martin von Gagern
References:
https://bugs.gentoo.org/372377
https://bugs.gentoo.org/295480
--- gcc-4.1.2.orig/libstdc++-v3/po/Makefile.am
+++ gcc-4.1.2/libstdc++-v3/po/Makefile.am
@@ -39,6 +39,7 @@ MSGFMT = msgfmt
EXTRA_DIST = string_literals.cc POTFILES.in $(PACKAGE).pot $(LOCALE_IN)
.po.mo:
+ env --unset=LD_LIBRARY_PATH \
$(MSGFMT) -o $@ $<
all-local: all-local-$(USE_NLS)
--- gcc-4.1.2.orig/libstdc++-v3/po/Makefile.in
+++ gcc-4.1.2/libstdc++-v3/po/Makefile.in
@@ -419,6 +419,7 @@ uninstall-am: uninstall-info-am
.po.mo:
+ env --unset=LD_LIBRARY_PATH \
$(MSGFMT) -o $@ $<
all-local: all-local-$(USE_NLS)
https://bugs.gentoo.org/508852
https://gcc.gnu.org/PR61164
2014-04-27 Magnus Granberg <zorry@gentoo.org>
#508852
* libitm/configure.tgt: Disable FORTIFY
--- a/libitm/configure.tgt
+++ b/libitm/configure.tgt
@@ -43,6 +43,16 @@ if test "$gcc_cv_have_tls" = yes ; then
esac
fi
+# FIXME: error: inlining failed in call to always_inline
+# ‘int vfprintf(FILE*, const char*, __va_list_tag*)’
+# : function body can be overwritten at link time
+# Disable Fortify in libitm for now. #508852
+case "${target}" in
+ *-*-linux*)
+ XCFLAGS="${XCFLAGS} -U_FORTIFY_SOURCE"
+ ;;
+esac
+
# Map the target cpu to an ARCH sub-directory. At the same time,
# work out any special compilation flags as necessary.
case "${target_cpu}" in
From 160397ef3c3331099af028f1b8d3e085b07d88ad Mon Sep 17 00:00:00 2001
http://cgit.openembedded.org/openembedded-core/tree/meta/recipes-devtools/gcc/gcc-4.9/0016-gcc-poison-system-directories.patch
From: Khem Raj <raj.khem@gmail.com>
Date: Fri, 29 Mar 2013 08:59:00 +0400
Subject: [PATCH 16/35] gcc: poison-system-directories
......@@ -17,8 +18,6 @@ Upstream-Status: Inappropriate [distribution: codesourcery]
gcc/incpath.c | 19 +++++++++++++++++++
8 files changed, 69 insertions(+), 3 deletions(-)
Index: gcc-4.9-20140316/gcc/common.opt
===================================================================
--- gcc-4.9-20140316.orig/gcc/common.opt
+++ gcc-4.9-20140316/gcc/common.opt
@@ -603,6 +603,10 @@ Wpedantic
......@@ -32,25 +31,25 @@ Index: gcc-4.9-20140316/gcc/common.opt
Wshadow
Common Var(warn_shadow) Warning
Warn when one local variable shadows another
Index: gcc-4.9-20140316/gcc/config.in
===================================================================
--- gcc-4.9-20140316.orig/gcc/config.in
+++ gcc-4.9-20140316/gcc/config.in
@@ -138,6 +138,12 @@
#endif
--- gcc-4.9-20140316.orig/gcc/configure.ac
+++ gcc-4.9-20140316/gcc/configure.ac
@@ -5366,6 +5366,16 @@ AC_ARG_ENABLE(version-specific-runtime-l
[specify that runtime libraries should be
installed in a compiler-specific directory])])
+/* Define to warn for use of native system header directories */
+#ifndef USED_FOR_TARGET
+#undef ENABLE_POISON_SYSTEM_DIRECTORIES
+#endif
+
+AC_ARG_ENABLE([poison-system-directories],
+ AS_HELP_STRING([--enable-poison-system-directories],
+ [warn for use of native system header directories]),,
+ [enable_poison_system_directories=no])
+if test "x${enable_poison_system_directories}" = "xyes"; then
+ AC_DEFINE([ENABLE_POISON_SYSTEM_DIRECTORIES],
+ [1],
+ [Define to warn for use of native system header directories])
+fi
+
/* Define if you want all operations on RTL (the basic data structure of the
optimizer and back end) to be checked for dynamic type safety at runtime.
This is quite expensive. */
Index: gcc-4.9-20140316/gcc/configure
===================================================================
# Substitute configuration variables
AC_SUBST(subdirs)
AC_SUBST(srcdir)
--- gcc-4.9-20140316.orig/gcc/configure
+++ gcc-4.9-20140316/gcc/configure
@@ -928,6 +928,7 @@ with_system_zlib
......@@ -90,56 +89,21 @@ Index: gcc-4.9-20140316/gcc/configure
# Substitute configuration variables
Index: gcc-4.9-20140316/gcc/configure.ac
===================================================================
--- gcc-4.9-20140316.orig/gcc/configure.ac
+++ gcc-4.9-20140316/gcc/configure.ac
@@ -5366,6 +5366,16 @@ AC_ARG_ENABLE(version-specific-runtime-l
[specify that runtime libraries should be
installed in a compiler-specific directory])])
--- gcc-4.9-20140316.orig/gcc/config.in
+++ gcc-4.9-20140316/gcc/config.in
@@ -138,6 +138,12 @@
#endif
+AC_ARG_ENABLE([poison-system-directories],
+ AS_HELP_STRING([--enable-poison-system-directories],
+ [warn for use of native system header directories]),,
+ [enable_poison_system_directories=no])
+if test "x${enable_poison_system_directories}" = "xyes"; then
+ AC_DEFINE([ENABLE_POISON_SYSTEM_DIRECTORIES],
+ [1],
+ [Define to warn for use of native system header directories])
+fi
+/* Define to warn for use of native system header directories */
+#ifndef USED_FOR_TARGET
+#undef ENABLE_POISON_SYSTEM_DIRECTORIES
+#endif
+
# Substitute configuration variables
AC_SUBST(subdirs)
AC_SUBST(srcdir)
Index: gcc-4.9-20140316/gcc/doc/invoke.texi
===================================================================
--- gcc-4.9-20140316.orig/gcc/doc/invoke.texi
+++ gcc-4.9-20140316/gcc/doc/invoke.texi
@@ -260,6 +260,7 @@ Objective-C and Objective-C++ Dialects}.
-Woverlength-strings -Wpacked -Wpacked-bitfield-compat -Wpadded @gol
-Wparentheses -Wpedantic-ms-format -Wno-pedantic-ms-format @gol
-Wpointer-arith -Wno-pointer-to-int-cast @gol
+-Wno-poison-system-directories @gol
-Wredundant-decls -Wno-return-local-addr @gol
-Wreturn-type -Wsequence-point -Wshadow @gol
-Wsign-compare -Wsign-conversion -Wfloat-conversion @gol
@@ -4230,6 +4231,14 @@ headers---for that, @option{-Wunknown-pr
for most targets, it is made up of code and thus requires the stack
to be made executable in order for the program to work properly.
+@item -Wno-poison-system-directories
+@opindex Wno-poison-system-directories
+Do not warn for @option{-I} or @option{-L} options using system
+directories such as @file{/usr/include} when cross compiling. This
+option is intended for use in chroot environments when such
+directories contain the correct headers and libraries for the target
+system rather than the host.
+
@item -Wfloat-equal
@opindex Wfloat-equal
@opindex Wno-float-equal
Index: gcc-4.9-20140316/gcc/gcc.c
===================================================================
/* Define if you want all operations on RTL (the basic data structure of the
optimizer and back end) to be checked for dynamic type safety at runtime.
This is quite expensive. */
--- gcc-4.9-20140316.orig/gcc/gcc.c
+++ gcc-4.9-20140316/gcc/gcc.c
@@ -764,6 +764,8 @@ proper position among the other output f
......@@ -151,8 +115,6 @@ Index: gcc-4.9-20140316/gcc/gcc.c
%{static:} %{L*} %(mfwrap) %(link_libgcc) " SANITIZER_EARLY_SPEC " %o\
%{fopenmp|ftree-parallelize-loops=*:%:include(libgomp.spec)%(link_gomp)}\
%{fgnu-tm:%:include(libitm.spec)%(link_itm)}\
Index: gcc-4.9-20140316/gcc/incpath.c
===================================================================
--- gcc-4.9-20140316.orig/gcc/incpath.c
+++ gcc-4.9-20140316/gcc/incpath.c
@@ -28,6 +28,7 @@
......@@ -188,3 +150,27 @@ Index: gcc-4.9-20140316/gcc/incpath.c
}
/* Use given -I paths for #include "..." but not #include <...>, and
--- a/gcc/doc/gcc.info
+++ b/gcc/doc/gcc.info
@@ -558,6 +558,7 @@ _Warning Options_
-Woverlength-strings -Wpacked -Wpacked-bitfield-compat -Wpadded
-Wparentheses -Wpedantic-ms-format -Wno-pedantic-ms-format
-Wpointer-arith -Wno-pointer-to-int-cast
+ -Wno-poison-system-directories
-Wredundant-decls -Wno-return-local-addr
-Wreturn-type -Wsequence-point -Wshadow
-Wsign-compare -Wsign-conversion -Wfloat-conversion
@@ -4010,6 +4011,13 @@ compiler warns that an unrecognized option is present.
pragmas in system headers--for that, '-Wunknown-pragmas' must also
be used.
+'-Wno-poison-system-directories'
+ Do not warn for @option{-I} or @option{-L} options using system
+ directories such as @file{/usr/include} when cross compiling. This
+ option is intended for use in chroot environments when such
+ directories contain the correct headers and libraries for the target
+ system rather than the host.
+
'-Wtrampolines'
Warn about trampolines generated for pointers to nested functions.
This diff is collapsed.
https://gcc.gnu.org/PR65780
2015-04-22 Jakub Jelinek <jakub@redhat.com>
PR target/65780
* config/s390/linux.h (TARGET_BINDS_LOCAL_P): Define to
default_binds_local_p_2.
* config/arm/linux-elf.h (TARGET_BINDS_LOCAL_P): Likewise.
* config/aarch64/aarch64-linux.h (TARGET_BINDS_LOCAL_P): Likewise.
--- a/gcc/config/s390/linux.h.jj 2015-01-05 13:07:16.000000000 +0100
+++ b/gcc/config/s390/linux.h 2015-04-22 17:39:38.880273650 +0200
@@ -90,4 +90,10 @@ along with GCC; see the file COPYING3.
#undef TARGET_LIBC_HAS_FUNCTION
#define TARGET_LIBC_HAS_FUNCTION gnu_libc_has_function
+/* Uninitialized common symbols in non-PIE executables, even with
+ strong definitions in dependent shared libraries, will resolve
+ to COPY relocated symbol in the executable. See PR65780. */
+#undef TARGET_BINDS_LOCAL_P
+#define TARGET_BINDS_LOCAL_P default_binds_local_p_2
+
#endif
--- a/gcc/config/arm/linux-elf.h.jj 2015-01-05 13:07:16.000000000 +0100
+++ b/gcc/config/arm/linux-elf.h 2015-04-22 17:42:35.979420149 +0200
@@ -118,3 +118,9 @@
/* Add .note.GNU-stack. */
#undef NEED_INDICATE_EXEC_STACK
#define NEED_INDICATE_EXEC_STACK 1
+
+/* Uninitialized common symbols in non-PIE executables, even with
+ strong definitions in dependent shared libraries, will resolve
+ to COPY relocated symbol in the executable. See PR65780. */
+#undef TARGET_BINDS_LOCAL_P
+#define TARGET_BINDS_LOCAL_P default_binds_local_p_2
--- a/gcc/config/aarch64/aarch64-linux.h.jj 2015-01-05 13:07:17.000000000 +0100
+++ b/gcc/config/aarch64/aarch64-linux.h 2015-04-22 17:40:46.395185820 +0200
@@ -69,4 +69,10 @@
#define TARGET_ASM_FILE_END file_end_indicate_exec_stack
+/* Uninitialized common symbols in non-PIE executables, even with
+ strong definitions in dependent shared libraries, will resolve
+ to COPY relocated symbol in the executable. See PR65780. */
+#undef TARGET_BINDS_LOCAL_P
+#define TARGET_BINDS_LOCAL_P default_binds_local_p_2
+
#endif /* GCC_AARCH64_LINUX_H */
libatomic build failure if configured with --disable-dependency-tracking
load_n.c:115:1: fatal error: opening dependency file .deps/load_1_.lo.Ppo: No such file or directory
https://bugs.gentoo.org/463463
http://gcc.gnu.org/PR55930
--- a/libatomic/Makefile.in
+++ b/libatomic/Makefile.in
@@ -298,7 +298,8 @@ PAT_N = $(word 2,$(PAT_SPLIT))
PAT_S = $(word 3,$(PAT_SPLIT))
IFUNC_DEF = -DIFUNC_ALT=$(PAT_S)
IFUNC_OPT = $(word $(PAT_S),$(IFUNC_OPTIONS))
-M_DEPS = -MT $@ -MD -MP -MF $(DEPDIR)/$(@F).Ppo
+@AMDEP_TRUE@M_DEPS = -MT $@ -MD -MP -MF $(DEPDIR)/$(@F).Ppo
+@AMDEP_FALSE@M_DEPS =
M_SIZE = -DN=$(PAT_N)
M_IFUNC = $(if $(PAT_S),$(IFUNC_DEF) $(IFUNC_OPT))
M_FILE = $(PAT_BASE)_n.c
2012-01-17 Magnus Granberg <zorry@gentoo.org>
2014-01-05 Magnus Granberg <zorry@gentoo.org>
* gcc/Makefile.in Add -fno-PIE. to ALL_CFLAGS and
ALL_CXXFLAGS if enable_esp yes.
......@@ -6,6 +6,7 @@
* libgcc/Makefile.in Add crtbeginP.o to EXTRA_PARTS if enable_crtbeginP yes
We add new file crtbeginP.o if enable_crtbeginP yes
Add -fno-PIE. to CRTSTUFF_CFLAGS.
Disable -fstack-check
--- a/gcc/Makefile.in 2011-11-09 02:20:14.000000000 +0100
+++ b/gcc/Makefile.in 2011-12-24 22:28:08.864804375 +0100
......@@ -70,15 +71,24 @@
# Options to use when compiling libgcc2.a.
#
LIBGCC2_DEBUG_CFLAGS = -g
@@ -279,7 +290,7 @@ INTERNAL_CFLAGS = $(CFLAGS) $(LIBGCC2_CF
CRTSTUFF_CFLAGS = -O2 $(GCC_CFLAGS) $(INCLUDES) $(MULTILIB_CFLAGS) -g0 \
@@ -225,7 +225,7 @@ endif
LIBGCC2_DEBUG_CFLAGS = -g
LIBGCC2_CFLAGS = -O2 $(LIBGCC2_INCLUDES) $(GCC_CFLAGS) $(HOST_LIBGCC2_CFLAGS) \
$(LIBGCC2_DEBUG_CFLAGS) -DIN_LIBGCC2 \
- -fbuilding-libgcc -fno-stack-protector \
+ -fbuilding-libgcc -fno-stack-protector -fstack-check=no \
$(INHIBIT_LIBC_CFLAGS)
# Additional options to use when compiling libgcc2.a.
@@ -298,7 +298,7 @@ CRTSTUFF_CFLAGS = -O2 $(GCC_CFLAGS) $(IN
-finhibit-size-directive -fno-inline -fno-exceptions \
-fno-zero-initialized-in-bss -fno-toplevel-reorder -fno-tree-vectorize \
- -fno-stack-protector \
+ -fno-stack-protector $(ESP_NOPIE_CFLAGS) \
$(INHIBIT_LIBC_CFLAGS)
-fbuilding-libgcc -fno-stack-protector $(FORCE_EXPLICIT_EH_REGISTRY) \
- $(INHIBIT_LIBC_CFLAGS)
+ -fstack-check=no $(ESP_NOPIE_CFLAGS) $(INHIBIT_LIBC_CFLAGS)
# Extra flags to use when compiling crt{begin,end}.o.
CRTSTUFF_T_CFLAGS =
@@ -966,6 +977,13 @@ crtendS$(objext): $(srcdir)/crtstuff.c
# This is a version of crtbegin for -static links.
crtbeginT$(objext): $(srcdir)/crtstuff.c
......
......@@ -3,14 +3,12 @@
* gcc/config/arm/arm.h (DRIVER_SELF_SPECS): Add ESP_DRIVER_SELF_SPEC.
* gcc/config/arm/elf.h (SUBSUBTARGET_EXTRA_SPECS): Add ESP_EXTRA_SPECS.
--- a/gcc/config/arm/arm.h 2013-01-15 17:17:28.000000000 +0100
+++ b/gcc/config/arm/arm.h 2013-02-18 22:45:18.327284928 +0100
@@ -2326,6 +2326,11 @@ extern const char *host_detect_local_cpu
# define MCPU_MTUNE_NATIVE_SPECS ""
--- a/gcc/config/arm/arm.h 2015-06-02 08:42:53.724969452 +0000
+++ b/gcc/config/arm/arm.h 2015-06-02 08:46:26.515546804 +0000
@@ -2411,6 +2411,13 @@ extern const char *host_detect_local_cpu
# define EXTRA_SPEC_FUNCTIONS BIG_LITTLE_CPU_SPEC_FUNCTIONS
#endif
-#define DRIVER_SELF_SPECS MCPU_MTUNE_NATIVE_SPECS
-
+#ifdef ENABLE_ESP
+# define DRIVER_SELF_SPECS \
+ MCPU_MTUNE_NATIVE_SPECS, \
......@@ -18,6 +16,8 @@
+#else
+# define DRIVER_SELF_SPECS MCPU_MTUNE_NATIVE_SPECS
+#endif
#define DRIVER_SELF_SPECS MCPU_MTUNE_NATIVE_SPECS
#define TARGET_SUPPORTS_WIDE_INT 1
#endif /* ! GCC_ARM_H */
--- a/gcc/config/arm/elf.h 2013-01-10 21:38:27.000000000 +0100
+++ b/gcc/config/arm/elf.h 2013-05-19 02:15:49.595855825 +0200
......
libgfortran does not respect --disable-werror
https://bugs.gentoo.org/433435
http://gcc.gnu.org/PR54724
--- a/libgfortran/configure
+++ b/libgfortran/configure
@@ -5764,7 +5764,7 @@ fi
# Add -Wall -fno-repack-arrays -fno-underscoring if we are using GCC.
if test "x$GCC" = "xyes"; then
- AM_FCFLAGS="-I . -Wall -Werror -fimplicit-none -fno-repack-arrays -fno-underscoring"
+ AM_FCFLAGS="-I . -Wall -fimplicit-none -fno-repack-arrays -fno-underscoring"
## We like to use C99 routines when available. This makes sure that
## __STDC_VERSION__ is set such that libc includes make them available.
AM_CFLAGS="-std=gnu99 -Wall -Wstrict-prototypes -Wmissing-prototypes -Wold-style-definition -Wextra -Wwrite-strings"
libgomp does not respect --disable-werror
https://bugs.gentoo.org/229059
http://gcc.gnu.org/PR38436
--- a/libgomp/configure
+++ b/libgomp/configure
@@ -4282,7 +4282,7 @@ save_CFLAGS="$CFLAGS"
# Add -Wall -Werror if we are using GCC.
if test "x$GCC" = "xyes"; then
- XCFLAGS="$XCFLAGS -Wall -Werror"
+ XCFLAGS="$XCFLAGS -Wall"
fi
# Find other programs we need.
diff --git a/libitm/config/arm/hwcap.cc b/libitm/config/arm/hwcap.cc
index a1c2cfd..ea8f023 100644
--- a/libitm/config/arm/hwcap.cc
+++ b/libitm/config/arm/hwcap.cc
@@ -40,7 +40,7 @@ int GTM_hwcap HIDDEN = 0
#ifdef __linux__
#include <unistd.h>
-#include <sys/fcntl.h>
+#include <fcntl.h>
#include <elf.h>
static void __attribute__((constructor))
diff --git a/libitm/config/linux/x86/tls.h b/libitm/config/linux/x86/tls.h
index e731ab7..54ad8b6 100644
--- a/libitm/config/linux/x86/tls.h
+++ b/libitm/config/linux/x86/tls.h
@@ -25,16 +25,19 @@
#ifndef LIBITM_X86_TLS_H
#define LIBITM_X86_TLS_H 1
-#if defined(__GLIBC_PREREQ) && __GLIBC_PREREQ(2, 10)
+#if defined(__GLIBC_PREREQ)
+#if __GLIBC_PREREQ(2, 10)
/* Use slots in the TCB head rather than __thread lookups.
GLIBC has reserved words 10 through 13 for TM. */
#define HAVE_ARCH_GTM_THREAD 1
#define HAVE_ARCH_GTM_THREAD_DISP 1
#endif
+#endif
#include "config/generic/tls.h"
-#if defined(__GLIBC_PREREQ) && __GLIBC_PREREQ(2, 10)
+#if defined(__GLIBC_PREREQ)
+#if __GLIBC_PREREQ(2, 10)
namespace GTM HIDDEN {
#ifdef __x86_64__
@@ -101,5 +104,6 @@ static inline void set_abi_disp(struct abi_dispatch *x)
} // namespace GTM
#endif /* >= GLIBC 2.10 */
+#endif
#endif // LIBITM_X86_TLS_H
diff --git a/gcc/config/arm/linux-eabi.h b/gcc/config/arm/linux-eabi.h
index e9d65dc..f12e6bd 100644
--- a/gcc/config/arm/linux-eabi.h
+++ b/gcc/config/arm/linux-eabi.h
@@ -77,6 +77,23 @@
%{mfloat-abi=soft*:" GLIBC_DYNAMIC_LINKER_SOFT_FLOAT "} \
%{!mfloat-abi=*:" GLIBC_DYNAMIC_LINKER_DEFAULT "}"
+/* For ARM musl currently supports four dynamic linkers:
+ - ld-musl-arm.so.1 - for the EABI-derived soft-float ABI
+ - ld-musl-armhf.so.1 - for the EABI-derived hard-float ABI
+ - ld-musl-armeb.so.1 - for the EABI-derived soft-float ABI, EB
+ - ld-musl-armebhf.so.1 - for the EABI-derived hard-float ABI, EB
+ musl does not support the legacy OABI mode.
+ All the dynamic linkers live in /lib.
+ We default to soft-float, EL. */
+#undef MUSL_DYNAMIC_LINKER
+#if TARGET_BIG_ENDIAN_DEFAULT
+#define MUSL_DYNAMIC_LINKER_E "%{mlittle-endian:;:eb}"
+#else
+#define MUSL_DYNAMIC_LINKER_E "%{mbig-endian:eb}"
+#endif
+#define MUSL_DYNAMIC_LINKER \
+ "/lib/ld-musl-arm" MUSL_DYNAMIC_LINKER_E "%{mfloat-abi=hard:hf}.so.1"
+
/* 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
diff --git a/gcc/config/i386/linux.h b/gcc/config/i386/linux.h
index a100963..385aefd 100644
--- a/gcc/config/i386/linux.h
+++ b/gcc/config/i386/linux.h
@@ -21,3 +21,6 @@ along with GCC; see the file COPYING3. If not see
#define GNU_USER_LINK_EMULATION "elf_i386"
#define GLIBC_DYNAMIC_LINKER "/lib/ld-linux.so.2"
+
+#undef MUSL_DYNAMIC_LINKER
+#define MUSL_DYNAMIC_LINKER "/lib/ld-musl-i386.so.1"
diff --git a/gcc/config/i386/linux64.h b/gcc/config/i386/linux64.h
index a27d3be..e300480 100644
--- a/gcc/config/i386/linux64.h
+++ b/gcc/config/i386/linux64.h
@@ -30,3 +30,10 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
#define GLIBC_DYNAMIC_LINKER32 "/lib/ld-linux.so.2"
#define GLIBC_DYNAMIC_LINKER64 "/lib64/ld-linux-x86-64.so.2"
#define GLIBC_DYNAMIC_LINKERX32 "/libx32/ld-linux-x32.so.2"
+
+#undef MUSL_DYNAMIC_LINKER32
+#define MUSL_DYNAMIC_LINKER32 "/lib/ld-musl-i386.so.1"
+#undef MUSL_DYNAMIC_LINKER64
+#define MUSL_DYNAMIC_LINKER64 "/lib/ld-musl-x86_64.so.1"
+#undef MUSL_DYNAMIC_LINKERX32
+#define MUSL_DYNAMIC_LINKERX32 "/lib/ld-musl-x32.so.1"
diff --git a/fixincludes/mkfixinc.sh b/fixincludes/mkfixinc.sh
index 6653fed..0d96c8c 100755
--- a/fixincludes/mkfixinc.sh
+++ b/fixincludes/mkfixinc.sh
@@ -19,7 +19,8 @@ case $machine in
powerpc-*-eabi* | \
powerpc-*-rtems* | \
powerpcle-*-eabisim* | \
- powerpcle-*-eabi* )