diff --git a/patches/win32-dll-build.patch b/patches/win32-dll-build.patch index f341c2ba..989cf989 100644 --- a/patches/win32-dll-build.patch +++ b/patches/win32-dll-build.patch @@ -1,12 +1,12 @@ -From c3236b6df9af74ec4c0c5aa9d5b1d95b43392a4a Mon Sep 17 00:00:00 2001 +From 3689f3e8291a4ad289ad8580a9afb227cbb8e7eb Mon Sep 17 00:00:00 2001 From: Kartik Singh Date: Thu, 12 Dec 2024 11:40:25 -0800 Subject: [PATCH] Patch libsbcl build for Windows --- make-shared-library.sh | 2 +- - src/runtime/GNUmakefile | 4 ++-- - 2 files changed, 3 insertions(+), 3 deletions(-) + src/runtime/GNUmakefile | 8 ++++++-- + 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/make-shared-library.sh b/make-shared-library.sh index 9acd9d843..39a951e9e 100755 @@ -19,16 +19,20 @@ index 9acd9d843..39a951e9e 100755 -$GNUMAKE -C src/runtime libsbcl.so +$GNUMAKE -C src/runtime libsbcl.dll diff --git a/src/runtime/GNUmakefile b/src/runtime/GNUmakefile -index 15e12a995..59d61592e 100644 +index 15e12a995..e02db7906 100644 --- a/src/runtime/GNUmakefile +++ b/src/runtime/GNUmakefile -@@ -132,8 +132,8 @@ libsbcl.a: $(OBJS) +@@ -132,8 +132,12 @@ libsbcl.a: $(OBJS) rm -f $@ ; ar rcs $@ $^ PIC_OBJS = $(subst .o,.pic.o,$(OBJS)) -libsbcl.so: $(PIC_OBJS) - $(CC) -shared -o $@ $^ $(LIBS) $(SOFLAGS) +libsbcl.dll: $(PIC_OBJS) ++# The MINGW64 environment uses msvcrt.dll as the C runtime, which does ++# not export log1p and log2. We statically link MPFR, which provides ++# those two functions, into the DLL and then export the missing ++# functions via mswin64.def. + $(CC) -shared -o $@ $^ $(LIBS) $(SOFLAGS) -Wl,-export-all-symbols -Wl,--whole-archive -lmpfr -Wl,--no-whole-archive mswin64.def # for this to work, you must have with-gcc-tls in your build features already. # can't define it here because then it conflicts if you have it in both places.