Commit 5b7befa1 authored by Timo Teräs's avatar Timo Teräs Committed by Natanael Copa

main/gcc: upgrade to 6.1.0

- use --enable-default-pie
- patch bind now, ssp-strong, fortify and as-needed to be defaults
- remove gentoo esp patches as unneeded (deprecated by the above)
- update ecj
- remove upstreamed musl patches, add current musl patches
- support musl's static pie
- fix some bootstrapping related issues
parent 25c19fed
This diff is collapsed.
# Turn on -Wl,-z,relro,-z,now by default.
---
gcc/doc/invoke.texi | 3 +++
gcc/gcc.c | 1 +
2 files changed, 4 insertions(+), 0 deletions(-)
Index: b/gcc/doc/invoke.texi
===================================================================
--- a/gcc/doc/invoke.texi
+++ b/gcc/doc/invoke.texi
@@ -11424,6 +11424,9 @@ For example, @option{-Wl,-Map,output.map
linker. When using the GNU linker, you can also get the same effect with
@option{-Wl,-Map=output.map}.
+NOTE: In Alpine Linux, for LDFLAGS, the option
+@option{-Wl,-z,relro,now} is used. To disable, use @option{-Wl,-z,norelro}.
+
@item -u @var{symbol}
@opindex u
Pretend the symbol @var{symbol} is undefined, to force linking of
Index: b/gcc/gcc.c
===================================================================
--- a/gcc/gcc.c
+++ b/gcc/gcc.c
@@ -890,6 +890,7 @@ proper position among the other output f
"%{flto|flto=*:%<fcompare-debug*} \
%{flto} %{fno-lto} %{flto=*} %l " LINK_PIE_SPEC \
"%{fuse-ld=*:-fuse-ld=%*} " LINK_COMPRESS_DEBUG_SPEC \
+ "-z relro -z now " \
"%X %{o*} %{e*} %{N} %{n} %{r}\
%{s} %{t} %{u*} %{z} %{Z} %{!nostdlib:%{!nostartfiles:%S}} " VTABLE_VERIFICATION_SPEC " \
%{static:} %{L*} %(mfwrap) %(link_libgcc) " SANITIZER_EARLY_SPEC " %o\
# DP: Turn on -D_FORTIFY_SOURCE=2 by default for C, C++, ObjC, ObjC++,
# DP: if the optimization level is > 0
---
gcc/doc/invoke.texi | 6 ++++++
gcc/c-family/c-cppbuiltin.c | 3 +
2 files changed, 9 insertions(+), 0 deletions(-)
Index: b/gcc/doc/invoke.texi
===================================================================
--- a/gcc/doc/invoke.texi
+++ b/gcc/doc/invoke.texi
@@ -7840,6 +7840,12 @@ also turns on the following optimization
Please note the warning under @option{-fgcse} about
invoking @option{-O2} on programs that use computed gotos.
+NOTE: In Alpine Linux, @option{-D_FORTIFY_SOURCE=2} is
+set by default, and is activated when @option{-O} is set to 2 or higher.
+This enables additional compile-time and run-time checks for several libc
+functions. To disable, specify either @option{-U_FORTIFY_SOURCE} or
+@option{-D_FORTIFY_SOURCE=0}.
+
@item -O3
@opindex O3
Optimize yet more. @option{-O3} turns on all optimizations specified
Index: b/gcc/c-family/c-cppbuiltin.c
===================================================================
--- a/gcc/c-family/c-cppbuiltin.c
+++ b/gcc/c-family/c-cppbuiltin.c
@@ -1176,6 +1176,10 @@ 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 for optimization levels > 0 */
+ if (optimize)
+ builtin_define_with_int_value ("_FORTIFY_SOURCE", 2);
+
/* Misc. */
if (flag_gnu89_inline)
cpp_define (pfile, "__GNUC_GNU_INLINE__");
# DP: Link using --hash-style=gnu (aarch64, alpha, amd64, armel, armhf, ia64,
# DP: i386, powerpc, ppc64, s390, sparc)
2006-07-11 Jakub Jelinek <jakub@redhat.com>
* config/i386/linux.h (LINK_SPEC): Add --hash-style=gnu.
* config/i386/linux64.h (LINK_SPEC): Likewise.
* config/rs6000/sysv4.h (LINK_OS_LINUX_SPEC): Likewise.
* config/rs6000/linux64.h (LINK_OS_LINUX_SPEC32,
LINK_OS_LINUX_SPEC64): Likewise.
* config/s390/linux.h (LINK_SPEC): Likewise.
* config/ia64/linux.h (LINK_SPEC): Likewise.
* config/sparc/linux.h (LINK_SPEC): Likewise.
* config/sparc/linux64.h (LINK_SPEC, LINK_ARCH32_SPEC,
LINK_ARCH64_SPEC): Likewise.
* config/alpha/linux-elf.h (LINK_SPEC): Likewise.
2009-12-21 Matthias Klose <doko@ubuntu.com>
* config/arm/linux-elf.h (LINK_SPEC): Add --hash-style=gnu.
2012-11-17 Matthias Klose <doko@ubuntu.com>
* config/aarch64/aarch64-linux.h (LINK_SPEC): Add --hash-style=gnu.
---
gcc/config/alpha/linux-elf.h | 2 +-
gcc/config/i386/linux.h | 2 +-
gcc/config/i386/linux64.h | 2 +-
gcc/config/ia64/linux.h | 2 +-
gcc/config/rs6000/linux64.h | 4 ++--
gcc/config/rs6000/sysv4.h | 2 +-
gcc/config/s390/linux.h | 2 +-
gcc/config/sparc/linux.h | 2 +-
8 files changed, 9 insertions(+), 9 deletions(-)
Index: b/gcc/config/alpha/linux-elf.h
===================================================================
--- a/gcc/config/alpha/linux-elf.h
+++ b/gcc/config/alpha/linux-elf.h
@@ -37,7 +37,7 @@ along with GCC; see the file COPYING3.
#define ELF_DYNAMIC_LINKER GNU_USER_DYNAMIC_LINKER
-#define LINK_SPEC "-m elf64alpha %{G*} %{relax:-relax} \
+#define LINK_SPEC "-m elf64alpha --hash-style=gnu %{G*} %{relax:-relax} \
%{O*:-O3} %{!O*:-O1} \
%{shared:-shared} \
%{!shared: \
Index: b/gcc/config/ia64/linux.h
===================================================================
--- a/gcc/config/ia64/linux.h
+++ b/gcc/config/ia64/linux.h
@@ -58,7 +58,7 @@ do { \
#define GLIBC_DYNAMIC_LINKER "/lib/ld-linux-ia64.so.2"
#undef LINK_SPEC
-#define LINK_SPEC "\
+#define LINK_SPEC " --hash-style=gnu \
%{shared:-shared} \
%{!shared: \
%{!static: \
Index: b/gcc/config/rs6000/linux64.h
===================================================================
--- a/gcc/config/rs6000/linux64.h
+++ b/gcc/config/rs6000/linux64.h
@@ -469,12 +469,12 @@ extern int dot_symbols;
" -m elf64ppc")
#endif
-#define LINK_OS_LINUX_SPEC32 LINK_OS_LINUX_EMUL32 " %{!shared: %{!static: \
+#define LINK_OS_LINUX_SPEC32 LINK_OS_LINUX_EMUL32 " --hash-style=gnu %{!shared: %{!static: \
%{rdynamic:-export-dynamic} \
-dynamic-linker " GNU_USER_DYNAMIC_LINKER32 "}} \
%(link_os_extra_spec32)"
-#define LINK_OS_LINUX_SPEC64 LINK_OS_LINUX_EMUL64 " %{!shared: %{!static: \
+#define LINK_OS_LINUX_SPEC64 LINK_OS_LINUX_EMUL64 " --hash-style=gnu %{!shared: %{!static: \
%{rdynamic:-export-dynamic} \
-dynamic-linker " GNU_USER_DYNAMIC_LINKER64 "}} \
%(link_os_extra_spec64)"
Index: b/gcc/config/rs6000/sysv4.h
===================================================================
--- a/gcc/config/rs6000/sysv4.h
+++ b/gcc/config/rs6000/sysv4.h
@@ -784,7 +784,7 @@ ENDIAN_SELECT(" -mbig", " -mlittle", DEF
CHOOSE_DYNAMIC_LINKER (GLIBC_DYNAMIC_LINKER, UCLIBC_DYNAMIC_LINKER, \
MUSL_DYNAMIC_LINKER)
-#define LINK_OS_LINUX_SPEC "-m elf32ppclinux %{!shared: %{!static: \
+#define LINK_OS_LINUX_SPEC "-m elf32ppclinux --hash-style=gnu %{!shared: %{!static: \
%{rdynamic:-export-dynamic} \
-dynamic-linker " GNU_USER_DYNAMIC_LINKER "}}"
Index: b/gcc/config/s390/linux.h
===================================================================
--- a/gcc/config/s390/linux.h
+++ b/gcc/config/s390/linux.h
@@ -65,7 +65,7 @@ along with GCC; see the file COPYING3.
#undef LINK_SPEC
#define LINK_SPEC \
- "%{m31:-m elf_s390}%{m64:-m elf64_s390} \
+ "%{m31:-m elf_s390}%{m64:-m elf64_s390} --hash-style=gnu \
%{shared:-shared} \
%{!shared: \
%{static:-static} \
Index: b/gcc/config/sparc/linux.h
===================================================================
--- a/gcc/config/sparc/linux.h
+++ b/gcc/config/sparc/linux.h
@@ -86,7 +86,7 @@ extern const char *host_detect_local_cpu
#define GLIBC_DYNAMIC_LINKER "/lib/ld-linux.so.2"
#undef LINK_SPEC
-#define LINK_SPEC "-m elf32_sparc %{shared:-shared} \
+#define LINK_SPEC "-m elf32_sparc --hash-style=gnu %{shared:-shared} \
%{!mno-relax:%{!r:-relax}} \
%{!shared: \
%{!static: \
Index: b/gcc/config/arm/linux-elf.h
===================================================================
--- a/gcc/config/arm/linux-elf.h
+++ b/gcc/config/arm/linux-elf.h
@@ -72,6 +72,7 @@
%{rdynamic:-export-dynamic} \
%{!shared:-dynamic-linker " GNU_USER_DYNAMIC_LINKER "}} \
-X \
+ --hash-style=gnu \
%{mbig-endian:-EB} %{mlittle-endian:-EL}" \
SUBTARGET_EXTRA_LINK_SPEC
Index: b/gcc/config/i386/gnu-user.h
===================================================================
--- a/gcc/config/i386/gnu-user.h
+++ b/gcc/config/i386/gnu-user.h
@@ -74,7 +74,7 @@ along with GCC; see the file COPYING3.
{ "link_emulation", GNU_USER_LINK_EMULATION },\
{ "dynamic_linker", GNU_USER_DYNAMIC_LINKER }
-#define GNU_USER_TARGET_LINK_SPEC "-m %(link_emulation) %{shared:-shared} \
+#define GNU_USER_TARGET_LINK_SPEC "-m %(link_emulation) --hash-style=gnu %{shared:-shared} \
%{!shared: \
%{!static: \
%{rdynamic:-export-dynamic} \
Index: b/gcc/config/i386/gnu-user64.h
===================================================================
--- a/gcc/config/i386/gnu-user64.h
+++ b/gcc/config/i386/gnu-user64.h
@@ -56,6 +56,7 @@ see the files COPYING3 and COPYING.RUNTI
"%{" SPEC_64 ":-m " GNU_USER_LINK_EMULATION64 "} \
%{" SPEC_32 ":-m " GNU_USER_LINK_EMULATION32 "} \
%{" SPEC_X32 ":-m " GNU_USER_LINK_EMULATIONX32 "} \
+ --hash-style=gnu \
%{shared:-shared} \
%{!shared: \
%{!static: \
Index: b/gcc/config/aarch64/aarch64-linux.h
===================================================================
--- a/gcc/config/aarch64/aarch64-linux.h
+++ b/gcc/config/aarch64/aarch64-linux.h
@@ -35,6 +35,7 @@
#define CPP_SPEC "%{pthread:-D_REENTRANT}"
#define LINUX_TARGET_LINK_SPEC "%{h*} \
+ --hash-style=gnu \
%{static:-Bstatic} \
%{shared:-shared} \
%{symbolic:-Bsymbolic} \
This diff is collapsed.
2013-08-22 Magnus Granberg <zorry@gentoo.org>
* gcc/gcc.c (main): Add support for external spec file via the GCC_SPECS env var
and move the process of the user specifed specs.
This allows us to easily control pie/ssp defaults with gcc-config profiles.
Original patch by Rob Holland
Extended to support multiple entries separated by ':' by Kevin F. Quinn
Modified to use getenv instead of poisoned GET_ENVIRONMENT by Ryan Hill
Modified to process the GCC_SPECS env var befor DRIVER_SELF_SPECS by Magnus Granberg
--- a/gcc/gcc.c
+++ b/gcc/gcc.c
@@ -6427,6 +6428,48 @@ main (int argc, char **argv)
do_option_spec (option_default_specs[i].name,
option_default_specs[i].spec);
+#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
+ /* Process any user specified specs in the order given on the command
+ * line. */
+ for (struct user_specs *uptr = user_specs_head; uptr; uptr = uptr->next)
+ {
+ char *filename = find_a_file (&startfile_prefixes, uptr->filename,
+ R_OK, true);
+ read_specs (filename ? filename : uptr->filename, false, true);
+ }
+ /* Process any user self specs. */
+ {
+ struct spec_list *sl;
+ for (sl = specs; sl; sl = sl->next)
+ if (sl->name_len == sizeof "self_spec" - 1
+ && !strcmp (sl->name, "self_spec"))
+ do_self_spec (*sl->ptr_spec);
+ }
+
/* Process DRIVER_SELF_SPECS, adding any new options to the end
of the command line. */
@@ -6535,24 +6578,6 @@ main (int argc, char **argv)
PREFIX_PRIORITY_LAST, 0, 1);
}
- /* Process any user specified specs in the order given on the command
- line. */
- for (struct user_specs *uptr = user_specs_head; uptr; uptr = uptr->next)
- {
- char *filename = find_a_file (&startfile_prefixes, uptr->filename,
- R_OK, true);
- read_specs (filename ? filename : uptr->filename, false, true);
- }
-
- /* Process any user self specs. */
- {
- struct spec_list *sl;
- for (sl = specs; sl; sl = sl->next)
- if (sl->name_len == sizeof "self_spec" - 1
- && !strcmp (sl->name, "self_spec"))
- do_self_spec (*sl->ptr_spec);
- }
-
if (compare_debug)
{
enum save_temps save;
Enable -D_FORTIFY_SOURCE=2 by default.
--- 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 Gentoo, `-D_FORTIFY_SOURCE=2' is set by default, and is
+ activated when `-O' is set to 2 or higher. This enables additional
+ compile-time and run-time checks for several libc functions. To disable,
+ specify either `-U_FORTIFY_SOURCE' or `-D_FORTIFY_SOURCE=0'.
+
'-O3'
Optimize yet more. '-O3' turns on all optimizations specified by
'-O2' and also turns on the '-finline-functions',
......@@ -27,7 +27,7 @@ Enable -Wformat and -Wformat-security by default.
'-Wno-format-contains-nul', '-Wno-format-extra-args', and
'-Wno-format-zero-length'. '-Wformat' is enabled by '-Wall'.
+ This option is enabled by default in Gentoo.
+ This option is enabled by default in Alpine Linux.
+
'-Wno-format-contains-nul'
If '-Wformat' is specified, do not warn about format strings
......@@ -36,7 +36,7 @@ Enable -Wformat and -Wformat-security by default.
future warnings may be added to '-Wformat-security' that are
not included in '-Wformat-nonliteral'.)
+ This option is enabled by default in Gentoo.
+ This option is enabled by default in Alpine Linux.
+
'-Wformat-y2k'
If '-Wformat' is specified, also warn about 'strftime' formats
......
dlopen cloog-isl library rather than link to it directly. This prevents
cloog upgrades that change the soname from breaking the compiler.
http://pkgs.fedoraproject.org/cgit/gcc.git/tree/gcc5-isl-dl.patch
http://pkgs.fedoraproject.org/cgit/rpms/gcc.git/plain/gcc6-isl-dl.patch
In FreeBSD dlopen is part of libc so we can't just hardcode -ldl.
We abuse the existing plugin check logic to pull out that info.
--- 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)
--- a/gcc/Makefile.in.jj 2015-06-06 10:00:25.000000000 +0200
+++ b/gcc/Makefile.in 2015-11-04 14:56:02.643536437 +0100
@@ -1013,7 +1013,7 @@ BUILD_LIBDEPS= $(BUILD_LIBIBERTY)
# and the system's installed libraries.
LIBS = @LIBS@ libcommon.a $(CPPLIB) $(LIBINTL) $(LIBICONV) $(LIBBACKTRACE) \
$(LIBIBERTY) $(LIBDECNUMBER) $(HOST_LIBS)
-BACKENDLIBS = $(ISLLIBS) $(GMPLIBS) $(PLUGINLIBS) $(HOST_LIBS) \
+BACKENDLIBS = $(if $(ISLLIBS),@DL_LIB@) $(GMPLIBS) $(PLUGINLIBS) $(HOST_LIBS) \
+BACKENDLIBS = $(if $(ISLLIBS),-ldl) $(GMPLIBS) $(PLUGINLIBS) $(HOST_LIBS) \
$(ZLIB)
# Any system libraries needed just for GNAT.
SYSLIBS = @GNAT_LIBEXC@
@@ -2050,6 +2050,15 @@ $(out_object_file): $(out_file)
@@ -2058,6 +2058,15 @@ $(out_object_file): $(out_file)
$(common_out_object_file): $(common_out_file)
$(COMPILE) $<
$(POSTCOMPILE)
......@@ -34,52 +30,28 @@ We abuse the existing plugin check logic to pull out that info.
#
# Generate header and source files from the machine description,
# and compile them.
--- a/gcc/configure
+++ b/gcc/configure
@@ -604,6 +604,7 @@ PICFLAG
enable_host_shared
enable_plugin
pluginlibs
+DL_LIB
ISLINC
ISLLIBS
GMPINC
@@ -28285,6 +28286,7 @@ $as_echo "unable to check" >&6; }
fi
# Check -ldl
+ DL_LIB=
saved_LIBS="$LIBS"
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing dlopen" >&5
$as_echo_n "checking for library containing dlopen... " >&6; }
@@ -28344,6 +28346,7 @@ fi
if test x"$ac_cv_search_dlopen" = x"-ldl"; then
pluginlibs="$pluginlibs -ldl"
+ DL_LIB=$ac_cv_search_dlopen
fi
LIBS="$saved_LIBS"
--- a/gcc/graphite.h.jj 2016-01-27 12:44:06.000000000 +0100
+++ b/gcc/graphite.h 2016-01-27 13:26:38.309876856 +0100
@@ -36,6 +36,7 @@ along with GCC; see the file COPYING3.
#include <isl/ilp.h>
#include <isl/schedule.h>
#include <isl/ast_build.h>
+#include <dlfcn.h>
--- 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,478 @@ along with GCC; see the file COPYING3.
#ifndef GCC_GRAPHITE_POLY_H
#define GCC_GRAPHITE_POLY_H
#ifdef HAVE_ISL_OPTIONS_SET_SCHEDULE_SERIALIZE_SCCS
/* isl 0.15 or later. */
@@ -47,6 +48,494 @@ along with GCC; see the file COPYING3.
# define isl_stat_ok 0
#endif
+#include <isl/aff.h>
+#include <isl/schedule.h>
+#include <isl/ilp.h>
+#include <isl/flow.h>
+#include <isl/options.h>
+#include <isl/ast.h>
+#include <isl/ast_build.h>
+#include <isl/val_gmp.h>
+#include <dlfcn.h>
+#ifdef HAVE_ISL_SCHED_CONSTRAINTS_COMPUTE_SCHEDULE
+#define DYNSYM_ZERO_DISTANCE DYNSYM (isl_band_member_is_coincident)
+#ifdef HAVE_ISL_OPTIONS_SET_SCHEDULE_SERIALIZE_SCCS
+#define DYNSYM_SCHEDULE_FUSE DYNSYM (isl_options_set_schedule_serialize_sccs)
+#define DYNSYM_SET_YAML_STYLE DYNSYM (isl_printer_set_yaml_style);
+#else
+#define DYNSYM_ZERO_DISTANCE DYNSYM (isl_band_member_is_zero_distance)
+#define DYNSYM_SCHEDULE_FUSE DYNSYM (isl_options_set_schedule_fuse)
+#define DYNSYM_SET_YAML_STYLE
+#endif
+
+#define DYNSYMS \
+ DYNSYM (isl_aff_add_coefficient_si); \
+ DYNSYM (isl_aff_free); \
......@@ -95,7 +67,6 @@ We abuse the existing plugin check logic to pull out that info.
+ DYNSYM (isl_band_list_get_band); \
+ DYNSYM (isl_band_list_get_ctx); \
+ DYNSYM (isl_band_list_n_band); \
+ DYNSYM_ZERO_DISTANCE; \
+ DYNSYM (isl_band_n_member); \
+ DYNSYM (isl_basic_map_add_constraint); \
+ DYNSYM (isl_basic_map_project_out); \
......@@ -143,7 +114,8 @@ We abuse the existing plugin check logic to pull out that info.
+ DYNSYM (isl_map_set_tuple_id); \
+ DYNSYM (isl_map_universe); \
+ DYNSYM (isl_options_set_on_error); \
+ DYNSYM (isl_options_set_schedule_fuse); \
+ DYNSYM_SCHEDULE_FUSE; \
+ DYNSYM_SET_YAML_STYLE \
+ DYNSYM (isl_options_set_schedule_max_constant_term); \
+ DYNSYM (isl_options_set_schedule_maximize_band_depth); \
+ DYNSYM (isl_printer_free); \
......@@ -301,7 +273,18 @@ We abuse the existing plugin check logic to pull out that info.
+ DYNSYM (isl_val_int_from_ui); \
+ DYNSYM (isl_val_mul); \
+ DYNSYM (isl_val_neg); \
+ DYNSYM (isl_val_sub);
+ DYNSYM (isl_val_sub); \
+ DYNSYM (isl_printer_print_union_map); \
+ DYNSYM (isl_pw_aff_get_ctx); \
+ DYNSYM (isl_val_is_int); \
+ DYNSYM (isl_ctx_get_max_operations); \
+ DYNSYM (isl_ctx_set_max_operations); \
+ DYNSYM (isl_ctx_last_error); \
+ DYNSYM (isl_ctx_reset_operations); \
+ DYNSYM (isl_map_coalesce); \
+ DYNSYM (isl_printer_print_schedule); \
+ DYNSYM (isl_set_set_dim_id); \
+ DYNSYM (isl_union_map_coalesce);
+
+extern struct isl_pointers_s__
+{
......@@ -326,11 +309,6 @@ We abuse the existing plugin check logic to pull out that info.
+#define isl_band_list_get_band (*isl_pointers__.p_isl_band_list_get_band)
+#define isl_band_list_get_ctx (*isl_pointers__.p_isl_band_list_get_ctx)
+#define isl_band_list_n_band (*isl_pointers__.p_isl_band_list_n_band)
+#ifdef HAVE_ISL_SCHED_CONSTRAINTS_COMPUTE_SCHEDULE
+#define isl_band_member_is_coincident (*isl_pointers__.p_isl_band_member_is_coincident)
+#else
+#define isl_band_member_is_zero_distance (*isl_pointers__.p_isl_band_member_is_zero_distance)
+#endif
+#define isl_band_n_member (*isl_pointers__.p_isl_band_n_member)
+#define isl_basic_map_add_constraint (*isl_pointers__.p_isl_basic_map_add_constraint)
+#define isl_basic_map_project_out (*isl_pointers__.p_isl_basic_map_project_out)
......@@ -378,7 +356,12 @@ We abuse the existing plugin check logic to pull out that info.
+#define isl_map_set_tuple_id (*isl_pointers__.p_isl_map_set_tuple_id)
+#define isl_map_universe (*isl_pointers__.p_isl_map_universe)
+#define isl_options_set_on_error (*isl_pointers__.p_isl_options_set_on_error)
+#ifdef HAVE_ISL_OPTIONS_SET_SCHEDULE_SERIALIZE_SCCS
+#define isl_options_set_schedule_serialize_sccs (*isl_pointers__.p_isl_options_set_schedule_serialize_sccs)
+#define isl_printer_set_yaml_style (*isl_pointers__.p_isl_printer_set_yaml_style)
+#else
+#define isl_options_set_schedule_fuse (*isl_pointers__.p_isl_options_set_schedule_fuse)
+#endif
+#define isl_options_set_schedule_max_constant_term (*isl_pointers__.p_isl_options_set_schedule_max_constant_term)
+#define isl_options_set_schedule_maximize_band_depth (*isl_pointers__.p_isl_options_set_schedule_maximize_band_depth)
+#define isl_printer_free (*isl_pointers__.p_isl_printer_free)
......@@ -537,15 +520,26 @@ We abuse the existing plugin check logic to pull out that info.
+#define isl_val_mul (*isl_pointers__.p_isl_val_mul)
+#define isl_val_neg (*isl_pointers__.p_isl_val_neg)
+#define isl_val_sub (*isl_pointers__.p_isl_val_sub)
+#define isl_printer_print_union_map (*isl_pointers__.p_isl_printer_print_union_map)
+#define isl_pw_aff_get_ctx (*isl_pointers__.p_isl_pw_aff_get_ctx)
+#define isl_val_is_int (*isl_pointers__.p_isl_val_is_int)
+#define isl_ctx_get_max_operations (*isl_pointers__.p_isl_ctx_get_max_operations)
+#define isl_ctx_set_max_operations (*isl_pointers__.p_isl_ctx_set_max_operations)
+#define isl_ctx_last_error (*isl_pointers__.p_isl_ctx_last_error)
+#define isl_ctx_reset_operations (*isl_pointers__.p_isl_ctx_reset_operations)
+#define isl_map_coalesce (*isl_pointers__.p_isl_map_coalesce)
+#define isl_printer_print_schedule (*isl_pointers__.p_isl_printer_print_schedule)
+#define isl_set_set_dim_id (*isl_pointers__.p_isl_set_set_dim_id)
+#define isl_union_map_coalesce (*isl_pointers__.p_isl_union_map_coalesce)
+
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
@@ -90,6 +90,34 @@ along with GCC; see the file COPYING3.
#include "graphite-isl-ast-to-gimple.h"
#include "graphite-sese-to-poly.h"
--- a/gcc/graphite.c.jj 2015-11-04 14:15:32.000000000 +0100
+++ b/gcc/graphite.c 2015-11-04 14:56:02.645536409 +0100
@@ -54,6 +54,34 @@ along with GCC; see the file COPYING3.
#include "tree-cfgcleanup.h"
#include "graphite.h"
+__typeof (isl_pointers__) isl_pointers__;
+
......@@ -578,7 +572,7 @@ We abuse the existing plugin check logic to pull out that info.
/* Print global statistics to FILE. */
static void
@@ -285,6 +313,15 @@ graphite_transform_loops (void)
@@ -298,6 +326,15 @@ graphite_transform_loops (void)
if (parallelized_function_p (cfun->decl))
return;
......
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 ;;