Sun Jan 17 15:32:00 2021 UTC ()
If the base GCC isn't enough, and GCC_REQD=4.5 to 6, use gcc6.

gcc4.8,4.9,5 have bugs preventing them from being useful within pkgsrc
for the primary use case that finds them handy:
glibc + FORTIFY + those GCC versions = build failures.

Additionally, requiring fewer versions of GCC is an improvement for
the vast majority of use-cases considered.

We might want to bump this further than gcc6 later on, but this is a
big improvement for CentOS builds.


(maya)
diff -r1.217 -r1.218 pkgsrc/mk/compiler/gcc.mk

cvs diff -r1.217 -r1.218 pkgsrc/mk/compiler/gcc.mk (expand / switch to unified diff)

--- pkgsrc/mk/compiler/gcc.mk 2020/12/05 09:24:00 1.217
+++ pkgsrc/mk/compiler/gcc.mk 2021/01/17 15:32:00 1.218
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1# $NetBSD: gcc.mk,v 1.217 2020/12/05 09:24:00 wiz Exp $ 1# $NetBSD: gcc.mk,v 1.218 2021/01/17 15:32:00 maya Exp $
2# 2#
3# This is the compiler definition for the GNU Compiler Collection. 3# This is the compiler definition for the GNU Compiler Collection.
4# 4#
5# User-settable variables: 5# User-settable variables:
6# 6#
7# GCCBASE 7# GCCBASE
8# If using a native GCC and the compiler is not in $PATH then 8# If using a native GCC and the compiler is not in $PATH then
9# this should be set to the base installation directory. 9# this should be set to the base installation directory.
10# 10#
11# USE_NATIVE_GCC 11# USE_NATIVE_GCC
12# When set to "yes", the native gcc is used, no matter which 12# When set to "yes", the native gcc is used, no matter which
13# compiler version a package requires. 13# compiler version a package requires.
14# 14#
@@ -85,28 +85,28 @@ _DEF_VARS.gcc= \ @@ -85,28 +85,28 @@ _DEF_VARS.gcc= \
85 _GCC_CC _GCC_CPP _GCC_CXX _GCC_DEPENDENCY _GCC_DEPENDS \ 85 _GCC_CC _GCC_CPP _GCC_CXX _GCC_DEPENDENCY _GCC_DEPENDS \
86 _GCC_DIST_NAME _GCC_DIST_VERSION \ 86 _GCC_DIST_NAME _GCC_DIST_VERSION \
87 _GCC_FC _GCC_LDFLAGS _GCC_LIBDIRS _GCC_PKG \ 87 _GCC_FC _GCC_LDFLAGS _GCC_LIBDIRS _GCC_PKG \
88 _GCC_PKGBASE _GCC_PKGSRCDIR _GCC_PKG_SATISFIES_DEP \ 88 _GCC_PKGBASE _GCC_PKGSRCDIR _GCC_PKG_SATISFIES_DEP \
89 _GCC_PREFIX _GCC_REQD _GCC_STRICTEST_REQD _GCC_SUBPREFIX \ 89 _GCC_PREFIX _GCC_REQD _GCC_STRICTEST_REQD _GCC_SUBPREFIX \
90 _GCC_TEST_DEPENDS _GCC_NEEDS_A_FORTRAN _GCC_VARS _GCC_VERSION \ 90 _GCC_TEST_DEPENDS _GCC_NEEDS_A_FORTRAN _GCC_VARS _GCC_VERSION \
91 _GCC_VERSION_STRING \ 91 _GCC_VERSION_STRING \
92 _GCC_ADA _GCC_GMK _GCC_GLK _GCC_GBD _GCC_CHP _GCC_GLS _GCC_GNT _GCC_PRP \ 92 _GCC_ADA _GCC_GMK _GCC_GLK _GCC_GBD _GCC_CHP _GCC_GLS _GCC_GNT _GCC_PRP \
93 _IGNORE_GCC _IGNORE_GCC3CXX _IGNORE_GCC3F77 _IGNORE_GCC3OBJC \ 93 _IGNORE_GCC _IGNORE_GCC3CXX _IGNORE_GCC3F77 _IGNORE_GCC3OBJC \
94 _IS_BUILTIN_GCC \ 94 _IS_BUILTIN_GCC \
95 _LANGUAGES.gcc \ 95 _LANGUAGES.gcc \
96 _LINKER_RPATH_FLAG \ 96 _LINKER_RPATH_FLAG \
97 _NEED_GCC2 _NEED_GCC3 _NEED_GCC34 _NEED_GCC44 \ 97 _NEED_GCC2 _NEED_GCC3 _NEED_GCC34 _NEED_GCC44 \
98 _NEED_GCC48 _NEED_GCC49 _NEED_GCC5 _NEED_GCC6 \ 98 _NEED_GCC6 \ _NEED_GCC7 _NEED_GCC8 _NEED_GCC9 \
99 _NEED_GCC7 _NEED_GCC8 _NEED_GCC9 _NEED_GCC10 \ 99 _NEED_GCC10 \
100 _NEED_GCC_AUX _NEED_NEWER_GCC \ 100 _NEED_GCC_AUX _NEED_NEWER_GCC \
101 _PKGSRC_GCC_VERSION \ 101 _PKGSRC_GCC_VERSION \
102 _USE_GCC_SHLIB _USE_PKGSRC_GCC \ 102 _USE_GCC_SHLIB _USE_PKGSRC_GCC \
103 _WRAP_EXTRA_ARGS.CC \ 103 _WRAP_EXTRA_ARGS.CC \
104 _EXTRA_CC_DIRS \ 104 _EXTRA_CC_DIRS \
105 _CXX_STD_VERSIONS \ 105 _CXX_STD_VERSIONS \
106 ${_CXX_STD_VERSIONS:@std@_CXX_STD_FLAG.${std}@} \ 106 ${_CXX_STD_VERSIONS:@std@_CXX_STD_FLAG.${std}@} \
107 _MKPIE_CFLAGS.gcc _MKPIE_LDFLAGS.gcc \ 107 _MKPIE_CFLAGS.gcc _MKPIE_LDFLAGS.gcc \
108 _FORTIFY_CFLAGS _RELRO_LDFLAGS _STACK_CHECK_CFLAGS \ 108 _FORTIFY_CFLAGS _RELRO_LDFLAGS _STACK_CHECK_CFLAGS \
109 _CTF_CFLAGS \ 109 _CTF_CFLAGS \
110 _GCC_DIR \ 110 _GCC_DIR \
111 _ALIASES.CC _ALIASES.CPP _ALIASES.CXX _ALIASES.FC \ 111 _ALIASES.CC _ALIASES.CPP _ALIASES.CXX _ALIASES.FC \
112 _ALIASES.ADA _ALIASES.GMK _ALIASES.GLK _ALIASES.GBD \ 112 _ALIASES.ADA _ALIASES.GMK _ALIASES.GLK _ALIASES.GBD \
@@ -161,37 +161,28 @@ _GCC_DIST_VERSION:= ${${_GCC_DIST_NAME:t @@ -161,37 +161,28 @@ _GCC_DIST_VERSION:= ${${_GCC_DIST_NAME:t
161_GCC2_PATTERNS= [0-1].* 2.[0-9] 2.[0-9].* 2.[1-8][0-9] 2.[1-8][0-9].* \ 161_GCC2_PATTERNS= [0-1].* 2.[0-9] 2.[0-9].* 2.[1-8][0-9] 2.[1-8][0-9].* \
162 2.9[0-4] 2.9[0-4].* 2.95 2.95.[0-3] 162 2.9[0-4] 2.9[0-4].* 2.95 2.95.[0-3]
163 163
164# _GCC3_PATTERNS matches N s.t. 2.95.3 < N < 3.4. 164# _GCC3_PATTERNS matches N s.t. 2.95.3 < N < 3.4.
165_GCC3_PATTERNS= 2.95.[4-9]* 2.95.[1-9][0-9]* 2.9[6-9] 2.9[6-9].* \ 165_GCC3_PATTERNS= 2.95.[4-9]* 2.95.[1-9][0-9]* 2.9[6-9] 2.9[6-9].* \
166 2.[1-9][0-9][0-9]* 3.[0-3] 3.[0-3].* 166 2.[1-9][0-9][0-9]* 3.[0-3] 3.[0-3].*
167 167
168# _GCC34_PATTERNS matches N s.t. 3.4 <= N < 4. 168# _GCC34_PATTERNS matches N s.t. 3.4 <= N < 4.
169_GCC34_PATTERNS= 3.[4-9] 3.[4-9].* 3.[1-9][0-9]* 169_GCC34_PATTERNS= 3.[4-9] 3.[4-9].* 3.[1-9][0-9]*
170 170
171# _GCC44_PATTERNS matches N s.t. 4.0 <= N < 4.5. 171# _GCC44_PATTERNS matches N s.t. 4.0 <= N < 4.5.
172_GCC44_PATTERNS= 4.[0-4] 4.[0-4].* 172_GCC44_PATTERNS= 4.[0-4] 4.[0-4].*
173 173
174# _GCC48_PATTERNS matches N s.t. 4.5 <= N < 4.9. 174# _GCC6_PATTERNS matches N s.t. 4.5 <= N < 7.
175_GCC48_PATTERNS= 4.[5-8] 4.[5-8].* 175_GCC6_PATTERNS= 4.[5-9] 4.[5-9]* 5 5.* 6 6.*
176 
177# _GCC49_PATTERNS matches N s.t. 4.9 <= N < 4.10. 
178_GCC49_PATTERNS= 4.9 4.9.* 
179 
180# _GCC5_PATTERNS matches N s.t. 5.0 <= N < 6. 
181_GCC5_PATTERNS= 5 5.* 
182 
183# _GCC6_PATTERNS matches N s.t. 6.0 <= N < 7. 
184_GCC6_PATTERNS= 6 6.* 
185 176
186# _GCC7_PATTERNS matches N s.t. 7.0 <= N < 8. 177# _GCC7_PATTERNS matches N s.t. 7.0 <= N < 8.
187_GCC7_PATTERNS= 7 7.* 178_GCC7_PATTERNS= 7 7.*
188 179
189# _GCC8_PATTERNS matches N s.t. 8.0 <= N < 9. 180# _GCC8_PATTERNS matches N s.t. 8.0 <= N < 9.
190_GCC8_PATTERNS= 8 8.* 181_GCC8_PATTERNS= 8 8.*
191 182
192# _GCC9_PATTERNS matches N s.t. 9.0 <= N < 10. 183# _GCC9_PATTERNS matches N s.t. 9.0 <= N < 10.
193_GCC9_PATTERNS= 9 9.* 184_GCC9_PATTERNS= 9 9.*
194 185
195# _GCC10_PATTERNS matches N s.t. 10.0 <= N < 11. 186# _GCC10_PATTERNS matches N s.t. 10.0 <= N < 11.
196_GCC10_PATTERNS= 10 10.* 187_GCC10_PATTERNS= 10 10.*
197 188
@@ -312,44 +303,26 @@ _NEED_GCC3= yes @@ -312,44 +303,26 @@ _NEED_GCC3= yes
312.endfor 303.endfor
313_NEED_GCC34?= no 304_NEED_GCC34?= no
314.for _pattern_ in ${_GCC34_PATTERNS} 305.for _pattern_ in ${_GCC34_PATTERNS}
315. if !empty(_GCC_REQD:M${_pattern_}) 306. if !empty(_GCC_REQD:M${_pattern_})
316_NEED_GCC34= yes 307_NEED_GCC34= yes
317. endif 308. endif
318.endfor 309.endfor
319_NEED_GCC44?= no 310_NEED_GCC44?= no
320.for _pattern_ in ${_GCC44_PATTERNS} 311.for _pattern_ in ${_GCC44_PATTERNS}
321. if !empty(_GCC_REQD:M${_pattern_}) 312. if !empty(_GCC_REQD:M${_pattern_})
322_NEED_GCC44= yes 313_NEED_GCC44= yes
323. endif 314. endif
324.endfor 315.endfor
325_NEED_GCC48?= no 
326.for _pattern_ in ${_GCC48_PATTERNS} 
327. if !empty(_GCC_REQD:M${_pattern_}) 
328_NEED_GCC48= yes 
329. endif 
330.endfor 
331_NEED_GCC49?= no 
332.for _pattern_ in ${_GCC49_PATTERNS} 
333. if !empty(_GCC_REQD:M${_pattern_}) 
334_NEED_GCC49= yes 
335. endif 
336.endfor 
337_NEED_GCC5?= no 
338.for _pattern_ in ${_GCC5_PATTERNS} 
339. if !empty(_GCC_REQD:M${_pattern_}) 
340_NEED_GCC5= yes 
341. endif 
342.endfor 
343_NEED_GCC6?= no 316_NEED_GCC6?= no
344.for _pattern_ in ${_GCC6_PATTERNS} 317.for _pattern_ in ${_GCC6_PATTERNS}
345. if !empty(_GCC_REQD:M${_pattern_}) 318. if !empty(_GCC_REQD:M${_pattern_})
346_NEED_GCC6= yes 319_NEED_GCC6= yes
347. endif 320. endif
348.endfor 321.endfor
349_NEED_GCC7?= no 322_NEED_GCC7?= no
350.for _pattern_ in ${_GCC7_PATTERNS} 323.for _pattern_ in ${_GCC7_PATTERNS}
351. if !empty(_GCC_REQD:M${_pattern_}) 324. if !empty(_GCC_REQD:M${_pattern_})
352_NEED_GCC7= yes 325_NEED_GCC7= yes
353. endif 326. endif
354.endfor 327.endfor
355_NEED_GCC8?= no 328_NEED_GCC8?= no