3 function detect_gcc_version () {
4 if [ "__xx__${TOOLCHAIN_VERSION}" = "__xx__" ] ; then
7 TEST_CC="gcc-${TOOLCHAIN_VERSION}"
9 CC_VERSION=`${TEST_CC} -dumpversion`
13 C_MAJOR_VERSION=`detect_gcc_version`
15 if [ $C_MAJOR_VERSION -lt 8 ] ; then
21 if [ __x__"${BUILD_TYPE}" = __x__Debug ] ; then
24 elif [ __x__"${BUILD_TYPE}" = __x__Relwithdebinfo ] ; then
30 BASICOPTS+=(${OPTIMIZE_LEVEL})
32 if [ __x__"${BUILD_TYPE}" != __x__Release ] ; then
34 if [ $C_MAJOR_VERSION -lt 8 ] ; then
39 if [ $C_MAJOR_VERSION -ge 12 ] ; then
40 COPTS+=(-Wa,--compress-debug-sections=zlib)
41 DEBUGFLAGS+=(-fmerge-debug-strings)
42 DEBUGFLAGS+=(-feliminate-unused-debug-symbols)
43 DEBUGFLAGS+=(-feliminate-unused-debug-types)
45 COPTS+=(-Wa,--compress-debug-sections=zlib)
50 if [ $USE_LTO -ne 0 ] ; then
52 DLL_LDOPTS+=(-flto=auto)
53 EXE_LDOPTS+=(-flto=auto)
55 if [ $C_MAJOR_VERSION -ge 12 ] ; then
56 COPTS+=(-flto-compression-level=19)
57 COPTS+=(-fno-fat-lto-objects)
59 COPTS+=(-flto-compression-level=9)
60 COPTS+=(-fno-fat-lto-objects)
64 # ToDo: Determine SIMD TYPES
65 . ${SCRIPTS_DIR}/additional_defines_simd_types_gcc.sh
68 Relwithdebinfo | Debug)
69 if [ $C_MAJOR_VERSION -lt 8 ] ; then
75 DLL_LDOPTS+=(-Wl,--compress-debug-sections=zlib)
79 EXE_LDOPTS+=(-Wl,--compress-debug-sections=zlib)