From a6b5b04742b56edf694a6e7aad8a1355aadc7600 Mon Sep 17 00:00:00 2001 From: CentOS Sources Date: Tue, 28 Apr 2020 04:54:08 -0400 Subject: [PATCH] import gcc-toolset-9-gcc-9.2.1-2.2.el8 --- .gcc-toolset-9-gcc.metadata | 4 +- .gitignore | 4 +- SOURCES/gcc9-add-sve-tests.patch | 159 +++++ SOURCES/gcc9-fixes.patch | 481 ++++++++++++++ SOURCES/gcc9-libstdc++-compat.patch | 14 +- SOURCES/gcc9-pr90756.patch | 55 -- SOURCES/nvptx-tools-build.patch | 11 + SOURCES/nvptx-tools-glibc.patch | 32 + SOURCES/nvptx-tools-no-ptxas.patch | 947 ++++++++++++++++++++++++++++ SPECS/gcc.spec | 157 ++++- 10 files changed, 1790 insertions(+), 74 deletions(-) create mode 100644 SOURCES/gcc9-add-sve-tests.patch create mode 100644 SOURCES/gcc9-fixes.patch delete mode 100644 SOURCES/gcc9-pr90756.patch create mode 100644 SOURCES/nvptx-tools-build.patch create mode 100644 SOURCES/nvptx-tools-glibc.patch create mode 100644 SOURCES/nvptx-tools-no-ptxas.patch diff --git a/.gcc-toolset-9-gcc.metadata b/.gcc-toolset-9-gcc.metadata index dd25f2a..5b96d56 100644 --- a/.gcc-toolset-9-gcc.metadata +++ b/.gcc-toolset-9-gcc.metadata @@ -1,4 +1,6 @@ 7f4348418dc3efefd357b32a2b5c8010211ab284 SOURCES/doxygen-1.8.0.src.tar.gz -186c672996b17fd7ea17a188a2ed927d9e52a835 SOURCES/gcc-9.1.1-20190605.tar.xz +f98fd29e9c3faf986b48404be3ae4201e6a1b492 SOURCES/gcc-9.2.1-20191120.tar.xz c5a2b201bf05229647e73203c0bf2d9679d4d21f SOURCES/isl-0.16.1.tar.bz2 5ef03ca7aee134fe7dfecb6c9d048799f0810278 SOURCES/mpc-0.8.1.tar.gz +3bdb3cc01fa7690a0e20ea5cfffcbe690f7665eb SOURCES/nvptx-newlib-aadc8eb0ec43b7cd0dd2dfb484bae63c8b05ef24.tar.xz +ce8eb83be0ac37fb5d5388df455a980fe37b4f13 SOURCES/nvptx-tools-c28050f60193b3b95a18866a96f03334e874e78f.tar.xz diff --git a/.gitignore b/.gitignore index 5a8f8c1..a5401a6 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,6 @@ SOURCES/doxygen-1.8.0.src.tar.gz -SOURCES/gcc-9.1.1-20190605.tar.xz +SOURCES/gcc-9.2.1-20191120.tar.xz SOURCES/isl-0.16.1.tar.bz2 SOURCES/mpc-0.8.1.tar.gz +SOURCES/nvptx-newlib-aadc8eb0ec43b7cd0dd2dfb484bae63c8b05ef24.tar.xz +SOURCES/nvptx-tools-c28050f60193b3b95a18866a96f03334e874e78f.tar.xz diff --git a/SOURCES/gcc9-add-sve-tests.patch b/SOURCES/gcc9-add-sve-tests.patch new file mode 100644 index 0000000..e0368f3 --- /dev/null +++ b/SOURCES/gcc9-add-sve-tests.patch @@ -0,0 +1,159 @@ +These tests are missing from the r273140 commit in gcc-9-branch. + +--- /dev/null ++++ gcc/testsuite/gcc.target/aarch64/pcs_attribute-2.c +@@ -0,0 +1,93 @@ ++/* { dg-do compile } */ ++/* { dg-require-effective-target aarch64_variant_pcs } */ ++ ++/* Test that .variant_pcs is emitted for vector PCS symbol references. */ ++ ++#define ATTR __attribute__ ((aarch64_vector_pcs)) ++ ++void f_undef_basepcs (void); ++ ++void f_def_basepcs (void) ++{ ++} ++ ++ATTR void f_undef_vpcs (void); ++ ++ATTR void f_def_vpcs (void) ++{ ++} ++ ++__attribute__ ((alias ("f_def_vpcs"))) ++ATTR void f_alias_vpcs (void); ++ ++__attribute__ ((weak, alias ("f_def_vpcs"))) ++ATTR void f_weak_alias_vpcs (void); ++ ++__attribute__ ((weak)) ++ATTR void f_weak_undef_vpcs (void); ++ ++__attribute__ ((visibility ("protected"))) ++ATTR void f_protected_vpcs (void) ++{ ++} ++ ++__attribute__ ((visibility ("hidden"))) ++ATTR void f_hidden_vpcs (void) ++{ ++} ++ ++ATTR static void f_local_vpcs (void) ++{ ++} ++ ++__attribute__((weakref ("f_undef_vpcs"))) ++ATTR static void f_local_weakref_undef_vpcs (void); ++ ++__attribute__((weakref ("f_hidden_vpcs"))) ++ATTR static void f_local_weakref_def_vpcs (void); ++ ++ATTR void bar_undef_vpcs (void) __asm__ ("f_undef_renamed_vpcs"); ++ ++ATTR void bar_def_vpcs (void) __asm__ ("f_def_renamed_vpcs"); ++ATTR void bar_def_vpcs (void) ++{ ++} ++ ++void (*refs_basepcs[]) (void) = { ++ f_undef_basepcs, ++ f_def_basepcs, ++}; ++ ++void (*ATTR refs_vpcs[]) (void) = { ++ f_undef_vpcs, ++ f_def_vpcs, ++ f_alias_vpcs, ++ f_weak_alias_vpcs, ++ f_weak_undef_vpcs, ++ f_protected_vpcs, ++ f_hidden_vpcs, ++ f_local_vpcs, ++ f_local_weakref_undef_vpcs, ++ f_local_weakref_def_vpcs, ++ bar_undef_vpcs, ++ bar_def_vpcs, ++}; ++ ++/* Note: local symbols don't need .variant_pcs, but gcc generates it, so ++ we check them here. An undefined weakref does not show up in the ++ symbol table, only the target symbol, so it does not need .variant_pcs. */ ++ ++/* { dg-final { scan-assembler-not {\.variant_pcs\tf_undef_basepcs} } } */ ++/* { dg-final { scan-assembler-not {\.variant_pcs\tf_def_basepcs} } } */ ++/* { dg-final { scan-assembler-times {\.variant_pcs\tf_undef_vpcs} 1 } } */ ++/* { dg-final { scan-assembler-times {\.variant_pcs\tf_def_vpcs} 1 } } */ ++/* { dg-final { scan-assembler-times {\.variant_pcs\tf_alias_vpcs} 1 } } */ ++/* { dg-final { scan-assembler-times {\.variant_pcs\tf_weak_alias_vpcs} 1 } } */ ++/* { dg-final { scan-assembler-times {\.variant_pcs\tf_weak_undef_vpcs} 1 } } */ ++/* { dg-final { scan-assembler-times {\.variant_pcs\tf_protected_vpcs} 1 } } */ ++/* { dg-final { scan-assembler-times {\.variant_pcs\tf_hidden_vpcs} 1 } } */ ++/* { dg-final { scan-assembler-times {\.variant_pcs\tf_local_vpcs} 1 } } */ ++/* { dg-final { scan-assembler-not {\.variant_pcs\tf_local_weakref_undef_vpcs} } } */ ++/* { dg-final { scan-assembler-times {\.variant_pcs\tf_local_weakref_def_vpcs} 1 } } */ ++/* { dg-final { scan-assembler-times {\.variant_pcs\tf_undef_renamed_vpcs} 1 } } */ ++/* { dg-final { scan-assembler-times {\.variant_pcs\tf_def_renamed_vpcs} 1 } } */ +--- /dev/null ++++ gcc/testsuite/gcc.target/aarch64/pcs_attribute-3.c +@@ -0,0 +1,58 @@ ++/* { dg-do compile } */ ++/* { dg-require-ifunc "" } */ ++/* { dg-require-effective-target aarch64_variant_pcs } */ ++ ++/* Test that .variant_pcs is emitted for vector PCS symbol references. */ ++ ++#define ATTR __attribute__ ((aarch64_vector_pcs)) ++ ++static void f_local_basepcs (void) ++{ ++} ++ ++static void (*f_ifunc_basepcs_resolver ()) (void) ++{ ++ return (void (*)(void))f_local_basepcs; ++} ++ ++__attribute__ ((ifunc ("f_ifunc_basepcs_resolver"))) ++void f_ifunc_basepcs (void); ++ ++ATTR static void f_local_vpcs (void) ++{ ++} ++ ++static void (*f_ifunc_vpcs_resolver ()) (void) ++{ ++ return (void (*)(void))f_local_vpcs; ++} ++ ++__attribute__ ((ifunc ("f_ifunc_vpcs_resolver"))) ++ATTR void f_ifunc_vpcs (void); ++ ++__attribute__ ((visibility ("hidden"))) ++__attribute__ ((ifunc ("f_ifunc_vpcs_resolver"))) ++ATTR void f_hidden_ifunc_vpcs (void); ++ ++__attribute__ ((ifunc ("f_ifunc_vpcs_resolver"))) ++ATTR static void f_local_ifunc_vpcs (void); ++ ++void (*refs_basepcs[]) (void) = { ++ f_ifunc_basepcs, ++}; ++ ++void (*ATTR refs_vpcs[]) (void) = { ++ f_ifunc_vpcs, ++ f_hidden_ifunc_vpcs, ++ f_local_ifunc_vpcs, ++}; ++ ++/* Note: local symbols don't need .variant_pcs, but gcc generates it, so ++ we check them here. */ ++ ++/* { dg-final { scan-assembler-not {\.variant_pcs\tf_local_basepcs} } } */ ++/* { dg-final { scan-assembler-not {\.variant_pcs\tf_ifunc_basepcs} } } */ ++/* { dg-final { scan-assembler-times {\.variant_pcs\tf_local_vpcs} 1 } } */ ++/* { dg-final { scan-assembler-times {\.variant_pcs\tf_ifunc_vpcs} 1 } } */ ++/* { dg-final { scan-assembler-times {\.variant_pcs\tf_hidden_ifunc_vpcs} 1 } } */ ++/* { dg-final { scan-assembler-times {\.variant_pcs\tf_local_ifunc_vpcs} 1 } } */ diff --git a/SOURCES/gcc9-fixes.patch b/SOURCES/gcc9-fixes.patch new file mode 100644 index 0000000..e0af38d --- /dev/null +++ b/SOURCES/gcc9-fixes.patch @@ -0,0 +1,481 @@ +2019-11-22 Jonathan Wakely + + Backport from mainline + 2019-10-29 Jonathan Wakely + + PR libstdc++/92267 + * include/bits/stl_deque.h (_Deque_iterator(const _Deque_iterator&)): + Do not define as defaulted. + * testsuite/23_containers/deque/types/92267.cc: New test. + +2019-11-21 Jakub Jelinek + + PR tree-optimization/91355 + * tree-ssa-sink.c (select_best_block): Use >= rather than > + for early_bb scaled count with best_bb count comparison. + +2019-11-21 Richard Biener + + Revert + 2019-09-17 Richard Biener + + PR tree-optimization/91790 + * tree-vect-stmts.c (vectorizable_load): For BB vectorization + use the correct DR for setting up realignment. + +2019-11-20 Peter Bergner + + Backport from mainline + 2019-11-07 Peter Bergner + + PR other/92090 + * config/rs6000/predicates.md (input_operand): Allow MODE_PARTIAL_INT + modes for integer constants. + +2019-11-20 Michael Matz + + Backport from mainline + PR middle-end/90796 + * gimple-loop-jam.c (any_access_function_variant_p): New function. + (adjust_unroll_factor): Use it to constrain safety, new parameter. + (tree_loop_unroll_and_jam): Adjust call and profitable unroll factor. + +2019-11-20 Joseph Myers + + * doc/invoke.texi (-Wc11-c2x-compat): Document. + +--- libstdc++-v3/include/bits/stl_deque.h (revision 278492) ++++ libstdc++-v3/include/bits/stl_deque.h (revision 278614) +@@ -158,13 +158,16 @@ + #else + // Conversion from iterator to const_iterator. + template, +- is_same<_Iter, iterator>>> ++ typename = _Require, ++ is_same<_Iter, iterator>>> + _Deque_iterator(const _Iter& __x) noexcept + : _M_cur(__x._M_cur), _M_first(__x._M_first), +- _M_last(__x._M_last), _M_node(__x._M_node) { } ++ _M_last(__x._M_last), _M_node(__x._M_node) { } + +- _Deque_iterator(const _Deque_iterator&) = default; ++ _Deque_iterator(const _Deque_iterator& __x) noexcept ++ : _M_cur(__x._M_cur), _M_first(__x._M_first), ++ _M_last(__x._M_last), _M_node(__x._M_node) { } ++ + _Deque_iterator& operator=(const _Deque_iterator&) = default; + #endif + +--- libstdc++-v3/testsuite/23_containers/deque/types/92267.cc (nonexistent) ++++ libstdc++-v3/testsuite/23_containers/deque/types/92267.cc (revision 278614) +@@ -0,0 +1,27 @@ ++// Copyright (C) 2019 Free Software Foundation, Inc. ++// ++// This file is part of the GNU ISO C++ Library. This library is free ++// software; you can redistribute it and/or modify it under the ++// terms of the GNU General Public License as published by the ++// Free Software Foundation; either version 3, or (at your option) ++// any later version. ++ ++// This library is distributed in the hope that it will be useful, ++// but WITHOUT ANY WARRANTY; without even the implied warranty of ++// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++// GNU General Public License for more details. ++ ++// You should have received a copy of the GNU General Public License along ++// with this library; see the file COPYING3. If not see ++// . ++ ++// { dg-do compile { target c++11 } } ++ ++#include ++ ++using std::deque; ++using std::is_trivially_copy_constructible; ++ ++// PR libstdc++/92267 ++static_assert(!is_trivially_copy_constructible::iterator>::value); ++static_assert(!is_trivially_copy_constructible::const_iterator>::value); +--- gcc/doc/invoke.texi (revision 278492) ++++ gcc/doc/invoke.texi (revision 278614) +@@ -292,6 +292,7 @@ + -Wbool-compare -Wbool-operation @gol + -Wno-builtin-declaration-mismatch @gol + -Wno-builtin-macro-redefined -Wc90-c99-compat -Wc99-c11-compat @gol ++-Wc11-c2x-compat @gol + -Wc++-compat -Wc++11-compat -Wc++14-compat -Wc++17-compat @gol + -Wcast-align -Wcast-align=strict -Wcast-function-type -Wcast-qual @gol + -Wchar-subscripts -Wcatch-value -Wcatch-value=@var{n} @gol +@@ -6698,6 +6699,14 @@ + and so on. This option is independent of the standards mode. Warnings are + disabled in the expression that follows @code{__extension__}. + ++@item -Wc11-c2x-compat @r{(C and Objective-C only)} ++@opindex Wc11-c2x-compat ++@opindex Wno-c11-c2x-compat ++Warn about features not present in ISO C11, but present in ISO C2X. ++For instance, warn about omitting the string in @code{_Static_assert}. ++This option is independent of the standards mode. Warnings are ++disabled in the expression that follows @code{__extension__}. ++ + @item -Wc++-compat @r{(C and Objective-C only)} + @opindex Wc++-compat + @opindex Wno-c++-compat +--- gcc/testsuite/gcc.target/powerpc/pr92090-2.c (nonexistent) ++++ gcc/testsuite/gcc.target/powerpc/pr92090-2.c (revision 278614) +@@ -0,0 +1,45 @@ ++/* { dg-do compile } */ ++/* { dg-options "-mdejagnu-cpu=power8 -Os -w" } */ ++/* { dg-additional-options "-mbig" { target powerpc64le-*-* } } */ ++ ++/* Verify that we don't ICE. */ ++ ++int a; ++static _Atomic long double b, c, d, m; ++double n; ++extern int foo (void); ++extern void bar (int, int, int, int); ++ ++void ++bug (void) ++{ ++ b = 1.79769313486231580793728971405301199e308L; ++ for (int i = 0; i < 10000; i++) ++ if (__builtin_isinf (n)) ++ b; ++ c = 1; ++ int e, f, g, h; ++ while (a) ++ ; ++ for (int i; i; i++) ++ { ++ double j = c /= foo (); ++ if (__builtin_isinf (j)) ++ { ++ if (foo == 1 << 31) ++ e++; ++ f++; ++ c = 0; ++ } ++ else ++ { ++ if (foo == 1 << 30) ++ g++; ++ h++; ++ c = 1; ++ } ++ } ++ bar (e, f, g, h); ++ d = 1.79769313486231580793728971405301199e308L; ++ m = 1; ++} +--- gcc/testsuite/gcc.target/powerpc/pr92090.c (nonexistent) ++++ gcc/testsuite/gcc.target/powerpc/pr92090.c (revision 278614) +@@ -0,0 +1,43 @@ ++/* { dg-do compile } */ ++/* { dg-options "-mdejagnu-cpu=power8 -Os" } */ ++/* { dg-additional-options "-mbig" { target powerpc64le-*-* } } */ ++ ++/* Verify that we don't ICE. */ ++ ++_Atomic int a; ++_Atomic long double b, c; ++int j; ++void foo (void); ++void bar (int, int, int, int); ++ ++void ++bug (void) ++{ ++ b = 1; ++ int d, e, f, g; ++ while (a) ++ ; ++ for (int h = 0; h < 10000; h++) ++ { ++ double i = b /= 3; ++ foo (); ++ if (i) ++ { ++ if (i == 1) ++ d++; ++ e++; ++ b = 0; ++ } ++ else ++ { ++ if (i == 2) ++ f++; ++ g++; ++ b = 1; ++ } ++ } ++ bar (d, e, f, g); ++ c = 1; ++ for (int h; h; h++) ++ j = 0; ++} +--- gcc/testsuite/gcc.dg/unroll-and-jam.c (revision 278492) ++++ gcc/testsuite/gcc.dg/unroll-and-jam.c (revision 278614) +@@ -1,5 +1,5 @@ + /* { dg-do run } */ +-/* { dg-options "-O3 -floop-unroll-and-jam --param unroll-jam-min-percent=0 -fdump-tree-unrolljam-details" } */ ++/* { dg-options "-O3 -floop-unroll-and-jam -fno-tree-loop-im --param unroll-jam-min-percent=0 -fdump-tree-unrolljam-details" } */ + /* { dg-require-effective-target int32plus } */ + + #include +@@ -34,7 +34,7 @@ + #define TEST(name, body, test) \ + static void __attribute__((noinline,noclone)) name (unsigned long n, unsigned long m) \ + { \ +- unsigned long i, j; \ ++ unsigned i, j; \ + for (i = 1; i < m; i++) { \ + for (j = 1; j < n; j++) { \ + body; \ +@@ -58,9 +58,14 @@ + TEST(foo4, aa[i][j] = aa[i-1][j+1] * aa[i-1][j+1] / 2, checkaa()) //notok, -1,1 + TEST(foo5, aa[i][j] = aa[i+1][j+1] * aa[i+1][j+1] / 2, checkaa()) //ok, 1,1 + TEST(foo6, aa[i][j] = aa[i+1][j] * aa[i+1][j] / 2, checkaa()) //ok, -1,0 ++TEST(foo61, aa[i][0] = aa[i+1][0] * aa[i+1][0] / 2, checkaa()) //notok, -1,0 ++TEST(foo62, aa[i][j/2] = aa[i+1][j/2] * aa[i+1][j/2] / 2, checkaa()) //notok, not affine ++TEST(foo63, aa[i][j%2] = aa[i+1][j%2] * aa[i+1][j%2] / 2, checkaa()) //notok, not affine + TEST(foo7, aa[i+1][j] = aa[i][j] * aa[i][j] / 2, checkaa()) //ok, 1,0 + TEST(foo9, b[j] = 3*b[j+1] + 1, checkb()) //notok, 0,-1 + TEST(foo10, b[j] = 3*b[j] + 1, checkb()) //ok, 0,0 ++extern int f; ++TEST(foo11, f = b[i-1] = 1 + 3* b[i+1], checkb()) //ok, 2,0 but must reduce unroll factor to 2, (it would be incorrect with unroll-by-3, which the profitability would suggest) + + /* foo8 should work as well, but currently doesn't because the distance + vectors we compute are too pessimistic. We compute +@@ -68,6 +73,7 @@ + and the last one causes us to lose. */ + TEST(foo8, b[j+1] = 3*b[j] + 1, checkb()) //ok, 0,1 + ++int f; + unsigned int a[1024]; + unsigned int b[1024]; + unsigned int aa[16][1024]; +@@ -88,10 +94,12 @@ + printf(" %s\n", #name); \ + init();for(i=0;i<4;i++)name##noopt(32,8); checka = checksum; \ + init();for(i=0;i<4;i++)name(32,8); \ ++ if (checka != checksum) fail = 1; \ + printf("%sok %s\n", checka != checksum ? "NOT " : "", #name); + + int main() + { ++ int fail = 0; + int i; + unsigned checka; + RUN(foo1); +@@ -100,12 +108,18 @@ + RUN(foo4); + RUN(foo5); + RUN(foo6); ++ RUN(foo61); ++ RUN(foo62); ++ RUN(foo63); + RUN(foo7); + RUN(foo8); + RUN(foo9); + RUN(foo10); +- return 0; ++ RUN(foo11); ++ if (fail) ++ __builtin_abort(); ++ return fail; + } + +-/* Five loops should be unroll-jammed (actually six, but see above). */ +-/* { dg-final { scan-tree-dump-times "applying unroll and jam" 5 "unrolljam" } } */ ++/* Six loops should be unroll-jammed (actually seven, but see above). */ ++/* { dg-final { scan-tree-dump-times "applying unroll and jam" 6 "unrolljam" } } */ +--- gcc/testsuite/g++.dg/torture/pr91355.C (nonexistent) ++++ gcc/testsuite/g++.dg/torture/pr91355.C (revision 278614) +@@ -0,0 +1,28 @@ ++// PR tree-optimization/91355 ++// { dg-do run } ++// { dg-options "-std=c++14" } ++ ++unsigned int d = 0; ++ ++struct S { ++ S () { d++; } ++ S (const S &) { d++; } ++ ~S () { d--; } ++}; ++ ++void ++foo (int i) throw (int) // { dg-warning "dynamic exception specifications are deprecated" } ++{ ++ if (i == 0) ++ throw 3; ++ S d; ++ throw 3; ++} ++ ++int ++main () ++{ ++ try { foo (1); } catch (...) {} ++ if (d) ++ __builtin_abort (); ++} +--- gcc/tree-ssa-sink.c (revision 278492) ++++ gcc/tree-ssa-sink.c (revision 278614) +@@ -229,7 +229,7 @@ + /* If result of comparsion is unknown, preffer EARLY_BB. + Thus use !(...>=..) rather than (...<...) */ + && !(best_bb->count.apply_scale (100, 1) +- > (early_bb->count.apply_scale (threshold, 1)))) ++ >= early_bb->count.apply_scale (threshold, 1))) + return best_bb; + + /* No better block found, so return EARLY_BB, which happens to be the +--- gcc/tree-vect-stmts.c (revision 278492) ++++ gcc/tree-vect-stmts.c (revision 278614) +@@ -8276,9 +8276,7 @@ + || alignment_support_scheme == dr_explicit_realign) + && !compute_in_loop) + { +- msq = vect_setup_realignment (first_stmt_info_for_drptr +- ? first_stmt_info_for_drptr +- : first_stmt_info, gsi, &realignment_token, ++ msq = vect_setup_realignment (first_stmt_info, gsi, &realignment_token, + alignment_support_scheme, NULL_TREE, + &at_loop); + if (alignment_support_scheme == dr_explicit_realign_optimized) +--- gcc/gimple-loop-jam.c (revision 278492) ++++ gcc/gimple-loop-jam.c (revision 278614) +@@ -360,9 +360,26 @@ + rewrite_into_loop_closed_ssa_1 (NULL, 0, SSA_OP_USE, loop); + } + ++/* Return true if any of the access functions for dataref A ++ isn't invariant with respect to loop LOOP_NEST. */ ++static bool ++any_access_function_variant_p (const struct data_reference *a, ++ const class loop *loop_nest) ++{ ++ unsigned int i; ++ vec fns = DR_ACCESS_FNS (a); ++ tree t; ++ ++ FOR_EACH_VEC_ELT (fns, i, t) ++ if (!evolution_function_is_invariant_p (t, loop_nest->num)) ++ return true; ++ ++ return false; ++} ++ + /* Returns true if the distance in DDR can be determined and adjusts + the unroll factor in *UNROLL to make unrolling valid for that distance. +- Otherwise return false. ++ Otherwise return false. DDR is with respect to the outer loop of INNER. + + If this data dep can lead to a removed memory reference, increment + *REMOVED and adjust *PROFIT_UNROLL to be the necessary unroll factor +@@ -369,7 +386,7 @@ + for this to happen. */ + + static bool +-adjust_unroll_factor (struct data_dependence_relation *ddr, ++adjust_unroll_factor (class loop *inner, struct data_dependence_relation *ddr, + unsigned *unroll, unsigned *profit_unroll, + unsigned *removed) + { +@@ -392,9 +409,59 @@ + gcc_unreachable (); + else if ((unsigned)dist >= *unroll) + ; +- else if (lambda_vector_lexico_pos (dist_v + 1, DDR_NB_LOOPS (ddr) - 1) +- || (lambda_vector_zerop (dist_v + 1, DDR_NB_LOOPS (ddr) - 1) +- && dist > 0)) ++ else if (lambda_vector_zerop (dist_v + 1, DDR_NB_LOOPS (ddr) - 1)) ++ { ++ /* We have (a,0) with a < N, so this will be transformed into ++ (0,0) after unrolling by N. This might potentially be a ++ problem, if it's not a read-read dependency. */ ++ if (DR_IS_READ (DDR_A (ddr)) && DR_IS_READ (DDR_B (ddr))) ++ ; ++ else ++ { ++ /* So, at least one is a write, and we might reduce the ++ distance vector to (0,0). This is still no problem ++ if both data-refs are affine with respect to the inner ++ loops. But if one of them is invariant with respect ++ to an inner loop our reordering implicit in loop fusion ++ corrupts the program, as our data dependences don't ++ capture this. E.g. for: ++ for (0 <= i < n) ++ for (0 <= j < m) ++ a[i][0] = a[i+1][0] + 2; // (1) ++ b[i][j] = b[i+1][j] + 2; // (2) ++ the distance vector for both statements is (-1,0), ++ but exchanging the order for (2) is okay, while ++ for (1) it is not. To see this, write out the original ++ accesses (assume m is 2): ++ a i j original ++ 0 0 0 r a[1][0] b[1][0] ++ 1 0 0 w a[0][0] b[0][0] ++ 2 0 1 r a[1][0] b[1][1] ++ 3 0 1 w a[0][0] b[0][1] ++ 4 1 0 r a[2][0] b[2][0] ++ 5 1 0 w a[1][0] b[1][0] ++ after unroll-by-2 and fusion the accesses are done in ++ this order (from column a): 0,1, 4,5, 2,3, i.e. this: ++ a i j transformed ++ 0 0 0 r a[1][0] b[1][0] ++ 1 0 0 w a[0][0] b[0][0] ++ 4 1 0 r a[2][0] b[2][0] ++ 5 1 0 w a[1][0] b[1][0] ++ 2 0 1 r a[1][0] b[1][1] ++ 3 0 1 w a[0][0] b[0][1] ++ Note how access 2 accesses the same element as access 5 ++ for array 'a' but not for array 'b'. */ ++ if (any_access_function_variant_p (DDR_A (ddr), inner) ++ && any_access_function_variant_p (DDR_B (ddr), inner)) ++ ; ++ else ++ /* And if any dataref of this pair is invariant with ++ respect to the inner loop, we have no chance than ++ to reduce the unroll factor. */ ++ *unroll = dist; ++ } ++ } ++ else if (lambda_vector_lexico_pos (dist_v + 1, DDR_NB_LOOPS (ddr) - 1)) + ; + else + *unroll = dist; +@@ -486,7 +553,7 @@ + /* Now check the distance vector, for determining a sensible + outer unroll factor, and for validity of merging the inner + loop copies. */ +- if (!adjust_unroll_factor (ddr, &unroll_factor, &profit_unroll, ++ if (!adjust_unroll_factor (loop, ddr, &unroll_factor, &profit_unroll, + &removed)) + { + /* Couldn't get the distance vector. For two reads that's +@@ -506,7 +573,7 @@ + to ignore all profitability concerns and apply the transformation + always. */ + if (!PARAM_VALUE (PARAM_UNROLL_JAM_MIN_PERCENT)) +- profit_unroll = 2; ++ profit_unroll = MAX(2, profit_unroll); + else if (removed * 100 / datarefs.length () + < (unsigned)PARAM_VALUE (PARAM_UNROLL_JAM_MIN_PERCENT)) + profit_unroll = 1; +--- gcc/config/rs6000/predicates.md (revision 278492) ++++ gcc/config/rs6000/predicates.md (revision 278614) +@@ -1053,8 +1053,7 @@ + return 1; + + /* Allow any integer constant. */ +- if (GET_MODE_CLASS (mode) == MODE_INT +- && CONST_SCALAR_INT_P (op)) ++ if (SCALAR_INT_MODE_P (mode) && CONST_SCALAR_INT_P (op)) + return 1; + + /* Allow easy vector constants. */ diff --git a/SOURCES/gcc9-libstdc++-compat.patch b/SOURCES/gcc9-libstdc++-compat.patch index d9b2d85..ceec138 100644 --- a/SOURCES/gcc9-libstdc++-compat.patch +++ b/SOURCES/gcc9-libstdc++-compat.patch @@ -9692,7 +9692,7 @@ } // namespace --- libstdc++-v3/src/nonshared17/cow-fs_ops.cc.jj 2019-05-13 10:33:09.443939688 +0200 +++ libstdc++-v3/src/nonshared17/cow-fs_ops.cc 2019-05-14 19:54:55.667219247 +0200 -@@ -0,0 +1,41 @@ +@@ -0,0 +1,40 @@ +// Copyright (C) 2019 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free @@ -9728,7 +9728,6 @@ +asm (".hidden _ZNSt5dequeINSt10filesystem4pathESaIS1_EED2Ev"); +#ifdef __x86_64__ +asm (".hidden _ZNSt11_Deque_baseINSt10filesystem4pathESaIS1_EE17_M_initialize_mapEm"); -+asm (".hidden _ZSt13move_backwardINSt10filesystem4pathEESt15_Deque_iteratorIT_RS3_PS3_ES2_IS3_RKS3_PS7_ESA_S6_"); +asm (".hidden _ZNSt5dequeINSt10filesystem4pathESaIS1_EE13_M_insert_auxINS1_8iteratorEEEvSt15_Deque_iteratorIS1_RS1_PS1_ET_SA_m"); +asm (".hidden _ZNSt5dequeINSt10filesystem4pathESaIS1_EE17_M_reallocate_mapEmb"); +asm (".hidden _ZNSt5dequeINSt10filesystem4pathESaIS1_EE23_M_new_elements_at_backEm"); @@ -11128,7 +11127,7 @@ +.NOEXPORT: --- libstdc++-v3/src/nonshared17/fs_ops.cc.jj 2019-05-13 10:33:09.456939472 +0200 +++ libstdc++-v3/src/nonshared17/fs_ops.cc 2019-05-14 20:00:02.088105705 +0200 -@@ -0,0 +1,53 @@ +@@ -0,0 +1,52 @@ +// Copyright (C) 2019 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free @@ -11180,7 +11179,6 @@ +asm (".hidden _ZNSt5dequeINSt10filesystem7__cxx114pathESaIS2_EE13_M_insert_auxINS2_8iteratorEEEvSt15_Deque_iteratorIS2_RS2_PS2_ET_SB_m"); +asm (".hidden _ZNSt5dequeINSt10filesystem7__cxx114pathESaIS2_EE23_M_new_elements_at_backEm"); +asm (".hidden _ZNSt5dequeINSt10filesystem7__cxx114pathESaIS2_EE24_M_new_elements_at_frontEm"); -+asm (".hidden _ZSt13move_backwardINSt10filesystem7__cxx114pathEESt15_Deque_iteratorIT_RS4_PS4_ES3_IS4_RKS4_PS8_ESB_S7_"); +#endif --- libstdc++-v3/src/nonshared17/ostream-inst.cc.jj 2019-05-13 10:33:09.466939305 +0200 +++ libstdc++-v3/src/nonshared17/ostream-inst.cc 2019-05-14 18:43:03.283254489 +0200 @@ -11878,17 +11876,17 @@ } void -@@ -127,6 +129,7 @@ namespace std _GLIBCXX_VISIBILITY(defaul - _M_mt.seed(_M_strtoul(token)); +@@ -147,6 +149,7 @@ + #endif } +#ifndef _GLIBCXX_NONSHARED_CXX11_48 void random_device::_M_fini() { -@@ -172,6 +175,7 @@ namespace std _GLIBCXX_VISIBILITY(defaul - { +@@ -196,6 +199,7 @@ return _M_mt(); + #endif } +#endif diff --git a/SOURCES/gcc9-pr90756.patch b/SOURCES/gcc9-pr90756.patch deleted file mode 100644 index c43fb18..0000000 --- a/SOURCES/gcc9-pr90756.patch +++ /dev/null @@ -1,55 +0,0 @@ -2019-07-04 Jakub Jelinek - - PR rtl-optimization/90756 - * explow.c (promote_ssa_mode): Always use TYPE_MODE, don't bypass it - for VECTOR_TYPE_P. - ---- gcc/explow.c -+++ gcc/explow.c -@@ -892,16 +892,7 @@ promote_ssa_mode (const_tree name, int *punsignedp) - - tree type = TREE_TYPE (name); - int unsignedp = TYPE_UNSIGNED (type); -- machine_mode mode = TYPE_MODE (type); -- -- /* Bypass TYPE_MODE when it maps vector modes to BLKmode. */ -- if (mode == BLKmode) -- { -- gcc_assert (VECTOR_TYPE_P (type)); -- mode = type->type_common.mode; -- } -- -- machine_mode pmode = promote_mode (type, mode, &unsignedp); -+ machine_mode pmode = promote_mode (type, TYPE_MODE (type), &unsignedp); - if (punsignedp) - *punsignedp = unsignedp; - ---- /dev/null -+++ gcc/testsuite/gcc.dg/pr90756.c -@@ -0,0 +1,26 @@ -+/* PR rtl-optimization/90756 */ -+/* { dg-do compile } */ -+/* { dg-options "-O2 -Wno-psabi" } */ -+/* { dg-additional-options "-mno-sse" { target ia32 } } */ -+ -+typedef float B __attribute__((vector_size(4 * sizeof (float)))); -+typedef unsigned long long C __attribute__((vector_size(4 * sizeof (long long)))); -+typedef short D __attribute__((vector_size(4 * sizeof (short)))); -+B z; -+void foo (C); -+C bar (D); -+B baz (); -+D qux (B); -+ -+void -+quux (int x) -+{ -+ B n = z, b = z; -+ while (1) -+ switch (x) -+ { -+ case 0: n = baz (); /* FALLTHRU */ -+ case 1: { B o = n; n = b; b = o; } /* FALLTHRU */ -+ case 2: { D u = qux (b); C v = bar (u); foo (v); } -+ } -+} diff --git a/SOURCES/nvptx-tools-build.patch b/SOURCES/nvptx-tools-build.patch new file mode 100644 index 0000000..53d7483 --- /dev/null +++ b/SOURCES/nvptx-tools-build.patch @@ -0,0 +1,11 @@ +--- nvptx-tools/nvptx-as.c.jj 2017-01-20 12:40:18.000000000 +0100 ++++ nvptx-tools/nvptx-as.c 2017-01-20 12:43:53.864271442 +0100 +@@ -939,7 +939,7 @@ fork_execute (const char *prog, char *co + fatal_error ("%s: %m", errmsg); + } + else +- fatal_error (errmsg); ++ fatal_error ("%s", errmsg); + } + do_wait (prog, pex); + } diff --git a/SOURCES/nvptx-tools-glibc.patch b/SOURCES/nvptx-tools-glibc.patch new file mode 100644 index 0000000..4b50114 --- /dev/null +++ b/SOURCES/nvptx-tools-glibc.patch @@ -0,0 +1,32 @@ +--- nvptx-tools/configure.ac.jj 2017-01-13 12:48:31.000000000 +0100 ++++ nvptx-tools/configure.ac 2017-05-03 10:26:57.076092259 +0200 +@@ -66,6 +66,8 @@ CPPFLAGS=$save_CPPFLAGS + LDFLAGS=$save_LDFLAGS + LIBS=$save_LIBS + ++AC_CHECK_DECLS(getopt) ++ + AC_CONFIG_SUBDIRS([libiberty]) + AC_CONFIG_FILES([Makefile dejagnu.exp]) + AC_OUTPUT +--- nvptx-tools/configure.jj 2017-01-13 12:48:54.000000000 +0100 ++++ nvptx-tools/configure 2017-05-03 10:27:13.503876809 +0200 +@@ -3963,6 +3963,18 @@ CPPFLAGS=$save_CPPFLAGS + LDFLAGS=$save_LDFLAGS + LIBS=$save_LIBS + ++ac_fn_c_check_decl "$LINENO" "getopt" "ac_cv_have_decl_getopt" "$ac_includes_default" ++if test "x$ac_cv_have_decl_getopt" = x""yes; then : ++ ac_have_decl=1 ++else ++ ac_have_decl=0 ++fi ++ ++cat >>confdefs.h <<_ACEOF ++#define HAVE_DECL_GETOPT $ac_have_decl ++_ACEOF ++ ++ + + + subdirs="$subdirs libiberty" diff --git a/SOURCES/nvptx-tools-no-ptxas.patch b/SOURCES/nvptx-tools-no-ptxas.patch new file mode 100644 index 0000000..28bc597 --- /dev/null +++ b/SOURCES/nvptx-tools-no-ptxas.patch @@ -0,0 +1,947 @@ +--- nvptx-tools/configure.ac ++++ nvptx-tools/configure.ac +@@ -51,6 +51,7 @@ LIBS="$LIBS -lcuda" + AC_CHECK_FUNCS([[cuGetErrorName] [cuGetErrorString]]) + AC_CHECK_DECLS([[cuGetErrorName], [cuGetErrorString]], + [], [], [[#include ]]) ++AC_CHECK_HEADERS(unistd.h sys/stat.h) + + AC_MSG_CHECKING([for extra programs to build requiring -lcuda]) + NVPTX_RUN= +--- nvptx-tools/include/libiberty.h ++++ nvptx-tools/include/libiberty.h +@@ -390,6 +390,17 @@ extern void hex_init (void); + /* Save files used for communication between processes. */ + #define PEX_SAVE_TEMPS 0x4 + ++/* Max number of alloca bytes per call before we must switch to malloc. ++ ++ ?? Swiped from gnulib's regex_internal.h header. Is this actually ++ the case? This number seems arbitrary, though sane. ++ ++ The OS usually guarantees only one guard page at the bottom of the stack, ++ and a page size can be as small as 4096 bytes. So we cannot safely ++ allocate anything larger than 4096 bytes. Also care for the possibility ++ of a few compiler-allocated temporary stack slots. */ ++#define MAX_ALLOCA_SIZE 4032 ++ + /* Prepare to execute one or more programs, with standard output of + each program fed to standard input of the next. + FLAGS As above. +--- nvptx-tools/nvptx-as.c ++++ nvptx-tools/nvptx-as.c +@@ -30,6 +30,9 @@ + #include + #include + #include ++#ifdef HAVE_SYS_STAT_H ++#include ++#endif + #include + #define obstack_chunk_alloc malloc + #define obstack_chunk_free free +@@ -42,6 +45,38 @@ + + #include "version.h" + ++#ifndef R_OK ++#define R_OK 4 ++#define W_OK 2 ++#define X_OK 1 ++#endif ++ ++#ifndef DIR_SEPARATOR ++# define DIR_SEPARATOR '/' ++#endif ++ ++#if defined (_WIN32) || defined (__MSDOS__) \ ++ || defined (__DJGPP__) || defined (__OS2__) ++# define HAVE_DOS_BASED_FILE_SYSTEM ++# define HAVE_HOST_EXECUTABLE_SUFFIX ++# define HOST_EXECUTABLE_SUFFIX ".exe" ++# ifndef DIR_SEPARATOR_2 ++# define DIR_SEPARATOR_2 '\\' ++# endif ++# define PATH_SEPARATOR ';' ++#else ++# define PATH_SEPARATOR ':' ++#endif ++ ++#ifndef DIR_SEPARATOR_2 ++# define IS_DIR_SEPARATOR(ch) ((ch) == DIR_SEPARATOR) ++#else ++# define IS_DIR_SEPARATOR(ch) \ ++ (((ch) == DIR_SEPARATOR) || ((ch) == DIR_SEPARATOR_2)) ++#endif ++ ++#define DIR_UP ".." ++ + static const char *outname = NULL; + + static void __attribute__ ((format (printf, 1, 2))) +@@ -816,7 +851,7 @@ traverse (void **slot, void *data) + } + + static void +-process (FILE *in, FILE *out) ++process (FILE *in, FILE *out, int verify, const char *outname) + { + symbol_table = htab_create (500, hash_string_hash, hash_string_eq, + NULL); +@@ -824,6 +859,18 @@ process (FILE *in, FILE *out) + const char *input = read_file (in); + Token *tok = tokenize (input); + ++ /* By default, when ptxas is not in PATH, do minimalistic verification, ++ just require that the first non-comment directive is .version. */ ++ if (verify < 0) ++ { ++ size_t i; ++ for (i = 0; tok[i].kind == K_comment; i++) ++ ; ++ if (tok[i].kind != K_dotted || !is_keyword (&tok[i], "version")) ++ fatal_error ("missing .version directive at start of file '%s'", ++ outname); ++ } ++ + do + tok = parse_file (tok); + while (tok->kind); +@@ -897,9 +944,83 @@ fork_execute (const char *prog, char *const *argv) + do_wait (prog, pex); + } + ++/* Determine if progname is available in PATH. */ ++static bool ++program_available (const char *progname) ++{ ++ char *temp = getenv ("PATH"); ++ if (temp) ++ { ++ char *startp, *endp, *nstore, *alloc_ptr = NULL; ++ size_t prefixlen = strlen (temp) + 1; ++ size_t len; ++ if (prefixlen < 2) ++ prefixlen = 2; ++ ++ len = prefixlen + strlen (progname) + 1; ++#ifdef HAVE_HOST_EXECUTABLE_SUFFIX ++ len += strlen (HOST_EXECUTABLE_SUFFIX); ++#endif ++ if (len < MAX_ALLOCA_SIZE) ++ nstore = (char *) alloca (len); ++ else ++ alloc_ptr = nstore = (char *) malloc (len); ++ ++ startp = endp = temp; ++ while (1) ++ { ++ if (*endp == PATH_SEPARATOR || *endp == 0) ++ { ++ if (endp == startp) ++ { ++ nstore[0] = '.'; ++ nstore[1] = DIR_SEPARATOR; ++ nstore[2] = '\0'; ++ } ++ else ++ { ++ memcpy (nstore, startp, endp - startp); ++ if (! IS_DIR_SEPARATOR (endp[-1])) ++ { ++ nstore[endp - startp] = DIR_SEPARATOR; ++ nstore[endp - startp + 1] = 0; ++ } ++ else ++ nstore[endp - startp] = 0; ++ } ++ strcat (nstore, progname); ++ if (! access (nstore, X_OK) ++#ifdef HAVE_HOST_EXECUTABLE_SUFFIX ++ || ! access (strcat (nstore, HOST_EXECUTABLE_SUFFIX), X_OK) ++#endif ++ ) ++ { ++#if defined (HAVE_SYS_STAT_H) && defined (S_ISREG) ++ struct stat st; ++ if (stat (nstore, &st) >= 0 && S_ISREG (st.st_mode)) ++#endif ++ { ++ free (alloc_ptr); ++ return true; ++ } ++ } ++ ++ if (*endp == 0) ++ break; ++ endp = startp = endp + 1; ++ } ++ else ++ endp++; ++ } ++ free (alloc_ptr); ++ } ++ return false; ++} ++ + static struct option long_options[] = { + {"traditional-format", no_argument, 0, 0 }, + {"save-temps", no_argument, 0, 0 }, ++ {"verify", no_argument, 0, 0 }, + {"no-verify", no_argument, 0, 0 }, + {"help", no_argument, 0, 'h' }, + {"version", no_argument, 0, 'V' }, +@@ -912,7 +1033,7 @@ main (int argc, char **argv) + FILE *in = stdin; + FILE *out = stdout; + bool verbose __attribute__((unused)) = false; +- bool verify = true; ++ int verify = -1; + const char *smver = "sm_30"; + + int o; +@@ -923,7 +1044,9 @@ main (int argc, char **argv) + { + case 0: + if (option_index == 2) +- verify = false; ++ verify = 1; ++ else if (option_index == 3) ++ verify = 0; + break; + case 'v': + verbose = true; +@@ -948,7 +1071,8 @@ Usage: nvptx-none-as [option...] [asmfile]\n\ + Options:\n\ + -o FILE Write output to FILE\n\ + -v Be verbose\n\ ++ --verify Do verify output is acceptable to ptxas\n\ + --no-verify Do not verify output is acceptable to ptxas\n\ + --help Print this help and exit\n\ + --version Print version number and exit\n\ + \n\ +@@ -983,11 +1108,17 @@ This program has absolutely no warranty.\n", + if (!in) + fatal_error ("cannot open input ptx file"); + +- process (in, out); +- if (outname) ++ if (outname == NULL) ++ verify = 0; ++ else if (verify == -1) ++ if (program_available ("ptxas")) ++ verify = 1; ++ ++ process (in, out, verify, outname); ++ if (outname) + fclose (out); + +- if (verify && outname) ++ if (verify > 0) + { + struct obstack argv_obstack; + obstack_init (&argv_obstack); +--- nvptx-tools/configure ++++ nvptx-tools/configure +@@ -168,7 +168,8 @@ test x\$exitcode = x0 || exit 1" + as_suggested=" as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO + as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO + eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" && +- test \"x\`expr \$as_lineno_1'\$as_run' + 1\`\" = \"x\$as_lineno_2'\$as_run'\"' || exit 1" ++ test \"x\`expr \$as_lineno_1'\$as_run' + 1\`\" = \"x\$as_lineno_2'\$as_run'\"' || exit 1 ++test \$(( 1 + 1 )) = 2 || exit 1" + if (eval "$as_required") 2>/dev/null; then : + as_have_required=yes + else +@@ -552,11 +553,50 @@ PACKAGE_URL= + + ac_unique_file="nvptx-tools" + ac_unique_file="nvptx-as.c" ++# Factoring default headers for most tests. ++ac_includes_default="\ ++#include ++#ifdef HAVE_SYS_TYPES_H ++# include ++#endif ++#ifdef HAVE_SYS_STAT_H ++# include ++#endif ++#ifdef STDC_HEADERS ++# include ++# include ++#else ++# ifdef HAVE_STDLIB_H ++# include ++# endif ++#endif ++#ifdef HAVE_STRING_H ++# if !defined STDC_HEADERS && defined HAVE_MEMORY_H ++# include ++# endif ++# include ++#endif ++#ifdef HAVE_STRINGS_H ++# include ++#endif ++#ifdef HAVE_INTTYPES_H ++# include ++#endif ++#ifdef HAVE_STDINT_H ++# include ++#endif ++#ifdef HAVE_UNISTD_H ++# include ++#endif" ++ + enable_option_checking=no + ac_subst_vars='LTLIBOBJS + LIBOBJS + subdirs + NVPTX_RUN ++EGREP ++GREP ++CPP + CUDA_DRIVER_LDFLAGS + CUDA_DRIVER_CPPFLAGS + AR +@@ -635,7 +675,8 @@ LIBS + CPPFLAGS + CXX + CXXFLAGS +-CCC' ++CCC ++CPP' + ac_subdirs_all='libiberty' + + # Initialize some variables set by options. +@@ -1267,6 +1308,7 @@ Some influential environment variables: + you have headers in a nonstandard directory + CXX C++ compiler command + CXXFLAGS C++ compiler flags ++ CPP C preprocessor + + Use these variables to override the choices made by `configure' or to help + it to find libraries and programs with nonstandard names/locations. +@@ -1575,6 +1617,203 @@ $as_echo "$ac_res" >&6; } + eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} + + } # ac_fn_c_check_decl ++ ++# ac_fn_c_try_cpp LINENO ++# ---------------------- ++# Try to preprocess conftest.$ac_ext, and return whether this succeeded. ++ac_fn_c_try_cpp () ++{ ++ as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack ++ if { { ac_try="$ac_cpp conftest.$ac_ext" ++case "(($ac_try" in ++ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; ++ *) ac_try_echo=$ac_try;; ++esac ++eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" ++$as_echo "$ac_try_echo"; } >&5 ++ (eval "$ac_cpp conftest.$ac_ext") 2>conftest.err ++ ac_status=$? ++ if test -s conftest.err; then ++ grep -v '^ *+' conftest.err >conftest.er1 ++ cat conftest.er1 >&5 ++ mv -f conftest.er1 conftest.err ++ fi ++ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 ++ test $ac_status = 0; } >/dev/null && { ++ test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || ++ test ! -s conftest.err ++ }; then : ++ ac_retval=0 ++else ++ $as_echo "$as_me: failed program was:" >&5 ++sed 's/^/| /' conftest.$ac_ext >&5 ++ ++ ac_retval=1 ++fi ++ eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} ++ return $ac_retval ++ ++} # ac_fn_c_try_cpp ++ ++# ac_fn_c_check_header_mongrel LINENO HEADER VAR INCLUDES ++# ------------------------------------------------------- ++# Tests whether HEADER exists, giving a warning if it cannot be compiled using ++# the include files in INCLUDES and setting the cache variable VAR ++# accordingly. ++ac_fn_c_check_header_mongrel () ++{ ++ as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack ++ if { as_var=$3; eval "test \"\${$as_var+set}\" = set"; }; then : ++ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 ++$as_echo_n "checking for $2... " >&6; } ++if { as_var=$3; eval "test \"\${$as_var+set}\" = set"; }; then : ++ $as_echo_n "(cached) " >&6 ++fi ++eval ac_res=\$$3 ++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 ++$as_echo "$ac_res" >&6; } ++else ++ # Is the header compilable? ++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 usability" >&5 ++$as_echo_n "checking $2 usability... " >&6; } ++cat confdefs.h - <<_ACEOF >conftest.$ac_ext ++/* end confdefs.h. */ ++$4 ++#include <$2> ++_ACEOF ++if ac_fn_c_try_compile "$LINENO"; then : ++ ac_header_compiler=yes ++else ++ ac_header_compiler=no ++fi ++rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_compiler" >&5 ++$as_echo "$ac_header_compiler" >&6; } ++ ++# Is the header present? ++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 presence" >&5 ++$as_echo_n "checking $2 presence... " >&6; } ++cat confdefs.h - <<_ACEOF >conftest.$ac_ext ++/* end confdefs.h. */ ++#include <$2> ++_ACEOF ++if ac_fn_c_try_cpp "$LINENO"; then : ++ ac_header_preproc=yes ++else ++ ac_header_preproc=no ++fi ++rm -f conftest.err conftest.$ac_ext ++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_preproc" >&5 ++$as_echo "$ac_header_preproc" >&6; } ++ ++# So? What about this header? ++case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in #(( ++ yes:no: ) ++ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&5 ++$as_echo "$as_me: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&2;} ++ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 ++$as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} ++ ;; ++ no:yes:* ) ++ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: present but cannot be compiled" >&5 ++$as_echo "$as_me: WARNING: $2: present but cannot be compiled" >&2;} ++ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: check for missing prerequisite headers?" >&5 ++$as_echo "$as_me: WARNING: $2: check for missing prerequisite headers?" >&2;} ++ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: see the Autoconf documentation" >&5 ++$as_echo "$as_me: WARNING: $2: see the Autoconf documentation" >&2;} ++ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&5 ++$as_echo "$as_me: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&2;} ++ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 ++$as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} ++ ;; ++esac ++ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 ++$as_echo_n "checking for $2... " >&6; } ++if { as_var=$3; eval "test \"\${$as_var+set}\" = set"; }; then : ++ $as_echo_n "(cached) " >&6 ++else ++ eval "$3=\$ac_header_compiler" ++fi ++eval ac_res=\$$3 ++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 ++$as_echo "$ac_res" >&6; } ++fi ++ eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} ++ ++} # ac_fn_c_check_header_mongrel ++ ++# ac_fn_c_try_run LINENO ++# ---------------------- ++# Try to link conftest.$ac_ext, and return whether this succeeded. Assumes ++# that executables *can* be run. ++ac_fn_c_try_run () ++{ ++ as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack ++ if { { ac_try="$ac_link" ++case "(($ac_try" in ++ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; ++ *) ac_try_echo=$ac_try;; ++esac ++eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" ++$as_echo "$ac_try_echo"; } >&5 ++ (eval "$ac_link") 2>&5 ++ ac_status=$? ++ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 ++ test $ac_status = 0; } && { ac_try='./conftest$ac_exeext' ++ { { case "(($ac_try" in ++ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; ++ *) ac_try_echo=$ac_try;; ++esac ++eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" ++$as_echo "$ac_try_echo"; } >&5 ++ (eval "$ac_try") 2>&5 ++ ac_status=$? ++ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 ++ test $ac_status = 0; }; }; then : ++ ac_retval=0 ++else ++ $as_echo "$as_me: program exited with status $ac_status" >&5 ++ $as_echo "$as_me: failed program was:" >&5 ++sed 's/^/| /' conftest.$ac_ext >&5 ++ ++ ac_retval=$ac_status ++fi ++ rm -rf conftest.dSYM conftest_ipa8_conftest.oo ++ eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} ++ return $ac_retval ++ ++} # ac_fn_c_try_run ++ ++# ac_fn_c_check_header_compile LINENO HEADER VAR INCLUDES ++# ------------------------------------------------------- ++# Tests whether HEADER exists and can be compiled using the include files in ++# INCLUDES, setting the cache variable VAR accordingly. ++ac_fn_c_check_header_compile () ++{ ++ as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack ++ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 ++$as_echo_n "checking for $2... " >&6; } ++if { as_var=$3; eval "test \"\${$as_var+set}\" = set"; }; then : ++ $as_echo_n "(cached) " >&6 ++else ++ cat confdefs.h - <<_ACEOF >conftest.$ac_ext ++/* end confdefs.h. */ ++$4 ++#include <$2> ++_ACEOF ++if ac_fn_c_try_compile "$LINENO"; then : ++ eval "$3=yes" ++else ++ eval "$3=no" ++fi ++rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ++fi ++eval ac_res=\$$3 ++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 ++$as_echo "$ac_res" >&6; } ++ eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} ++ ++} # ac_fn_c_check_header_compile + cat >config.log <<_ACEOF + This file contains any messages produced by compilers while + running configure, to aid debugging if configure makes a mistake. +@@ -3284,6 +3523,418 @@ cat >>confdefs.h <<_ACEOF + #define HAVE_DECL_CUGETERRORSTRING $ac_have_decl + _ACEOF + ++ac_ext=c ++ac_cpp='$CPP $CPPFLAGS' ++ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ++ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ++ac_compiler_gnu=$ac_cv_c_compiler_gnu ++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C preprocessor" >&5 ++$as_echo_n "checking how to run the C preprocessor... " >&6; } ++# On Suns, sometimes $CPP names a directory. ++if test -n "$CPP" && test -d "$CPP"; then ++ CPP= ++fi ++if test -z "$CPP"; then ++ if test "${ac_cv_prog_CPP+set}" = set; then : ++ $as_echo_n "(cached) " >&6 ++else ++ # Double quotes because CPP needs to be expanded ++ for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp" ++ do ++ ac_preproc_ok=false ++for ac_c_preproc_warn_flag in '' yes ++do ++ # Use a header file that comes with gcc, so configuring glibc ++ # with a fresh cross-compiler works. ++ # Prefer to if __STDC__ is defined, since ++ # exists even on freestanding compilers. ++ # On the NeXT, cc -E runs the code through the compiler's parser, ++ # not just through cpp. "Syntax error" is here to catch this case. ++ cat confdefs.h - <<_ACEOF >conftest.$ac_ext ++/* end confdefs.h. */ ++#ifdef __STDC__ ++# include ++#else ++# include ++#endif ++ Syntax error ++_ACEOF ++if ac_fn_c_try_cpp "$LINENO"; then : ++ ++else ++ # Broken: fails on valid input. ++continue ++fi ++rm -f conftest.err conftest.$ac_ext ++ ++ # OK, works on sane cases. Now check whether nonexistent headers ++ # can be detected and how. ++ cat confdefs.h - <<_ACEOF >conftest.$ac_ext ++/* end confdefs.h. */ ++#include ++_ACEOF ++if ac_fn_c_try_cpp "$LINENO"; then : ++ # Broken: success on invalid input. ++continue ++else ++ # Passes both tests. ++ac_preproc_ok=: ++break ++fi ++rm -f conftest.err conftest.$ac_ext ++ ++done ++# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. ++rm -f conftest.err conftest.$ac_ext ++if $ac_preproc_ok; then : ++ break ++fi ++ ++ done ++ ac_cv_prog_CPP=$CPP ++ ++fi ++ CPP=$ac_cv_prog_CPP ++else ++ ac_cv_prog_CPP=$CPP ++fi ++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $CPP" >&5 ++$as_echo "$CPP" >&6; } ++ac_preproc_ok=false ++for ac_c_preproc_warn_flag in '' yes ++do ++ # Use a header file that comes with gcc, so configuring glibc ++ # with a fresh cross-compiler works. ++ # Prefer to if __STDC__ is defined, since ++ # exists even on freestanding compilers. ++ # On the NeXT, cc -E runs the code through the compiler's parser, ++ # not just through cpp. "Syntax error" is here to catch this case. ++ cat confdefs.h - <<_ACEOF >conftest.$ac_ext ++/* end confdefs.h. */ ++#ifdef __STDC__ ++# include ++#else ++# include ++#endif ++ Syntax error ++_ACEOF ++if ac_fn_c_try_cpp "$LINENO"; then : ++ ++else ++ # Broken: fails on valid input. ++continue ++fi ++rm -f conftest.err conftest.$ac_ext ++ ++ # OK, works on sane cases. Now check whether nonexistent headers ++ # can be detected and how. ++ cat confdefs.h - <<_ACEOF >conftest.$ac_ext ++/* end confdefs.h. */ ++#include ++_ACEOF ++if ac_fn_c_try_cpp "$LINENO"; then : ++ # Broken: success on invalid input. ++continue ++else ++ # Passes both tests. ++ac_preproc_ok=: ++break ++fi ++rm -f conftest.err conftest.$ac_ext ++ ++done ++# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. ++rm -f conftest.err conftest.$ac_ext ++if $ac_preproc_ok; then : ++ ++else ++ { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 ++$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} ++as_fn_error "C preprocessor \"$CPP\" fails sanity check ++See \`config.log' for more details." "$LINENO" 5; } ++fi ++ ++ac_ext=c ++ac_cpp='$CPP $CPPFLAGS' ++ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ++ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ++ac_compiler_gnu=$ac_cv_c_compiler_gnu ++ ++ ++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5 ++$as_echo_n "checking for grep that handles long lines and -e... " >&6; } ++if test "${ac_cv_path_GREP+set}" = set; then : ++ $as_echo_n "(cached) " >&6 ++else ++ if test -z "$GREP"; then ++ ac_path_GREP_found=false ++ # Loop through the user's path and test for each of PROGNAME-LIST ++ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR ++for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin ++do ++ IFS=$as_save_IFS ++ test -z "$as_dir" && as_dir=. ++ for ac_prog in grep ggrep; do ++ for ac_exec_ext in '' $ac_executable_extensions; do ++ ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext" ++ { test -f "$ac_path_GREP" && $as_test_x "$ac_path_GREP"; } || continue ++# Check for GNU ac_path_GREP and select it if it is found. ++ # Check for GNU $ac_path_GREP ++case `"$ac_path_GREP" --version 2>&1` in ++*GNU*) ++ ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;; ++*) ++ ac_count=0 ++ $as_echo_n 0123456789 >"conftest.in" ++ while : ++ do ++ cat "conftest.in" "conftest.in" >"conftest.tmp" ++ mv "conftest.tmp" "conftest.in" ++ cp "conftest.in" "conftest.nl" ++ $as_echo 'GREP' >> "conftest.nl" ++ "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break ++ diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break ++ as_fn_arith $ac_count + 1 && ac_count=$as_val ++ if test $ac_count -gt ${ac_path_GREP_max-0}; then ++ # Best one so far, save it but keep looking for a better one ++ ac_cv_path_GREP="$ac_path_GREP" ++ ac_path_GREP_max=$ac_count ++ fi ++ # 10*(2^10) chars as input seems more than enough ++ test $ac_count -gt 10 && break ++ done ++ rm -f conftest.in conftest.tmp conftest.nl conftest.out;; ++esac ++ ++ $ac_path_GREP_found && break 3 ++ done ++ done ++ done ++IFS=$as_save_IFS ++ if test -z "$ac_cv_path_GREP"; then ++ as_fn_error "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 ++ fi ++else ++ ac_cv_path_GREP=$GREP ++fi ++ ++fi ++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5 ++$as_echo "$ac_cv_path_GREP" >&6; } ++ GREP="$ac_cv_path_GREP" ++ ++ ++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5 ++$as_echo_n "checking for egrep... " >&6; } ++if test "${ac_cv_path_EGREP+set}" = set; then : ++ $as_echo_n "(cached) " >&6 ++else ++ if echo a | $GREP -E '(a|b)' >/dev/null 2>&1 ++ then ac_cv_path_EGREP="$GREP -E" ++ else ++ if test -z "$EGREP"; then ++ ac_path_EGREP_found=false ++ # Loop through the user's path and test for each of PROGNAME-LIST ++ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR ++for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin ++do ++ IFS=$as_save_IFS ++ test -z "$as_dir" && as_dir=. ++ for ac_prog in egrep; do ++ for ac_exec_ext in '' $ac_executable_extensions; do ++ ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext" ++ { test -f "$ac_path_EGREP" && $as_test_x "$ac_path_EGREP"; } || continue ++# Check for GNU ac_path_EGREP and select it if it is found. ++ # Check for GNU $ac_path_EGREP ++case `"$ac_path_EGREP" --version 2>&1` in ++*GNU*) ++ ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;; ++*) ++ ac_count=0 ++ $as_echo_n 0123456789 >"conftest.in" ++ while : ++ do ++ cat "conftest.in" "conftest.in" >"conftest.tmp" ++ mv "conftest.tmp" "conftest.in" ++ cp "conftest.in" "conftest.nl" ++ $as_echo 'EGREP' >> "conftest.nl" ++ "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break ++ diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break ++ as_fn_arith $ac_count + 1 && ac_count=$as_val ++ if test $ac_count -gt ${ac_path_EGREP_max-0}; then ++ # Best one so far, save it but keep looking for a better one ++ ac_cv_path_EGREP="$ac_path_EGREP" ++ ac_path_EGREP_max=$ac_count ++ fi ++ # 10*(2^10) chars as input seems more than enough ++ test $ac_count -gt 10 && break ++ done ++ rm -f conftest.in conftest.tmp conftest.nl conftest.out;; ++esac ++ ++ $ac_path_EGREP_found && break 3 ++ done ++ done ++ done ++IFS=$as_save_IFS ++ if test -z "$ac_cv_path_EGREP"; then ++ as_fn_error "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 ++ fi ++else ++ ac_cv_path_EGREP=$EGREP ++fi ++ ++ fi ++fi ++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP" >&5 ++$as_echo "$ac_cv_path_EGREP" >&6; } ++ EGREP="$ac_cv_path_EGREP" ++ ++ ++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5 ++$as_echo_n "checking for ANSI C header files... " >&6; } ++if test "${ac_cv_header_stdc+set}" = set; then : ++ $as_echo_n "(cached) " >&6 ++else ++ cat confdefs.h - <<_ACEOF >conftest.$ac_ext ++/* end confdefs.h. */ ++#include ++#include ++#include ++#include ++ ++int ++main () ++{ ++ ++ ; ++ return 0; ++} ++_ACEOF ++if ac_fn_c_try_compile "$LINENO"; then : ++ ac_cv_header_stdc=yes ++else ++ ac_cv_header_stdc=no ++fi ++rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ++ ++if test $ac_cv_header_stdc = yes; then ++ # SunOS 4.x string.h does not declare mem*, contrary to ANSI. ++ cat confdefs.h - <<_ACEOF >conftest.$ac_ext ++/* end confdefs.h. */ ++#include ++ ++_ACEOF ++if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | ++ $EGREP "memchr" >/dev/null 2>&1; then : ++ ++else ++ ac_cv_header_stdc=no ++fi ++rm -f conftest* ++ ++fi ++ ++if test $ac_cv_header_stdc = yes; then ++ # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. ++ cat confdefs.h - <<_ACEOF >conftest.$ac_ext ++/* end confdefs.h. */ ++#include ++ ++_ACEOF ++if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | ++ $EGREP "free" >/dev/null 2>&1; then : ++ ++else ++ ac_cv_header_stdc=no ++fi ++rm -f conftest* ++ ++fi ++ ++if test $ac_cv_header_stdc = yes; then ++ # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. ++ if test "$cross_compiling" = yes; then : ++ : ++else ++ cat confdefs.h - <<_ACEOF >conftest.$ac_ext ++/* end confdefs.h. */ ++#include ++#include ++#if ((' ' & 0x0FF) == 0x020) ++# define ISLOWER(c) ('a' <= (c) && (c) <= 'z') ++# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) ++#else ++# define ISLOWER(c) \ ++ (('a' <= (c) && (c) <= 'i') \ ++ || ('j' <= (c) && (c) <= 'r') \ ++ || ('s' <= (c) && (c) <= 'z')) ++# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) ++#endif ++ ++#define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) ++int ++main () ++{ ++ int i; ++ for (i = 0; i < 256; i++) ++ if (XOR (islower (i), ISLOWER (i)) ++ || toupper (i) != TOUPPER (i)) ++ return 2; ++ return 0; ++} ++_ACEOF ++if ac_fn_c_try_run "$LINENO"; then : ++ ++else ++ ac_cv_header_stdc=no ++fi ++rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ ++ conftest.$ac_objext conftest.beam conftest.$ac_ext ++fi ++ ++fi ++fi ++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5 ++$as_echo "$ac_cv_header_stdc" >&6; } ++if test $ac_cv_header_stdc = yes; then ++ ++$as_echo "#define STDC_HEADERS 1" >>confdefs.h ++ ++fi ++ ++# On IRIX 5.3, sys/types and inttypes.h are conflicting. ++for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \ ++ inttypes.h stdint.h unistd.h ++do : ++ as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` ++ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default ++" ++eval as_val=\$$as_ac_Header ++ if test "x$as_val" = x""yes; then : ++ cat >>confdefs.h <<_ACEOF ++#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 ++_ACEOF ++ ++fi ++ ++done ++ ++ ++for ac_header in unistd.h sys/stat.h ++do : ++ as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` ++ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" ++eval as_val=\$$as_ac_Header ++ if test "x$as_val" = x""yes; then : ++ cat >>confdefs.h <<_ACEOF ++#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 ++_ACEOF ++ ++fi ++ ++done ++ + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for extra programs to build requiring -lcuda" >&5 + $as_echo_n "checking for extra programs to build requiring -lcuda... " >&6; } diff --git a/SPECS/gcc.spec b/SPECS/gcc.spec index 17c1b7f..cc018e0 100644 --- a/SPECS/gcc.spec +++ b/SPECS/gcc.spec @@ -2,9 +2,9 @@ %{?scl:%global __strip %%{_scl_root}/usr/bin/strip} %{?scl:%global __objdump %%{_scl_root}/usr/bin/objdump} %{?scl:%scl_package gcc} -%global DATE 20190605 -%global SVNREV 271961 -%global gcc_version 9.1.1 +%global DATE 20191120 +%global SVNREV 278493 +%global gcc_version 9.2.1 %global gcc_major 9 # Note, gcc_release must be integer, if you want to add suffixes to # %%{release}, append them after %%{gcc_release} on Release: line. @@ -94,7 +94,7 @@ %global attr_ifunc 0 %endif %ifarch x86_64 ppc64le -%global build_offload_nvptx 0 +%global build_offload_nvptx 1 %else %global build_offload_nvptx 0 %endif @@ -113,7 +113,7 @@ Summary: GCC version 9 Name: %{?scl_prefix}gcc Version: %{gcc_version} -Release: %{gcc_release}.4%{?dist} +Release: %{gcc_release}.2%{?dist} # libgcc, libgfortran, libgomp, libstdc++ and crtstuff have # GCC Runtime Exception. License: GPLv3+ and GPLv3+ with exceptions and GPLv2+ with exceptions and LGPLv2+ and BSD @@ -125,6 +125,21 @@ Source0: gcc-%{version}-%{DATE}.tar.xz Source1: ftp://gcc.gnu.org/pub/gcc/infrastructure/isl-%{isl_version}.tar.bz2 Source2: http://www.multiprecision.org/mpc/download/mpc-%{mpc_version}.tar.gz Source3: ftp://ftp.stack.nl/pub/users/dimitri/doxygen-%{doxygen_version}.src.tar.gz +# The source for nvptx-tools package was pulled from upstream's vcs. Use the +# following commands to generate the tarball: +# git clone https://github.com/MentorEmbedded/nvptx-tools.git +# cd nvptx-tools +# git archive origin/master --prefix=nvptx-tools-%%{nvptx_tools_gitrev}/ | xz -9e > ../nvptx-tools-%%{nvptx_tools_gitrev}.tar.xz +# cd ..; rm -rf nvptx-tools +Source4: nvptx-tools-%{nvptx_tools_gitrev}.tar.xz +# The source for nvptx-newlib package was pulled from upstream's vcs. Use the +# following commands to generate the tarball: +# git clone https://github.com/MentorEmbedded/nvptx-newlib.git +# cd nvptx-newlib +# git archive origin/master --prefix=nvptx-newlib-%%{nvptx_newlib_gitrev}/ | xz -9 > ../nvptx-newlib-%%{nvptx_newlib_gitrev}.tar.xz +# cd ..; rm -rf nvptx-newlib +Source5: nvptx-newlib-%{nvptx_newlib_gitrev}.tar.xz +%global isl_version 0.16.1 URL: http://gcc.gnu.org # Need binutils with -pie support >= 2.14.90.0.4-4 # Need binutils which can omit dot symbols and overlap .opd on ppc64 >= 2.15.91.0.2-4 @@ -274,7 +289,8 @@ Patch8: gcc9-foffload-default.patch Patch9: gcc9-Wno-format-security.patch Patch10: gcc9-rh1574936.patch Patch11: gcc9-d-shared-libphobos.patch -Patch12: gcc9-pr90756.patch +Patch12: gcc9-fixes.patch +Patch13: gcc9-add-sve-tests.patch Patch1000: gcc9-libstdc++-compat.patch Patch1001: gcc9-alt-compat-test.patch @@ -302,6 +318,10 @@ Patch3014: 0014-Fill-in-missing-array-dimensions-using-the-lower-bou.patch Patch3015: 0015-Allow-automatics-in-equivalence.patch Patch3016: 0016-Suppress-warning-with-Wno-overwrite-recursive.patch +Patch4000: nvptx-tools-no-ptxas.patch +Patch4001: nvptx-tools-build.patch +Patch4002: nvptx-tools-glibc.patch + %if 0%{?rhel} > 7 %global nonsharedver 80 %else @@ -598,12 +618,22 @@ Requires: liblsan%{_isa} >= 5.1.1 %description -n %{?scl_prefix}liblsan-devel This package contains Leak Sanitizer static runtime library. +%package -n %{?scl_prefix}offload-nvptx +Summary: Offloading compiler to NVPTX +Requires: gcc >= 8.3.1 +Requires: libgomp-offload-nvptx >= 8.3.1 + +%description -n %{?scl_prefix}offload-nvptx +The gcc-offload-nvptx package provides offloading support for +NVidia PTX. OpenMP and OpenACC programs linked with -fopenmp will +by default add PTX code into the binaries, which can be offloaded +to NVidia PTX capable devices if available. %prep %if 0%{?rhel} >= 7 -%setup -q -n gcc-%{version}-%{DATE} -a 1 +%setup -q -n gcc-%{version}-%{DATE} -a 1 -a 4 -a 5 %else -%setup -q -n gcc-%{version}-%{DATE} -a 1 -a 2 -a 3 +%setup -q -n gcc-%{version}-%{DATE} -a 1 -a 2 -a 3 -a 4 -a 5 %endif %patch0 -p0 -b .hack~ %patch1 -p0 -b .i386-libgomp~ @@ -623,7 +653,8 @@ This package contains Leak Sanitizer static runtime library. %patch10 -p0 -b .rh1574936~ %endif %patch11 -p0 -b .d-shared-libphobos~ -%patch12 -p0 -b .pr90756~ +%patch12 -p0 -b .fixes~ +%patch13 -p0 -b .add-sve-tests~ %patch1000 -p0 -b .libstdc++-compat~ %ifarch %{ix86} x86_64 @@ -665,6 +696,12 @@ cd .. %patch3015 -p1 -b .fortran15~ %patch3016 -p1 -b .fortran16~ +cd nvptx-tools-%{nvptx_tools_gitrev} +%patch4000 -p1 -b .nvptx-tools-no-ptxas~ +%patch4001 -p1 -b .nvptx-tools-build~ +%patch4002 -p1 -b .nvptx-tools-glibc~ +cd .. + echo 'Red Hat %{version}-%{gcc_release}' > gcc/DEV-PHASE %if 0%{?rhel} == 6 @@ -708,6 +745,41 @@ rm -f gcc/testsuite/go.test/test/chan/goroutines.go # Undo the broken autoconf change in recent Fedora versions export CONFIG_SITE=NONE +%if %{build_offload_nvptx} +mkdir obji +IROOT=`pwd`/obji +cd nvptx-tools-%{nvptx_tools_gitrev} +rm -rf obj-%{gcc_target_platform} +mkdir obj-%{gcc_target_platform} +cd obj-%{gcc_target_platform} +CC="$CC" CXX="$CXX" CFLAGS="%{optflags}" CXXFLAGS="%{optflags}" \ +../configure --prefix=%{_prefix} +make %{?_smp_mflags} +make install prefix=${IROOT}%{_prefix} +cd ../.. + +ln -sf nvptx-newlib-%{nvptx_newlib_gitrev}/newlib newlib +rm -rf obj-offload-nvptx-none +mkdir obj-offload-nvptx-none + +cd obj-offload-nvptx-none +CC="$CC" CXX="$CXX" CFLAGS="$OPT_FLAGS" \ + CXXFLAGS="`echo " $OPT_FLAGS " | sed 's/ -Wall / /g;s/ -fexceptions / /g' \ + | sed 's/ -Wformat-security / -Wformat -Wformat-security /'`" \ + XCFLAGS="$OPT_FLAGS" TCFLAGS="$OPT_FLAGS" \ + ../configure --disable-bootstrap --disable-sjlj-exceptions \ + --enable-newlib-io-long-long --with-build-time-tools=${IROOT}%{_prefix}/nvptx-none/bin \ + --target nvptx-none --enable-as-accelerator-for=%{gcc_target_platform} \ + --enable-languages=c,c++,fortran,lto \ + --prefix=%{_prefix} --mandir=%{_mandir} --infodir=%{_infodir} \ + --with-bugurl=http://bugzilla.redhat.com/bugzilla \ + --enable-checking=release --with-system-zlib \ + --with-gcc-major-version-only --without-isl +make %{?_smp_mflags} +cd .. +rm -f newlib +%endif + rm -fr obj-%{gcc_target_platform} mkdir obj-%{gcc_target_platform} cd obj-%{gcc_target_platform} @@ -807,6 +879,10 @@ CONFIGURE_OPTS="\ --with-isl=`pwd`/isl-install \ %else --without-isl \ +%if %{build_offload_nvptx} + --enable-offload-targets=nvptx-none \ + --without-cuda-driver \ +%endif %endif --disable-libmpx \ %if 0%{?rhel} < 7 @@ -1020,6 +1096,32 @@ cd .. %install rm -rf %{buildroot} +%if %{build_offload_nvptx} +cd nvptx-tools-%{nvptx_tools_gitrev} +cd obj-%{gcc_target_platform} +make install prefix=%{buildroot}%{_prefix} +cd ../.. + +ln -sf nvptx-newlib-%{nvptx_newlib_gitrev}/newlib newlib +cd obj-offload-nvptx-none +make prefix=%{buildroot}%{_prefix} mandir=%{buildroot}%{_mandir} \ + infodir=%{buildroot}%{_infodir} install +rm -rf %{buildroot}%{_prefix}/libexec/gcc/nvptx-none/%{gcc_major}/install-tools +rm -rf %{buildroot}%{_prefix}/libexec/gcc/%{gcc_target_platform}/%{gcc_major}/accel/nvptx-none/{install-tools,plugin,cc1,cc1plus,f951} +rm -rf %{buildroot}%{_infodir} %{buildroot}%{_mandir}/man7 %{buildroot}%{_prefix}/share/locale +rm -rf %{buildroot}%{_prefix}/lib/gcc/nvptx-none/%{gcc_major}/{install-tools,plugin} +rm -rf %{buildroot}%{_prefix}/lib/gcc/%{gcc_target_platform}/%{gcc_major}/accel/nvptx-none/{install-tools,plugin,include-fixed} +rm -rf %{buildroot}%{_prefix}/%{_lib}/libc[cp]1* +mv -f %{buildroot}%{_prefix}/nvptx-none/lib/*.{a,spec} %{buildroot}%{_prefix}/lib/gcc/%{gcc_target_platform}/%{gcc_major}/accel/nvptx-none/ +mv -f %{buildroot}%{_prefix}/nvptx-none/lib/mgomp/*.{a,spec} %{buildroot}%{_prefix}/lib/gcc/%{gcc_target_platform}/%{gcc_major}/accel/nvptx-none/mgomp/ +mv -f %{buildroot}%{_prefix}/lib/gcc/nvptx-none/%{gcc_major}/*.a %{buildroot}%{_prefix}/lib/gcc/%{gcc_target_platform}/%{gcc_major}/accel/nvptx-none/ +mv -f %{buildroot}%{_prefix}/lib/gcc/nvptx-none/%{gcc_major}/mgomp/*.a %{buildroot}%{_prefix}/lib/gcc/%{gcc_target_platform}/%{gcc_major}/accel/nvptx-none/mgomp/ +find %{buildroot}%{_prefix}/lib/gcc/nvptx-none %{buildroot}%{_prefix}/lib/gcc/%{gcc_target_platform}/%{gcc_major}/accel/nvptx-none \ + %{buildroot}%{_prefix}/nvptx-none/lib -name \*.la | xargs rm +cd .. +rm -f newlib +%endif + %if %{build_libstdcxx_docs} %if 0%{?rhel} < 7 export PATH=`pwd`/obj-%{gcc_target_platform}/doxygen-install/bin/${PATH:+:${PATH}} @@ -2491,7 +2593,44 @@ fi %{_prefix}/lib/gcc/%{gcc_target_platform}/%{gcc_major}/plugin/libcp1plugin.so* %doc rpm.doc/changelogs/libcc1/ChangeLog* +%if %{build_offload_nvptx} +%files -n %{?scl_prefix}offload-nvptx +%{_prefix}/bin/nvptx-none-* +%{_prefix}/bin/%{gcc_target_platform}-accel-nvptx-none-gcc +%dir %{_prefix}/lib/gcc +%dir %{_prefix}/lib/gcc/%{gcc_target_platform} +%dir %{_prefix}/lib/gcc/%{gcc_target_platform}/%{gcc_major} +%dir %{_prefix}/lib/gcc/%{gcc_target_platform}/%{gcc_major}/accel +%dir %{_prefix}/libexec/gcc +%dir %{_prefix}/libexec/gcc/%{gcc_target_platform} +%dir %{_prefix}/libexec/gcc/%{gcc_target_platform}/%{gcc_major} +%dir %{_prefix}/libexec/gcc/%{gcc_target_platform}/%{gcc_major}/accel +%{_prefix}/lib/gcc/nvptx-none +%{_prefix}/lib/gcc/%{gcc_target_platform}/%{gcc_major}/accel/nvptx-none +%{_prefix}/libexec/gcc/%{gcc_target_platform}/%{gcc_major}/accel/nvptx-none +%dir %{_prefix}/nvptx-none +%{_prefix}/nvptx-none/bin +%{_prefix}/nvptx-none/include + %endif + %changelog +* Wed Nov 27 2019 Marek Polacek 9.2.1-2.2 +- fix offload-nvptx requires + +* Mon Nov 25 2019 Marek Polacek 9.2.1-2.1 +- add offload-nvptx (#1698607) + +* Thu Nov 21 2019 Marek Polacek 9.2.1-2 +- update from Fedora gcc-9.2.1-2 (#1747158) +- fix ABI change in deque iterators (PR libstdc++/92267) +- fix up sink select_best_block (PR tree-optimization/91355) +- revert PR tree-optimization/91790 fix +- allow MODE_PARTIAL_INT modes for integer constant input operands + (PR other/92090) +- fix adjust_unroll_factor (PR middle-end/90796) +- fixes for SVE Vector PCS on AArch64: emit .variant_pcs for + aarch64_vector_pcs symbol references (#1726641) + * Tue Sep 24 2019 Marek Polacek 9.1.1-2.4 - drop libtsan and liblsan (#1729402)