From a94a96cbd20b672ed319506a7a01724de5e5a02d Mon Sep 17 00:00:00 2001 From: Keno Fischer Date: Fri, 11 Sep 2015 21:44:37 -0400 Subject: [PATCH] [make & configure] Don't strip leading underscore on Win64 ref: http://reviews.llvm.org/D5036 --- tools/llvm-shlib/Makefile | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/tools/llvm-shlib/Makefile b/tools/llvm-shlib/Makefile index 19077a3858a6..70f4f3e5429e 100644 --- a/tools/llvm-shlib/Makefile +++ b/tools/llvm-shlib/Makefile @@ -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) > $@