toolchain/gcc: fix a build failure on 7.3.0 with macOS
[oweals/openwrt.git] / toolchain / gcc / patches / 7.3.0 / 020-PR-libstdc-81797-Add-.NOTPARALLEL-to-include-Makefil.patch
1 From: redi <redi@138bc75d-0d04-0410-961f-82ee72b054a4>
2 Date: Mon, 19 Feb 2018 16:02:38 +0000
3 Subject: [PATCH] PR libstdc++/81797 Add .NOTPARALLEL to include/Makefile for
4  darwin
5
6 Backport from mainline
7 2018-02-15  Jonathan Wakely  <jwakely@redhat.com>
8
9         PR libstdc++/81797
10         * configure.ac (INCLUDE_DIR_NOTPARALLEL): Define.
11         * configure: Regenerate.
12         * include/Makefile.am (INCLUDE_DIR_NOTPARALLEL): Add .NOTPARALLEL when
13         defined.
14         * include/Makefile.in: Regenerate.
15
16 git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/gcc-7-branch@257808 138bc75d-0d04-0410-961f-82ee72b054a4
17 ---
18
19 --- a/libstdc++-v3/configure
20 +++ b/libstdc++-v3/configure
21 @@ -620,6 +620,8 @@ CPU_DEFINES_SRCDIR
22  ATOMIC_FLAGS
23  ATOMIC_WORD_SRCDIR
24  ATOMICITY_SRCDIR
25 +INCLUDE_DIR_NOTPARALLEL_FALSE
26 +INCLUDE_DIR_NOTPARALLEL_TRUE
27  BUILD_PDF_FALSE
28  BUILD_PDF_TRUE
29  PDFLATEX
30 @@ -11601,7 +11603,7 @@ else
31    lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
32    lt_status=$lt_dlunknown
33    cat > conftest.$ac_ext <<_LT_EOF
34 -#line 11604 "configure"
35 +#line 11606 "configure"
36  #include "confdefs.h"
37  
38  #if HAVE_DLFCN_H
39 @@ -11707,7 +11709,7 @@ else
40    lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
41    lt_status=$lt_dlunknown
42    cat > conftest.$ac_ext <<_LT_EOF
43 -#line 11710 "configure"
44 +#line 11712 "configure"
45  #include "confdefs.h"
46  
47  #if HAVE_DLFCN_H
48 @@ -15393,7 +15395,7 @@ $as_echo "$glibcxx_cv_atomic_long_long"
49    # Fake what AC_TRY_COMPILE does.
50  
51      cat > conftest.$ac_ext << EOF
52 -#line 15396 "configure"
53 +#line 15398 "configure"
54  int main()
55  {
56    typedef bool atomic_type;
57 @@ -15428,7 +15430,7 @@ $as_echo "$glibcxx_cv_atomic_bool" >&6;
58      rm -f conftest*
59  
60      cat > conftest.$ac_ext << EOF
61 -#line 15431 "configure"
62 +#line 15433 "configure"
63  int main()
64  {
65    typedef short atomic_type;
66 @@ -15463,7 +15465,7 @@ $as_echo "$glibcxx_cv_atomic_short" >&6;
67      rm -f conftest*
68  
69      cat > conftest.$ac_ext << EOF
70 -#line 15466 "configure"
71 +#line 15468 "configure"
72  int main()
73  {
74    // NB: _Atomic_word not necessarily int.
75 @@ -15499,7 +15501,7 @@ $as_echo "$glibcxx_cv_atomic_int" >&6; }
76      rm -f conftest*
77  
78      cat > conftest.$ac_ext << EOF
79 -#line 15502 "configure"
80 +#line 15504 "configure"
81  int main()
82  {
83    typedef long long atomic_type;
84 @@ -15580,7 +15582,7 @@ $as_echo "$as_me: WARNING: Performance o
85    # unnecessary for this test.
86  
87      cat > conftest.$ac_ext << EOF
88 -#line 15583 "configure"
89 +#line 15585 "configure"
90  int main()
91  {
92    _Decimal32 d1;
93 @@ -15622,7 +15624,7 @@ ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
94    # unnecessary for this test.
95  
96      cat > conftest.$ac_ext << EOF
97 -#line 15625 "configure"
98 +#line 15627 "configure"
99  template<typename T1, typename T2>
100    struct same
101    { typedef T2 type; };
102 @@ -15656,7 +15658,7 @@ $as_echo "$enable_int128" >&6; }
103      rm -f conftest*
104  
105      cat > conftest.$ac_ext << EOF
106 -#line 15659 "configure"
107 +#line 15661 "configure"
108  template<typename T1, typename T2>
109    struct same
110    { typedef T2 type; };
111 @@ -81219,6 +81221,18 @@ else
112  fi
113  
114  
115 +case "$build" in
116 + *-*-darwin* ) glibcxx_include_dir_notparallel=yes ;;
117 + * ) glibcxx_include_dir_notparallel=no ;;
118 +esac
119 + if test $glibcxx_include_dir_notparallel = "yes"; then
120 +  INCLUDE_DIR_NOTPARALLEL_TRUE=
121 +  INCLUDE_DIR_NOTPARALLEL_FALSE='#'
122 +else
123 +  INCLUDE_DIR_NOTPARALLEL_TRUE='#'
124 +  INCLUDE_DIR_NOTPARALLEL_FALSE=
125 +fi
126 +
127  
128  # Propagate the target-specific source directories through the build chain.
129  ATOMICITY_SRCDIR=config/${atomicity_dir}
130 @@ -81913,6 +81927,10 @@ if test -z "${BUILD_PDF_TRUE}" && test -
131    as_fn_error "conditional \"BUILD_PDF\" was never defined.
132  Usually this means the macro was only invoked conditionally." "$LINENO" 5
133  fi
134 +if test -z "${INCLUDE_DIR_NOTPARALLEL_TRUE}" && test -z "${INCLUDE_DIR_NOTPARALLEL_FALSE}"; then
135 +  as_fn_error "conditional \"INCLUDE_DIR_NOTPARALLEL\" was never defined.
136 +Usually this means the macro was only invoked conditionally." "$LINENO" 5
137 +fi
138  
139  : ${CONFIG_STATUS=./config.status}
140  ac_write_fail=0
141 --- a/libstdc++-v3/configure.ac
142 +++ b/libstdc++-v3/configure.ac
143 @@ -467,6 +467,12 @@ AM_CONDITIONAL(BUILD_PDF,
144                test $ac_cv_prog_DBLATEX = "yes" &&
145                test $ac_cv_prog_PDFLATEX = "yes")
146  
147 +case "$build" in
148 + *-*-darwin* ) glibcxx_include_dir_notparallel=yes ;;
149 + * ) glibcxx_include_dir_notparallel=no ;;
150 +esac
151 +AM_CONDITIONAL(INCLUDE_DIR_NOTPARALLEL,
152 +               test $glibcxx_include_dir_notparallel = "yes")
153  
154  # Propagate the target-specific source directories through the build chain.
155  ATOMICITY_SRCDIR=config/${atomicity_dir}
156 --- a/libstdc++-v3/include/Makefile.am
157 +++ b/libstdc++-v3/include/Makefile.am
158 @@ -1474,3 +1474,8 @@ $(decimal_headers): ; @:
159  $(ext_headers): ; @:
160  $(experimental_headers): ; @:
161  $(experimental_bits_headers): ; @:
162 +
163 +if INCLUDE_DIR_NOTPARALLEL
164 +# See https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81797
165 +.NOTPARALLEL:
166 +endif
167 --- a/libstdc++-v3/include/Makefile.in
168 +++ b/libstdc++-v3/include/Makefile.in
169 @@ -1897,6 +1897,9 @@ $(ext_headers): ; @:
170  $(experimental_headers): ; @:
171  $(experimental_bits_headers): ; @:
172  
173 +# See https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81797
174 +@INCLUDE_DIR_NOTPARALLEL_TRUE@.NOTPARALLEL:
175 +
176  # Tell versions [3.59,3.63) of GNU make to not export all variables.
177  # Otherwise a system limit (for SysV at least) may be exceeded.
178  .NOEXPORT: