Sat May 30 22:45:36 2020 UTC ()
mk/compiler: Fix version check for GCC 10

Caused SSP flags to be omitted in GCC 10. Check flipped because all new
GCC versions can be expected to support it.


(sjmulder)
diff -r1.210 -r1.211 pkgsrc/mk/compiler/gcc.mk

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

--- pkgsrc/mk/compiler/gcc.mk 2020/03/30 09:39:24 1.210
+++ pkgsrc/mk/compiler/gcc.mk 2020/05/30 22:45:36 1.211
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1# $NetBSD: gcc.mk,v 1.210 2020/03/30 09:39:24 nia Exp $ 1# $NetBSD: gcc.mk,v 1.211 2020/05/30 22:45:36 sjmulder 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#
@@ -966,27 +966,27 @@ CC_VERSION!= \ @@ -966,27 +966,27 @@ CC_VERSION!= \
966 ${ECHO} "gcc-${_GCC_REQD}"; \ 966 ${ECHO} "gcc-${_GCC_REQD}"; \
967 fi 967 fi
968 968
969. else 969. else
970CC_VERSION_STRING= ${CC_VERSION} 970CC_VERSION_STRING= ${CC_VERSION}
971CC_VERSION= gcc-${_GCC_REQD} 971CC_VERSION= gcc-${_GCC_REQD}
972. endif 972. endif
973.else 973.else
974CC_VERSION_STRING= ${CC_VERSION} 974CC_VERSION_STRING= ${CC_VERSION}
975CC_VERSION= ${_GCC_PKG} 975CC_VERSION= ${_GCC_PKG}
976.endif 976.endif
977 977
978# The user can choose the level of stack smashing protection. 978# The user can choose the level of stack smashing protection.
979.if !empty(CC_VERSION:Mgcc-[4-9]*) 979.if empty(CC_VERSION:Mgcc-[1-3].*)
980. if ${PKGSRC_USE_SSP} == "all" 980. if ${PKGSRC_USE_SSP} == "all"
981_SSP_CFLAGS= -fstack-protector-all 981_SSP_CFLAGS= -fstack-protector-all
982. elif ${PKGSRC_USE_SSP} == "strong" 982. elif ${PKGSRC_USE_SSP} == "strong"
983_SSP_CFLAGS= -fstack-protector-strong 983_SSP_CFLAGS= -fstack-protector-strong
984. else 984. else
985_SSP_CFLAGS= -fstack-protector 985_SSP_CFLAGS= -fstack-protector
986. endif 986. endif
987.endif 987.endif
988 988
989# Prepend the path to the compiler to the PATH. 989# Prepend the path to the compiler to the PATH.
990.if !empty(_LANGUAGES.gcc) 990.if !empty(_LANGUAGES.gcc)
991PREPEND_PATH+= ${_GCC_DIR}/bin 991PREPEND_PATH+= ${_GCC_DIR}/bin
992.endif 992.endif