27
27
# This file contains functionality related to linking a native binary;
28
28
# creating either a dynamic library, a static library or an executable.
29
29
30
-
31
30
################################################################################
32
31
# GetEntitlementsFile
33
32
# Find entitlements file for executable when signing on macosx. If no
@@ -49,14 +48,6 @@ GetEntitlementsFile = \
49
48
50
49
################################################################################
51
50
define SetupLinking
52
- ifneq ($(DISABLE_MAPFILES), true)
53
- $1_REAL_MAPFILE := $$($1_MAPFILE)
54
- endif
55
-
56
- ifneq ($$($1_REAL_MAPFILE), )
57
- $1_EXTRA_LDFLAGS += $(call SET_SHARED_LIBRARY_MAPFILE,$$($1_REAL_MAPFILE))
58
- endif
59
-
60
51
# Unless specifically set, stripping should only happen if symbols are also
61
52
# being copied.
62
53
$$(call SetIfEmpty, $1_STRIP_SYMBOLS, $$($1_COPY_DEBUG_SYMBOLS))
@@ -95,15 +86,7 @@ define CreateStaticLibrary
95
86
$1_VARDEPS_FILE := $$(call DependOnVariable, $1_VARDEPS, \
96
87
$$($1_OBJECT_DIR)/$$($1_NOSUFFIX).vardeps)
97
88
98
- # Generating a static library, ie object file archive.
99
- ifeq ($(STATIC_BUILD), true)
100
- ifeq ($$($1_USE_MAPFILE_FOR_SYMBOLS), true)
101
- STATIC_MAPFILE_DEP := $$($1_MAPFILE)
102
- endif
103
- endif
104
-
105
- $1_TARGET_DEPS := $$($1_ALL_OBJS) $$($1_RES) $$($1_VARDEPS_FILE) \
106
- $$(STATIC_MAPFILE_DEP)
89
+ $1_TARGET_DEPS := $$($1_ALL_OBJS) $$($1_VARDEPS_FILE)
107
90
108
91
$1_AR_OBJ_ARG := $$($1_LD_OBJ_ARG)
109
92
# With clang on linux, partial linking is enabled and 'AR' takes the output
@@ -136,28 +119,11 @@ define CreateStaticLibrary
136
119
$$($1_AR) $$(ARFLAGS) $$($1_ARFLAGS) -r -cs $$($1_TARGET) \
137
120
$$($1_AR_OBJ_ARG) $$($1_RES))
138
121
ifeq ($(STATIC_BUILD), true)
139
- ifeq ($$($1_USE_MAPFILE_FOR_SYMBOLS), true)
140
- $(CP) $$($1_MAPFILE) $$(@D)/$$(basename $$(@F)).symbols
141
- else
142
- # get the exported symbols from mapfiles and if there
143
- # is no mapfile, get them from the archive
144
- $(RM) $$(@D)/$$(basename $$(@F)).symbols; \
145
- if [ ! -z $$($1_MAPFILE) -a -e $$($1_MAPFILE) ]; then \
146
- $(ECHO) "Getting symbols from mapfile $$($1_MAPFILE)"; \
147
- $(AWK) '/global:/','/local:/' $$($1_MAPFILE) | \
148
- $(SED) -e 's/#.*//;s/global://;s/local://;s/\;//;s/^[ ]*/_/;/^_$$$$/d' | \
149
- $(EGREP) -v "JNI_OnLoad|JNI_OnUnload|Agent_OnLoad|Agent_OnUnload|Agent_OnAttach" > \
150
- $$(@D)/$$(basename $$(@F)).symbols || true; \
151
- $(NM) $(NMFLAGS) $$($1_TARGET) | $(GREP) " T " | \
152
- $(EGREP) "JNI_OnLoad|JNI_OnUnload|Agent_OnLoad|Agent_OnUnload|Agent_OnAttach" | \
153
- $(CUT) -d ' ' -f 3 >> $$(@D)/$$(basename $$(@F)).symbols || true;\
154
- else \
155
- $(ECHO) "Getting symbols from nm"; \
156
- $(NM) $(NMFLAGS) -m $$($1_TARGET) | $(GREP) "__TEXT" | \
157
- $(EGREP) -v "non-external|private extern|__TEXT,__eh_frame" | \
158
- $(SED) -e 's/.* //' > $$(@D)/$$(basename $$(@F)).symbols; \
159
- fi
160
- endif
122
+ $(RM) $$(@D)/$$(basename $$(@F)).symbols; \
123
+ $(ECHO) "Getting symbols from nm"; \
124
+ $(NM) $(NMFLAGS) -m $$($1_TARGET) | $(GREP) "__TEXT" | \
125
+ $(EGREP) -v "non-external|private extern|__TEXT,__eh_frame" | \
126
+ $(SED) -e 's/.* //' > $$(@D)/$$(basename $$(@F)).symbols
161
127
endif
162
128
endef
163
129
@@ -180,7 +146,7 @@ define CreateDynamicLibraryOrExecutable
180
146
$1_VARDEPS_FILE := $$(call DependOnVariable, $1_VARDEPS, \
181
147
$$($1_OBJECT_DIR)/$$($1_NOSUFFIX).vardeps)
182
148
183
- $1_TARGET_DEPS := $$($1_ALL_OBJS) $$($1_REAL_MAPFILE) $$($ 1_VARDEPS_FILE)
149
+ $1_TARGET_DEPS := $$($1_ALL_OBJS) $$($1_VARDEPS_FILE)
184
150
185
151
$$($1_TARGET): $$($1_TARGET_DEPS)
186
152
ifneq ($$($1_OBJ_FILE_LIST), )
0 commit comments