1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
|
Respect build environment settings
Bug: https://bugs.gentoo.org/913186
Bug: https://bugs.gentoo.org/913188
Bug: https://bugs.gentoo.org/913189
--- a/7zip_gcc.mak
+++ b/7zip_gcc.mak
@@ -87,14 +87,14 @@ SHARED_EXT=.dll
LDFLAGS = -shared -DEF $(DEF_FILE) $(LDFLAGS_STATIC)
else
SHARED_EXT=.so
-LDFLAGS = -shared -fPIC $(LDFLAGS_STATIC)
+LDFLAGS = -shared -fPIC $(G_LDFLAGS) $(LDFLAGS_STATIC)
CC_SHARED=-fPIC
endif
else
-LDFLAGS = $(LDFLAGS_STATIC)
+LDFLAGS = $(LDFLAGS_STATIC) $(G_LDFLAGS)
# -s is not required for clang, do we need it for GCC ???
#-static -static-libgcc -static-libstdc++
@@ -149,7 +149,7 @@ endif
-CFLAGS = $(MY_ARCH_2) $(LOCAL_FLAGS) $(CFLAGS_BASE2) $(CFLAGS_BASE) $(FLAGS_FLTO) $(CC_SHARED) -o $@
+CFLAGS = $(MY_ARCH_2) $(LOCAL_FLAGS) $(CFLAGS_BASE2) $(CFLAGS_BASE) $(FLAGS_FLTO) $(CC_SHARED) $(G_CFLAGS) -o $@
ifdef IS_MINGW
@@ -190,7 +190,7 @@ CXX_WARN_FLAGS =
#-Wno-invalid-offsetof
#-Wno-reorder
-CXXFLAGS = $(MY_ARCH_2) $(LOCAL_FLAGS) $(CXXFLAGS_BASE2) $(CFLAGS_BASE) $(FLAGS_FLTO) $(CXXFLAGS_EXTRA) $(CC_SHARED) $(CXX_WARN_FLAGS) $(CXX_STD_FLAGS) -o $@
+CXXFLAGS = $(MY_ARCH_2) $(LOCAL_FLAGS) $(CXXFLAGS_BASE2) $(CFLAGS_BASE) $(FLAGS_FLTO) $(CXXFLAGS_EXTRA) $(CC_SHARED) $(CXX_WARN_FLAGS) $(CXX_STD_FLAGS) $(G_CXXFLAGS) -o $@
STATIC_TARGET=
ifdef COMPL_STATIC
@@ -208,7 +208,7 @@ $(O):
# -Wl,--print-gc-sections
ifneq ($(CC), $(CROSS_COMPILE)clang)
-LFLAGS_STRIP = -s
+
endif
LFLAGS_ALL = $(LFLAGS_STRIP) $(MY_ARCH_2) $(LDFLAGS) $(FLAGS_FLTO) $(LD_arch) $(OBJS) $(MY_LIBS) $(LIB2)
--- a/var_clang.mak
+++ b/var_clang.mak
@@ -6,6 +6,6 @@ IS_ARM64=
CROSS_COMPILE=
MY_ARCH=
USE_ASM=
-CC=$(CROSS_COMPILE)clang
-CXX=$(CROSS_COMPILE)clang++
+CC=$(G_CC)
+CXX=$(G_CXX)
USE_CLANG=1
--- a/var_clang_x64.mak
+++ b/var_clang_x64.mak
@@ -6,7 +6,7 @@ IS_ARM64=
CROSS_COMPILE=
MY_ARCH=
USE_ASM=1
-CC=$(CROSS_COMPILE)clang
-CXX=$(CROSS_COMPILE)clang++
+CC=$(G_CC)
+CXX=$(G_CXX)
USE_CLANG=1
--- a/var_gcc.mak
+++ b/var_gcc.mak
@@ -6,7 +6,7 @@ IS_ARM64=
CROSS_COMPILE=
MY_ARCH=
USE_ASM=
-CC=$(CROSS_COMPILE)gcc
-CXX=$(CROSS_COMPILE)g++
+CC=$(G_CC)
+CXX=$(G_CXX)
# -march=armv8-a+crc+crypto
--- a/var_gcc_x64.mak
+++ b/var_gcc_x64.mak
@@ -6,5 +6,5 @@ IS_ARM64=
CROSS_COMPILE=
MY_ARCH=
USE_ASM=1
-CC=$(CROSS_COMPILE)gcc
-CXX=$(CROSS_COMPILE)g++
+CC=$(G_CC)
+CXX=$(G_CXX)
|