Browse Source

gcc: implemented gcc with alpine linux style.

toolchain-update
Nagy Károly Gábriel 9 years ago
parent
commit
c56132ad68
40 changed files with 2783 additions and 342 deletions
  1. +172
    -0
      base/gcc/01_all_gcc49_configure.patch
  2. +48
    -0
      base/gcc/02_all_gcc48_config.in.patch
  3. +112
    -0
      base/gcc/03_all_gcc49_Makefile.in.patch
  4. +41
    -0
      base/gcc/05_all_gcc48_gcc.c.patch
  5. +47
    -0
      base/gcc/10_all_default-fortify-source.patch
  6. +40
    -0
      base/gcc/12_all_default-warn-trampolines.patch
  7. +33
    -0
      base/gcc/15_all_libgfortran-Werror.patch
  8. +32
    -0
      base/gcc/16_all_gcc47_nopie_option.patch
  9. +33
    -0
      base/gcc/16_all_libgomp-Werror.patch
  10. +56
    -0
      base/gcc/20_all_gcc49_config_crtbeginp.patch
  11. +60
    -0
      base/gcc/24_all_gcc49_invoke.texi.patch
  12. +72
    -0
      base/gcc/34_all_gcc48_config_i386.patch
  13. +51
    -0
      base/gcc/35_all_gcc48_config_arm.patch
  14. +151
    -0
      base/gcc/40_all_gcc49_config_esp.patch
  15. +83
    -0
      base/gcc/41_all_gcc49_config_esp_alpine.patch
  16. +44
    -0
      base/gcc/48_all_x86_pr53113_libitm-avx.patch
  17. +34
    -0
      base/gcc/50_all_libiberty-asprintf.patch
  18. +26
    -0
      base/gcc/51_all_libiberty-pic.patch
  19. +206
    -0
      base/gcc/67_all_gcc-poison-system-directories.patch
  20. +60
    -0
      base/gcc/ada-fixes.patch
  21. +82
    -0
      base/gcc/ada-no-pie.patch
  22. +46
    -0
      base/gcc/ada-shared.patch
  23. +27
    -0
      base/gcc/boehm-gc-uclibc.patch
  24. +41
    -0
      base/gcc/gcc-4.6-pr32219.patch
  25. +0
    -109
      base/gcc/gcc-4.7-HAVE_SYS_SDT_H-cross-compile.patch
  26. +320
    -0
      base/gcc/gcc-ice-hack.patch
  27. +27
    -0
      base/gcc/gcc-pure64.patch
  28. +58
    -0
      base/gcc/gcc-spec-env.patch
  29. +9
    -3
      base/gcc/gcc.conf
  30. +494
    -0
      base/gcc/gcc49-cloog-dl.patch
  31. +0
    -106
      base/gcc/gcc49-pr38757.patch
  32. +55
    -0
      base/gcc/libgcc-always-build-gcceh.a.patch
  33. +0
    -34
      base/gcc/no-fixincludes.patch
  34. +0
    -86
      base/gcc/no-include-fixed-dir.patch
  35. +5
    -4
      base/gcc/no-libstdc++.patch.toolchain
  36. +33
    -0
      base/gcc/pr63740.patch
  37. +99
    -0
      base/gcc/pr64037.patch
  38. +16
    -0
      base/musl/pkg/gcc/01_gcc-4.9-musl.patch
  39. +27
    -0
      base/musl/pkg/gcc/gcc-4.9-musl-fortify.patch
  40. +43
    -0
      base/musl/pkg/gcc/musl-posix_memalign-c++.patch

+ 172
- 0
base/gcc/01_all_gcc49_configure.patch

@ -0,0 +1,172 @@
# --- SDE-COPYRIGHT-NOTE-BEGIN ---
# This copyright note is auto-generated by ./scripts/Create-CopyPatch.
#
# Filename: package/.../gcc/01_all_gcc49_configure.patch
# Copyright (C) 2015 The OpenSDE Project
#
# More information can be found in the files COPYING and README.
#
# This patch file is dual-licensed. It is available under the license the
# patched project is licensed under, as long as it is an OpenSource license
# as defined at http://www.opensource.org/ (e.g. BSD, X11) or under the terms
# of the GNU General Public License as published by the Free Software
# Foundation; either version 2 of the License, or (at your option) any later
# version.
# --- SDE-COPYRIGHT-NOTE-END ---
2013-12-30 Magnus Granberg <zorry@gentoo.org>
* gcc/configure.ac Add --enable-esp and define ENABLE_ESP.
Check if we support crtbeginP and define ENABLE_CRTBEGINP.
* gcc/configure Regenerated
--- a/gcc/configure.ac 2011-11-18 11:52:32.000000000 +0100
+++ b/gcc/configure.ac 2012-10-02 17:39:15.649526241 +0200
@@ -5130,6 +5237,55 @@ if test x"${LINKER_HASH_STYLE}" != x; th
[The linker hash style])
fi
+# --------------
+# Esp checks
+# --------------
+
+# Check whether --enable-esp was given and target have the support.
+AC_ARG_ENABLE([esp],
+[AS_HELP_STRING([--enable-esp],
+ [Enable Stack protector and Position independent executable as
+ default if we have suppot for it when compiling
+ and link with -z now as default.
+ Linux targets supported i*86, x86_64, x32,
+ powerpc, powerpc64, ia64, arm and mips.])],
+ enable_esp=$enableval,
+ enable_esp=no)
+if test $enable_esp = yes ; then
+ AC_MSG_CHECKING(if $target support esp)
+ case "$target" in
+ i?86*-*-linux* | x86_64-*-linux* | powerpc*-*-linux* | mips-*-linux* | arm*-*-linux* | ia64-*-linux*)
+ enable_esp=yes
+ AC_DEFINE(ENABLE_ESP, 1,
+ [Define if your target support esp and you have enable it.])
+ ;;
+ *)
+ enable_esp=no
+ ;;
+ esac
+AC_MSG_RESULT($enable_esp)
+fi
+AC_SUBST([enable_esp])
+if test $enable_esp = yes ; then
+ AC_MSG_CHECKING(checking for crtbeginP.o support)
+ if test x$enable_esp = xyes ; then
+ case "$target" in
+ ia64*-*-linux*)
+ enable_crtbeginP=no ;;
+ *-*-linux*)
+ if test x$gcc_cv_ld_pie = xyes && test x$lt_cv_prog_compiler_static_works = xyes; then
+ enable_crtbeginP=yes
+ AC_DEFINE(ENABLE_CRTBEGINP, 1,
+ [Define if your compiler will support crtbeginP.])
+ fi
+ ;;
+ *) enable_crtbeginP=no ;;
+ esac
+ fi
+ AC_MSG_RESULT($enable_crtbeginP)
+fi
+AC_SUBST([enable_crtbeginP])
+
# Configure the subdirectories
# AC_CONFIG_SUBDIRS($subdirs)
--- a/gcc/configure 2013-02-01 21:26:24.000000000 +0100
+++ b/gcc/configure 2013-02-12 01:59:20.000000000 +0100
@@ -600,6 +600,8 @@
ac_subst_vars='LTLIBOBJS
LIBOBJS
PICFLAG
+enable_crtbeginP
+enable_esp
enable_host_shared
enable_plugin
pluginlibs
@@ -920,6 +922,7 @@
enable_plugin
enable_libquadmath_support
with_linker_hash_style
+enable_esp
'
ac_precious_vars='build_alias
host_alias
@@ -1633,6 +1636,11 @@
--enable-plugin enable plugin support
--disable-libquadmath-support
disable libquadmath support for Fortran
+ --enable-esp Enable Stack protector and Position independent
+ executable as default if we have suppot for it when
+ compiling and link with -z now as default.
+ Linux targets supported i*86, x86_64, x32,
+ powerpc, powerpc64, ia64, arm and mips.
Optional Packages:
--with-PACKAGE[=ARG] use PACKAGE [ARG=yes]
@@ -27419,6 +27427,59 @@
fi
+# --------------
+# Esp checks
+# --------------
+
+# Check whether --enable-esp was given and target have the support.
+# Check whether --enable-esp was given.
+if test "${enable_esp+set}" = set; then :
+ enableval=$enable_esp; enable_esp=$enableval
+else
+ enable_esp=no
+fi
+
+if test $enable_esp = yes ; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $target support esp" >&5
+$as_echo_n "checking if $target support esp... " >&6; }
+ case "$target" in
+ i?86*-*-linux* | x86_64-*-linux* | powerpc*-*-linux* | mips*-*-linux* | arm*-*-linux* | ia64-*-linux*)
+ enable_esp=yes
+
+$as_echo "#define ENABLE_ESP 1" >>confdefs.h
+
+ ;;
+ *)
+ enable_esp=no
+ ;;
+ esac
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_esp" >&5
+$as_echo "$enable_esp" >&6; }
+fi
+
+if test $enable_esp = yes ; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking checking for crtbeginP.o support" >&5
+$as_echo_n "checking checking for crtbeginP.o support... " >&6; }
+ if test x$enable_esp = xyes ; then
+ case "$target" in
+ ia64*-*-linux*)
+ enable_crtbeginP=no ;;
+ *-*-linux*)
+ if test x$gcc_cv_ld_pie = xyes && test x$lt_cv_prog_compiler_static_works = xyes; then
+ enable_crtbeginP=yes
+
+$as_echo "#define ENABLE_CRTBEGINP 1" >>confdefs.h
+
+ fi
+ ;;
+ *) enable_crtbeginP=no ;;
+ esac
+ fi
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_crtbeginP" >&5
+$as_echo "$enable_crtbeginP" >&6; }
+fi
+
+
# Configure the subdirectories
# AC_CONFIG_SUBDIRS($subdirs)

+ 48
- 0
base/gcc/02_all_gcc48_config.in.patch

@ -0,0 +1,48 @@
# --- SDE-COPYRIGHT-NOTE-BEGIN ---
# This copyright note is auto-generated by ./scripts/Create-CopyPatch.
#
# Filename: package/.../gcc/02_all_gcc48_config.in.patch
# Copyright (C) 2015 The OpenSDE Project
#
# More information can be found in the files COPYING and README.
#
# This patch file is dual-licensed. It is available under the license the
# patched project is licensed under, as long as it is an OpenSource license
# as defined at http://www.opensource.org/ (e.g. BSD, X11) or under the terms
# of the GNU General Public License as published by the Free Software
# Foundation; either version 2 of the License, or (at your option) any later
# version.
# --- SDE-COPYRIGHT-NOTE-END ---
2013-02-13 Magnus Granberg <zorry@gentoo.org>
* gcc/config.in Add ENABLE_CRTBEGINP, ENABLE_ESP
--- ./gcc/config.in 2009-04-21 11:08:08.000000000 +0200
+++ ./gcc/config.in 2009-05-12 00:10:08.000000000 +0200
@@ -46,6 +46,12 @@
#endif
+/* Define to 1 to enable crtbeginP.o. */
+#ifndef USED_FOR_TARGET
+#undef ENABLE_CRTBEGINP
+#endif
+
+
/* Define to 1 to specify that we are using the BID decimal floating point
format instead of DPD */
#ifndef USED_FOR_TARGET
@@ -65,6 +65,12 @@
#endif
+/* Define to 1 to enable esp. */
+#ifndef USED_FOR_TARGET
+#undef ENABLE_ESP
+#endif
+
+
/* Define to 1 to enable fixed-point arithmetic extension to C. */
#ifndef USED_FOR_TARGET
#undef ENABLE_FIXED_POINT

+ 112
- 0
base/gcc/03_all_gcc49_Makefile.in.patch

@ -0,0 +1,112 @@
# --- SDE-COPYRIGHT-NOTE-BEGIN ---
# This copyright note is auto-generated by ./scripts/Create-CopyPatch.
#
# Filename: package/.../gcc/03_all_gcc49_Makefile.in.patch
# Copyright (C) 2015 The OpenSDE Project
#
# More information can be found in the files COPYING and README.
#
# This patch file is dual-licensed. It is available under the license the
# patched project is licensed under, as long as it is an OpenSource license
# as defined at http://www.opensource.org/ (e.g. BSD, X11) or under the terms
# of the GNU General Public License as published by the Free Software
# Foundation; either version 2 of the License, or (at your option) any later
# version.
# --- SDE-COPYRIGHT-NOTE-END ---
2012-01-17 Magnus Granberg <zorry@gentoo.org>
* gcc/Makefile.in Add -fno-PIE. to ALL_CFLAGS and
ALL_CXXFLAGS if enable_esp yes.
Echo enable_esp and enable_crtbeginP to tmp-libgcc.mvars.
* 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.
--- a/gcc/Makefile.in 2011-11-09 02:20:14.000000000 +0100
+++ b/gcc/Makefile.in 2011-12-24 22:28:08.864804375 +0100
@@ -247,6 +247,14 @@ LINKER_FLAGS = $(CFLAGS)
endif
endif
+# We don't want to compile the compiler with -fPIE, it make PCH fail.
+enable_esp = @enable_esp@
+ifeq ($(enable_esp),yes)
+ESP_NOPIE_CFLAGS = -fno-PIE
+else
+ESP_NOPIE_CFLAGS=
+endif
+
# -------------------------------------------
# Programs which operate on the build machine
# -------------------------------------------
@@ -974,12 +982,13 @@ INTERNAL_CFLAGS = -DIN_GCC @CROSS@
# This is the variable actually used when we compile. If you change this,
# you probably want to update BUILD_CFLAGS in configure.ac
-ALL_CFLAGS = $(T_CFLAGS) $(CFLAGS-$@) \
+ALL_CFLAGS = $(ESP_NOPIE_CFLAGS) $(T_CFLAGS) $(CFLAGS-$@) \
$(CFLAGS) $(INTERNAL_CFLAGS) $(COVERAGE_FLAGS) $(WARN_CFLAGS) @DEFS@
# The C++ version.
-ALL_CXXFLAGS = $(T_CFLAGS) $(CFLAGS-$@) $(CXXFLAGS) $(INTERNAL_CFLAGS) \
- $(COVERAGE_FLAGS) $(NOEXCEPTION_FLAGS) $(WARN_CXXFLAGS) @DEFS@
+ALL_CXXFLAGS = $(ESP_NOPIE_CFLAGS) $(T_CFLAGS) $(CFLAGS-$@) $(CXXFLAGS) \
+ $(INTERNAL_CFLAGS) $(COVERAGE_FLAGS) $(NOEXCEPTION_FLAGS) \
+ $(WARN_CXXFLAGS) @DEFS@
# Likewise. Put INCLUDES at the beginning: this way, if some autoconf macro
# puts -I options in CPPFLAGS, our include files in the srcdir will always
@@ -1814,6 +1823,8 @@ libgcc.mvars: config.status Makefile spe
echo GCC_CFLAGS = '$(GCC_CFLAGS)' >> tmp-libgcc.mvars
echo INHIBIT_LIBC_CFLAGS = '$(INHIBIT_LIBC_CFLAGS)' >> tmp-libgcc.mvars
echo TARGET_SYSTEM_ROOT = '$(TARGET_SYSTEM_ROOT)' >> tmp-libgcc.mvars
+ echo enable_esp = '$(enable_esp)' >> tmp-libgcc.mvars
+ echo enable_crtbeginP = '@enable_crtbeginP@' >> tmp-libgcc.mvars
mv tmp-libgcc.mvars libgcc.mvars
--- a/libgcc/Makefile.in 2011-11-22 04:01:02.000000000 +0100
+++ b/libgcc/Makefile.in 2011-12-25 15:18:22.449610631 +0100
@@ -219,6 +219,17 @@ else
DECNUMINC =
endif
+ifeq ($(enable_esp),yes)
+ESP_NOPIE_CFLAGS = -fno-PIE
+else
+ESP_NOPIE_CFLAGS=
+endif
+
+# We add crtbeginP.o to the EXTRA_PARTS list if enable_crtbeginP = yes
+ifeq ($(enable_crtbeginP),yes)
+EXTRA_PARTS += crtbeginP.o
+endif
+
# 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 \
-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)
# Extra flags to use when compiling crt{begin,end}.o.
@@ -966,6 +977,13 @@ crtendS$(objext): $(srcdir)/crtstuff.c
# This is a version of crtbegin for -static links.
crtbeginT$(objext): $(srcdir)/crtstuff.c
$(crt_compile) $(CRTSTUFF_T_CFLAGS) -c $< -DCRT_BEGIN -DCRTSTUFFT_O
+
+# This is a version of crtbegin for -static -fPIE links.
+ifeq ($(enable_crtbeginP),yes)
+crtbeginP$(objext): $(srcdir)/crtstuff.c
+ $(crt_compile) $(CRTSTUFF_T_CFLAGS_S) \
+ -c $< -DCRT_BEGIN -DCRTSTUFFT_O -DCRTSTUFFS_O
+endif
ifeq ($(enable_vtable_verify),yes)
# These are used in vtable verification; see comments in source files for

+ 41
- 0
base/gcc/05_all_gcc48_gcc.c.patch

@ -0,0 +1,41 @@
# --- SDE-COPYRIGHT-NOTE-BEGIN ---
# This copyright note is auto-generated by ./scripts/Create-CopyPatch.
#
# Filename: package/.../gcc/05_all_gcc48_gcc.c.patch
# Copyright (C) 2015 The OpenSDE Project
#
# More information can be found in the files COPYING and README.
#
# This patch file is dual-licensed. It is available under the license the
# patched project is licensed under, as long as it is an OpenSource license
# as defined at http://www.opensource.org/ (e.g. BSD, X11) or under the terms
# of the GNU General Public License as published by the Free Software
# Foundation; either version 2 of the License, or (at your option) any later
# version.
# --- SDE-COPYRIGHT-NOTE-END ---
2013-03-24 Magnus Granberg <zorry@gentoo.org>
* gcc/gcc.c include esp.h
static const char *cc1_spec We set that in esp.h if ENABLE_ESP.
--- ./gcc/gcc.c 2010-01-21 10:29:30.000000000 -0500
+++ ./gcc/gcc.c 2010-01-29 23:29:16.000000000 -0500
@@ -44,6 +44,7 @@
#include "opts.h"
#include "params.h"
#include "vec.h"
+#include "config/esp.h" /* for --enable-esp support */
#include "filenames.h"
/* By default there is no special suffix for target executables. */
@@ -822,7 +823,9 @@
static const char *asm_debug;
static const char *cpp_spec = CPP_SPEC;
+#ifndef ENABLE_ESP
static const char *cc1_spec = CC1_SPEC;
+#endif
static const char *cc1plus_spec = CC1PLUS_SPEC;
static const char *link_gcc_c_sequence_spec = LINK_GCC_C_SEQUENCE_SPEC;
static const char *link_ssp_spec = LINK_SSP_SPEC;

+ 47
- 0
base/gcc/10_all_default-fortify-source.patch

@ -0,0 +1,47 @@
# --- SDE-COPYRIGHT-NOTE-BEGIN ---
# This copyright note is auto-generated by ./scripts/Create-CopyPatch.
#
# Filename: package/.../gcc/10_all_default-fortify-source.patch
# Copyright (C) 2015 The OpenSDE Project
#
# More information can be found in the files COPYING and README.
#
# This patch file is dual-licensed. It is available under the license the
# patched project is licensed under, as long as it is an OpenSource license
# as defined at http://www.opensource.org/ (e.g. BSD, X11) or under the terms
# of the GNU General Public License as published by the Free Software
# Foundation; either version 2 of the License, or (at your option) any later
# version.
# --- SDE-COPYRIGHT-NOTE-END ---
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
@@ -951,6 +951,9 @@ c_cpp_builtins (cpp_reader *pfile)
builtin_define_with_value ("__REGISTER_PREFIX__", REGISTER_PREFIX, 0);
builtin_define_with_value ("__USER_LABEL_PREFIX__", user_label_prefix, 0);
+ /* Fortify Source enabled by default w/optimization. */
+ cpp_define (pfile, "_FORTIFY_SOURCE=((defined __OPTIMIZE__ && __OPTIMIZE__ > 0) ? 2 : 0)");
+
/* Misc. */
if (flag_gnu89_inline)
cpp_define (pfile, "__GNUC_GNU_INLINE__");
--- a/gcc/doc/gcc.info
+++ b/gcc/doc/gcc.info
@@ -6255,6 +6255,11 @@ find out the exact set of optimizations that are enabled at each level.
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
+ compile-time and run-time checks for several libc functions. To disable,
+ specify either `-U_FORTIFY_SOURCE' or `-D_FORTIFY_SOURCE=0'.
+
'-O3'
Optimize yet more. '-O3' turns on all optimizations specified by
'-O2' and also turns on the '-finline-functions',

+ 40
- 0
base/gcc/12_all_default-warn-trampolines.patch

@ -0,0 +1,40 @@
# --- SDE-COPYRIGHT-NOTE-BEGIN ---
# This copyright note is auto-generated by ./scripts/Create-CopyPatch.
#
# Filename: package/.../gcc/12_all_default-warn-trampolines.patch
# Copyright (C) 2015 The OpenSDE Project
#
# More information can be found in the files COPYING and README.
#
# This patch file is dual-licensed. It is available under the license the
# patched project is licensed under, as long as it is an OpenSource license
# as defined at http://www.opensource.org/ (e.g. BSD, X11) or under the terms
# of the GNU General Public License as published by the Free Software
# Foundation; either version 2 of the License, or (at your option) any later
# version.
# --- SDE-COPYRIGHT-NOTE-END ---
Enable -Wtrampolines by default.
--- a/gcc/common.opt
+++ b/gcc/common.opt
@@ -640,7 +640,7 @@ Common Var(warn_system_headers) Warning
Do not suppress warnings from system headers
Wtrampolines
-Common Var(warn_trampolines) Warning
+Common Var(warn_trampolines) Init(1) Warning
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.
+ This warning is enabled by default in Gentoo.
+
@item -Wfloat-equal
@opindex Wfloat-equal
@opindex Wno-float-equal

+ 33
- 0
base/gcc/15_all_libgfortran-Werror.patch

@ -0,0 +1,33 @@
# --- SDE-COPYRIGHT-NOTE-BEGIN ---
# This copyright note is auto-generated by ./scripts/Create-CopyPatch.
#
# Filename: package/.../gcc/15_all_libgfortran-Werror.patch
# Copyright (C) 2015 The OpenSDE Project
#
# More information can be found in the files COPYING and README.
#
# This patch file is dual-licensed. It is available under the license the
# patched project is licensed under, as long as it is an OpenSource license
# as defined at http://www.opensource.org/ (e.g. BSD, X11) or under the terms
# of the GNU General Public License as published by the Free Software
# Foundation; either version 2 of the License, or (at your option) any later
# version.
# --- SDE-COPYRIGHT-NOTE-END ---
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"

+ 32
- 0
base/gcc/16_all_gcc47_nopie_option.patch

@ -0,0 +1,32 @@
# --- SDE-COPYRIGHT-NOTE-BEGIN ---
# This copyright note is auto-generated by ./scripts/Create-CopyPatch.
#
# Filename: package/.../gcc/16_all_gcc47_nopie_option.patch
# Copyright (C) 2015 The OpenSDE Project
#
# More information can be found in the files COPYING and README.
#
# This patch file is dual-licensed. It is available under the license the
# patched project is licensed under, as long as it is an OpenSource license
# as defined at http://www.opensource.org/ (e.g. BSD, X11) or under the terms
# of the GNU General Public License as published by the Free Software
# Foundation; either version 2 of the License, or (at your option) any later
# version.
# --- SDE-COPYRIGHT-NOTE-END ---
2012-01-24 Magnus Granberg <zorry@gentoo.org>
* gcc/common.opt Add -nopie
--- a/gcc/common.opt 2011-11-23 19:51:17.000000000 +0100
+++ b//gcc/common.opt 2012-01-24 16:56:24.302224357 +0100
@@ -2280,6 +2280,9 @@ Driver
nodefaultlibs
Driver
+nopie
+Driver
+
nostartfiles
Driver

+ 33
- 0
base/gcc/16_all_libgomp-Werror.patch

@ -0,0 +1,33 @@
# --- SDE-COPYRIGHT-NOTE-BEGIN ---
# This copyright note is auto-generated by ./scripts/Create-CopyPatch.
#
# Filename: package/.../gcc/16_all_libgomp-Werror.patch
# Copyright (C) 2015 The OpenSDE Project
#
# More information can be found in the files COPYING and README.
#
# This patch file is dual-licensed. It is available under the license the
# patched project is licensed under, as long as it is an OpenSource license
# as defined at http://www.opensource.org/ (e.g. BSD, X11) or under the terms
# of the GNU General Public License as published by the Free Software
# Foundation; either version 2 of the License, or (at your option) any later
# version.
# --- SDE-COPYRIGHT-NOTE-END ---
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.

+ 56
- 0
base/gcc/20_all_gcc49_config_crtbeginp.patch

@ -0,0 +1,56 @@
# --- SDE-COPYRIGHT-NOTE-BEGIN ---
# This copyright note is auto-generated by ./scripts/Create-CopyPatch.
#
# Filename: package/.../gcc/20_all_gcc49_config_crtbeginp.patch
# Copyright (C) 2015 The OpenSDE Project
#
# More information can be found in the files COPYING and README.
#
# This patch file is dual-licensed. It is available under the license the
# patched project is licensed under, as long as it is an OpenSource license
# as defined at http://www.opensource.org/ (e.g. BSD, X11) or under the terms
# of the GNU General Public License as published by the Free Software
# Foundation; either version 2 of the License, or (at your option) any later
# version.
# --- SDE-COPYRIGHT-NOTE-END ---
2014-04-23 Magnus Granberg <zorry@gentoo.org>
* gcc/config/gnu-user.h If ENABLE_CRTBEGINP, -static and -pie use crtbegineP.o.
* gcc/config/rs6000/sysv4.h If ENABLE_CRTBEGINP, -static and -pie use crtbegineP.o.
--- a/gcc/config/gnu-user.h 2014-01-02 23:23:26.000000000 +0100
+++ b/gcc/config/gnu-user.h 2014-04-23 00:55:06.390265454 +0200
@@ -40,7 +40,15 @@ see the files COPYING3 and COPYING.RUNTI
provides part of the support for getting C++ file-scope static
object constructed before entering `main'. */
-#if defined HAVE_LD_PIE
+#if defined (HAVE_LD_PIE) && defined (ENABLE_CRTBEGINP)
+#define GNU_USER_TARGET_STARTFILE_SPEC \
+ "%{!shared: %{pg|p|profile:gcrt1.o%s;pie:Scrt1.o%s;:crt1.o%s}} \
+ crti.o%s %{static:%{pie:crtbeginP.o%s;:crtbeginT.o%s}; \
+ shared|pie:crtbeginS.o%s;:crtbegin.o%s} \
+ %{fvtable-verify=none:%s; \
+ fvtable-verify=preinit:vtv_start_preinit.o%s; \
+ fvtable-verify=std:vtv_start.o%s}"
+#elif defined (HAVE_LD_PIE) && ! defined (ENABLE_CRTBEGINP)
#define GNU_USER_TARGET_STARTFILE_SPEC \
"%{!shared: %{pg|p|profile:gcrt1.o%s;pie:Scrt1.o%s;:crt1.o%s}} \
crti.o%s %{static:crtbeginT.o%s;shared|pie:crtbeginS.o%s;:crtbegin.o%s} \
--- a/gcc/config/rs6000/sysv4.h 2009-04-10 01:23:07.000000000 +0200
+++ b/gcc/config/rs6000/sysv4.h 2009-09-08 04:41:50.000000000 +0200
@@ -883,7 +883,12 @@
%{!mnewlib: %{pthread:-lpthread} %{shared:-lc} \
%{!shared: %{profile:-lc_p} %{!profile:-lc}}}"
-#ifdef HAVE_LD_PIE
+#if defined (HAVE_LD_PIE) && defined (ENABLE_CRTBEGINP)
+#define STARTFILE_LINUX_SPEC "\
+%{!shared: %{pg|p|profile:gcrt1.o%s;pie:Scrt1.o%s;:crt1.o%s}} \
+%{mnewlib:ecrti.o%s;:crti.o%s} \
+%{static:%{pie:crtbeginP.o%s;:crtbeginT.o%s}} %{!static:%{shared|pie:crtbeginS.o%s;:crtbegin.o%s}}"
+#elif defined (HAVE_LD_PIE) && ! defined (ENABLE_CRTBEGINP)
#define STARTFILE_LINUX_SPEC "\
%{!shared: %{pg|p|profile:gcrt1.o%s;pie:Scrt1.o%s;:crt1.o%s}} \
%{mnewlib:ecrti.o%s;:crti.o%s} \

+ 60
- 0
base/gcc/24_all_gcc49_invoke.texi.patch

@ -0,0 +1,60 @@
# --- SDE-COPYRIGHT-NOTE-BEGIN ---
# This copyright note is auto-generated by ./scripts/Create-CopyPatch.
#
# Filename: package/.../gcc/24_all_gcc49_invoke.texi.patch
# Copyright (C) 2015 The OpenSDE Project
#
# More information can be found in the files COPYING and README.
#
# This patch file is dual-licensed. It is available under the license the
# patched project is licensed under, as long as it is an OpenSource license
# as defined at http://www.opensource.org/ (e.g. BSD, X11) or under the terms
# of the GNU General Public License as published by the Free Software
# Foundation; either version 2 of the License, or (at your option) any later
# version.
# --- SDE-COPYRIGHT-NOTE-END ---
2014-04-24 Magnus Granberg <zorry@gentoo.org>
* gcc/doc/invoke.texi Add NOTES about -fstack-protector-all, -pie and
-fPIE/-fpie when --enable-esp is enable, this options is on by default.
--- a/gcc/doc/invoke.texi 2009-04-01 09:18:47.000000000 +0200
+++ b/gcc/doc/invoke.texi 2009-06-18 14:08:38.000000000 +0200
@@ -9233,6 +9245,11 @@ If a guard check fails, an error message
@opindex fstack-protector-all
Like @option{-fstack-protector} except that all functions are protected.
+NOTE: NOTE: When --enable-esp this option is enabled by default
+for C, C++, ObjC, ObjC++, if neither @option{-fno-stack-protector},
+@option{-nostdlib}, @option{-ffreestanding}, @option{-fstack-protector},
+@option{-fstack-protector-strong}or @option{-fstack-protector-all}are found.
+
@item -fstack-protector-strong
@opindex fstack-protector-strong
Like @option{-fstack-protector} but includes additional functions to
@@ -7960,6 +7965,12 @@
that were used to generate code (@option{-fpie}, @option{-fPIE},
or model suboptions) when you specify this option.
+NOTE: When --enable-esp this option is enabled by default
+for C, C++, ObjC, ObjC++, if neither @option{-fno-pie} or @option{-fno-PIE}
+or @option{-fno-pic} or @option{-fno-PIC} or @option{-nostdlib} or
+@option{-nostartfiles} or @option{-shared} or @option{-pg} or @option{-p}
+are found.
+
@item -rdynamic
@opindex rdynamic
Pass the flag @option{-export-dynamic} to the ELF linker, on targets
@@ -15889,6 +15910,11 @@
@code{__pie__} and @code{__PIE__}. The macros have the value 1
for @option{-fpie} and 2 for @option{-fPIE}.
+NOTE: When --enable-esp this option is enabled by default
+for C, C++, ObjC, ObjC++, if neither @option{-fno-pie} or @option{-fno-PIE}
+or @option{-fno-pic} or @option{-fno-PIC} or @option{-nostdlib} or
+@option{-nostartfiles} or @option{-shared} are found.
+
@item -fno-jump-tables
@opindex fno-jump-tables
Do not use jump tables for switch statements even where it would be

+ 72
- 0
base/gcc/34_all_gcc48_config_i386.patch

@ -0,0 +1,72 @@
# --- SDE-COPYRIGHT-NOTE-BEGIN ---
# This copyright note is auto-generated by ./scripts/Create-CopyPatch.
#
# Filename: package/.../gcc/34_all_gcc48_config_i386.patch
# Copyright (C) 2015 The OpenSDE Project
#
# More information can be found in the files COPYING and README.
#
# This patch file is dual-licensed. It is available under the license the
# patched project is licensed under, as long as it is an OpenSource license
# as defined at http://www.opensource.org/ (e.g. BSD, X11) or under the terms
# of the GNU General Public License as published by the Free Software
# Foundation; either version 2 of the License, or (at your option) any later
# version.
# --- SDE-COPYRIGHT-NOTE-END ---
2013-03-24 Magnus Granberg <zorry@gentoo.org>
* gcc/config/i386/gnu-user-common.h (DRIVER_SELF_SPECS): Add ESP_DRIVER_SELF_SPEC.
* gcc/config/i386/gnu-user.h (SUBTARGET_EXTRA_SPECS): Add ESP_EXTRA_SPECS.
* gcc/config/i386/i386.h (SUBTARGET_EXTRA_SPECS): Add ESP_EXTRA_SPECS.
--- a/gcc/config/i386/gnu-user-common.h 2013-01-10 21:38:27.000000000 +0100
+++ b/gcc/config/i386/gnu-user-common.h 2013-02-14 00:51:44.689637605 +0100
@@ -70,3 +70,7 @@ along with GCC; see the file COPYING3.
/* Static stack checking is supported by means of probes. */
#define STACK_CHECK_STATIC_BUILTIN 1
+
+#ifdef ENABLE_ESP
+#define DRIVER_SELF_SPECS ESP_DRIVER_SELF_SPEC
+#endif
--- a/gcc/config/i386/gnu-user.h 2011-05-05 14:32:50.000000000 +0200
+++ b/gcc/config/i386/gnu-user.h 2012-07-09 14:28:38.726289455 +0200
@@ -93,9 +93,16 @@ along with GCC; see the file COPYING3.
"--32 %{!mno-sse2avx:%{mavx:-msse2avx}} %{msse2avx:%{!mavx:-msse2avx}}"
#undef SUBTARGET_EXTRA_SPECS
+#ifdef ENABLE_ESP
#define SUBTARGET_EXTRA_SPECS \
{ "link_emulation", GNU_USER_LINK_EMULATION },\
- { "dynamic_linker", GNU_USER_DYNAMIC_LINKER }
+ { "dynamic_linker", GNU_USER_DYNAMIC_LINKER }, \
+ ESP_EXTRA_SPECS
+#else
+#define SUBTARGET_EXTRA_SPECS \
+ { "link_emulation", GNU_USER_LINK_EMULATION },\
+ { "dynamic_linker", GNU_USER_DYNAMIC_LINKER }
+#endif
#undef LINK_SPEC
#define LINK_SPEC "-m %(link_emulation) %{shared:-shared} \
--- a/gcc/config/i386/i386.h 2011-11-24 23:11:12.000000000 +0100
+++ b/gcc/config/i386/i386.h 2012-07-09 14:21:24.575276517 +0200
@@ -617,13 +617,16 @@ enum target_cpu_default
Do not define this macro if it does not need to do anything. */
#ifndef SUBTARGET_EXTRA_SPECS
+#ifdef ENABLE_ESP
+#define SUBTARGET_EXTRA_SPECS ESP_EXTRA_SPECS
+#else
#define SUBTARGET_EXTRA_SPECS
#endif
+#endif
#define EXTRA_SPECS \
{ "cc1_cpu", CC1_CPU_SPEC }, \
SUBTARGET_EXTRA_SPECS
-
/* Set the value of FLT_EVAL_METHOD in float.h. When using only the
FPU, assume that the fpcw is set to extended precision; when using

+ 51
- 0
base/gcc/35_all_gcc48_config_arm.patch

@ -0,0 +1,51 @@
# --- SDE-COPYRIGHT-NOTE-BEGIN ---
# This copyright note is auto-generated by ./scripts/Create-CopyPatch.
#
# Filename: package/.../gcc/35_all_gcc48_config_arm.patch
# Copyright (C) 2015 The OpenSDE Project
#
# More information can be found in the files COPYING and README.
#
# This patch file is dual-licensed. It is available under the license the
# patched project is licensed under, as long as it is an OpenSource license
# as defined at http://www.opensource.org/ (e.g. BSD, X11) or under the terms
# of the GNU General Public License as published by the Free Software
# Foundation; either version 2 of the License, or (at your option) any later
# version.
# --- SDE-COPYRIGHT-NOTE-END ---
2013-06-03 Magnus Granberg <zorry@gentoo.org>
* 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 ""
#endif
-#define DRIVER_SELF_SPECS MCPU_MTUNE_NATIVE_SPECS
-
+#ifdef ENABLE_ESP
+# define DRIVER_SELF_SPECS \
+ MCPU_MTUNE_NATIVE_SPECS, \
+ ESP_DRIVER_SELF_SPEC
+#else
+# define DRIVER_SELF_SPECS MCPU_MTUNE_NATIVE_SPECS
+#endif
#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
@@ -49,7 +49,11 @@
#endif
#undef SUBSUBTARGET_EXTRA_SPECS
+#ifdef ENABLE_ESP
+#define SUBSUBTARGET_EXTRA_SPECS ESP_EXTRA_SPECS
+#else
#define SUBSUBTARGET_EXTRA_SPECS
+#endif
#ifndef ASM_SPEC
#define ASM_SPEC "\

+ 151
- 0
base/gcc/40_all_gcc49_config_esp.patch

@ -0,0 +1,151 @@
# --- SDE-COPYRIGHT-NOTE-BEGIN ---
# This copyright note is auto-generated by ./scripts/Create-CopyPatch.
#
# Filename: package/.../gcc/40_all_gcc49_config_esp.patch
# Copyright (C) 2015 The OpenSDE Project
#
# More information can be found in the files COPYING and README.
#
# This patch file is dual-licensed. It is available under the license the
# patched project is licensed under, as long as it is an OpenSource license
# as defined at http://www.opensource.org/ (e.g. BSD, X11) or under the terms
# of the GNU General Public License as published by the Free Software
# Foundation; either version 2 of the License, or (at your option) any later
# version.
# --- SDE-COPYRIGHT-NOTE-END ---
2014-05-12 Magnus Granberg <zorry@gentoo.org>
* gcc/esp.h New file to support --enable-esp
Version 20140512.1
--- a/gcc/config/esp.h 2010-04-09 16:14:00.000000000 +0200
+++ b/gcc/config/esp.h 2012-06-23 01:00:31.248348491 +0200
@@ -0,0 +1,127 @@
+/* License terms see GNU GENERAL PUBLIC LICENSE Version 3.
+ * Version 20140512.1
+ * Magnus Granberg (Zorry) <zorry@gentoo.org> */
+#ifndef GCC_ESP_H
+#define GCC_ESP_H
+
+/* This file will add -fstack-protector-all, -fstack-check, -fPIE, -pie and -z now
+ as default if the defines and the spec allow it.
+ Added a hack for gcc-specs-* in toolchain-funcs.eclass and _filter-hardened in flag-o-matic.eclass
+ to support older hardened GCC patches and we don't need to change the code on gcc-specs-* and _filter-hardened.
+ This will add some unsupported upstream commands options as -nopie and -nonow.
+ -D__KERNEL__ is added so we don't have -fPIE, -pie and -fstack-protector-all and -fstack-check when building kernels.
+ ESP_CC1_SPEC is added to CC1_SPEC.
+ ESP_CC1_STRICT_OVERFLOW_SPEC is added so we don't disable the strict-overflow check.
+ ESP_LINK_PIE_CHECK_SPEC check for -pie, -p, -pg, -profile and -static.
+ ENABLE_CRTBEGINP add support for crtbeginP.o, build -static with -fPIE or -fpie.
+*/
+#ifdef ENABLE_ESP
+
+ /* Hack to support gcc-specs-* in toolchain-funcs.eclass and _filter-hardened in flag-o-matic.eclass */
+ #define ESP_CC1_SPEC " %(esp_cc1_ssp) %(esp_cc1_pie) %(esp_cc1_strict_overflow)"
+ #if defined ( EFAULT_SSP ) || defined ( EFAULT_PIE_SSP )
+ #define ESP_CC1_SSP_SPEC "%{!fno-stack-protector: %{!fno-stack-protector-all: %{!fno-stack-check: }}}"
+ #else
+ #define ESP_CC1_SSP_SPEC ""
+ #endif
+ #if defined ( EFAULT_PIE ) || defined ( EFAULT_PIE_SSP )
+ #define ESP_CC1_PIE_SPEC "%{!nopie: }"
+ #else
+ #define ESP_CC1_PIE_SPEC ""
+ #endif
+ #define ESP_CC1_STRICT_OVERFLOW_SPEC "%{!fstrict-overflow:%{!fno-strict-overflow: -fno-strict-overflow}}"
+
+ /* ESP_LINK_SPEC is added to LINK_PIE_SPEC if esp is enable
+ -z now will be added if we don't have -vanilla spec. We do a -pie incompatible check
+ Don't remove the specs in the end */
+ #define ESP_LINK_SPEC "%(esp_link_now) %(esp_link_pie_check) "
+ #define ESP_LINK_NOW_SPEC "%{!nonow:-z now}"
+
+ /* We use ESP_DRIVER_SELF_SPEC to add pie and ssp command-line options. */
+ #define ESP_DRIVER_SELF_SPEC "%{D__KERNEL__:;:%{!nopie:%(esp_options_pie) \
+ %(esp_link_pie)} %(esp_options_ssp) }"
+
+ /* This will add -fstack-protector-all if we don't have -nostdlib -nodefaultlibs -fno-stack-protector -fstack-protector
+ -fstack-protector-all and we have EFAULT_SSP or EFAULT_PIE_SSP defined. */
+ #if defined ( EFAULT_SSP ) || defined ( EFAULT_PIE_SSP )
+ #define ESP_OPTIONS_SSP_SPEC \
+ "%{nostdlib|ffreestanding|fno-stack-protector|fstack-protector| \
+ fstack-protector-all|fstack-protector-strong:;:-fstack-protector-all} \
+ %{fstack-check|fstack-check=*:;: -fstack-check}"
+ #else
+ #define ESP_OPTIONS_SSP_SPEC ""
+ #endif
+
+ /* If EFAULT_PIE or EFAULT_PIE_SSP is defined we will add -fPIE -pie */
+ #if defined ( EFAULT_PIE ) || defined ( EFAULT_PIE_SSP )
+
+ /* This will add -fPIE if we don't have -pie -fpic -fPIC -fpie -fPIE -fno-pic -fno-PIC -fno-pie -fno-PIE -shared -static
+ -nostdlib -nostartfiles. */
+ /* With ENABLE_CRTBEGINP we don't need to check for -static */
+ #ifdef ENABLE_CRTBEGINP
+ #define ESP_OPTIONS_PIE_SPEC \
+ "%{!pie: %{!fpic:%{!fPIC:%{!fpie:%{!fPIE: %{!fno-pic:%{!fno-PIC:%{!fno-pie:%{!fno-PIE: \
+ %{!shared: %{!nostdlib: %{!nostartfiles:-fPIE}} } }}}} }}}} }"
+ #else
+ #define ESP_OPTIONS_PIE_SPEC \
+ "%{!pie: %{!fpic:%{!fPIC:%{!fpie:%{!fPIE: %{!fno-pic:%{!fno-PIC:%{!fno-pie:%{!fno-PIE: \
+ %{!shared: %{!static: %{!nostdlib: %{!nostartfiles:-fPIE}} } }}}} }}}} }}"
+ #endif
+
+ /* This will add -pie if we don't have -pie -A -fno-pic -fno-PIC -fno-pie -fno-PIE -shared -static -r -nostdlib
+ -nostartfiles */
+ /* With ENABLE_CRTBEGINP we don't need to check for -static
+ and we add -pie only to get the start and endfiles. -pie will not go to the linker. */
+ #ifdef ENABLE_CRTBEGINP
+ #define ESP_LINK_PIE_SPEC \
+ "%{!pie:%{!A:%{!fno-pie:%{!fno-PIE:%{!fno-pic:%{!fno-PIC:%{!shared:%{!r: \
+ %{!nostdlib:%{!nostartfiles:-pie}}}}}}}}}}"
+ #else
+ #define ESP_LINK_PIE_SPEC \
+ "%{!pie:%{!A:%{!fno-pie:%{!fno-PIE:%{!fno-pic:%{!fno-PIC:%{!shared:%{!static:%{!r: \
+ %{!nostdlib:%{!nostartfiles:-pie}}}}}}}}}}}"
+ #endif
+
+ /* This will check if -pie is set when (-static) -pg -p -profile. If set it will make gcc print out
+ "-pie and (static)|pg|p|profile are incompatible when linking" */
+ /* With ENABLE_CRTBEGINP we don't need to check for -static */
+ #ifdef ENABLE_CRTBEGINP
+ #define ESP_LINK_PIE_CHECK_SPEC \
+ "%{pie:%{pg|p|profile:%e-pie and -pg|p|profile are incompatible when linking}}"
+ #else
+ #define ESP_LINK_PIE_CHECK_SPEC \
+ "%{pie:%{static|pg|p|profile:%e-pie and -static|pg|p|profile are incompatible when linking}}"
+ #endif
+
+ /* We don't pass -pie to the linker when -static. */
+ #ifdef ENABLE_CRTBEGINP
+ #define LINK_PIE_SPEC "%{!static:%{pie:-pie}} %(esp_link)"
+ #else
+ #define LINK_PIE_SPEC "%{pie:-pie} %(esp_link)"
+ #endif
+
+ #else
+ #define ESP_OPTIONS_PIE_SPEC ""
+ #define ESP_LINK_PIE_CHECK_SPEC ""
+ #define ESP_LINK_PIE_SPEC ""
+ #define LINK_PIE_SPEC "%{pie:-pie} %(esp_link)"
+ #endif
+
+ /* We add extra spec name's to the EXTRA_SPECS list */
+ #define ESP_EXTRA_SPECS \
+ { "esp_cc1", ESP_CC1_SPEC }, \
+ { "esp_cc1_pie", ESP_CC1_PIE_SPEC }, \
+ { "esp_cc1_ssp", ESP_CC1_SSP_SPEC }, \
+ { "esp_cc1_strict_overflow", ESP_CC1_STRICT_OVERFLOW_SPEC }, \
+ { "esp_link", ESP_LINK_SPEC }, \
+ { "esp_link_now", ESP_LINK_NOW_SPEC }, \
+ { "esp_link_pie", ESP_LINK_PIE_SPEC }, \
+ { "esp_link_pie_check", ESP_LINK_PIE_CHECK_SPEC }, \
+ { "esp_driver_self", ESP_DRIVER_SELF_SPEC }, \
+ { "esp_options_pie", ESP_OPTIONS_PIE_SPEC }, \
+ { "esp_options_ssp", ESP_OPTIONS_SSP_SPEC }
+
+ static const char *cc1_spec = CC1_SPEC ESP_CC1_SPEC;
+
+#endif
+#endif /* End GCC_ESP_H */

+ 83
- 0
base/gcc/41_all_gcc49_config_esp_alpine.patch

@ -0,0 +1,83 @@
# --- SDE-COPYRIGHT-NOTE-BEGIN ---
# This copyright note is auto-generated by ./scripts/Create-CopyPatch.
#
# Filename: package/.../gcc/41_all_gcc49_config_esp_alpine.patch
# Copyright (C) 2015 The OpenSDE Project
#
# More information can be found in the files COPYING and README.
#
# This patch file is dual-licensed. It is available under the license the
# patched project is licensed under, as long as it is an OpenSource license
# as defined at http://www.opensource.org/ (e.g. BSD, X11) or under the terms
# of the GNU General Public License as published by the Free Software
# Foundation; either version 2 of the License, or (at your option) any later
# version.
# --- SDE-COPYRIGHT-NOTE-END ---
Apply Alpine Linux specific differences to Gentoo ESP configuration:
- default PIE and SSP by default without additional CFLAGS (to clean up APKBUILD)
- do not enable -fstack-check by default (caused failures in programs that setup
small stack in musl)
- enable -z relro by default
- enable -fstack-protector-strong instead of -fstack-protector-all by default
--- gcc-4.9.2/gcc/config/esp.h 2014-12-10 15:54:19.925060848 +0000
+++ gcc-4.9.2/gcc/config/esp.h 2014-12-10 15:59:16.793850060 +0000
@@ -4,7 +4,7 @@
#ifndef GCC_ESP_H
#define GCC_ESP_H
-/* This file will add -fstack-protector-all, -fstack-check, -fPIE, -pie and -z now
+/* This file will add -fstack-protector-strong, -fPIE, -pie, -z relro and -z now
as default if the defines and the spec allow it.
Added a hack for gcc-specs-* in toolchain-funcs.eclass and _filter-hardened in flag-o-matic.eclass
to support older hardened GCC patches and we don't need to change the code on gcc-specs-* and _filter-hardened.
@@ -16,11 +16,14 @@
ENABLE_CRTBEGINP add support for crtbeginP.o, build -static with -fPIE or -fpie.
*/
#ifdef ENABLE_ESP
+
+ /* Enable by default on Alpine */
+ #define EFAULT_PIE_SSP
/* Hack to support gcc-specs-* in toolchain-funcs.eclass and _filter-hardened in flag-o-matic.eclass */
#define ESP_CC1_SPEC " %(esp_cc1_ssp) %(esp_cc1_pie) %(esp_cc1_strict_overflow)"
#if defined ( EFAULT_SSP ) || defined ( EFAULT_PIE_SSP )
- #define ESP_CC1_SSP_SPEC "%{!fno-stack-protector: %{!fno-stack-protector-all: %{!fno-stack-check: }}}"
+ #define ESP_CC1_SSP_SPEC "%{!fno-stack-protector: %{!fno-stack-protector-all: }}"
#else
#define ESP_CC1_SSP_SPEC ""
#endif
@@ -34,20 +37,20 @@
/* ESP_LINK_SPEC is added to LINK_PIE_SPEC if esp is enable
-z now will be added if we don't have -vanilla spec. We do a -pie incompatible check
Don't remove the specs in the end */
- #define ESP_LINK_SPEC "%(esp_link_now) %(esp_link_pie_check) "
+ #define ESP_LINK_SPEC "%(esp_link_now) %(esp_link_relro) %(esp_link_pie_check) "
#define ESP_LINK_NOW_SPEC "%{!nonow:-z now}"
+ #define ESP_LINK_RELRO_SPEC "%{!norelro:-z relro}"
/* We use ESP_DRIVER_SELF_SPEC to add pie and ssp command-line options. */
#define ESP_DRIVER_SELF_SPEC "%{D__KERNEL__:;:%{!nopie:%(esp_options_pie) \
%(esp_link_pie)} %(esp_options_ssp) }"
- /* This will add -fstack-protector-all if we don't have -nostdlib -nodefaultlibs -fno-stack-protector -fstack-protector
+ /* This will add -fstack-protector-strong if we don't have -nostdlib -nodefaultlibs -fno-stack-protector -fstack-protector
-fstack-protector-all and we have EFAULT_SSP or EFAULT_PIE_SSP defined. */
#if defined ( EFAULT_SSP ) || defined ( EFAULT_PIE_SSP )
#define ESP_OPTIONS_SSP_SPEC \
"%{nostdlib|ffreestanding|fno-stack-protector|fstack-protector| \
- fstack-protector-all|fstack-protector-strong:;:-fstack-protector-all} \
- %{fstack-check|fstack-check=*:;: -fstack-check}"
+ fstack-protector-all|fstack-protector-strong:;:-fstack-protector-strong}"
#else
#define ESP_OPTIONS_SSP_SPEC ""
#endif
@@ -115,6 +118,7 @@
{ "esp_cc1_strict_overflow", ESP_CC1_STRICT_OVERFLOW_SPEC }, \
{ "esp_link", ESP_LINK_SPEC }, \
{ "esp_link_now", ESP_LINK_NOW_SPEC }, \
+ { "esp_link_relro", ESP_LINK_RELRO_SPEC }, \
{ "esp_link_pie", ESP_LINK_PIE_SPEC }, \
{ "esp_link_pie_check", ESP_LINK_PIE_CHECK_SPEC }, \
{ "esp_driver_self", ESP_DRIVER_SELF_SPEC }, \

+ 44
- 0
base/gcc/48_all_x86_pr53113_libitm-avx.patch

@ -0,0 +1,44 @@
# --- SDE-COPYRIGHT-NOTE-BEGIN ---
# This copyright note is auto-generated by ./scripts/Create-CopyPatch.
#
# Filename: package/.../gcc/48_all_x86_pr53113_libitm-avx.patch
# Copyright (C) 2015 The OpenSDE Project
#
# More information can be found in the files COPYING and README.
#
# This patch file is dual-licensed. It is available under the license the
# patched project is licensed under, as long as it is an OpenSource license
# as defined at http://www.opensource.org/ (e.g. BSD, X11) or under the terms
# of the GNU General Public License as published by the Free Software
# Foundation; either version 2 of the License, or (at your option) any later
# version.
# --- SDE-COPYRIGHT-NOTE-END ---
libitm checks for AVX support in the assembler and adds -mavx to x86_avx.cc
which defines the needed typedefs. User CFLAGS can override -mavx however,
so also use the fallback typedef if __AVX__ isn't defined.
https://bugs.gentoo.org/417271
http://gcc.gnu.org/PR53113
--- a/libitm/config/x86/x86_avx.cc
+++ b/libitm/config/x86/x86_avx.cc
@@ -29,7 +29,7 @@
extern "C" {
-#ifndef HAVE_AS_AVX
+#if !defined (HAVE_AS_AVX) || !defined(__AVX__)
// If we don't have an AVX capable assembler, we didn't set -mavx on the
// command-line either, which means that libitm.h defined neither this type
// nor the functions in this file. Define the type and unconditionally
@@ -40,7 +40,7 @@ typedef float _ITM_TYPE_M256 __attribute__((vector_size(32), may_alias));
// Re-define the memcpy implementations so that we can frob the
// interface to deal with possibly missing AVX instruction set support.
-#ifdef HAVE_AS_AVX
+#if defined(HAVE_AS_AVX) && defined(__AVX__)
#define RETURN(X) return X
#define STORE(X,Y) X = Y
#define OUTPUT(T) _ITM_TYPE_##T

+ 34
- 0
base/gcc/50_all_libiberty-asprintf.patch

@ -0,0 +1,34 @@
# --- SDE-COPYRIGHT-NOTE-BEGIN ---
# This copyright note is auto-generated by ./scripts/Create-CopyPatch.
#
# Filename: package/.../gcc/50_all_libiberty-asprintf.patch
# Copyright (C) 2015 The OpenSDE Project
#
# More information can be found in the files COPYING and README.
#
# This patch file is dual-licensed. It is available under the license the
# patched project is licensed under, as long as it is an OpenSource license
# as defined at http://www.opensource.org/ (e.g. BSD, X11) or under the terms
# of the GNU General Public License as published by the Free Software
# Foundation; either version 2 of the License, or (at your option) any later
# version.
# --- SDE-COPYRIGHT-NOTE-END ---
2008-07-25 Magnus Granberg <zorry@ume.nu>
* include/libiberty.h (asprintf): Don't declare if defined as a macro
--- a/include/libiberty.h
+++ b/include/libiberty.h
@@ -609,8 +609,11 @@ extern int pwait (int, int *, int);
/* Like sprintf but provides a pointer to malloc'd storage, which must
be freed by the caller. */
+/* asprintf may be declared as a macro by glibc with __USE_FORTIFY_LEVEL. */
+#ifndef asprintf
extern int asprintf (char **, const char *, ...) ATTRIBUTE_PRINTF_2;
#endif
+#endif
#if !HAVE_DECL_VASPRINTF
/* Like vsprintf but provides a pointer to malloc'd storage, which

+ 26
- 0
base/gcc/51_all_libiberty-pic.patch

@ -0,0 +1,26 @@
# --- SDE-COPYRIGHT-NOTE-BEGIN ---
# This copyright note is auto-generated by ./scripts/Create-CopyPatch.
#
# Filename: package/.../gcc/51_all_libiberty-pic.patch
# Copyright (C) 2015 The OpenSDE Project
#
# More information can be found in the files COPYING and README.
#
# This patch file is dual-licensed. It is available under the license the
# patched project is licensed under, as long as it is an OpenSource license
# as defined at http://www.opensource.org/ (e.g. BSD, X11) or under the terms
# of the GNU General Public License as published by the Free Software
# Foundation; either version 2 of the License, or (at your option) any later
# version.
# --- SDE-COPYRIGHT-NOTE-END ---
--- a/libiberty/Makefile.in
+++ b/libiberty/Makefile.in
@@ -246,6 +246,7 @@ $(TARGETLIB): $(REQUIRED_OFILES) $(EXTRA_OFILES) $(LIBOBJS)
$(AR) $(AR_FLAGS) $(TARGETLIB) \
$(REQUIRED_OFILES) $(EXTRA_OFILES) $(LIBOBJS); \
$(RANLIB) $(TARGETLIB); \
+ cp $(TARGETLIB) ../ ; \
cd ..; \
else true; fi

+ 206
- 0
base/gcc/67_all_gcc-poison-system-directories.patch

@ -0,0 +1,206 @@
# --- SDE-COPYRIGHT-NOTE-BEGIN ---
# This copyright note is auto-generated by ./scripts/Create-CopyPatch.
#
# Filename: package/.../gcc/67_all_gcc-poison-system-directories.patch
# Copyright (C) 2015 The OpenSDE Project
#
# More information can be found in the files COPYING and README.
#
# This patch file is dual-licensed. It is available under the license the
# patched project is licensed under, as long as it is an OpenSource license
# as defined at http://www.opensource.org/ (e.g. BSD, X11) or under the terms
# of the GNU General Public License as published by the Free Software
# Foundation; either version 2 of the License, or (at your option) any later
# version.
# --- SDE-COPYRIGHT-NOTE-END ---
From 160397ef3c3331099af028f1b8d3e085b07d88ad Mon Sep 17 00:00:00 2001
From: Khem Raj <raj.khem@gmail.com>
Date: Fri, 29 Mar 2013 08:59:00 +0400
Subject: [PATCH 16/35] gcc: poison-system-directories
Signed-off-by: Khem Raj <raj.khem@gmail.com>
Upstream-Status: Inappropriate [distribution: codesourcery]
---
gcc/Makefile.in | 2 +-
gcc/common.opt | 4 ++++
gcc/config.in | 6 ++++++
gcc/configure | 20 ++++++++++++++++++--
gcc/configure.ac | 10 ++++++++++
gcc/doc/invoke.texi | 9 +++++++++
gcc/gcc.c | 2 ++
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
Common Var(pedantic) Warning
Issue warnings needed for strict compliance to the standard
+Wpoison-system-directories
+Common Var(flag_poison_system_directories) Init(1) Warning
+Warn for -I and -L options using system directories if cross compiling
+
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
+/* Define to warn for use of native system header directories */
+#ifndef USED_FOR_TARGET
+#undef ENABLE_POISON_SYSTEM_DIRECTORIES
+#endif
+
+
/* 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
===================================================================
--- gcc-4.9-20140316.orig/gcc/configure
+++ gcc-4.9-20140316/gcc/configure
@@ -928,6 +928,7 @@ with_system_zlib
enable_maintainer_mode
enable_link_mutex
enable_version_specific_runtime_libs
+enable_poison_system_directories
enable_plugin
enable_host_shared
enable_libquadmath_support
@@ -1648,6 +1649,8 @@ Optional Features:
--enable-version-specific-runtime-libs
specify that runtime libraries should be installed
in a compiler-specific directory
+ --enable-poison-system-directories
+ warn for use of native system header directories
--enable-plugin enable plugin support
--enable-host-shared build host code as shared libraries
--disable-libquadmath-support
@@ -27702,6 +27705,19 @@ if test "${enable_version_specific_runti
fi
+# Check whether --enable-poison-system-directories was given.
+if test "${enable_poison_system_directories+set}" = set; then :
+ enableval=$enable_poison_system_directories;
+else
+ enable_poison_system_directories=no
+fi
+
+if test "x${enable_poison_system_directories}" = "xyes"; then
+
+$as_echo "#define ENABLE_POISON_SYSTEM_DIRECTORIES 1" >>confdefs.h
+
+fi
+
# 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])])
+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
+
# 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
===================================================================
--- 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
"%{fuse-ld=*:-fuse-ld=%*}\
%X %{o*} %{e*} %{N} %{n} %{r}\
%{s} %{t} %{u*} %{z} %{Z} %{!nostdlib:%{!nostartfiles:%S}} " VTABLE_VERIFICATION_SPEC " \
+ %{Wno-poison-system-directories:--no-poison-system-directories}\
+ %{Werror=poison-system-directories:--error-poison-system-directories}\
%{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 @@
#include "intl.h"
#include "incpath.h"
#include "cppdefault.h"
+#include "diagnostic-core.h"
/* Microsoft Windows does not natively support inodes.
VMS has non-numeric inodes. */
@@ -382,6 +383,24 @@ merge_include_chains (const char *sysroo
}
fprintf (stderr, _("End of search list.\n"));
}
+
+#ifdef ENABLE_POISON_SYSTEM_DIRECTORIES
+ if (flag_poison_system_directories)
+ {
+ struct cpp_dir *p;
+
+ for (p = heads[QUOTE]; p; p = p->next)
+ {
+ if ((!strncmp (p->name, "/usr/include", 12))
+ || (!strncmp (p->name, "/usr/local/include", 18))
+ || (!strncmp (p->name, "/usr/X11R6/include", 18)))
+ warning (OPT_Wpoison_system_directories,
+ "include location \"%s\" is unsafe for "
+ "cross-compilation",
+ p->name);
+ }
+ }
+#endif
}
/* Use given -I paths for #include "..." but not #include <...>, and

+ 60
- 0
base/gcc/ada-fixes.patch

@ -0,0 +1,60 @@
# --- SDE-COPYRIGHT-NOTE-BEGIN ---
# This copyright note is auto-generated by ./scripts/Create-CopyPatch.
#
# Filename: package/.../gcc/ada-fixes.patch
# Copyright (C) 2015 The OpenSDE Project
#
# More information can be found in the files COPYING and README.
#
# This patch file is dual-licensed. It is available under the license the
# patched project is licensed under, as long as it is an OpenSource license
# as defined at http://www.opensource.org/ (e.g. BSD, X11) or under the terms
# of the GNU General Public License as published by the Free Software
# Foundation; either version 2 of the License, or (at your option) any later
# version.
# --- SDE-COPYRIGHT-NOTE-END ---
--- gcc-4.8.1/gcc/ada/terminals.c.orig
+++ gcc-4.8.1/gcc/ada/terminals.c
@@ -984,13 +984,6 @@
#include <stdio.h>
#include <stdlib.h>
-/* On some system termio is either absent or including it will disable termios
- (HP-UX) */
-#if ! defined (__hpux__) && ! defined (FREEBSD) && \
- ! defined (__APPLE__) && ! defined(__rtems__)
-# include <termio.h>
-#endif
-
#include <sys/ioctl.h>
#include <termios.h>
#include <fcntl.h>
@@ -1078,7 +1078,7 @@
char *slave_name = NULL;
#ifdef USE_GETPT
- master_fd = getpt ();
+ master_fd = posix_openpt (O_RDWR);
#elif defined (USE_OPENPTY)
status = openpty (&master_fd, &slave_fd, NULL, NULL, NULL);
#elif defined (USE_CLONE_DEVICE)
@@ -1179,7 +1170,7 @@
int status;
/* ensure that s is filled with 0 */
- bzero (&s, sizeof (&s));
+ bzero (&s, sizeof (s));
/* Get the current terminal settings */
status = tcgetattr (fd, &s);
--- gcc-4.8.1/gcc/ada/cal.c.orig
+++ gcc-4.8.1/gcc/ada/cal.c
@@ -65,6 +65,7 @@
#include <time.h>
#else
#include <sys/time.h>
+#include <time.h>
#endif
#ifdef __MINGW32__

+ 82
- 0
base/gcc/ada-no-pie.patch

@ -0,0 +1,82 @@
# --- SDE-COPYRIGHT-NOTE-BEGIN ---
# This copyright note is auto-generated by ./scripts/Create-CopyPatch.
#
# Filename: package/.../gcc/ada-no-pie.patch
# Copyright (C) 2015 The OpenSDE Project
#
# More information can be found in the files COPYING and README.
#
# This patch file is dual-licensed. It is available under the license the
# patched project is licensed under, as long as it is an OpenSource license
# as defined at http://www.opensource.org/ (e.g. BSD, X11) or under the terms
# of the GNU General Public License as published by the Free Software
# Foundation; either version 2 of the License, or (at your option) any later
# version.
# --- SDE-COPYRIGHT-NOTE-END ---
--- gcc-4.9.2/gcc/ada/gcc-interface/Makefile.in.orig 2014-05-17 13:13:12.000000000 -0300
+++ gcc-4.9.2/gcc/ada/gcc-interface/Makefile.in 2014-12-10 12:01:32.304493855 -0200
@@ -2570,23 +2570,23 @@
gnatchop gnatcmd gnatkr gnatls gnatprep gnatxref gnatfind gnatname \
gnatclean -bargs $(ADA_INCLUDES) $(GNATBIND_FLAGS)
$(GNATLINK) -v gnatcmd -o ../../gnat$(exeext) \
- --GCC="$(GCC_LINK)" $(TOOLS_LIBS)
+ --GCC="$(GCC_LINK)" -fno-PIE $(TOOLS_LIBS)
$(GNATLINK) -v gnatchop -o ../../gnatchop$(exeext) \
- --GCC="$(GCC_LINK)" $(TOOLS_LIBS)
+ --GCC="$(GCC_LINK)" -fno-PIE $(TOOLS_LIBS)
$(GNATLINK) -v gnatkr -o ../../gnatkr$(exeext) \
- --GCC="$(GCC_LINK)" $(TOOLS_LIBS)
+ --GCC="$(GCC_LINK)" -fno-PIE $(TOOLS_LIBS)
$(GNATLINK) -v gnatls -o ../../gnatls$(exeext) \
- --GCC="$(GCC_LINK)" $(TOOLS_LIBS)
+ --GCC="$(GCC_LINK)" -fno-PIE $(TOOLS_LIBS)
$(GNATLINK) -v gnatprep -o ../../gnatprep$(exeext) \
- --GCC="$(GCC_LINK)" $(TOOLS_LIBS)
+ --GCC="$(GCC_LINK)" -fno-PIE $(TOOLS_LIBS)
$(GNATLINK) -v gnatxref -o ../../gnatxref$(exeext) \
- --GCC="$(GCC_LINK)" $(TOOLS_LIBS)
+ --GCC="$(GCC_LINK)" -fno-PIE $(TOOLS_LIBS)
$(GNATLINK) -v gnatfind -o ../../gnatfind$(exeext) \
- --GCC="$(GCC_LINK)" $(TOOLS_LIBS)
+ --GCC="$(GCC_LINK)" -fno-PIE $(TOOLS_LIBS)
$(GNATLINK) -v gnatname -o ../../gnatname$(exeext) \
- --GCC="$(GCC_LINK)" $(TOOLS_LIBS)
+ --GCC="$(GCC_LINK)" -fno-PIE $(TOOLS_LIBS)
$(GNATLINK) -v gnatclean -o ../../gnatclean$(exeext) \
- --GCC="$(GCC_LINK)" $(TOOLS_LIBS)
+ --GCC="$(GCC_LINK)" -fno-PIE $(TOOLS_LIBS)
../../gnatsym$(exeext): ../stamp-tools
$(GNATMAKE) -c $(ADA_INCLUDES) gnatsym --GCC="$(CC) $(ALL_ADAFLAGS)"
@@ -2608,7 +2608,7 @@
$(GNATMAKE) -j0 -c $(ADA_INCLUDES) gnatmake --GCC="$(CC) $(ALL_ADAFLAGS)"
$(GNATBIND) $(ADA_INCLUDES) $(GNATBIND_FLAGS) gnatmake
$(GNATLINK) -v gnatmake -o ../../gnatmake$(exeext) \
- --GCC="$(GCC_LINK)" $(TOOLS_LIBS)
+ --GCC="$(GCC_LINK)" -fno-PIE $(TOOLS_LIBS)
# Note the use of the "mv" command in order to allow gnatlink to be linked with
# with the former version of gnatlink itself which cannot override itself.
@@ -2618,7 +2618,7 @@
$(GNATMAKE) -j0 -c $(ADA_INCLUDES) gnatlink --GCC="$(CC) $(ALL_ADAFLAGS)"
$(GNATBIND) $(ADA_INCLUDES) $(GNATBIND_FLAGS) gnatlink
$(GNATLINK) -v gnatlink -o ../../gnatlinknew$(exeext) \
- --GCC="$(GCC_LINK)" $(TOOLS_LIBS)
+ --GCC="$(GCC_LINK)" -fno-PIE $(TOOLS_LIBS)
$(MV) ../../gnatlinknew$(exeext) ../../gnatlink$(exeext)
# Needs to be built with CC=gcc
@@ -2627,10 +2627,10 @@
# Likewise for the tools
../../gnatmake$(exeext): $(P) b_gnatm.o $(GNATMAKE_OBJS)
- +$(GCC_LINK) $(ALL_CFLAGS) -o $@ b_gnatm.o $(GNATMAKE_OBJS) $(TOOLS_LIBS)
+ +$(GCC_LINK) $(ALL_CFLAGS) -fno-PIE -o $@ b_gnatm.o $(GNATMAKE_OBJS) $(TOOLS_LIBS)
../../gnatlink$(exeext): $(P) b_gnatl.o $(GNATLINK_OBJS)
- +$(GCC_LINK) $(ALL_CFLAGS) -o $@ b_gnatl.o $(GNATLINK_OBJS) $(TOOLS_LIBS)
+ +$(GCC_LINK) $(ALL_CFLAGS) -fno-PIE -o $@ b_gnatl.o $(GNATLINK_OBJS) $(TOOLS_LIBS)
../stamp-gnatlib-$(RTSDIR):
@if [ ! -f stamp-gnatlib-$(RTSDIR) ] ; \

+ 46
- 0
base/gcc/ada-shared.patch

@ -0,0 +1,46 @@
# --- SDE-COPYRIGHT-NOTE-BEGIN ---
# This copyright note is auto-generated by ./scripts/Create-CopyPatch.
#
# Filename: package/.../gcc/ada-shared.patch
# Copyright (C) 2015 The OpenSDE Project
#
# More information can be found in the files COPYING and README.
#
# This patch file is dual-licensed. It is available under the license the
# patched project is licensed under, as long as it is an OpenSource license
# as defined at http://www.opensource.org/ (e.g. BSD, X11) or under the terms
# of the GNU General Public License as published by the Free Software
# Foundation; either version 2 of the License, or (at your option) any later
# version.
# --- SDE-COPYRIGHT-NOTE-END ---
Index: b/gcc/ada/link.c
===================================================================
--- a/gcc/ada/link.c
+++ b/gcc/ada/link.c
@@ -105,9 +105,9 @@
#elif defined (__FreeBSD__)
const char *__gnat_object_file_option = "-Wl,@";
-const char *__gnat_run_path_option = "-Wl,-rpath,";
-char __gnat_shared_libgnat_default = STATIC;
-char __gnat_shared_libgcc_default = STATIC;
+const char *__gnat_run_path_option = "";
+char __gnat_shared_libgnat_default = SHARED;
+char __gnat_shared_libgcc_default = SHARED;
int __gnat_link_max = 8192;
unsigned char __gnat_objlist_file_supported = 1;
const char *__gnat_object_library_extension = ".a";
@@ -127,9 +127,9 @@
#elif defined (linux) || defined(__GLIBC__)
const char *__gnat_object_file_option = "-Wl,@";
-const char *__gnat_run_path_option = "-Wl,-rpath,";
-char __gnat_shared_libgnat_default = STATIC;
-char __gnat_shared_libgcc_default = STATIC;
+const char *__gnat_run_path_option = "";
+char __gnat_shared_libgnat_default = SHARED;
+char __gnat_shared_libgcc_default = SHARED;
int __gnat_link_max = 8192;
unsigned char __gnat_objlist_file_supported = 1;
const char *__gnat_object_library_extension = ".a";

+ 27
- 0
base/gcc/boehm-gc-uclibc.patch

@ -0,0 +1,27 @@
# --- SDE-COPYRIGHT-NOTE-BEGIN ---
# This copyright note is auto-generated by ./scripts/Create-CopyPatch.
#
# Filename: package/.../gcc/boehm-gc-uclibc.patch
# Copyright (C) 2015 The OpenSDE Project
#
# More information can be found in the files COPYING and README.
#
# This patch file is dual-licensed. It is available under the license the
# patched project is licensed under, as long as it is an OpenSource license
# as defined at http://www.opensource.org/ (e.g. BSD, X11) or under the terms
# of the GNU General Public License as published by the Free Software
# Foundation; either version 2 of the License, or (at your option) any later
# version.
# --- SDE-COPYRIGHT-NOTE-END ---
--- ./boehm-gc/include/gc.h.orig
+++ ./boehm-gc/include/gc.h
@@ -503,7 +503,7 @@
#if defined(__linux__) || defined(__GLIBC__)
# include <features.h>
# if (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 1 || __GLIBC__ > 2) \
- && !defined(__ia64__)
+ && !defined(__ia64__) && !defined(__UCLIBC__)
# ifndef GC_HAVE_BUILTIN_BACKTRACE
# define GC_HAVE_BUILTIN_BACKTRACE
# endif

+ 41
- 0
base/gcc/gcc-4.6-pr32219.patch

@ -0,0 +1,41 @@
# --- SDE-COPYRIGHT-NOTE-BEGIN ---
# This copyright note is auto-generated by ./scripts/Create-CopyPatch.
#
# Filename: package/.../gcc/gcc-4.6-pr32219.patch
# Copyright (C) 2015 The OpenSDE Project
#
# More information can be found in the files COPYING and README.
#
# This patch file is dual-licensed. It is available under the license the
# patched project is licensed under, as long as it is an OpenSource license
# as defined at http://www.opensource.org/ (e.g. BSD, X11) or under the terms
# of the GNU General Public License as published by the Free Software
# Foundation; either version 2 of the License, or (at your option) any later
# version.
# --- SDE-COPYRIGHT-NOTE-END ---
--- ./gcc/varasm.c.orig
+++ ./gcc/varasm.c
@@ -6758,6 +6758,10 @@
/* Static variables are always local. */
else if (! TREE_PUBLIC (exp))
local_p = true;
+ /* Weak data can be overridden by a strong symbol
+ in another module and so are not local. */
+ 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)
@@ -6771,11 +6775,6 @@
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)

+ 0
- 109
base/gcc/gcc-4.7-HAVE_SYS_SDT_H-cross-compile.patch

@ -1,109 +0,0 @@
Check sys/sdt.h with AC_CHECK_HEADERS
The original patch was backported to gcc 4.7.2!
see: http://patchwork.ozlabs.org/patch/207141/ for the original patch
------------------------------------------------------------------------------
2012-12-18 Christian Bruel <christian.bruel@st.com>
* configure.ac: Check sys/sdt.h with AC_CHECK_HEADERS.
* configure: Regenerate.
* config.in: Regenerat.e
------------------------------------------------------------------------------
--- a/gcc/configure
+++ b/gcc/configure
@@ -8286,7 +8286,7 @@ fi
for ac_header in limits.h stddef.h string.h strings.h stdlib.h time.h iconv.h \
fcntl.h unistd.h sys/file.h sys/time.h sys/mman.h \
- sys/resource.h sys/param.h sys/times.h sys/stat.h \
+ sys/resource.h sys/param.h sys/times.h sys/sdt.h sys/stat.h \
direct.h malloc.h langinfo.h ldfcn.h locale.h wchar.h
do :
as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
@@ -26716,20 +26716,6 @@ $as_echo "#define TARGET_LIBC_PROVIDES_SSP 1" >>co
fi
-# Test for <sys/sdt.h> on the target.
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking sys/sdt.h in the target C library" >&5
-$as_echo_n "checking sys/sdt.h in the target C library... " >&6; }
-have_sys_sdt_h=no
-if test -f $target_header_dir/sys/sdt.h; then
- have_sys_sdt_h=yes
-
-$as_echo "#define HAVE_SYS_SDT_H 1" >>confdefs.h
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $have_sys_sdt_h" >&5
-$as_echo "$have_sys_sdt_h" >&6; }
-
# Check if TFmode long double should be used by default or not.
# Some glibc targets used DFmode long double, but with glibc 2.4
# and later they can use TFmode.
--- a/gcc/configure.ac
+++ b/gcc/configure.ac
@@ -940,7 +940,7 @@ ACX_HEADER_STRING
AC_HEADER_SYS_WAIT
AC_CHECK_HEADERS(limits.h stddef.h string.h strings.h stdlib.h time.h iconv.h \
fcntl.h unistd.h sys/file.h sys/time.h sys/mman.h \
- sys/resource.h sys/param.h sys/times.h sys/stat.h \
+ sys/resource.h sys/param.h sys/times.h sys/sdt.h sys/stat.h \
direct.h malloc.h langinfo.h ldfcn.h locale.h wchar.h)
# Check for thread headers.
@@ -4718,17 +4718,6 @@ if test x$gcc_cv_libc_provides_ssp = xyes; then
[Define if your target C library provides stack protector support])
fi
-# Test for <sys/sdt.h> on the target.
-GCC_TARGET_TEMPLATE([HAVE_SYS_SDT_H])
-AC_MSG_CHECKING(sys/sdt.h in the target C library)
-have_sys_sdt_h=no
-if test -f $target_header_dir/sys/sdt.h; then
- have_sys_sdt_h=yes
- AC_DEFINE(HAVE_SYS_SDT_H, 1,
- [Define if your target C library provides sys/sdt.h])
-fi
-AC_MSG_RESULT($have_sys_sdt_h)
-
# Check if TFmode long double should be used by default or not.
# Some glibc targets used DFmode long double, but with glibc 2.4
# and later they can use TFmode.
--- a/gcc/config.in
+++ b/gcc/config.in
@@ -465,6 +465,12 @@
#endif
+/* Define if your assembler supports SPARC4 instructions. */
+#ifndef USED_FOR_TARGET
+#undef HAVE_AS_SPARC4
+#endif
+
+
/* Define if your assembler and linker support GOTDATA_OP relocs. */
#ifndef USED_FOR_TARGET
#undef HAVE_AS_SPARC_GOTDATA_OP
@@ -1210,7 +1216,7 @@
#endif
-/* Define if your PowerPC64 linker supports a large TOC. */
+/* Define if your AIX linker supports a large TOC. */
#ifndef USED_FOR_TARGET
#undef HAVE_LD_LARGE_TOC
#endif
@@ -1447,7 +1453,10 @@
/* Define if your target C library provides sys/sdt.h */
+#ifndef USED_FOR_TARGET
#undef HAVE_SYS_SDT_H
+#endif
+
/* Define to 1 if you have the <sys/stat.h> header file. */
#ifndef USED_FOR_TARGET

+ 320
- 0
base/gcc/gcc-ice-hack.patch

@ -0,0 +1,320 @@
# --- SDE-COPYRIGHT-NOTE-BEGIN ---
# This copyright note is auto-generated by ./scripts/Create-CopyPatch.
#
# Filename: package/.../gcc/gcc-ice-hack.patch
# Copyright (C) 2015 The OpenSDE Project
#
# More information can be found in the files COPYING and README.
#
# This patch file is dual-licensed. It is available under the license the
# patched project is licensed under, as long as it is an OpenSource license
# as defined at http://www.opensource.org/ (e.g. BSD, X11) or under the terms
# of the GNU General Public License as published by the Free Software
# Foundation; either version 2 of the License, or (at your option) any later
# version.
# --- SDE-COPYRIGHT-NOTE-END ---
# DP: Retry the build on an ice, save the calling options and preprocessed
# DP: source when the ice is reproducible.
2004-01-23 Jakub Jelinek <jakub@redhat.com>
* gcc.c (execute): Don't free first string early, but at the end
of the function. Call retry_ice if compiler exited with
ICE_EXIT_CODE.
(retry_ice): New function.
* diagnostic.c (diagnostic_count_diagnostic,
diagnostic_action_after_output, error_recursion): Exit with
ICE_EXIT_CODE instead of FATAL_EXIT_CODE.
Index: b/gcc/gcc.c
===================================================================
--- a/gcc/gcc.c
+++ b/gcc/gcc.c
@@ -249,6 +249,9 @@
#if defined(HAVE_TARGET_OBJECT_SUFFIX) || defined(HAVE_TARGET_EXECUTABLE_SUFFIX)
static const char *convert_filename (const char *, int, int);
#endif
+#if !(defined (__MSDOS__) || defined (OS2) || defined (VMS))
+static void retry_ice (const char *prog, const char **argv);
+#endif
static const char *getenv_spec_function (int, const char **);
static const char *if_exists_spec_function (int, const char **);
@@ -2771,7 +2774,7 @@
}
}
- if (string != commands[i].prog)
+ if (i && string != commands[i].prog)
free (CONST_CAST (char *, string));
}
@@ -2824,6 +2827,16 @@
else if (WIFEXITED (status)
&& WEXITSTATUS (status) >= MIN_FATAL_STATUS)
{
+#if !(defined (__MSDOS__) || defined (OS2) || defined (VMS))
+ /* For ICEs in cc1, cc1obj, cc1plus see if it is
+ reproducible or not. */
+ const char *p;
+ if (WEXITSTATUS (status) == ICE_EXIT_CODE
+ && i == 0
+ && (p = strrchr (commands[0].argv[0], DIR_SEPARATOR))
+ && ! strncmp (p + 1, "cc1", 3))
+ retry_ice (commands[0].prog, commands[0].argv);
+#endif
if (WEXITSTATUS (status) > greatest_status)
greatest_status = WEXITSTATUS (status);
ret_code = -1;
@@ -2881,6 +2894,9 @@
}
}
+ if (commands[0].argv[0] != commands[0].prog)
+ free (CONST_CAST (char *, commands[0].argv[0]));
+
return ret_code;
}
}
@@ -6034,6 +6050,227 @@
switches[switchnum].validated = true;
}
+#if !(defined (__MSDOS__) || defined (OS2) || defined (VMS))
+#define RETRY_ICE_ATTEMPTS 2
+
+static void
+retry_ice (const char *prog, const char **argv)
+{
+ int nargs, out_arg = -1, quiet = 0, attempt;
+ int pid, retries, sleep_interval;
+ const char **new_argv;
+ char *temp_filenames[RETRY_ICE_ATTEMPTS * 2 + 2];
+
+ if (gcc_input_filename == NULL || ! strcmp (gcc_input_filename, "-"))
+ return;
+
+ for (nargs = 0; argv[nargs] != NULL; ++nargs)
+ /* Only retry compiler ICEs, not preprocessor ones. */
+ if (! strcmp (argv[nargs], "-E"))
+ return;
+ else if (argv[nargs][0] == '-' && argv[nargs][1] == 'o')
+ {
+ if (out_arg == -1)
+ out_arg = nargs;
+ else
+ return;
+ }
+ /* If the compiler is going to output any time information,
+ it might varry between invocations. */
+ else if (! strcmp (argv[nargs], "-quiet"))
+ quiet = 1;
+ else if (! strcmp (argv[nargs], "-ftime-report"))
+ return;
+
+ if (out_arg == -1 || !quiet)
+ return;
+
+ memset (temp_filenames, '\0', sizeof (temp_filenames));
+ new_argv = XALLOCAVEC (const char *, nargs + 3);
+ memcpy (new_argv, argv, (nargs + 1) * sizeof (const char *));
+ new_argv[nargs++] = "-frandom-seed=0";
+ new_argv[nargs] = NULL;
+ if (new_argv[out_arg][2] == '\0')
+ new_argv[out_arg + 1] = "-";
+ else
+ new_argv[out_arg] = "-o-";
+
+ for (attempt = 0; attempt < RETRY_ICE_ATTEMPTS + 1; ++attempt)
+ {
+ int fd = -1;
+ int status;
+
+ temp_filenames[attempt * 2] = make_temp_file (".out");
+ temp_filenames[attempt * 2 + 1] = make_temp_file (".err");
+
+ if (attempt == RETRY_ICE_ATTEMPTS)
+ {
+ int i;
+ int fd1, fd2;
+ struct stat st1, st2;
+ size_t n, len;
+ char *buf;
+
+ buf = XNEWVEC (char, 8192);
+
+ for (i = 0; i < 2; ++i)
+ {
+ fd1 = open (temp_filenames[i], O_RDONLY);
+ fd2 = open (temp_filenames[2 + i], O_RDONLY);
+
+ if (fd1 < 0 || fd2 < 0)
+ {
+ i = -1;
+ close (fd1);
+ close (fd2);
+ break;
+ }
+
+ if (fstat (fd1, &st1) < 0 || fstat (fd2, &st2) < 0)
+ {
+ i = -1;
+ close (fd1);
+ close (fd2);
+ break;
+ }
+
+ if (st1.st_size != st2.st_size)
+ {
+ close (fd1);
+ close (fd2);
+ break;
+ }
+
+ len = 0;
+ for (n = st1.st_size; n; n -= len)
+ {
+ len = n;
+ if (len > 4096)
+ len = 4096;
+
+ if (read (fd1, buf, len) != (int) len
+ || read (fd2, buf + 4096, len) != (int) len)
+ {
+ i = -1;
+ break;
+ }
+
+ if (memcmp (buf, buf + 4096, len) != 0)
+ break;
+ }
+
+ close (fd1);
+ close (fd2);
+
+ if (n)
+ break;
+ }
+
+ free (buf);
+ if (i == -1)
+ break;
+
+ if (i != 2)
+ {
+ fnotice (stderr, "The bug is not reproducible, so it is"
+ " likely a hardware or OS problem.\n");
+ break;
+ }
+
+ fd = open (temp_filenames[attempt * 2], O_RDWR);
+ if (fd < 0)
+ break;
+ write (fd, "//", 2);
+ for (i = 0; i < nargs; i++)
+ {
+ write (fd, " ", 1);
+ write (fd, new_argv[i], strlen (new_argv[i]));
+ }
+ write (fd, "\n", 1);
+ new_argv[nargs] = "-E";
+ new_argv[nargs + 1] = NULL;
+ }
+
+ /* Fork a subprocess; wait and retry if it fails. */
+ sleep_interval = 1;
+ pid = -1;
+ for (retries = 0; retries < 4; retries++)
+ {
+ pid = fork ();
+ if (pid >= 0)
+ break;
+ sleep (sleep_interval);
+ sleep_interval *= 2;
+ }
+
+ if (pid < 0)
+ break;
+ else if (pid == 0)
+ {
+ if (attempt != RETRY_ICE_ATTEMPTS)
+ fd = open (temp_filenames[attempt * 2], O_RDWR);
+ if (fd < 0)
+ exit (-1);
+ if (fd != 1)
+ {
+ close (1);
+ dup (fd);
+ close (fd);
+ }
+
+ fd = open (temp_filenames[attempt * 2 + 1], O_RDWR);
+ if (fd < 0)
+ exit (-1);
+ if (fd != 2)
+ {
+ close (2);
+ dup (fd);
+ close (fd);
+ }
+
+ if (prog == new_argv[0])
+ execvp (prog, CONST_CAST2 (char *const *, const char **, new_argv));
+ else
+ execv (new_argv[0], CONST_CAST2 (char *const *, const char **, new_argv));
+ exit (-1);
+ }
+
+ if (waitpid (pid, &status, 0) < 0)
+ break;
+
+ if (attempt < RETRY_ICE_ATTEMPTS
+ && (! WIFEXITED (status) || WEXITSTATUS (status) != ICE_EXIT_CODE))
+ {
+ fnotice (stderr, "The bug is not reproducible, so it is"
+ " likely a hardware or OS problem.\n");
+ break;
+ }
+ else if (attempt == RETRY_ICE_ATTEMPTS)
+ {
+ close (fd);
+ if (WIFEXITED (status)
+ && WEXITSTATUS (status) == SUCCESS_EXIT_CODE)
+ {
+ fnotice (stderr, "Preprocessed source stored into %s file,"
+ " please attach this to your bugreport.\n",
+ temp_filenames[attempt * 2]);
+ /* Make sure it is not deleted. */
+ free (temp_filenames[attempt * 2]);
+ temp_filenames[attempt * 2] = NULL;
+ break;
+ }
+ }
+ }
+
+ for (attempt = 0; attempt < RETRY_ICE_ATTEMPTS * 2 + 2; attempt++)
+ if (temp_filenames[attempt])
+ {
+ unlink (temp_filenames[attempt]);
+ free (temp_filenames[attempt]);
+ }
+}
+#endif
+
/* Search for a file named NAME trying various prefixes including the
user's -B prefix and some standard ones.
Return the absolute file name found. If nothing is found, return NAME. */
Index: b/gcc/diagnostic.c
===================================================================
--- a/gcc/diagnostic.c
+++ b/gcc/diagnostic.c
@@ -455,7 +455,7 @@
real_abort ();
diagnostic_finish (context);
fnotice (stderr, "compilation terminated.\n");
- exit (FATAL_EXIT_CODE);
+ exit (ICE_EXIT_CODE);
default:
gcc_unreachable ();

+ 27
- 0
base/gcc/gcc-pure64.patch

@ -0,0 +1,27 @@
# --- SDE-COPYRIGHT-NOTE-BEGIN ---
# This copyright note is auto-generated by ./scripts/Create-CopyPatch.
#
# Filename: package/.../gcc/gcc-pure64.patch
# Copyright (C) 2015 The OpenSDE Project
#
# More information can be found in the files COPYING and README.
#
# This patch file is dual-licensed. It is available under the license the
# patched project is licensed under, as long as it is an OpenSource license
# as defined at http://www.opensource.org/ (e.g. BSD, X11) or under the terms
# of the GNU General Public License as published by the Free Software
# Foundation; either version 2 of the License, or (at your option) any later
# version.
# --- SDE-COPYRIGHT-NOTE-END ---
--- ./gcc/config/i386/t-linux64.orig 2013-01-14 16:32:37.000000000 +0000
+++ ./gcc/config/i386/t-linux64 2013-04-22 06:12:32.984439677 +0000
@@ -34,6 +34,6 @@
comma=,
MULTILIB_OPTIONS = $(subst $(comma),/,$(TM_MULTILIB_CONFIG))
MULTILIB_DIRNAMES = $(patsubst m%, %, $(subst /, ,$(MULTILIB_OPTIONS)))
-MULTILIB_OSDIRNAMES = m64=../lib64$(call if_multiarch,:x86_64-linux-gnu)
-MULTILIB_OSDIRNAMES+= m32=$(if $(wildcard $(shell echo $(SYSTEM_HEADER_DIR))/../../usr/lib32),../lib32,../lib)$(call if_multiarch,:i386-linux-gnu)
+MULTILIB_OSDIRNAMES = m64=../lib
+MULTILIB_OSDIRNAMES+= m32=../lib32
MULTILIB_OSDIRNAMES+= mx32=../libx32$(call if_multiarch,:x86_64-linux-gnux32)

+ 58
- 0
base/gcc/gcc-spec-env.patch

@ -0,0 +1,58 @@
# --- SDE-COPYRIGHT-NOTE-BEGIN ---
# This copyright note is auto-generated by ./scripts/Create-CopyPatch.
#
# Filename: package/.../gcc/gcc-spec-env.patch
# Copyright (C) 2015 The OpenSDE Project
#
# More information can be found in the files COPYING and README.
#
# This patch file is dual-licensed. It is available under the license the
# patched project is licensed under, as long as it is an OpenSource license
# as defined at http://www.opensource.org/ (e.g. BSD, X11) or under the terms
# of the GNU General Public License as published by the Free Software
# Foundation; either version 2 of the License, or (at your option) any later
# version.
# --- SDE-COPYRIGHT-NOTE-END ---
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.
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
--- gcc-4/gcc/gcc.c
+++ gcc-4/gcc/gcc.c
@@ -6482,6 +6482,32 @@
/* 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
+ * (':') with '\0', an effect of strtok_r().
+ */
+ specs_file = getenv ("GCC_SPECS");
+ if (specs_file && (strlen(specs_file) > 0))
+ {
+ char *spec, *saveptr;
+ for (spec=strtok_r(specs_file,":",&saveptr);
+ spec!=NULL;
+ spec=strtok_r(NULL,":",&saveptr))
+ {
+ 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)
+ user_specs_tail->next = user;
+ else
+ user_specs_head = user;
+ user_specs_tail = user;
+ }
+ }
+#endif
for (uptr = user_specs_head; uptr; uptr = uptr->next)
{
char *filename = find_a_file (&startfile_prefixes, uptr->filename,

+ 9
- 3
base/gcc/gcc.conf

@ -99,8 +99,8 @@ var_append confopt ' ' '--disable-bootstrap'
if [ "$SDECFG_LIBC" == "musl" ]; then
var_append confopt " " "--disable-libssp"
var_append confopt " " "--disable-symvers"
var_append confopt " " "--disable-libmudflap"
var_append confopt " " "--disable-libsanitizer"
var_append confopt " " "--enable-esp"
fi
# we prefere libiberty from binutils so we disable this one
@ -115,6 +115,12 @@ var_append confopt ' ' "--disable-install-libiberty"
[ "$SDECFG_PKG_GCC_CXX_PCH" = 1 ] || \
var_append confopt ' ' "--disable-libstdcxx-pch"
# we want some stuff on intel architectures
for feature in cld __cxa_atexit; do
[ "$arch" = "x86-64" -o "$arch" = "x86-64" ] && \
var_append confopt ' ' "--enable-$feature"
done
# add the multi-lib config
if [ "$SDECFG_MULTILIB" = 1 ]; then
var_append confopt ' ' "--enable-multilib"
@ -133,7 +139,7 @@ fi
# available languages:
# grep ^language= gcc/*/config-lang.in | cut -d\" -f2 | sort | tr '\n' ' '
# ada c c++ fortran go java objc obj-c++
# ada c c++ fortran go java lto obj-c++ objc
# only C and C++ by default, and on every stage
languages="c,c++"
@ -218,7 +224,7 @@ if atstage cross; then
fi
if ! atstage native; then
var_append confopt " " "--disable-libmudflap"
var_append confopt " " "--disable-libsanitizer"
else
var_append confopt " " "--with-gnu-as"
var_append confopt " " "--with-gnu-ld"

+ 494
- 0
base/gcc/gcc49-cloog-dl.patch

@ -0,0 +1,494 @@
# --- SDE-COPYRIGHT-NOTE-BEGIN ---
# This copyright note is auto-generated by ./scripts/Create-CopyPatch.
#
# Filename: package/.../gcc/gcc49-cloog-dl.patch
# Copyright (C) 2015 The OpenSDE Project
#
# More information can be found in the files COPYING and README.
#
# This patch file is dual-licensed. It is available under the license the
# patched project is licensed under, as long as it is an OpenSource license
# as defined at http://www.opensource.org/ (e.g. BSD, X11) or under the terms
# of the GNU General Public License as published by the Free Software
# Foundation; either version 2 of the License, or (at your option) any later
# version.
# --- SDE-COPYRIGHT-NOTE-END ---
http://pkgs.fedoraproject.org/cgit/gcc.git/plain/gcc49-cloog-dl.patch
--- a/gcc/Makefile.in.jj 2012-12-13 17:09:20.000000000 +0100
+++ b/gcc/Makefile.in 2012-12-14 11:45:22.585670055 +0100
@@ -1006,7 +1006,7 @@ BUILD_LIBDEPS= $(BUILD_LIBIBERTY)
# and the system's installed libraries.
LIBS = @LIBS@ libcommon.a $(CPPLIB) $(LIBINTL) $(LIBICONV) $(LIBBACKTRACE) \
$(LIBIBERTY) $(LIBDECNUMBER) $(HOST_LIBS)
-BACKENDLIBS = $(CLOOGLIBS) $(GMPLIBS) $(PLUGINLIBS) $(HOST_LIBS) \
+BACKENDLIBS = $(if $(CLOOGLIBS),-ldl) $(GMPLIBS) $(PLUGINLIBS) $(HOST_LIBS) \
$(ZLIB)
# Any system libraries needed just for GNAT.
SYSLIBS = @GNAT_LIBEXC@
@@ -2011,6 +2011,15 @@ $(out_object_file): $(out_file)
$(common_out_object_file): $(common_out_file)
$(COMPILE) $<
$(POSTCOMPILE)
+
+graphite%.o : \
+ ALL_CFLAGS := -O $(filter-out -fkeep-inline-functions, $(ALL_CFLAGS))
+graphite.o : \
+ ALL_CFLAGS := -O $(filter-out -fkeep-inline-functions, $(ALL_CFLAGS))
+graphite%.o : \
+ ALL_CXXFLAGS := -O $(filter-out -fkeep-inline-functions, $(ALL_CXXFLAGS))
+graphite.o : \
+ ALL_CXXFLAGS := -O $(filter-out -fkeep-inline-functions, $(ALL_CXXFLAGS))
#
# Generate header and source files from the machine description,
# and compile them.
--- a/gcc/graphite-poly.h.jj 2012-12-13 11:31:27.000000000 +0100
+++ b/gcc/graphite-poly.h 2012-12-14 13:41:41.970800726 +0100
@@ -22,6 +22,371 @@ along with GCC; see the file COPYING3.
#ifndef GCC_GRAPHITE_POLY_H
#define GCC_GRAPHITE_POLY_H
+#include <isl/aff.h>
+#include <isl/schedule.h>
+#include <isl/ilp.h>
+#include <isl/flow.h>
+#include <isl/options.h>
+#include <cloog/isl/cloog.h>
+#include <dlfcn.h>
+#define DYNSYMS \
+ DYNSYM (clast_pprint); \
+ DYNSYM (cloog_clast_create_from_input); \
+ DYNSYM (cloog_clast_free); \
+ DYNSYM (cloog_domain_from_isl_set); \
+ DYNSYM (cloog_input_alloc); \
+ DYNSYM (cloog_isl_state_malloc); \
+ DYNSYM (cloog_options_free); \
+ DYNSYM (cloog_options_malloc); \
+ DYNSYM (cloog_scattering_from_isl_map); \
+ DYNSYM (cloog_state_free); \
+ DYNSYM (cloog_union_domain_add_domain); \
+ DYNSYM (cloog_union_domain_alloc); \
+ DYNSYM (cloog_union_domain_set_name); \
+ DYNSYM (isl_aff_add_coefficient_si); \
+ DYNSYM (isl_aff_add_constant); \
+ DYNSYM (isl_aff_free); \
+ DYNSYM (isl_aff_get_coefficient); \
+ DYNSYM (isl_aff_get_space); \
+ DYNSYM (isl_aff_mod); \
+ DYNSYM (isl_aff_set_coefficient_si); \
+ DYNSYM (isl_aff_set_constant_si); \
+ DYNSYM (isl_aff_zero_on_domain); \
+ DYNSYM (isl_band_free); \
+ DYNSYM (isl_band_get_children); \
+ DYNSYM (isl_band_get_partial_schedule); \
+ DYNSYM (isl_band_has_children); \
+ DYNSYM (isl_band_list_free); \
+ DYNSYM (isl_band_list_get_band); \
+ DYNSYM (isl_band_list_get_ctx); \
+ DYNSYM (isl_band_list_n_band); \
+ DYNSYM (isl_band_member_is_zero_distance); \
+ DYNSYM (isl_band_n_member); \
+ DYNSYM (isl_basic_map_add_constraint); \
+ DYNSYM (isl_basic_map_project_out); \
+ DYNSYM (isl_basic_map_universe); \
+ DYNSYM (isl_constraint_set_coefficient); \
+ DYNSYM (isl_constraint_set_coefficient_si); \
+ DYNSYM (isl_constraint_set_constant); \
+ DYNSYM (isl_constraint_set_constant_si); \
+ DYNSYM (isl_ctx_alloc); \
+ DYNSYM (isl_ctx_free); \
+ DYNSYM (isl_equality_alloc); \
+ DYNSYM (isl_id_alloc); \
+ DYNSYM (isl_id_copy); \
+ DYNSYM (isl_id_free); \
+ DYNSYM (isl_inequality_alloc); \
+ DYNSYM (isl_local_space_copy); \
+ DYNSYM (isl_local_space_free); \
+ DYNSYM (isl_local_space_from_space); \
+ DYNSYM (isl_local_space_range); \
+ DYNSYM (isl_map_add_constraint); \
+ DYNSYM (isl_map_add_dims); \
+ DYNSYM (isl_map_align_params); \
+ DYNSYM (isl_map_apply_range); \
+ DYNSYM (isl_map_copy); \
+ DYNSYM (isl_map_dim); \
+ DYNSYM (isl_map_dump); \
+ DYNSYM (isl_map_equate); \
+ DYNSYM (isl_map_fix_si); \
+ DYNSYM (isl_map_flat_product); \
+ DYNSYM (isl_map_flat_range_product); \
+ DYNSYM (isl_map_free); \
+ DYNSYM (isl_map_from_basic_map); \
+ DYNSYM (isl_map_from_pw_aff); \
+ DYNSYM (isl_map_from_union_map); \
+ DYNSYM (isl_map_get_ctx); \
+ DYNSYM (isl_map_get_space); \
+ DYNSYM (isl_map_get_tuple_id); \
+ DYNSYM (isl_map_insert_dims); \
+ DYNSYM (isl_map_intersect); \
+ DYNSYM (isl_map_intersect_domain); \
+ DYNSYM (isl_map_intersect_range); \
+ DYNSYM (isl_map_is_empty); \
+ DYNSYM (isl_map_lex_ge); \
+ DYNSYM (isl_map_lex_le); \
+ DYNSYM (isl_map_n_out); \
+ DYNSYM (isl_map_range); \
+ DYNSYM (isl_map_set_tuple_id); \
+ DYNSYM (isl_map_universe); \
+ DYNSYM (isl_options_set_on_error); \
+ DYNSYM (isl_options_set_schedule_fuse); \
+ DYNSYM (isl_options_set_schedule_max_constant_term); \
+ DYNSYM (isl_options_set_schedule_maximize_band_depth); \
+ DYNSYM (isl_printer_free); \
+ DYNSYM (isl_printer_print_aff); \
+ DYNSYM (isl_printer_print_constraint); \
+ DYNSYM (isl_printer_print_map); \
+ DYNSYM (isl_printer_print_set); \
+ DYNSYM (isl_printer_to_file); \
+ DYNSYM (isl_pw_aff_add); \
+ DYNSYM (isl_pw_aff_alloc); \
+ DYNSYM (isl_pw_aff_copy); \
+ DYNSYM (isl_pw_aff_eq_set); \
+ DYNSYM (isl_pw_aff_free); \
+ DYNSYM (isl_pw_aff_from_aff); \
+ DYNSYM (isl_pw_aff_ge_set); \
+ DYNSYM (isl_pw_aff_gt_set); \
+ DYNSYM (isl_pw_aff_is_cst); \
+ DYNSYM (isl_pw_aff_le_set); \
+ DYNSYM (isl_pw_aff_lt_set); \
+ DYNSYM (isl_pw_aff_mod); \
+ DYNSYM (isl_pw_aff_mul); \
+ DYNSYM (isl_pw_aff_ne_set); \
+ DYNSYM (isl_pw_aff_nonneg_set); \
+ DYNSYM (isl_pw_aff_set_tuple_id); \
+ DYNSYM (isl_pw_aff_sub); \
+ DYNSYM (isl_pw_aff_zero_set); \
+ DYNSYM (isl_schedule_free); \
+ DYNSYM (isl_schedule_get_band_forest); \
+ DYNSYM (isl_set_add_constraint); \
+ DYNSYM (isl_set_add_dims); \
+ DYNSYM (isl_set_apply); \
+ DYNSYM (isl_set_coalesce); \
+ DYNSYM (isl_set_copy); \
+ DYNSYM (isl_set_dim); \
+ DYNSYM (isl_set_fix_si); \
+ DYNSYM (isl_set_free); \
+ DYNSYM (isl_set_from_cloog_domain); \
+ DYNSYM (isl_set_get_space); \
+ DYNSYM (isl_set_get_tuple_id); \
+ DYNSYM (isl_set_intersect); \
+ DYNSYM (isl_set_is_empty); \
+ DYNSYM (isl_set_max); \
+ DYNSYM (isl_set_min); \
+ DYNSYM (isl_set_n_dim); \
+ DYNSYM (isl_set_nat_universe); \
+ DYNSYM (isl_set_project_out); \
+ DYNSYM (isl_set_set_tuple_id); \
+ DYNSYM (isl_set_universe); \
+ DYNSYM (isl_space_add_dims); \
+ DYNSYM (isl_space_alloc); \
+ DYNSYM (isl_space_copy); \
+ DYNSYM (isl_space_dim); \
+ DYNSYM (isl_space_domain); \
+ DYNSYM (isl_space_find_dim_by_id); \
+ DYNSYM (isl_space_free); \
+ DYNSYM (isl_space_from_domain); \
+ DYNSYM (isl_space_get_tuple_id); \
+ DYNSYM (isl_space_params_alloc); \
+ DYNSYM (isl_space_range); \
+ DYNSYM (isl_space_set_alloc); \
+ DYNSYM (isl_space_set_dim_id); \
+ DYNSYM (isl_space_set_tuple_id); \
+ DYNSYM (isl_union_map_add_map); \
+ DYNSYM (isl_union_map_align_params); \
+ DYNSYM (isl_union_map_apply_domain); \
+ DYNSYM (isl_union_map_apply_range); \
+ DYNSYM (isl_union_map_compute_flow); \
+ DYNSYM (isl_union_map_copy); \
+ DYNSYM (isl_union_map_empty); \
+ DYNSYM (isl_union_map_flat_range_product); \
+ DYNSYM (isl_union_map_foreach_map); \
+ DYNSYM (isl_union_map_free); \
+ DYNSYM (isl_union_map_from_map); \
+ DYNSYM (isl_union_map_get_ctx); \
+ DYNSYM (isl_union_map_get_space); \
+ DYNSYM (isl_union_map_gist_domain); \
+ DYNSYM (isl_union_map_gist_range); \
+ DYNSYM (isl_union_map_intersect_domain); \
+ DYNSYM (isl_union_map_is_empty); \
+ DYNSYM (isl_union_map_subtract); \
+ DYNSYM (isl_union_map_union); \
+ DYNSYM (isl_union_set_add_set); \
+ DYNSYM (isl_union_set_compute_schedule); \
+ DYNSYM (isl_union_set_copy); \
+ DYNSYM (isl_union_set_empty); \
+ DYNSYM (isl_union_set_from_set); \
+ DYNSYM (stmt_ass); \
+ DYNSYM (stmt_block); \
+ DYNSYM (stmt_for); \
+ DYNSYM (stmt_guard); \
+ DYNSYM (stmt_root); \
+ DYNSYM (stmt_user);
+extern struct cloog_pointers_s__
+{
+ bool inited;
+ void *h;
+#define DYNSYM(x) __typeof (x) *p_##x
+ DYNSYMS
+#undef DYNSYM
+} cloog_pointers__;
+
+#define cloog_block_alloc (*cloog_pointers__.p_cloog_block_alloc)
+#define clast_pprint (*cloog_pointers__.p_clast_pprint)
+#define cloog_clast_create_from_input (*cloog_pointers__.p_cloog_clast_create_from_input)
+#define cloog_clast_free (*cloog_pointers__.p_cloog_clast_free)
+#define cloog_domain_from_isl_set (*cloog_pointers__.p_cloog_domain_from_isl_set)
+#define cloog_input_alloc (*cloog_pointers__.p_cloog_input_alloc)
+#define cloog_isl_state_malloc (*cloog_pointers__.p_cloog_isl_state_malloc)
+#define cloog_options_free (*cloog_pointers__.p_cloog_options_free)
+#define cloog_options_malloc (*cloog_pointers__.p_cloog_options_malloc)
+#define cloog_scattering_from_isl_map (*cloog_pointers__.p_cloog_scattering_from_isl_map)
+#define cloog_state_free (*cloog_pointers__.p_cloog_state_free)
+#define cloog_union_domain_add_domain (*cloog_pointers__.p_cloog_union_domain_add_domain)
+#define cloog_union_domain_alloc (*cloog_pointers__.p_cloog_union_domain_alloc)
+#define cloog_union_domain_set_name (*cloog_pointers__.p_cloog_union_domain_set_name)
+#define isl_aff_add_coefficient_si (*cloog_pointers__.p_isl_aff_add_coefficient_si)
+#define isl_aff_add_constant (*cloog_pointers__.p_isl_aff_add_constant)
+#define isl_aff_free (*cloog_pointers__.p_isl_aff_free)
+#define isl_aff_get_coefficient (*cloog_pointers__.p_isl_aff_get_coefficient)
+#define isl_aff_get_space (*cloog_pointers__.p_isl_aff_get_space)
+#define isl_aff_mod (*cloog_pointers__.p_isl_aff_mod)
+#define isl_aff_set_coefficient_si (*cloog_pointers__.p_isl_aff_set_coefficient_si)
+#define isl_aff_set_constant_si (*cloog_pointers__.p_isl_aff_set_constant_si)
+#define isl_aff_zero_on_domain (*cloog_pointers__.p_isl_aff_zero_on_domain)
+#define isl_band_free (*cloog_pointers__.p_isl_band_free)
+#define isl_band_get_children (*cloog_pointers__.p_isl_band_get_children)
+#define isl_band_get_partial_schedule (*cloog_pointers__.p_isl_band_get_partial_schedule)
+#define isl_band_has_children (*cloog_pointers__.p_isl_band_has_children)
+#define isl_band_list_free (*cloog_pointers__.p_isl_band_list_free)
+#define isl_band_list_get_band (*cloog_pointers__.p_isl_band_list_get_band)
+#define isl_band_list_get_ctx (*cloog_pointers__.p_isl_band_list_get_ctx)
+#define isl_band_list_n_band (*cloog_pointers__.p_isl_band_list_n_band)
+#define isl_band_member_is_zero_distance (*cloog_pointers__.p_isl_band_member_is_zero_distance)
+#define isl_band_n_member (*cloog_pointers__.p_isl_band_n_member)
+#define isl_basic_map_add_constraint (*cloog_pointers__.p_isl_basic_map_add_constraint)
+#define isl_basic_map_project_out (*cloog_pointers__.p_isl_basic_map_project_out)
+#define isl_basic_map_universe (*cloog_pointers__.p_isl_basic_map_universe)
+#define isl_constraint_set_coefficient (*cloog_pointers__.p_isl_constraint_set_coefficient)
+#define isl_constraint_set_coefficient_si (*cloog_pointers__.p_isl_constraint_set_coefficient_si)
+#define isl_constraint_set_constant (*cloog_pointers__.p_isl_constraint_set_constant)
+#define isl_constraint_set_constant_si (*cloog_pointers__.p_isl_constraint_set_constant_si)
+#define isl_ctx_alloc (*cloog_pointers__.p_isl_ctx_alloc)
+#define isl_ctx_free (*cloog_pointers__.p_isl_ctx_free)
+#define isl_equality_alloc (*cloog_pointers__.p_isl_equality_alloc)
+#define isl_id_alloc (*cloog_pointers__.p_isl_id_alloc)
+#define isl_id_copy (*cloog_pointers__.p_isl_id_copy)
+#define isl_id_free (*cloog_pointers__.p_isl_id_free)
+#define isl_inequality_alloc (*cloog_pointers__.p_isl_inequality_alloc)
+#define isl_local_space_copy (*cloog_pointers__.p_isl_local_space_copy)
+#define isl_local_space_free (*cloog_pointers__.p_isl_local_space_free)
+#define isl_local_space_from_space (*cloog_pointers__.p_isl_local_space_from_space)
+#define isl_local_space_range (*cloog_pointers__.p_isl_local_space_range)
+#define isl_map_add_constraint (*cloog_pointers__.p_isl_map_add_constraint)
+#define isl_map_add_dims (*cloog_pointers__.p_isl_map_add_dims)
+#define isl_map_align_params (*cloog_pointers__.p_isl_map_align_params)
+#define isl_map_apply_range (*cloog_pointers__.p_isl_map_apply_range)
+#define isl_map_copy (*cloog_pointers__.p_isl_map_copy)
+#define isl_map_dim (*cloog_pointers__.p_isl_map_dim)
+#define isl_map_dump (*cloog_pointers__.p_isl_map_dump)
+#define isl_map_equate (*cloog_pointers__.p_isl_map_equate)
+#define isl_map_fix_si (*cloog_pointers__.p_isl_map_fix_si)
+#define isl_map_flat_product (*cloog_pointers__.p_isl_map_flat_product)
+#define isl_map_flat_range_product (*cloog_pointers__.p_isl_map_flat_range_product)
+#define isl_map_free (*cloog_pointers__.p_isl_map_free)
+#define isl_map_from_basic_map (*cloog_pointers__.p_isl_map_from_basic_map)
+#define isl_map_from_pw_aff (*cloog_pointers__.p_isl_map_from_pw_aff)
+#define isl_map_from_union_map (*cloog_pointers__.p_isl_map_from_union_map)
+#define isl_map_get_ctx (*cloog_pointers__.p_isl_map_get_ctx)
+#define isl_map_get_space (*cloog_pointers__.p_isl_map_get_space)
+#define isl_map_get_tuple_id (*cloog_pointers__.p_isl_map_get_tuple_id)
+#define isl_map_insert_dims (*cloog_pointers__.p_isl_map_insert_dims)
+#define isl_map_intersect (*cloog_pointers__.p_isl_map_intersect)
+#define isl_map_intersect_domain (*cloog_pointers__.p_isl_map_intersect_domain)
+#define isl_map_intersect_range (*cloog_pointers__.p_isl_map_intersect_range)
+#define isl_map_is_empty (*cloog_pointers__.p_isl_map_is_empty)
+#define isl_map_lex_ge (*cloog_pointers__.p_isl_map_lex_ge)
+#define isl_map_lex_le (*cloog_pointers__.p_isl_map_lex_le)
+#define isl_map_n_out (*cloog_pointers__.p_isl_map_n_out)
+#define isl_map_range (*cloog_pointers__.p_isl_map_range)
+#define isl_map_set_tuple_id (*cloog_pointers__.p_isl_map_set_tuple_id)
+#define isl_map_universe (*cloog_pointers__.p_isl_map_universe)
+#define isl_options_set_on_error (*cloog_pointers__.p_isl_options_set_on_error)
+#define isl_options_set_schedule_fuse (*cloog_pointers__.p_isl_options_set_schedule_fuse)
+#define isl_options_set_schedule_max_constant_term (*cloog_pointers__.p_isl_options_set_schedule_max_constant_term)
+#define isl_options_set_schedule_maximize_band_depth (*cloog_pointers__.p_isl_options_set_schedule_maximize_band_depth)
+#define isl_printer_free (*cloog_pointers__.p_isl_printer_free)
+#define isl_printer_print_aff (*cloog_pointers__.p_isl_printer_print_aff)
+#define isl_printer_print_constraint (*cloog_pointers__.p_isl_printer_print_constraint)
+#define isl_printer_print_map (*cloog_pointers__.p_isl_printer_print_map)
+#define isl_printer_print_set (*cloog_pointers__.p_isl_printer_print_set)
+#define isl_printer_to_file (*cloog_pointers__.p_isl_printer_to_file)
+#define isl_pw_aff_add (*cloog_pointers__.p_isl_pw_aff_add)
+#define isl_pw_aff_alloc (*cloog_pointers__.p_isl_pw_aff_alloc)
+#define isl_pw_aff_copy (*cloog_pointers__.p_isl_pw_aff_copy)
+#define isl_pw_aff_eq_set (*cloog_pointers__.p_isl_pw_aff_eq_set)
+#define isl_pw_aff_free (*cloog_pointers__.p_isl_pw_aff_free)
+#define isl_pw_aff_from_aff (*cloog_pointers__.p_isl_pw_aff_from_aff)
+#define isl_pw_aff_ge_set (*cloog_pointers__.p_isl_pw_aff_ge_set)
+#define isl_pw_aff_gt_set (*cloog_pointers__.p_isl_pw_aff_gt_set)
+#define isl_pw_aff_is_cst (*cloog_pointers__.p_isl_pw_aff_is_cst)
+#define isl_pw_aff_le_set (*cloog_pointers__.p_isl_pw_aff_le_set)
+#define isl_pw_aff_lt_set (*cloog_pointers__.p_isl_pw_aff_lt_set)
+#define isl_pw_aff_mod (*cloog_pointers__.p_isl_pw_aff_mod)
+#define isl_pw_aff_mul (*cloog_pointers__.p_isl_pw_aff_mul)
+#define isl_pw_aff_ne_set (*cloog_pointers__.p_isl_pw_aff_ne_set)
+#define isl_pw_aff_nonneg_set (*cloog_pointers__.p_isl_pw_aff_nonneg_set)
+#define isl_pw_aff_set_tuple_id (*cloog_pointers__.p_isl_pw_aff_set_tuple_id)
+#define isl_pw_aff_sub (*cloog_pointers__.p_isl_pw_aff_sub)
+#define isl_pw_aff_zero_set (*cloog_pointers__.p_isl_pw_aff_zero_set)
+#define isl_schedule_free (*cloog_pointers__.p_isl_schedule_free)
+#define isl_schedule_get_band_forest (*cloog_pointers__.p_isl_schedule_get_band_forest)
+#define isl_set_add_constraint (*cloog_pointers__.p_isl_set_add_constraint)
+#define isl_set_add_dims (*cloog_pointers__.p_isl_set_add_dims)
+#define isl_set_apply (*cloog_pointers__.p_isl_set_apply)
+#define isl_set_coalesce (*cloog_pointers__.p_isl_set_coalesce)
+#define isl_set_copy (*cloog_pointers__.p_isl_set_copy)
+#define isl_set_dim (*cloog_pointers__.p_isl_set_dim)
+#define isl_set_fix_si (*cloog_pointers__.p_isl_set_fix_si)
+#define isl_set_free (*cloog_pointers__.p_isl_set_free)
+#define isl_set_from_cloog_domain (*cloog_pointers__.p_isl_set_from_cloog_domain)
+#define isl_set_get_space (*cloog_pointers__.p_isl_set_get_space)
+#define isl_set_get_tuple_id (*cloog_pointers__.p_isl_set_get_tuple_id)
+#define isl_set_intersect (*cloog_pointers__.p_isl_set_intersect)
+#define isl_set_is_empty (*cloog_pointers__.p_isl_set_is_empty)
+#define isl_set_max (*cloog_pointers__.p_isl_set_max)
+#define isl_set_min (*cloog_pointers__.p_isl_set_min)
+#define isl_set_n_dim (*cloog_pointers__.p_isl_set_n_dim)
+#define isl_set_nat_universe (*cloog_pointers__.p_isl_set_nat_universe)
+#define isl_set_project_out (*cloog_pointers__.p_isl_set_project_out)
+#define isl_set_set_tuple_id (*cloog_pointers__.p_isl_set_set_tuple_id)
+#define isl_set_universe (*cloog_pointers__.p_isl_set_universe)
+#define isl_space_add_dims (*cloog_pointers__.p_isl_space_add_dims)
+#define isl_space_alloc (*cloog_pointers__.p_isl_space_alloc)
+#define isl_space_copy (*cloog_pointers__.p_isl_space_copy)
+#define isl_space_dim (*cloog_pointers__.p_isl_space_dim)
+#define isl_space_domain (*cloog_pointers__.p_isl_space_domain)
+#define isl_space_find_dim_by_id (*cloog_pointers__.p_isl_space_find_dim_by_id)
+#define isl_space_free (*cloog_pointers__.p_isl_space_free)
+#define isl_space_from_domain (*cloog_pointers__.p_isl_space_from_domain)
+#define isl_space_get_tuple_id (*cloog_pointers__.p_isl_space_get_tuple_id)
+#define isl_space_params_alloc (*cloog_pointers__.p_isl_space_params_alloc)
+#define isl_space_range (*cloog_pointers__.p_isl_space_range)
+#define isl_space_set_alloc (*cloog_pointers__.p_isl_space_set_alloc)
+#define isl_space_set_dim_id (*cloog_pointers__.p_isl_space_set_dim_id)
+#define isl_space_set_tuple_id (*cloog_pointers__.p_isl_space_set_tuple_id)
+#define isl_union_map_add_map (*cloog_pointers__.p_isl_union_map_add_map)
+#define isl_union_map_align_params (*cloog_pointers__.p_isl_union_map_align_params)
+#define isl_union_map_apply_domain (*cloog_pointers__.p_isl_union_map_apply_domain)
+#define isl_union_map_apply_range (*cloog_pointers__.p_isl_union_map_apply_range)
+#define isl_union_map_compute_flow (*cloog_pointers__.p_isl_union_map_compute_flow)
+#define isl_union_map_copy (*cloog_pointers__.p_isl_union_map_copy)
+#define isl_union_map_empty (*cloog_pointers__.p_isl_union_map_empty)
+#define isl_union_map_flat_range_product (*cloog_pointers__.p_isl_union_map_flat_range_product)
+#define isl_union_map_foreach_map (*cloog_pointers__.p_isl_union_map_foreach_map)
+#define isl_union_map_free (*cloog_pointers__.p_isl_union_map_free)
+#define isl_union_map_from_map (*cloog_pointers__.p_isl_union_map_from_map)
+#define isl_union_map_get_ctx (*cloog_pointers__.p_isl_union_map_get_ctx)
+#define isl_union_map_get_space (*cloog_pointers__.p_isl_union_map_get_space)
+#define isl_union_map_gist_domain (*cloog_pointers__.p_isl_union_map_gist_domain)
+#define isl_union_map_gist_range (*cloog_pointers__.p_isl_union_map_gist_range)
+#define isl_union_map_intersect_domain (*cloog_pointers__.p_isl_union_map_intersect_domain)
+#define isl_union_map_is_empty (*cloog_pointers__.p_isl_union_map_is_empty)
+#define isl_union_map_subtract (*cloog_pointers__.p_isl_union_map_subtract)
+#define isl_union_map_union (*cloog_pointers__.p_isl_union_map_union)
+#define isl_union_set_add_set (*cloog_pointers__.p_isl_union_set_add_set)
+#define isl_union_set_compute_schedule (*cloog_pointers__.p_isl_union_set_compute_schedule)
+#define isl_union_set_copy (*cloog_pointers__.p_isl_union_set_copy)
+#define isl_union_set_empty (*cloog_pointers__.p_isl_union_set_empty)
+#define isl_union_set_from_set (*cloog_pointers__.p_isl_union_set_from_set)
+#define stmt_ass (*cloog_pointers__.p_stmt_ass)
+#define stmt_block (*cloog_pointers__.p_stmt_block)
+#define stmt_for (*cloog_pointers__.p_stmt_for)
+#define stmt_guard (*cloog_pointers__.p_stmt_guard)
+#define stmt_root (*cloog_pointers__.p_stmt_root)
+#define stmt_user (*cloog_pointers__.p_stmt_user)
+
typedef struct poly_dr *poly_dr_p;
typedef struct poly_bb *poly_bb_p;
--- a/gcc/graphite.c.jj 2012-12-13 11:31:00.000000000 +0100
+++ b/gcc/graphite.c 2012-12-14 13:40:44.155136961 +0100
@@ -78,6 +78,34 @@ along with GCC; see the file COPYING3.
CloogState *cloog_state;
+__typeof (cloog_pointers__) cloog_pointers__;
+
+static bool
+init_cloog_pointers (void)
+{
+ void *h;
+
+ if (cloog_pointers__.inited)
+ return cloog_pointers__.h != NULL;
+ h = dlopen ("libcloog-isl.so.4", RTLD_LAZY);
+ cloog_pointers__.h = h;
+ if (h == NULL)
+ return false;
+#define DYNSYM(x) \
+ do \
+ { \
+ union { __typeof (cloog_pointers__.p_##x) p; void *q; } u; \
+ u.q = dlsym (h, #x); \
+ if (u.q == NULL) \
+ return false; \
+ cloog_pointers__.p_##x = u.p; \
+ } \
+ while (0)
+ DYNSYMS
+#undef DYNSYM
+ return true;
+}
+
/* Print global statistics to FILE. */
static void
@@ -277,6 +305,15 @@ graphite_transform_loops (void)
if (parallelized_function_p (cfun->decl))
return;
+ if (number_of_loops (cfun) <= 1)
+ return;
+
+ if (!init_cloog_pointers ())
+ {
+ sorry ("Graphite loop optimizations cannot be used");
+ return;
+ }
+
ctx = isl_ctx_alloc ();
isl_options_set_on_error (ctx, ISL_ON_ERROR_ABORT);
if (!graphite_initialize (ctx))
--- a/gcc/graphite-clast-to-gimple.c.jj 2012-12-13 11:31:27.000000000 +0100
+++ b/gcc/graphite-clast-to-gimple.c 2012-12-14 13:27:47.196519858 +0100
@@ -910,7 +910,7 @@ compute_bounds_for_loop (struct clast_fo
from STMT_FOR. */
static tree
-type_for_clast_for (struct clast_for *stmt_for, ivs_params_p ip)
+type_for_clast_for (struct clast_for *stmt_fora, ivs_params_p ip)
{
mpz_t bound_one, bound_two;
tree lb_type, ub_type;
@@ -918,8 +918,8 @@ type_for_clast_for (struct clast_for *st
mpz_init (bound_one);
mpz_init (bound_two);
- lb_type = type_for_clast_expr (stmt_for->LB, ip, bound_one, bound_two);
- ub_type = type_for_clast_expr (stmt_for->UB, ip, bound_one, bound_two);
+ lb_type = type_for_clast_expr (stmt_fora->LB, ip, bound_one, bound_two);
+ ub_type = type_for_clast_expr (stmt_fora->UB, ip, bound_one, bound_two);
mpz_clear (bound_one);
mpz_clear (bound_two);

+ 0
- 106
base/gcc/gcc49-pr38757.patch

@ -1,106 +0,0 @@
2009-03-18 Jakub Jelinek <jakub@redhat.com>
PR debug/38757
* langhooks.h (struct lang_hooks): Add source_language langhook.
* langhooks-def.h (LANG_HOOKS_SOURCE_LANGUAGE): Define to NULL.
(LANG_HOOKS_INITIALIZER): Add LANG_HOOKS_SOURCE_LANGUAGE.
* dwarf2out.c (add_prototyped_attribute): Add DW_AT_prototype
also for DW_LANG_{C,C99,ObjC}.
(gen_compile_unit_die): Use lang_hooks.source_language () to
determine if DW_LANG_C99 or DW_LANG_C89 should be returned.
c/
* c-lang.c (c_source_language): New function.
(LANG_HOOKS_SOURCE_LANGUAGE): Define.
--- ./gcc/langhooks.h.jj 2011-01-03 12:53:05.125745450 +0100
+++ ./gcc/langhooks.h 2011-01-04 17:59:43.166744926 +0100
@@ -467,6 +467,10 @@ struct lang_hooks
gimplification. */
bool deep_unsharing;
+ /* Return year of the source language standard version if the FE supports
+ multiple versions of the standard. */
+ int (*source_language) (void);
+
/* Whenever you add entries here, make sure you adjust langhooks-def.h
and langhooks.c accordingly. */
};
--- ./gcc/langhooks-def.h.jj 2011-01-03 12:53:05.000000000 +0100
+++ ./gcc/langhooks-def.h 2011-01-04 18:00:44.858851030 +0100
@@ -118,6 +118,7 @@ extern void lhd_omp_firstprivatize_type_
#define LANG_HOOKS_BLOCK_MAY_FALLTHRU hook_bool_const_tree_true
#define LANG_HOOKS_EH_USE_CXA_END_CLEANUP false
#define LANG_HOOKS_DEEP_UNSHARING false
+#define LANG_HOOKS_SOURCE_LANGUAGE NULL
/* Attribute hooks. */
#define LANG_HOOKS_ATTRIBUTE_TABLE NULL
@@ -303,7 +304,8 @@ extern void lhd_end_section (void);
LANG_HOOKS_EH_PROTECT_CLEANUP_ACTIONS, \
LANG_HOOKS_BLOCK_MAY_FALLTHRU, \
LANG_HOOKS_EH_USE_CXA_END_CLEANUP, \
- LANG_HOOKS_DEEP_UNSHARING \
+ LANG_HOOKS_DEEP_UNSHARING, \
+ LANG_HOOKS_SOURCE_LANGUAGE \
}
#endif /* GCC_LANG_HOOKS_DEF_H */
--- ./gcc/c/c-lang.c.jj 2011-01-03 12:53:05.376056936 +0100
+++ ./gcc/c/c-lang.c 2011-01-04 17:59:43.167743798 +0100
@@ -36,6 +36,12 @@ along with GCC; see the file COPYING3.
enum c_language_kind c_language = clk_c;
+static int
+c_source_language (void)
+{
+ return flag_isoc99 ? 1999 : 1989;
+}
+
/* Lang hooks common to C and ObjC are declared in c-objc-common.h;
consequently, there should be very few hooks below. */
@@ -45,6 +51,8 @@ enum c_language_kind c_language = clk_c;
#define LANG_HOOKS_INIT c_objc_common_init
#undef LANG_HOOKS_INIT_TS
#define LANG_HOOKS_INIT_TS c_common_init_ts
+#undef LANG_HOOKS_SOURCE_LANGUAGE
+#define LANG_HOOKS_SOURCE_LANGUAGE c_source_language
/* Each front end provides its own lang hook initializer. */
struct lang_hooks lang_hooks = LANG_HOOKS_INITIALIZER;
--- ./gcc/dwarf2out.c.jj 2011-01-03 12:53:05.102056475 +0100
+++ ./gcc/dwarf2out.c 2011-01-04 18:03:14.534151763 +0100
@@ -16109,9 +16109,18 @@ add_bit_size_attribute (dw_die_ref die,
static inline void
add_prototyped_attribute (dw_die_ref die, tree func_type)
{
- if (get_AT_unsigned (comp_unit_die (), DW_AT_language) == DW_LANG_C89
- && prototype_p (func_type))
- add_AT_flag (die, DW_AT_prototyped, 1);
+ switch (get_AT_unsigned (comp_unit_die (), DW_AT_language))
+ {
+ case DW_LANG_C:
+ case DW_LANG_C89:
+ case DW_LANG_C99:
+ case DW_LANG_ObjC:
+ if (prototype_p (func_type))
+ add_AT_flag (die, DW_AT_prototyped, 1);
+ break;
+ default:
+ break;
+ }
}
/* Add an 'abstract_origin' attribute below a given DIE. The DIE is found
@@ -18915,6 +18924,10 @@ gen_compile_unit_die (const char *filena
if (strcmp (language_string, "GNU Go") == 0)
language = DW_LANG_Go;
}
+ else if (strcmp (language_string, "GNU C") == 0
+ && lang_hooks.source_language
+ && lang_hooks.source_language () >= 1999)
+ language = DW_LANG_C99;
}
/* Use a degraded Fortran setting in strict DWARF2 so is_fortran works. */
else if (strcmp (language_string, "GNU Fortran") == 0)

+ 55
- 0
base/gcc/libgcc-always-build-gcceh.a.patch

@ -0,0 +1,55 @@
# --- SDE-COPYRIGHT-NOTE-BEGIN ---
# This copyright note is auto-generated by ./scripts/Create-CopyPatch.
#
# Filename: package/.../gcc/libgcc-always-build-gcceh.a.patch
# Copyright (C) 2015 The OpenSDE Project
#
# More information can be found in the files COPYING and README.
#
# This patch file is dual-licensed. It is available under the license the
# patched project is licensed under, as long as it is an OpenSource license
# as defined at http://www.opensource.org/ (e.g. BSD, X11) or under the terms
# of the GNU General Public License as published by the Free Software
# Foundation; either version 2 of the License, or (at your option) any later
# version.
# --- SDE-COPYRIGHT-NOTE-END ---
Highly inspired by:
http://landley.net/hg/aboriginal/file/7e0747a665ab/sources/patches/gcc-core-libgcceh.patch
diff -durN gcc-4.6.0.orig/libgcc/Makefile.in gcc-4.6.0/libgcc/Makefile.in
--- gcc-4.6.0.orig/libgcc/Makefile.in 2011-01-26 05:19:58.000000000 +0100
+++ gcc-4.6.0/libgcc/Makefile.in 2011-09-12 18:17:12.743718974 +0200
@@ -772,8 +772,9 @@
libgcc_s$(SHLIB_EXT): libunwind$(SHLIB_EXT)
endif
+all: libgcc_eh.a
ifeq ($(enable_shared),yes)
-all: libgcc_eh.a libgcc_s$(SHLIB_EXT)
+all: libgcc_s$(SHLIB_EXT)
ifneq ($(LIBUNWIND),)
all: libunwind$(SHLIB_EXT)
endif
@@ -950,10 +951,6 @@
install-shared:
$(mkinstalldirs) $(DESTDIR)$(inst_libdir)
- $(INSTALL_DATA) libgcc_eh.a $(DESTDIR)$(inst_libdir)/
- chmod 644 $(DESTDIR)$(inst_libdir)/libgcc_eh.a
- $(RANLIB) $(DESTDIR)$(inst_libdir)/libgcc_eh.a
-
$(subst @multilib_dir@,$(MULTIDIR),$(subst \
@shlib_base_name@,libgcc_s,$(subst \
@shlib_slibdir_qual@,$(MULTIOSSUBDIR),$(SHLIB_INSTALL))))
@@ -968,6 +965,10 @@
chmod 644 $(DESTDIR)$(inst_libdir)/libgcov.a
$(RANLIB) $(DESTDIR)$(inst_libdir)/libgcov.a
+ $(INSTALL_DATA) libgcc_eh.a $(DESTDIR)$(inst_libdir)/
+ chmod 644 $(DESTDIR)$(inst_libdir)/libgcc_eh.a
+ $(RANLIB) $(DESTDIR)$(inst_libdir)/libgcc_eh.a
+
parts="$(INSTALL_PARTS)"; \
for file in $$parts; do \
rm -f $(DESTDIR)$(inst_libdir)/$$file; \

+ 0
- 34
base/gcc/no-fixincludes.patch

@ -1,34 +0,0 @@
# --- SDE-COPYRIGHT-NOTE-BEGIN ---
# This copyright note is auto-generated by ./scripts/Create-CopyPatch.
#
# Filename: package/.../gcc/no-fixincludes.patch
# Copyright (C) 2010 - 2011 The OpenSDE Project
#
# More information can be found in the files COPYING and README.
#
# This patch file is dual-licensed. It is available under the license the
# patched project is licensed under, as long as it is an OpenSource license
# as defined at http://www.opensource.org/ (e.g. BSD, X11) or under the terms
# of the GNU General Public License as published by the Free Software
# Foundation; either version 2 of the License, or (at your option) any later
# version.
# --- SDE-COPYRIGHT-NOTE-END ---
# Do not run the 'fixinc.sh' script.
# The fixincludes script attempts to "fix" the system headers installed so far.
# Since GCC is cross-compiled expecting the system headers to be in
# /usr/include, the script will be looking at the host system's headers.
diff --git a/gcc/Makefile.in b/gcc/Makefile.in
index 60dcee5..e5cff9c 100644
--- a/gcc/Makefile.in
+++ b/gcc/Makefile.in
@@ -4168,7 +4168,7 @@ stmp-fixinc: gsyslimits.h macro_list fixinc_list \
gcc_dir=`${PWD_COMMAND}` ; \
export TARGET_MACHINE srcdir SHELL MACRO_LIST && \
cd $(build_objdir)/fixincludes && \
- $(SHELL) ./fixinc.sh "$${gcc_dir}/$${fix_dir}" \
+ $(SHELL) -c true "$${gcc_dir}/$${fix_dir}" \
$(SYSTEM_HEADER_DIR) $(OTHER_FIXINCLUDES_DIRS) ); \
rm -f $${fix_dir}/syslimits.h; \
if [ -f $${fix_dir}/limits.h ]; then \

+ 0
- 86
base/gcc/no-include-fixed-dir.patch

@ -1,86 +0,0 @@
# --- SDE-COPYRIGHT-NOTE-BEGIN ---
# This copyright note is auto-generated by ./scripts/Create-CopyPatch.
#
# Filename: package/.../gcc/no-include-fixed-dir.patch
# Copyright (C) 2010 The OpenSDE Project
#
# More information can be found in the files COPYING and README.
#
# This patch file is dual-licensed. It is available under the license the
# patched project is licensed under, as long as it is an OpenSource license
# as defined at http://www.opensource.org/ (e.g. BSD, X11) or under the terms
# of the GNU General Public License as published by the Free Software
# Foundation; either version 2 of the License, or (at your option) any later
# version.
# --- SDE-COPYRIGHT-NOTE-END ---
# Do not create a 'include-fixed' directory containing certain header files,
# but install the header file into the default include directory.
#
# Without this patch a 'include-fixed' directory is created on install, where
# the 'limits.h' and 'syslimits.h' header files get installed as following
# flist output is demonstrating:
# --------------------------------------------------------------------------
# gcc: usr/lib/gcc/i686-unknown-linux-gnu/4.4.3/include-fixed
# gcc: usr/lib/gcc/i686-unknown-linux-gnu/4.4.3/include-fixed/README
# gcc: usr/lib/gcc/i686-unknown-linux-gnu/4.4.3/include-fixed/limits.h
# gcc: usr/lib/gcc/i686-unknown-linux-gnu/4.4.3/include-fixed/syslimits.h
# --------------------------------------------------------------------------
--- gcc-4.4.3/gcc/Makefile.in.orig 2010-03-22 12:15:16.545004067 +0100
+++ gcc-4.4.3/gcc/Makefile.in 2010-03-22 12:21:27.841867139 +0100
@@ -4277,10 +4277,10 @@
if [ $$? -eq 0 ]; then \
dir=`cd include-fixed; ${PWD_COMMAND}`; \
for i in $$files; do \
- dest=`ls -ld $(DESTDIR)$(libsubdir)/include-fixed/$$i | sed -n 's/.*-> //p'`; \
+ dest=`ls -ld $(DESTDIR)$(libsubdir)/include/$$i | sed -n 's/.*-> //p'`; \
if expr "$$dest" : "$$dir.*" > /dev/null; then \
rm -f $(DESTDIR)$(libsubdir)/include-fixed/$$i; \
- ln -s `echo $$i | sed "s|/[^/]*|/..|g" | sed 's|/..$$||'``echo "$$dest" | sed "s|$$dir||"` $(DESTDIR)$(libsubdir)/include-fixed/$$i; \
+ ln -s `echo $$i | sed "s|/[^/]*|/..|g" | sed 's|/..$$||'``echo "$$dest" | sed "s|$$dir||"` $(DESTDIR)$(libsubdir)/include/$$i; \
fi; \
done; \
fi
@@ -4288,9 +4288,6 @@
# Create or recreate the gcc private include file directory.
install-include-dir: installdirs
$(mkinstalldirs) $(DESTDIR)$(libsubdir)/include
- -rm -rf $(DESTDIR)$(libsubdir)/include-fixed
- mkdir $(DESTDIR)$(libsubdir)/include-fixed
- -chmod a+rx $(DESTDIR)$(libsubdir)/include-fixed
# Create or recreate the install-tools include file directory.
itoolsdir = $(libexecsubdir)/install-tools
@@ -4308,7 +4305,7 @@
(cd `${PWD_COMMAND}`/include ; \
tar -cf - .; exit 0) | (cd $(DESTDIR)$(libsubdir)/include; tar xpf - )
(cd `${PWD_COMMAND}`/include-fixed ; \
- tar -cf - .; exit 0) | (cd $(DESTDIR)$(libsubdir)/include-fixed; tar xpf - )
+ tar -cf - .; exit 0) | (cd $(DESTDIR)$(libsubdir)/include; tar xpf - )
# /bin/sh on some systems returns the status of the first tar,
# and that can lose with GNU tar which always writes a full block.
# So use `exit 0' to ignore its exit status.
@@ -4319,7 +4316,7 @@
cd `${PWD_COMMAND}`/include ; \
find . -print | cpio -pdum $(DESTDIR)$(libsubdir)/include
cd `${PWD_COMMAND}`/include-fixed ; \
- find . -print | cpio -pdum $(DESTDIR)$(libsubdir)/include-fixed
+ find . -print | cpio -pdum $(DESTDIR)$(libsubdir)/include
# Install the include directory using cp.
install-headers-cp: stmp-int-hdrs $(STMP_FIXPROTO) install-include-dir
@@ -4329,11 +4326,11 @@
# Targets without dependencies, for use in prev-gcc during bootstrap.
real-install-headers-tar:
(cd `${PWD_COMMAND}`/include-fixed ; \
- tar -cf - .; exit 0) | (cd $(DESTDIR)$(libsubdir)/include-fixed; tar xpf - )
+ tar -cf - .; exit 0) | (cd $(DESTDIR)$(libsubdir)/include; tar xpf - )
real-install-headers-cpio:
cd `${PWD_COMMAND}`/include-fixed ; \
- find . -print | cpio -pdum $(DESTDIR)$(libsubdir)/include-fixed
+ find . -print | cpio -pdum $(DESTDIR)$(libsubdir)/include
real-install-headers-cp:
cp -p -r include-fixed $(DESTDIR)$(libsubdir)

+ 5
- 4
base/gcc/no-libstdc++.patch.toolchain

@ -2,7 +2,7 @@
# This copyright note is auto-generated by ./scripts/Create-CopyPatch.
#
# Filename: package/.../gcc/no-libstdc++.patch.toolchain
# Copyright (C) 2007 The OpenSDE Project
# Copyright (C) 2007 - 2015 The OpenSDE Project
# Copyright (C) 2004 - 2006 The T2 SDE Project
#
# More information can be found in the files COPYING and README.
@ -24,11 +24,12 @@ libstdc++ STL.
--- ./configure.orig 2005-11-24 11:58:19.000000000 +0100
+++ ./configure 2005-11-24 11:58:10.000000000 +0100
@@ -1001,7 +1001,7 @@
# Skipdirs are removed silently.
-skipdirs=
+skipdirs=target-libstdc++-v3
# Noconfigdirs are removed loudly.
noconfigdirs=""

+ 33
- 0
base/gcc/pr63740.patch

@ -0,0 +1,33 @@
# --- SDE-COPYRIGHT-NOTE-BEGIN ---
# This copyright note is auto-generated by ./scripts/Create-CopyPatch.
#
# Filename: package/.../gcc/pr63740.patch
# Copyright (C) 2015 The OpenSDE Project
#
# More information can be found in the files COPYING and README.
#
# This patch file is dual-licensed. It is available under the license the
# patched project is licensed under, as long as it is an OpenSource license
# as defined at http://www.opensource.org/ (e.g. BSD, X11) or under the terms
# of the GNU General Public License as published by the Free Software
# Foundation; either version 2 of the License, or (at your option) any later
# version.
# --- SDE-COPYRIGHT-NOTE-END ---
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63740
--- trunk/gcc/lra-lives.c 2014/06/16 09:25:26 211700
+++ trunk/gcc/lra-lives.c 2014/06/16 09:58:34 211701
@@ -558,7 +558,11 @@
/* It might be 'inheritance pseudo <- reload pseudo'. */
|| (src_regno >= lra_constraint_new_regno_start
&& ((int) REGNO (SET_DEST (set))
- >= lra_constraint_new_regno_start))))
+ >= lra_constraint_new_regno_start)
+ /* Remember to skip special cases where src/dest regnos are
+ the same, e.g. insn SET pattern has matching constraints
+ like =r,0. */
+ && src_regno != (int) REGNO (SET_DEST (set)))))
{
int hard_regno = -1, regno = -1;

+ 99
- 0
base/gcc/pr64037.patch

@ -0,0 +1,99 @@
# --- SDE-COPYRIGHT-NOTE-BEGIN ---
# This copyright note is auto-generated by ./scripts/Create-CopyPatch.
#
# Filename: package/.../gcc/pr64037.patch
# Copyright (C) 2015 The OpenSDE Project
#
# More information can be found in the files COPYING and README.
#
# This patch file is dual-licensed. It is available under the license the
# patched project is licensed under, as long as it is an OpenSource license
# as defined at http://www.opensource.org/ (e.g. BSD, X11) or under the terms
# of the GNU General Public License as published by the Free Software
# Foundation; either version 2 of the License, or (at your option) any later
# version.
# --- SDE-COPYRIGHT-NOTE-END ---
https://gcc.gnu.org/git/?p=gcc.git;a=patch;h=0817dc6f0e6b973e0e3671eb72d3758a8f042324
(changelog changes removed)
From 0817dc6f0e6b973e0e3671eb72d3758a8f042324 Mon Sep 17 00:00:00 2001
From: hjl <hjl@138bc75d-0d04-0410-961f-82ee72b054a4>
Date: Sun, 14 Dec 2014 16:07:03 +0000
Subject: [PATCH] Pass unpromoted argument to promote_function_mode
This patch updates setup_incoming_promotions in combine.c to match what
is actually passed in assign_parm_setup_reg in function.c.
Backported from mainline:
gcc/
PR rtl-optimization/64037
* combine.c (setup_incoming_promotions): Pass the argument
before any promotions happen to promote_function_mode.
gcc/testsuite/
PR rtl-optimization/64037
* g++.dg/pr64037.C: New test.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/gcc-4_9-branch@218721 138bc75d-0d04-0410-961f-82ee72b054a4
---
gcc/combine.c | 4 ++--
gcc/testsuite/g++.dg/pr64037.C | 27 +++++++++++++++++++++++++++
4 files changed, 46 insertions(+), 2 deletions(-)
create mode 100644 gcc/testsuite/g++.dg/pr64037.C
diff --git a/gcc/combine.c b/gcc/combine.c
index 7c00452..adea2c1 100644
--- a/gcc/combine.c
+++ b/gcc/combine.c
@@ -1529,8 +1529,8 @@ setup_incoming_promotions (rtx first)
uns3 = TYPE_UNSIGNED (DECL_ARG_TYPE (arg));
/* The mode and signedness of the argument as it is actually passed,
- after any TARGET_PROMOTE_FUNCTION_ARGS-driven ABI promotions. */
- mode3 = promote_function_mode (DECL_ARG_TYPE (arg), mode2, &uns3,
+ see assign_parm_setup_reg in function.c. */
+ mode3 = promote_function_mode (TREE_TYPE (arg), mode1, &uns3,
TREE_TYPE (cfun->decl), 0);
/* The mode of the register in which the argument is being passed. */
diff --git a/gcc/testsuite/g++.dg/pr64037.C b/gcc/testsuite/g++.dg/pr64037.C
new file mode 100644
index 0000000..e5cd0e2
--- /dev/null
+++ b/gcc/testsuite/g++.dg/pr64037.C
@@ -0,0 +1,27 @@
+// { dg-do run { target i?86-*-* x86_64-*-* } }
+// { dg-options "-std=c++11 -Os" }
+
+enum class X : unsigned char {
+ V = 2,
+};
+
+static void
+__attribute__((noinline,noclone))
+foo(unsigned &out, unsigned a, X b)
+{
+ out = static_cast<unsigned>(b);
+}
+
+int main()
+{
+ unsigned deadbeef = 0xDEADBEEF;
+ asm volatile ("" : "+d" (deadbeef), "+c" (deadbeef));
+
+ unsigned out;
+ foo(out, 2, X::V);
+
+ if (out != 2)
+ __builtin_abort ();
+
+ return 0;
+}
--
1.7.1

base/musl/pkg/gcc/gcc-4.9-musl.patch → base/musl/pkg/gcc/01_gcc-4.9-musl.patch

@ -1,3 +1,19 @@
# --- SDE-COPYRIGHT-NOTE-BEGIN ---
# This copyright note is auto-generated by ./scripts/Create-CopyPatch.
#
# Filename: package/.../musl/pkg/gcc/01_gcc-4.9-musl.patch
# Copyright (C) 2015 The OpenSDE Project
#
# More information can be found in the files COPYING and README.
#
# This patch file is dual-licensed. It is available under the license the
# patched project is licensed under, as long as it is an OpenSource license
# as defined at http://www.opensource.org/ (e.g. BSD, X11) or under the terms
# of the GNU General Public License as published by the Free Software
# Foundation; either version 2 of the License, or (at your option) any later
# version.
# --- SDE-COPYRIGHT-NOTE-END ---
# HG changeset patch
# Parent 2f9df662aaaba956600bbdb123b6a227c8e64c59
Use the generic implementation of libstdc++ primitives when we're on musl, not the glibc one.

+ 27
- 0
base/musl/pkg/gcc/gcc-4.9-musl-fortify.patch

@ -0,0 +1,27 @@
# --- SDE-COPYRIGHT-NOTE-BEGIN ---
# This copyright note is auto-generated by ./scripts/Create-CopyPatch.
#
# Filename: package/.../musl/pkg/gcc/gcc-4.9-musl-fortify.patch
# Copyright (C) 2015 The OpenSDE Project
#
# More information can be found in the files COPYING and README.
#
# This patch file is dual-licensed. It is available under the license the
# patched project is licensed under, as long as it is an OpenSource license
# as defined at http://www.opensource.org/ (e.g. BSD, X11) or under the terms
# of the GNU General Public License as published by the Free Software
# Foundation; either version 2 of the License, or (at your option) any later
# version.
# --- SDE-COPYRIGHT-NOTE-END ---
--- gcc-4.9.2/gcc/config/linux.h.orig 2015-03-09 13:27:13.289736710 +0000
+++ gcc-4.9.2/gcc/config/linux.h 2015-03-09 13:29:32.295625046 +0000
@@ -146,6 +146,8 @@
#ifdef NATIVE_SYSTEM_HEADER_DIR
#define INCLUDE_DEFAULTS_MUSL_NATIVE \
+ { NATIVE_SYSTEM_HEADER_DIR "/fortify", 0, 0, 0, 1, 2 }, \
+ { NATIVE_SYSTEM_HEADER_DIR "/fortify", 0, 0, 0, 1, 0 }, \
{ NATIVE_SYSTEM_HEADER_DIR, 0, 0, 0, 1, 2 }, \
{ NATIVE_SYSTEM_HEADER_DIR, 0, 0, 0, 1, 0 },
#else

+ 43
- 0
base/musl/pkg/gcc/musl-posix_memalign-c++.patch

@ -0,0 +1,43 @@
# --- SDE-COPYRIGHT-NOTE-BEGIN ---
# This copyright note is auto-generated by ./scripts/Create-CopyPatch.
#
# Filename: package/.../musl/pkg/gcc/musl-posix_memalign-c++.patch
# Copyright (C) 2015 The OpenSDE Project
#
# More information can be found in the files COPYING and README.
#
# This patch file is dual-licensed. It is available under the license the
# patched project is licensed under, as long as it is an OpenSource license
# as defined at http://www.opensource.org/ (e.g. BSD, X11) or under the terms
# of the GNU General Public License as published by the Free Software
# Foundation; either version 2 of the License, or (at your option) any later
# version.
# --- SDE-COPYRIGHT-NOTE-END ---
Fix conflicting prototype of posix_memalign for c++
http://www.openwall.com/lists/musl/2013/11/10/1
--- ./gcc/config/i386/pmm_malloc.h.orig
+++ ./gcc/config/i386/pmm_malloc.h
@@ -28,11 +28,7 @@
/* We can't depend on <stdlib.h> since the prototype of posix_memalign
may not be visible. */
-#ifndef __cplusplus
-extern int posix_memalign (void **, size_t, size_t);
-#else
-extern "C" int posix_memalign (void **, size_t, size_t) throw ();
-#endif
+extern int __gcc_posix_memalign (void **, size_t, size_t) __asm__("posix_memalign");
static __inline void *
_mm_malloc (size_t size, size_t alignment)
@@ -42,7 +38,7 @@
return malloc (size);
if (alignment == 2 || (sizeof (void *) == 8 && alignment == 4))
alignment = sizeof (void *);
- if (posix_memalign (&ptr, alignment, size) == 0)
+ if (__gcc_posix_memalign (&ptr, alignment, size) == 0)
return ptr;
else
return NULL;

Loading…
Cancel
Save