Skip to content

Commit

Permalink
- Incorporate comment suggestion from @magicus. Also applied some add…
Browse files Browse the repository at this point in the history
…itional minor adjustments on top of the suggestion.
  • Loading branch information
jianglizhou committed Aug 7, 2024
1 parent bc427ba commit f2cc2b5
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions make/common/native/Link.gmk
Original file line number Diff line number Diff line change
Expand Up @@ -109,9 +109,9 @@ define CreateStaticLibrary
$(if $$($1_LINK_OBJS_RELATIVE), $$(CD) $$(OUTPUTDIR) ; ) \
$$($1_LD) $(LDFLAGS_CXX_PARTIAL_LINKING) $$($1_SYSROOT_LDFLAGS) \
-o $$($1_TARGET_RELOCATABLE) $$($1_LD_OBJ_ARG))
# Linking with '-Wl,--icf=safe' using objects created by 'ld -r' may not work
# and could cause errors like the following:
# ld: --icf=safe conservatively ignores SHT_LLVM_ADDRSIG [...] with sh_link=0 (likely created using objcopy or ld -r)
# 'ld -r' might invalidate the .llvm_addrsig section, and this will cause subsequent
# calls to lld (with '-Wl,--icf=safe') to fail when linking with this library, so
# remove that section.
$$(call ExecuteWithLog, $$($1_OBJECT_DIR)/$$($1_SAFE_NAME)_objcopy_remove_llvm_addrsig_section, \
$$($1_OBJCOPY) --remove-section=.llvm_addrsig $$($1_TARGET_RELOCATABLE))
endif
Expand Down

0 comments on commit f2cc2b5

Please sign in to comment.