Skip to content

Commit

Permalink
Comment patch
Browse files Browse the repository at this point in the history
  • Loading branch information
kartik-s committed Dec 16, 2024
1 parent 22b08cf commit 3d1fcf8
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions patches/win32-dll-build.patch
Original file line number Diff line number Diff line change
@@ -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 <[email protected]>
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
Expand All @@ -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.
Expand Down

0 comments on commit 3d1fcf8

Please sign in to comment.