Browse code

core: enables compilation with debug symbols by default for other architectures

- enables compilation with debug symbols by default for other architectures in core
- pull request GH #2811
- closes GH #2789

(cherry picked from commit ed46adad82e7b6569eb42704c5460263d2af75f7)
(cherry picked from commit ba8a06d2988e41b09947d3ae3386a13e3d8415b9)
(cherry picked from commit 69819531b532fdec7956c0c28e1ea1aadcc2bc2e)

Sergey Safarov authored on 01/08/2021 11:40:26 • Henning Westerholt committed on 22/10/2021 12:03:43
Showing 1 changed files
... ...
@@ -923,8 +923,8 @@ ifeq ($(use_fast_lock), yes)
923 923
 	found_lock_method=yes
924 924
 endif
925 925
 
926
-CFLAGS=
927
-LDFLAGS=
926
+CFLAGS=-g
927
+LDFLAGS=-g
928 928
 C_INCLUDES=
929 929
 # setting CFLAGS
930 930
 ifeq ($(mode), release)
... ...
@@ -934,7 +934,7 @@ ifeq	($(ARCH), i386)
934 934
 ifeq		($(CC_NAME), gcc)
935 935
 				C_DEFS+=-DCC_GCC_LIKE_ASM
936 936
 				#common stuff
937
-				CFLAGS=-g $(CC_OPT) -funroll-loops  -Wcast-align $(PROFILE)
937
+				CFLAGS+=$(CC_OPT) -funroll-loops  -Wcast-align $(PROFILE)
938 938
 			#if gcc 9.0+ 8.0+, 7.0+, 6.0+, 5.0+, 4.5+ or 4.2+
939 939
 ifeq (,$(strip $(filter-out 4.2+ 4.5+ 5.0+ 6.0+ 7.0+ 8.0+ 9.0+,$(CC_SHORTVER))))
940 940
 $(call				set_if_empty,CPUTYPE,generic)
... ...
@@ -991,12 +991,12 @@ else		# CC_NAME, gcc
991 991
 ifeq		($(CC_NAME), clang)
992 992
 $(call                          set_if_empty,CPUTYPE,athlon64)
993 993
 					C_DEFS+=-DCC_GCC_LIKE_ASM
994
-					CFLAGS+=-g -m32 $(CC_OPT) -mtune=$(CPUTYPE)
994
+					CFLAGS+=-m32 $(CC_OPT) -mtune=$(CPUTYPE)
995 995
 					LDFLAGS+=-m32
996 996
 else			# CC_NAME, clang
997 997
 ifeq		($(CC_NAME), icc)
998 998
 			C_DEFS+=-DCC_GCC_LIKE_ASM
999
-			CFLAGS=-g -O3  -ipo -ipo_obj -unroll  $(PROFILE) \
999
+			CFLAGS+=-O3  -ipo -ipo_obj -unroll  $(PROFILE) \
1000 1000
 					 -tpp6 -xK  #-openmp  #optimize for PIII
1001 1001
 				# -prefetch doesn't seem to work
1002 1002
 				#( ty to inline acroos files, unroll loops,prefetch,
... ...
@@ -1016,7 +1016,7 @@ ifeq	($(ARCH), x86_64)
1016 1016
 ifeq		($(CC_NAME), gcc)
1017 1017
 				C_DEFS+=-DCC_GCC_LIKE_ASM
1018 1018
 				#common stuff
1019
-				CFLAGS=-g $(CC_OPT) -funroll-loops  -Wcast-align $(PROFILE)
1019
+				CFLAGS+=$(CC_OPT) -funroll-loops  -Wcast-align $(PROFILE)
1020 1020
 			#if gcc 4.5+
1021 1021
 ifeq			($(CC_SHORTVER),$(filter $(CC_SHORTVER),4.2+ 4.5+ 5.0+ 6.0+ 7.0+ 8.0+ 9.0+))
1022 1022
 $(call				set_if_empty,CPUTYPE,generic)
... ...
@@ -1073,13 +1073,13 @@ else		# CC_NAME, gcc
1073 1073
 ifeq            ($(CC_NAME), clang)
1074 1074
 $(call                          set_if_empty,CPUTYPE,opteron)
1075 1075
 					C_DEFS+=-DCC_GCC_LIKE_ASM
1076
-                                        CFLAGS+=-g -m64 \
1076
+                                        CFLAGS+=-m64 \
1077 1077
                                                 $(CC_OPT)
1078 1078
                                         LDFLAGS+=-m64
1079 1079
 else      	# CC_NAME, clang
1080 1080
 ifeq		($(CC_NAME), icc)
1081 1081
 			C_DEFS+=-DCC_GCC_LIKE_ASM
1082
-			CFLAGS=-g -O3  -ipo -ipo_obj -unroll  $(PROFILE) \
1082
+			CFLAGS+=-O3  -ipo -ipo_obj -unroll  $(PROFILE) \
1083 1083
 					 -tpp6 -xK  #-openmp  #optimize for PIII
1084 1084
 				# -prefetch doesn't seem to work
1085 1085
 				#( ty to inline acroos files, unroll loops,prefetch,
... ...
@@ -1099,7 +1099,7 @@ ifeq	($(ARCH), sparc64)
1099 1099
 ifeq		($(CC_NAME), gcc)
1100 1100
 				C_DEFS+=-DCC_GCC_LIKE_ASM -DSPARC64_MODE
1101 1101
 				#common stuff
1102
-				CFLAGS=-g $(CC_OPT) -funroll-loops  $(PROFILE) \
1102
+				CFLAGS+=$(CC_OPT) -funroll-loops  $(PROFILE) \
1103 1103
 					#-Wcast-align \
1104 1104
 					#-Wmissing-prototypes
1105 1105
 				#if gcc 9.0+ 8.0+, 7.0+, 6.0+, 5.0+, 4.5+ or 4.2+
... ...
@@ -1175,7 +1175,7 @@ else		#CC_NAME, gcc
1175 1175
 ifeq		($(CC_NAME), suncc)
1176 1176
 			C_DEFS+=-DCC_GCC_LIKE_ASM
1177 1177
 			C_DEFS+=-DSPARC64_MODE
1178
-			CFLAGS+= -m64 -g -xO3 -xtarget=native -xmemalign=8i \
1178
+			CFLAGS+= -m64 -xO3 -xtarget=native -xmemalign=8i \
1179 1179
 					-fma=fused -fns=yes \
1180 1180
 					-xc99 # C99 support
1181 1181
 			LDFLAGS+=-m64
... ...
@@ -1193,7 +1193,7 @@ ifeq	($(ARCH), sparc)
1193 1193
 ifeq		($(CC_NAME), gcc)
1194 1194
 				C_DEFS+=-DCC_GCC_LIKE_ASM
1195 1195
 				#common stuff
1196
-				CFLAGS=-g $(CC_OPT) -funroll-loops  $(PROFILE) \
1196
+				CFLAGS+=$(CC_OPT) -funroll-loops  $(PROFILE) \
1197 1197
 					#-Wcast-align \
1198 1198
 					#-Wmissing-prototypes
1199 1199
 				#if gcc 5.0+, 4.5+ or 4.2+
... ...
@@ -1243,7 +1243,7 @@ endif			#CC_SHORTVER, 9.0+ 8.0+, 7.0+, 6.0+, 5.0+, 4.5+ or 4.2+
1243 1243
 else		#CC_NAME, gcc
1244 1244
 ifeq		($(CC_NAME), suncc)
1245 1245
 			C_DEFS+=-DCC_GCC_LIKE_ASM
1246
-			CFLAGS+= -g -xO3 -xtarget=native -xmemalign=4i \
1246
+			CFLAGS+=-xO3 -xtarget=native -xmemalign=4i \
1247 1247
 					-fma=fused -fns=yes \
1248 1248
 					-xc99 # C99 support
1249 1249
 			# -Dinline="" # add this if cc < 5.3 (define inline as null)
... ...
@@ -1260,7 +1260,7 @@ ifeq	($(ARCH), arm)
1260 1260
 ifeq		($(CC_NAME), gcc)
1261 1261
 				C_DEFS+=-DCC_GCC_LIKE_ASM
1262 1262
 				#common stuff
1263
-				CFLAGS=-marm -march=armv5t $(CC_OPT) -funroll-loops -fsigned-char $(PROFILE)
1263
+				CFLAGS+=-marm -march=armv5t $(CC_OPT) -funroll-loops -fsigned-char $(PROFILE)
1264 1264
 			#if gcc 4.5+ or 4.2+
1265 1265
 ifeq (,$(strip $(filter-out 4.2+ 4.5+ 5.0+ 6.0+ 7.0+ 8.0+ 9.0+,$(CC_SHORTVER))))
1266 1266
 					CFLAGS+= -ftree-vectorize -fno-strict-overflow
... ...
@@ -1308,7 +1308,7 @@ ifeq	($(ARCH), arm6)
1308 1308
 ifeq		($(CC_NAME), gcc)
1309 1309
 				C_DEFS+=-DCC_GCC_LIKE_ASM
1310 1310
 				#common stuff
1311
-				CFLAGS=-march=armv6 $(CC_OPT) -funroll-loops -fsigned-char \
1311
+				CFLAGS+=-march=armv6 $(CC_OPT) -funroll-loops -fsigned-char \
1312 1312
 						$(PROFILE)
1313 1313
 			#if gcc 7.0+, 6.0+, 5.0+, 4.5+ or 4.2+
1314 1314
 ifeq (,$(strip $(filter-out 4.2+ 4.5+ 5.0+ 6.0+ 7.0+ 8.0+ 9.0+,$(CC_SHORTVER))))
... ...
@@ -1355,7 +1355,7 @@ ifeq	($(ARCH), arm7)
1355 1355
 ifeq		($(CC_NAME), gcc)
1356 1356
 				C_DEFS+=-DCC_GCC_LIKE_ASM
1357 1357
 				#common stuff, use armv7-a as lowest common architecture
1358
-				CFLAGS=-march=armv7-a $(CC_OPT) -funroll-loops -fsigned-char \
1358
+				CFLAGS+=-march=armv7-a $(CC_OPT) -funroll-loops -fsigned-char \
1359 1359
 						$(PROFILE)
1360 1360
 			#if gcc 7.0+, 6.0+, 5.0+, 4.5+ or 4.2+
1361 1361
 ifeq (,$(strip $(filter-out 4.2+ 4.5+ 5.0+ 6.0+ 7.0+ 8.0+ 9.0+,$(CC_SHORTVER))))
... ...
@@ -1402,7 +1402,7 @@ ifeq	($(ARCH), mips)
1402 1402
 ifeq		($(CC_NAME), gcc)
1403 1403
 				C_DEFS+=-DCC_GCC_LIKE_ASM
1404 1404
 				#common stuff
1405
-				CFLAGS=$(CC_OPT) -funroll-loops  $(PROFILE)
1405
+				CFLAGS+=$(CC_OPT) -funroll-loops  $(PROFILE)
1406 1406
 			#if gcc 9.0+ 8.0+, 7.0+, 6.0, 5.0+, 4.5+ or 4.2+
1407 1407
 ifeq (,$(strip $(filter-out 4.2+ 4.5+ 5.0+ 6.0+ 7.0+ 8.0+ 9.0+,$(CC_SHORTVER))))
1408 1408
 					CFLAGS+=-mfp32 -march=r3000 \
... ...
@@ -1451,7 +1451,7 @@ ifeq	($(ARCH), mips2)
1451 1451
 ifeq		($(CC_NAME), gcc)
1452 1452
 				C_DEFS+=-DCC_GCC_LIKE_ASM
1453 1453
 				#common stuff
1454
-				CFLAGS= $(CC_OPT) -funroll-loops $(PROFILE)
1454
+				CFLAGS+= $(CC_OPT) -funroll-loops $(PROFILE)
1455 1455
 			#if gcc 9.0+ 8.0+, 7.0+, 6.0+, 5.0+, 4.5+ or 4.2+
1456 1456
 ifeq (,$(strip $(filter-out 4.2+ 4.5+ 5.0+ 6.0+ 7.0+ 8.0+ 9.0+,$(CC_SHORTVER))))
1457 1457
 					CFLAGS+=-ftree-vectorize -fno-strict-overflow
... ...
@@ -1497,7 +1497,7 @@ ifeq	($(ARCH), mips64)
1497 1497
 ifeq		($(CC_NAME), gcc)
1498 1498
 				C_DEFS+=-DCC_GCC_LIKE_ASM
1499 1499
 				#common stuff
1500
-				CFLAGS= $(CC_OPT) -funroll-loops $(PROFILE)
1500
+				CFLAGS+= $(CC_OPT) -funroll-loops $(PROFILE)
1501 1501
 			#if gcc 9.0+ 8.0+, 7.0+, 6.0+, 5.0+, 4.5+ or 4.2+
1502 1502
 ifeq (,$(strip $(filter-out 4.2+ 4.5+ 5.0+ 6.0+ 7.0+ 8.0+ 9.0+,$(CC_SHORTVER))))
1503 1503
 					CFLAGS+=-ftree-vectorize -fno-strict-overflow
... ...
@@ -1544,7 +1544,7 @@ ifeq	($(ARCH), alpha)
1544 1544
 ifeq		($(CC_NAME), gcc)
1545 1545
 				C_DEFS+=-DCC_GCC_LIKE_ASM
1546 1546
 				#common stuff
1547
-				CFLAGS= $(CC_OPT) -funroll-loops $(PROFILE)
1547
+				CFLAGS+= $(CC_OPT) -funroll-loops $(PROFILE)
1548 1548
 			#if gcc 5.0+, 4.5 or 4.2+
1549 1549
 ifeq (,$(strip $(filter-out 4.2+ 4.5+ 5.0+ 6.0+ 7.0+ 8.0+ 9.0+,$(CC_SHORTVER))))
1550 1550
 					CFLAGS+= -fno-strict-overflow
... ...
@@ -1590,7 +1590,7 @@ ifeq	($(ARCH), ppc)
1590 1590
 ifeq		($(CC_NAME), gcc)
1591 1591
 				C_DEFS+=-DCC_GCC_LIKE_ASM
1592 1592
 				#common stuff
1593
-				CFLAGS=
1593
+				CFLAGS+=
1594 1594
 			#if gcc 9.0+ 8.0+, 7.0+, 6.0+, 5.0+, 4.5+ or 4.2+
1595 1595
 ifeq (,$(strip $(filter-out 4.2+ 4.5+ 5.0+ 6.0+ 7.0+ 8.0+ 9.0+,$(CC_SHORTVER))))
1596 1596
 $(call				set_if_empty,CPUTYPE,powerpc)
... ...
@@ -1647,7 +1647,7 @@ ifeq	($(ARCH), ppc64)
1647 1647
 ifeq		($(CC_NAME), gcc)
1648 1648
 				C_DEFS+=-DCC_GCC_LIKE_ASM
1649 1649
 				#common stuff
1650
-				CFLAGS= $(CC_OPT) -funroll-loops -fsigned-char $(PROFILE)
1650
+				CFLAGS+= $(CC_OPT) -funroll-loops -fsigned-char $(PROFILE)
1651 1651
 			#if gcc 9.0+ 8.0+, 7.0+, 6.0+, 5.0+, 4.5+ or 4.2+
1652 1652
 ifeq (,$(strip $(filter-out 4.2+ 4.5+ 5.0+ 6.0+ 7.0+ 8.0+ 9.0+,$(CC_SHORTVER))))
1653 1653
 $(call				set_if_empty,CPUTYPE,powerpc64)
... ...
@@ -1745,7 +1745,7 @@ LIB_LDFLAGS+= $(LD_EXTRA_OPTS) $(LD_PMUTEX_OPTS)
1745 1745
 
1746 1746
 else	#mode,release
1747 1747
 ifeq	($(CC_NAME), gcc)
1748
-		CFLAGS=-g -Wcast-align $(PROFILE)
1748
+		CFLAGS+=-Wcast-align $(PROFILE)
1749 1749
 		C_DEFS+=-DCC_GCC_LIKE_ASM
1750 1750
 ifeq		($(ARCH), sparc64)
1751 1751
 			C_DEFS+=SPARC64_MODE
... ...
@@ -1754,14 +1754,14 @@ ifeq		($(ARCH), sparc64)
1754 1754
 endif
1755 1755
 ifeq		($(LDTYPE), solaris)
1756 1756
 			#solaris ld
1757
-			LDFLAGS+=-g $(PROFILE)
1757
+			LDFLAGS+=$(PROFILE)
1758 1758
 			MOD_LDFLAGS:=-G $(LDFLAGS)
1759 1759
 			LIB_LDFLAGS:=-G $(LDFLAGS)
1760 1760
 			LIB_SONAME=-Wl,-h,
1761 1761
 			LD_RPATH=-Wl,-R,
1762 1762
 else
1763 1763
 			#gnu or other ld type
1764
-			LDFLAGS+=-g -Wl,-E $(PROFILE)
1764
+			LDFLAGS+=-Wl,-E $(PROFILE)
1765 1765
 			MOD_LDFLAGS:=-shared $(LDFLAGS)
1766 1766
 			LIB_LDFLAGS:=-shared $(LDFLAGS)
1767 1767
 			LIB_SONAME=-Wl,-soname,
... ...
@@ -1770,16 +1770,16 @@ endif
1770 1770
 endif
1771 1771
 ifeq	($(CC_NAME), icc)
1772 1772
 		C_DEFS+=-DCC_GCC_LIKE_ASM
1773
-		CFLAGS=-g  $(PROFILE)
1774
-		LDFLAGS+=-g -Wl,-E $(PROFILE)
1773
+		CFLAGS+=$(PROFILE)
1774
+		LDFLAGS+=-Wl,-E $(PROFILE)
1775 1775
 		MOD_LDFLAGS:=-shared $(LDFLAGS)
1776 1776
 		LIB_LDFLAGS:=-shared $(LDFLAGS)
1777 1777
 		LIB_SONAME=-Wl,-soname,
1778 1778
 		LD_RPATH=-Wl,-rpath,
1779 1779
 endif
1780 1780
 ifeq	($(CC_NAME), suncc)
1781
-		CFLAGS= -g $(PROFILE)
1782
-		LDFLAGS+=-g $(PROFILE)
1781
+		CFLAGS+=$(PROFILE)
1782
+		LDFLAGS+=$(PROFILE)
1783 1783
 		MOD_LDFLAGS:=-G $(LDFLAGS)
1784 1784
 		LIB_LDFLAGS:=-G $(LDFLAGS)
1785 1785
 		LIB_SONAME=-Wl,-h,