diff --git a/.gitignore b/.gitignore index 91196d5..ce2a86d 100644 --- a/.gitignore +++ b/.gitignore @@ -5,3 +5,4 @@ /gcc-7.0.1-20170131.tar.bz2 /gcc-7.0.1-20170201.tar.bz2 /gcc-7.0.1-20170204.tar.bz2 +/gcc-7.0.1-20170209.tar.bz2 diff --git a/gcc.spec b/gcc.spec index 2de974b..af2ac8e 100644 --- a/gcc.spec +++ b/gcc.spec @@ -1,10 +1,10 @@ -%global DATE 20170204 -%global SVNREV 245184 +%global DATE 20170209 +%global SVNREV 245310 %global gcc_version 7.0.1 %global gcc_major 7 # Note, gcc_release must be integer, if you want to add suffixes to # %{release}, append them after %{gcc_release} on Release: line. -%global gcc_release 0.6 +%global gcc_release 0.7 %global nvptx_tools_gitrev c28050f60193b3b95a18866a96f03334e874e78f %global nvptx_newlib_gitrev aadc8eb0ec43b7cd0dd2dfb484bae63c8b05ef24 %global _unpackaged_files_terminate_build 0 @@ -118,7 +118,7 @@ Source1: nvptx-tools-%{nvptx_tools_gitrev}.tar.bz2 # git archive origin/master --prefix=nvptx-newlib-%{nvptx_newlib_gitrev}/ | bzip2 -9 > ../nvptx-newlib-%{nvptx_newlib_gitrev}.tar.bz2 # cd ..; rm -rf nvptx-newlib Source2: nvptx-newlib-%{nvptx_newlib_gitrev}.tar.bz2 -%global isl_version 0.14 +%global isl_version 0.16.1 URL: http://gcc.gnu.org BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) # Need binutils with -pie support >= 2.14.90.0.4-4 @@ -170,7 +170,11 @@ BuildRequires: libunwind >= 0.98 %if %{build_isl} BuildRequires: isl = %{isl_version} BuildRequires: isl-devel = %{isl_version} -Requires: isl = %{isl_version} +%if %{__isa_bits} == 64 +Requires: libisl.so.15()(64bit) +%else +Requires: libisl.so.15 +%endif %endif %if %{build_libstdcxx_docs} BuildRequires: doxygen >= 1.7.1 @@ -229,6 +233,8 @@ Patch9: gcc7-aarch64-async-unw-tables.patch Patch10: gcc7-foffload-default.patch Patch11: gcc7-pr79232.patch Patch12: gcc7-pr79288.patch +Patch13: gcc7-pr79331.patch +Patch14: gcc7-s390x-libsanitizer-CVE.patch Patch1000: nvptx-tools-no-ptxas.patch Patch1001: nvptx-tools-build.patch @@ -818,6 +824,8 @@ package or when debugging this package. %patch10 -p0 -b .foffload-default~ %patch11 -p0 -b .pr79232~ %patch12 -p0 -b .pr79288~ +%patch13 -p0 -b .pr79341~ +%patch14 -p0 -b .s390x-libsanitizer-CVE~ cd nvptx-tools-%{nvptx_tools_gitrev} %patch1000 -p1 -b .nvptx-tools-no-ptxas~ @@ -3239,6 +3247,22 @@ fi %endif %changelog +* Thu Feb 9 2017 Jakub Jelinek 7.0.1-0.7 +- update from the trunk + - PRs c++/70448, c++/71193, c++/79360, c++/79372, c++/79377, c++/79379, + c++/79429, c/79413, c/79428, c/79431, fortran/78958, fortran/79230, + fortran/79335, fortran/79344, ipa/79375, libstdc++/79323, + middle-end/79278, middle-end/79399, rtl-optimization/68664, + rtl-optimization/79386, target/66144, target/68972, target/78604, + target/78883, target/79299, target/79353, translation/79397, + tree-optimization/69823, tree-optimization/78348, + tree-optimization/79284, tree-optimization/79376, + tree-optimization/79408, tree-optimization/79409, tree-ssa/79347 +- fix addition of OFFLOAD_TARGET_DEFAULT env var in gcc driver +- use isl 0.16.1 instead of 0.14 +- fix s390x libasan __tls_get_offset interception (PR sanitizer/79341) +- list fixed RHEL{6,7} kernels in CVE-2016-2143 s390x libsanitizer whitelist + * Sat Feb 4 2017 Jakub Jelinek 7.0.1-0.6 - update from the trunk - PRs ada/79309, c++/12245, c++/69637, c++/78689, c++/79294, cp/14179, diff --git a/gcc7-foffload-default.patch b/gcc7-foffload-default.patch index 74f8b4a..771e1e0 100644 --- a/gcc7-foffload-default.patch +++ b/gcc7-foffload-default.patch @@ -38,16 +38,12 @@ libgomp/ if (output_file && strcmp (output_file, "-") != 0 -@@ -7693,6 +7700,12 @@ driver::maybe_putenv_OFFLOAD_TARGETS () +@@ -7693,6 +7700,8 @@ driver::maybe_putenv_OFFLOAD_TARGETS () obstack_grow (&collect_obstack, offload_targets, strlen (offload_targets) + 1); xputenv (XOBFINISH (&collect_obstack, char *)); + if (offload_targets_default) -+ { -+ obstack_grow (&collect_obstack, "OFFLOAD_TARGET_DEFAULT=1", -+ sizeof ("OFFLOAD_TARGET_DEFAULT=1") - 1); -+ xputenv (XOBFINISH (&collect_obstack, char *)); -+ } ++ xputenv ("OFFLOAD_TARGET_DEFAULT=1"); } free (offload_targets); diff --git a/gcc7-isl-dl.patch b/gcc7-isl-dl.patch index e5e3fa9..07deb56 100644 --- a/gcc7-isl-dl.patch +++ b/gcc7-isl-dl.patch @@ -35,7 +35,7 @@ #ifdef HAVE_ISL_OPTIONS_SET_SCHEDULE_SERIALIZE_SCCS /* isl 0.15 or later. */ -@@ -47,6 +48,494 @@ along with GCC; see the file COPYING3. +@@ -47,6 +48,591 @@ along with GCC; see the file COPYING3. # define isl_stat_ok 0 #endif @@ -279,7 +279,55 @@ + DYNSYM (isl_map_coalesce); \ + DYNSYM (isl_printer_print_schedule); \ + DYNSYM (isl_set_set_dim_id); \ -+ DYNSYM (isl_union_map_coalesce); ++ DYNSYM (isl_union_map_coalesce); \ ++ DYNSYM (isl_multi_val_set_val); \ ++ DYNSYM (isl_multi_val_zero); \ ++ DYNSYM (isl_options_set_schedule_max_coefficient); \ ++ DYNSYM (isl_options_set_tile_scale_tile_loops); \ ++ DYNSYM (isl_schedule_copy); \ ++ DYNSYM (isl_schedule_get_map); \ ++ DYNSYM (isl_schedule_map_schedule_node_bottom_up); \ ++ DYNSYM (isl_schedule_node_band_get_permutable); \ ++ DYNSYM (isl_schedule_node_band_get_space); \ ++ DYNSYM (isl_schedule_node_band_tile); \ ++ DYNSYM (isl_schedule_node_child); \ ++ DYNSYM (isl_schedule_node_free); \ ++ DYNSYM (isl_schedule_node_get_child); \ ++ DYNSYM (isl_schedule_node_get_ctx); \ ++ DYNSYM (isl_schedule_node_get_type); \ ++ DYNSYM (isl_schedule_node_n_children); \ ++ DYNSYM (isl_union_map_is_equal); \ ++ DYNSYM (isl_union_access_info_compute_flow); \ ++ DYNSYM (isl_union_access_info_from_sink); \ ++ DYNSYM (isl_union_access_info_set_may_source); \ ++ DYNSYM (isl_union_access_info_set_must_source); \ ++ DYNSYM (isl_union_access_info_set_schedule); \ ++ DYNSYM (isl_union_flow_free); \ ++ DYNSYM (isl_union_flow_get_may_dependence); \ ++ DYNSYM (isl_union_flow_get_must_dependence); \ ++ DYNSYM (isl_aff_var_on_domain); \ ++ DYNSYM (isl_multi_aff_from_aff); \ ++ DYNSYM (isl_schedule_get_ctx); \ ++ DYNSYM (isl_multi_aff_set_tuple_id); \ ++ DYNSYM (isl_multi_aff_dim); \ ++ DYNSYM (isl_schedule_get_domain); \ ++ DYNSYM (isl_union_set_is_empty); \ ++ DYNSYM (isl_union_set_get_space); \ ++ DYNSYM (isl_union_pw_multi_aff_empty); \ ++ DYNSYM (isl_union_set_foreach_set); \ ++ DYNSYM (isl_union_set_free); \ ++ DYNSYM (isl_multi_union_pw_aff_from_union_pw_multi_aff); \ ++ DYNSYM (isl_multi_union_pw_aff_apply_multi_aff); \ ++ DYNSYM (isl_schedule_insert_partial_schedule); \ ++ DYNSYM (isl_union_pw_multi_aff_free); \ ++ DYNSYM (isl_pw_multi_aff_project_out_map); \ ++ DYNSYM (isl_union_pw_multi_aff_add_pw_multi_aff); \ ++ DYNSYM (isl_schedule_from_domain); \ ++ DYNSYM (isl_schedule_sequence); \ ++ DYNSYM (isl_ast_build_node_from_schedule); \ ++ DYNSYM (isl_ast_node_mark_get_node); \ ++ DYNSYM (isl_schedule_node_band_member_get_ast_loop_type); \ ++ DYNSYM (isl_schedule_node_band_member_set_ast_loop_type); + +extern struct isl_pointers_s__ +{ @@ -526,6 +574,55 @@ +#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) ++ ++#define isl_multi_val_set_val (*isl_pointers__.p_isl_multi_val_set_val) ++#define isl_multi_val_zero (*isl_pointers__.p_isl_multi_val_zero) ++#define isl_options_set_schedule_max_coefficient (*isl_pointers__.p_isl_options_set_schedule_max_coefficient) ++#define isl_options_set_tile_scale_tile_loops (*isl_pointers__.p_isl_options_set_tile_scale_tile_loops) ++#define isl_schedule_copy (*isl_pointers__.p_isl_schedule_copy) ++#define isl_schedule_get_map (*isl_pointers__.p_isl_schedule_get_map) ++#define isl_schedule_map_schedule_node_bottom_up (*isl_pointers__.p_isl_schedule_map_schedule_node_bottom_up) ++#define isl_schedule_node_band_get_permutable (*isl_pointers__.p_isl_schedule_node_band_get_permutable) ++#define isl_schedule_node_band_get_space (*isl_pointers__.p_isl_schedule_node_band_get_space) ++#define isl_schedule_node_band_tile (*isl_pointers__.p_isl_schedule_node_band_tile) ++#define isl_schedule_node_child (*isl_pointers__.p_isl_schedule_node_child) ++#define isl_schedule_node_free (*isl_pointers__.p_isl_schedule_node_free) ++#define isl_schedule_node_get_child (*isl_pointers__.p_isl_schedule_node_get_child) ++#define isl_schedule_node_get_ctx (*isl_pointers__.p_isl_schedule_node_get_ctx) ++#define isl_schedule_node_get_type (*isl_pointers__.p_isl_schedule_node_get_type) ++#define isl_schedule_node_n_children (*isl_pointers__.p_isl_schedule_node_n_children) ++#define isl_union_map_is_equal (*isl_pointers__.p_isl_union_map_is_equal) ++#define isl_union_access_info_compute_flow (*isl_pointers__.p_isl_union_access_info_compute_flow) ++#define isl_union_access_info_from_sink (*isl_pointers__.p_isl_union_access_info_from_sink) ++#define isl_union_access_info_set_may_source (*isl_pointers__.p_isl_union_access_info_set_may_source) ++#define isl_union_access_info_set_must_source (*isl_pointers__.p_isl_union_access_info_set_must_source) ++#define isl_union_access_info_set_schedule (*isl_pointers__.p_isl_union_access_info_set_schedule) ++#define isl_union_flow_free (*isl_pointers__.p_isl_union_flow_free) ++#define isl_union_flow_get_may_dependence (*isl_pointers__.p_isl_union_flow_get_may_dependence) ++#define isl_union_flow_get_must_dependence (*isl_pointers__.p_isl_union_flow_get_must_dependence) ++#define isl_aff_var_on_domain (*isl_pointers__.p_isl_aff_var_on_domain) ++#define isl_multi_aff_from_aff (*isl_pointers__.p_isl_multi_aff_from_aff) ++#define isl_schedule_get_ctx (*isl_pointers__.p_isl_schedule_get_ctx) ++#define isl_multi_aff_set_tuple_id (*isl_pointers__.p_isl_multi_aff_set_tuple_id) ++#define isl_multi_aff_dim (*isl_pointers__.p_isl_multi_aff_dim) ++#define isl_schedule_get_domain (*isl_pointers__.p_isl_schedule_get_domain) ++#define isl_union_set_is_empty (*isl_pointers__.p_isl_union_set_is_empty) ++#define isl_union_set_get_space (*isl_pointers__.p_isl_union_set_get_space) ++#define isl_union_pw_multi_aff_empty (*isl_pointers__.p_isl_union_pw_multi_aff_empty) ++#define isl_union_set_foreach_set (*isl_pointers__.p_isl_union_set_foreach_set) ++#define isl_union_set_free (*isl_pointers__.p_isl_union_set_free) ++#define isl_multi_union_pw_aff_from_union_pw_multi_aff (*isl_pointers__.p_isl_multi_union_pw_aff_from_union_pw_multi_aff) ++#define isl_multi_union_pw_aff_apply_multi_aff (*isl_pointers__.p_isl_multi_union_pw_aff_apply_multi_aff) ++#define isl_schedule_insert_partial_schedule (*isl_pointers__.p_isl_schedule_insert_partial_schedule) ++#define isl_union_pw_multi_aff_free (*isl_pointers__.p_isl_union_pw_multi_aff_free) ++#define isl_pw_multi_aff_project_out_map (*isl_pointers__.p_isl_pw_multi_aff_project_out_map) ++#define isl_union_pw_multi_aff_add_pw_multi_aff (*isl_pointers__.p_isl_union_pw_multi_aff_add_pw_multi_aff) ++#define isl_schedule_from_domain (*isl_pointers__.p_isl_schedule_from_domain) ++#define isl_schedule_sequence (*isl_pointers__.p_isl_schedule_sequence) ++#define isl_ast_build_node_from_schedule (*isl_pointers__.p_isl_ast_build_node_from_schedule) ++#define isl_ast_node_mark_get_node (*isl_pointers__.p_isl_ast_node_mark_get_node) ++#define isl_schedule_node_band_member_get_ast_loop_type (*isl_pointers__.p_isl_schedule_node_band_member_get_ast_loop_type) ++#define isl_schedule_node_band_member_set_ast_loop_type (*isl_pointers__.p_isl_schedule_node_band_member_set_ast_loop_type) + typedef struct poly_dr *poly_dr_p; @@ -545,7 +642,7 @@ + + if (isl_pointers__.inited) + return isl_pointers__.h != NULL; -+ h = dlopen ("libisl.so.13", RTLD_LAZY); ++ h = dlopen ("libisl.so.15", RTLD_LAZY); + isl_pointers__.h = h; + if (h == NULL) + return false; diff --git a/gcc7-pr79341.patch b/gcc7-pr79341.patch new file mode 100644 index 0000000..7a4f485 --- /dev/null +++ b/gcc7-pr79341.patch @@ -0,0 +1,84 @@ +2017-02-08 Jakub Jelinek + + PR sanitizer/79341 + * sanitizer_common/sanitizer_common_interceptors.inc + (INIT_TLS_GET_ADDR): INTERCEPT_FUNCTION __tls_get_offset rather than + __tls_get_addr_internal. + (__tls_get_addr_internal): Call __tls_get_offset_wrapper with + REAL(__tls_get_offset) as another arugment instead of calling + REAL(__tls_get_addr_internal). + (__tls_get_offset): Call __tls_get_addr_hidden instead of + __interceptor___tls_get_addr_internal_protected. + (__tls_get_offset_wrapper): New function. + +--- libsanitizer/sanitizer_common/sanitizer_common_interceptors.inc.jj 2017-02-07 11:08:15.000000000 -0500 ++++ libsanitizer/sanitizer_common/sanitizer_common_interceptors.inc 2017-02-08 05:28:58.656850984 -0500 +@@ -4550,11 +4550,15 @@ void *__tls_get_addr_opt(void *arg); + // descriptor offset as an argument instead of a pointer. GOT address + // is passed in r12, so it's necessary to write it in assembly. This is + // the function used by the compiler. +-#define INIT_TLS_GET_ADDR COMMON_INTERCEPT_FUNCTION(__tls_get_addr_internal) ++extern "C" uptr __tls_get_offset_wrapper (void *arg, uptr (*fn) (void *)); ++#define INIT_TLS_GET_ADDR COMMON_INTERCEPT_FUNCTION(__tls_get_offset) ++DEFINE_REAL(uptr, __tls_get_offset, void *arg) ++extern "C" uptr __tls_get_offset (void *arg); ++extern "C" uptr __interceptor___tls_get_offset (void *arg); + INTERCEPTOR(uptr, __tls_get_addr_internal, void *arg) { + void *ctx; + COMMON_INTERCEPTOR_ENTER(ctx, __tls_get_addr_internal, arg); +- uptr res = REAL(__tls_get_addr_internal)(arg); ++ uptr res = __tls_get_offset_wrapper(arg, REAL(__tls_get_offset)); + uptr tp = reinterpret_cast(__builtin_thread_pointer()); + void *ptr = reinterpret_cast(res + tp); + uptr tls_begin, tls_end; +@@ -4569,29 +4573,42 @@ INTERCEPTOR(uptr, __tls_get_addr_interna + // We need a protected symbol aliasing the above, so that we can jump + // directly to it from the assembly below. + extern "C" __attribute__((alias("__interceptor___tls_get_addr_internal"), +- visibility("protected"))) +-uptr __interceptor___tls_get_addr_internal_protected(void *arg); ++ visibility("hidden"))) ++uptr __tls_get_addr_hidden(void *arg); + // Now carefully intercept __tls_get_offset. + asm( + ".text\n" +- ".global __tls_get_offset\n" +- "__tls_get_offset:\n" + // The __intercept_ version has to exist, so that gen_dynamic_list.py + // exports our symbol. ++ ".weak __tls_get_offset\n" ++ ".type __tls_get_offset, @function\n" ++ "__tls_get_offset:\n" + ".global __interceptor___tls_get_offset\n" ++ ".type __interceptor___tls_get_offset, @function\n" + "__interceptor___tls_get_offset:\n" + #ifdef __s390x__ + "la %r2, 0(%r2,%r12)\n" +- "jg __interceptor___tls_get_addr_internal_protected\n" ++ "jg __tls_get_addr_hidden\n" + #else + "basr %r3,0\n" + "0: la %r2,0(%r2,%r12)\n" + "l %r4,1f-0b(%r3)\n" + "b 0(%r4,%r3)\n" +- "1: .long __interceptor___tls_get_addr_internal_protected - 0b\n" ++ "1: .long __tls_get_addr_hidden - 0b\n" + #endif +- ".type __tls_get_offset, @function\n" +- ".size __tls_get_offset, .-__tls_get_offset\n" ++ ".size __interceptor___tls_get_offset, .-__interceptor___tls_get_offset\n" ++// Assembly wrapper to call REAL(__tls_get_offset)(arg) ++ ".type __tls_get_offset_wrapper, @function\n" ++ "__tls_get_offset_wrapper:\n" ++#ifdef __s390x__ ++ "sgr %r2,%r12\n" ++ "lgr %r1,%r3\n" ++#else ++ "sr %r2,%r12\n" ++ "lr %r1,%r3\n" ++#endif ++ "br %r1\n" ++ ".size __tls_get_offset_wrapper, .-__tls_get_offset_wrapper\n" + ); + #endif // SANITIZER_S390 + #else diff --git a/gcc7-s390x-libsanitizer-CVE.patch b/gcc7-s390x-libsanitizer-CVE.patch new file mode 100644 index 0000000..bae9f9b --- /dev/null +++ b/gcc7-s390x-libsanitizer-CVE.patch @@ -0,0 +1,46 @@ +2017-02-08 Jakub Jelinek + + PR sanitizer/79341 + * sanitizer_common/sanitizer_linux_s390.cc (FixedCVE_2016_2143): + Whiltelist fixed RHEL6 and RHEL7 kernels. + +--- libsanitizer/sanitizer_common/sanitizer_linux_s390.cc 2016-11-09 15:22:41.917353799 +0100 ++++ libsanitizer/sanitizer_common/sanitizer_linux_s390.cc 2017-02-08 15:36:44.335857387 +0100 +@@ -134,6 +134,18 @@ static bool FixedCVE_2016_2143() { + if (ptr[0] == '.') + patch = internal_simple_strtoll(ptr+1, &ptr, 10); + if (major < 3) { ++ if (major == 2 && minor == 6 && patch == 32 && ptr[0] == '-' ++ && internal_strstr(ptr, ".el6")) { ++ // Check RHEL6 ++ int r1 = internal_simple_strtoll(ptr+1, &ptr, 10); ++ if (r1 >= 657) // 2.6.32-657.el6 or later ++ return true; ++ if (r1 == 642 && ptr[0] == '.') { ++ int r2 = internal_simple_strtoll(ptr+1, &ptr, 10); ++ if (r2 >= 9) // 2.6.32-642.9.1.el6 or later ++ return true; ++ } ++ } + // <3.0 is bad. + return false; + } else if (major == 3) { +@@ -143,6 +155,18 @@ static bool FixedCVE_2016_2143() { + // 3.12.58+ is OK. + if (minor == 12 && patch >= 58) + return true; ++ if (minor == 10 && patch == 0 && ptr[0] == '-' ++ && internal_strstr(ptr, ".el7")) { ++ // Check RHEL7 ++ int r1 = internal_simple_strtoll(ptr+1, &ptr, 10); ++ if (r1 >= 426) // 3.10.0-426.el7 or later ++ return true; ++ if (r1 == 327 && ptr[0] == '.') { ++ int r2 = internal_simple_strtoll(ptr+1, &ptr, 10); ++ if (r2 >= 27) // 3.10.0-327.27.1.el7 or later ++ return true; ++ } ++ } + // Otherwise, bad. + return false; + } else if (major == 4) { diff --git a/sources b/sources index e9525b9..68def56 100644 --- a/sources +++ b/sources @@ -1,3 +1,3 @@ -SHA512 (gcc-7.0.1-20170204.tar.bz2) = bca8ac6656af91ea0fb4c7ad9b3ea8f182fb88f06e6ce5b8e5daeab8bd513ef3b1fc4adcf9108d6712fe7c2d1b333b6a1f5c4e352c684dfbbb85fbc3f0519398 +SHA512 (gcc-7.0.1-20170209.tar.bz2) = 44841b8d87a8d34ec9bd944858a34a4a51f70290b76adabd01bddcf559f7f37dc187adb7d1b8e60d22bc08c363c2a048b8e84c61c4a6e51c022f654415c11940 SHA512 (nvptx-newlib-aadc8eb0ec43b7cd0dd2dfb484bae63c8b05ef24.tar.bz2) = 38f97c9297ad108568352a4d28277455a3c01fd8b7864e798037e5006b6f757022e874bbf3f165775fe3b873781bc108137bbeb42dd5ed3c7d3e6747746fa918 SHA512 (nvptx-tools-c28050f60193b3b95a18866a96f03334e874e78f.tar.bz2) = 95b577a06a93bb044dbc8033e550cb36bcf2ab2687da030a7318cdc90e7467ed49665e247dcafb5ff4a7e92cdc264291d19728bd17fab902fb64b22491269330