Skip to content

Commit 31f2335

Browse files
android,build: different host flags for linking
Use different flags for linking depending on host_os, since macOS doesn't support --start-group and --end-group on clang.
1 parent e6817bd commit 31f2335

File tree

1 file changed

+5
-0
lines changed
  • tools/gyp/pylib/gyp/generator

1 file changed

+5
-0
lines changed

tools/gyp/pylib/gyp/generator/make.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,12 @@ def CalculateGeneratorInputInfo(params):
201201
quiet_cmd_link = LINK($(TOOLSET)) $@
202202
quiet_cmd_link_host = LINK($(TOOLSET)) $@
203203
cmd_link = $(LINK.$(TOOLSET)) $(GYP_LDFLAGS) $(LDFLAGS.$(TOOLSET)) -o $@ -Wl,--start-group $(LD_INPUTS) -Wl,--end-group $(LIBS)
204+
# If building on MacOS, --start-group and --end-group won't be supported in clang.
205+
ifeq ($(shell uname -s),Darwin) then
206+
cmd_link_host = $(LINK.$(TOOLSET)) $(GYP_LDFLAGS) $(LDFLAGS.$(TOOLSET)) -o $@ $(LD_INPUTS) $(LIBS)
207+
else
204208
cmd_link_host = $(LINK.$(TOOLSET)) $(GYP_LDFLAGS) $(LDFLAGS.$(TOOLSET)) -o $@ -Wl,--start-group $(LD_INPUTS) -Wl,--end-group $(LIBS)
209+
endif
205210
206211
# Other shared-object link notes:
207212
# - Set SONAME to the library filename so our binaries don't reference

0 commit comments

Comments
 (0)