Skip to content

Commit

Permalink
[make & configure] Don't strip leading underscore on Win64
Browse files Browse the repository at this point in the history
  • Loading branch information
Keno authored and ihnorton committed Sep 12, 2015
1 parent 55f7b46 commit a94a96c
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions tools/llvm-shlib/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -86,11 +86,19 @@ $(LibName.SO): $(SHLIB_STUBS)
$(Echo) Collecting global symbols of $(notdir $*)
$(Verb) $(NM_PATH) -g $< > $@

# The Windows ABI specifies leading underscores only on 32bit, so
# make sure we don't strip them on x86_64
ifeq ($(ARCH),x86_64)
ABI_UNDERSCORE =
else
ABI_UNDERSCORE =_
endif

$(ObjDir)/$(LIBRARYNAME).exports: $(SHLIB_FRAGS) $(ObjDir)/.dir
$(Echo) Generating exports for $(LIBRARYNAME)
$(Verb) ($(SED) -n \
-e "s/^.* T _\([^.][^.]*\)$$/\1/p" \
-e "s/^.* [BDR] _\([^.][^.]*\)$$/\1 DATA/p" \
-e "s/^.* T $(ABI_UNDERSCORE)\([^.][^.]*\)$$/\1/p" \
-e "s/^.* [BDR] $(ABI_UNDERSCORE)\([^.][^.]*\)$$/\1 DATA/p" \
$(SHLIB_FRAGS) \
| sort -u) > $@

Expand Down

0 comments on commit a94a96c

Please sign in to comment.