Skip to content

Commit 9417f1a

Browse files
committed
Windows CI fdlibm | Here is a way to actually use Microsoft LIB to package the .o files for a libm.lib, not a libm.a
1 parent c720710 commit 9417f1a

16 files changed

Lines changed: 56 additions & 23 deletions

File tree

.github/workflows/win-arm.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ jobs:
9191
release: true # no MSYS2 installed in ARM64 runners
9292
update: false # faster?
9393
cache: true
94-
install: git base make mingw-w64-clang-aarch64-llvm-tools
94+
install: git base make
9595

9696
- name: Build VM
9797
shell: msys2 {0} #bash

.github/workflows/win.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ jobs:
9292
release: false # use existing MSYS2 installation
9393
update: false # faster?
9494
cache: true
95-
install: git base make binutils
95+
install: git base make
9696

9797
- name: Build VM
9898
shell: msys2 {0} #bash

building/win32x86/common/Makefile

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,9 @@ LIBS:= $(addprefix $(OBJDIR)/, $(addsuffix .lib, $(INTERNAL_PLUGINS)))
118118
DLLS:= $(addprefix $(OBJDIR)/, $(addsuffix .dll, $(EXTERNAL_PLUGINS)))
119119

120120
ifdef BIT_IDENTICAL_FLOATING_POINT
121-
LIBS:=$(BUILD)/fdlibm/libm.a $(LIBS)
121+
LIBM_LIB?=libm.a
122+
export LIBM_LIB
123+
LIBS:=$(BUILD)/fdlibm/$(LIBM_LIB) $(LIBS)
122124
export BIT_IDENTICAL_FLOATING_POINT
123125
endif
124126

@@ -300,10 +302,12 @@ $(OBJDIR)/%.dll: always
300302
JMPOBJ=$(JMPOBJ) VMLIB=$(OBJDIR)/$(VMLIB) \
301303
COGDEFS="$(COGDEFS) -DSQUEAK_EXTERNAL_PLUGIN=$(*F)" $(OBJDIR)/$(*F).dll
302304

305+
# Build fdlibm with GNU ar and GNU ranlib. Override $(LIBM_LIB) and add
306+
# custom rule to choose, e.g., different librarian method.
303307
$(BUILD)/fdlibm/libm.a:
304308
@-$(MKDIR) $(@D)
305309
$(MAKE) CC='$(CC)' CFLAGS="$(CFLAGS) -D_IEEE_LIBM" -C $(@D) \
306-
TP=../../$(TPDIR) -f ../../$(TPDIR)/fdlibm/Makefile.remote
310+
TP=../../$(TPDIR) -f ../../$(TPDIR)/fdlibm/Makefile.remote libm.a
307311

308312

309313
#############################################################################

building/win32x86/common/Makefile.WinSDK

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,4 +22,12 @@
2222
#############################################################################
2323

2424
SDKPREFIX:=.WinSDK
25+
LIBM_LIB:=libm.lib
26+
2527
include ../common/Makefile
28+
29+
$(BUILD)/fdlibm/$(LIBM_LIB):
30+
@-$(MKDIR) $(@D)
31+
$(MAKE) CC='$(CC)' CFLAGS="$(CFLAGS) -D_IEEE_LIBM" -C $(@D) \
32+
LIBRARIAN='$(LIBRARIAN)' \
33+
TP=../../$(TPDIR) -f ../../$(TPDIR)/fdlibm/Makefile.remote $(LIBM_LIB)

building/win32x86/common/Makefile.WinSDK.plugin

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ LIBOBJ?= $(LIBSRC:.c=.o)
7272
LIBOBJ:= $(LIBOBJ:.cpp=.o)
7373
LIBOBJ:= $(addprefix $(OBJDIR)/,$(LIBOBJ))
7474
ifdef BIT_IDENTICAL_FLOATING_POINT
75-
LIBOBJ+=$(BUILD)/fdlibm/libm.a $(LIBS)
75+
LIBOBJ+=$(BUILD)/fdlibm/$(LIBM_LIB) $(LIBS)
7676
endif
7777

7878
#############################################################################

building/win32x86/common/Makefile.plugin

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ PLUGINDLL:= $(VMDIR)/$(LIBNAME).dll
7171
LIBOBJ ?= $(patsubst %.c,%.o,$(patsubst %.cpp,%.o,$(LIBSRC)))
7272
LIBOBJ:= $(addprefix $(OBJDIR)/,$(LIBOBJ))
7373
ifdef BIT_IDENTICAL_FLOATING_POINT
74-
LIBOBJ+=$(BUILD)/fdlibm/libm.a $(LIBS)
74+
LIBOBJ+=$(BUILD)/fdlibm/$(LIBM_LIB) $(LIBS)
7575
endif
7676

7777
#############################################################################

building/win64ARMv8/common/Makefile

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#############################################################################
2-
# Common Makefile for Win64 VM using LLVM/Clang compiler, MSYS2 toolchain,
2+
# Common Makefile for Win64ARMv8 VM using LLVM/Clang compiler, MSYS2 toolchain,
33
# and mingw-w64 for building a native Windows application.
44
#
55
# Visit: https://www.msys2.org/
@@ -118,7 +118,9 @@ LIBS:= $(addprefix $(OBJDIR)/, $(addsuffix .lib, $(INTERNAL_PLUGINS)))
118118
DLLS:= $(addprefix $(OBJDIR)/, $(addsuffix .dll, $(EXTERNAL_PLUGINS)))
119119

120120
ifdef BIT_IDENTICAL_FLOATING_POINT
121-
LIBS:=$(BUILD)/fdlibm/libm.a $(LIBS)
121+
LIBM_LIB?=libm.a
122+
export LIBM_LIB
123+
LIBS:=$(BUILD)/fdlibm/$(LIBM_LIB) $(LIBS)
122124
export BIT_IDENTICAL_FLOATING_POINT
123125
endif
124126

@@ -300,10 +302,12 @@ $(OBJDIR)/%.dll: always
300302
JMPOBJ=$(JMPOBJ) VMLIB=$(OBJDIR)/$(VMLIB) \
301303
COGDEFS="$(COGDEFS) -DSQUEAK_EXTERNAL_PLUGIN=$(*F)" $(OBJDIR)/$(*F).dll
302304

305+
# Build fdlibm with GNU ar and GNU ranlib. Override $(LIBM_LIB) and add
306+
# custom rule to choose, e.g., different librarian method.
303307
$(BUILD)/fdlibm/libm.a:
304308
@-$(MKDIR) $(@D)
305309
$(MAKE) CC='$(CC)' CFLAGS="$(CFLAGS) -D_IEEE_LIBM" -C $(@D) \
306-
TP=../../$(TPDIR) -f ../../$(TPDIR)/fdlibm/Makefile.remote
310+
TP=../../$(TPDIR) -f ../../$(TPDIR)/fdlibm/Makefile.remote libm.a
307311

308312

309313
#############################################################################

building/win64ARMv8/common/Makefile.WinSDK

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,4 +22,12 @@
2222
#############################################################################
2323

2424
SDKPREFIX:=.WinSDK
25+
LIBM_LIB:=libm.lib
26+
2527
include ../common/Makefile
28+
29+
$(BUILD)/fdlibm/$(LIBM_LIB):
30+
@-$(MKDIR) $(@D)
31+
$(MAKE) CC='$(CC)' CFLAGS="$(CFLAGS) -D_IEEE_LIBM" -C $(@D) \
32+
LIBRARIAN='$(LIBRARIAN)' \
33+
TP=../../$(TPDIR) -f ../../$(TPDIR)/fdlibm/Makefile.remote $(LIBM_LIB)

building/win64ARMv8/common/Makefile.WinSDK.plugin

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ LIBOBJ?= $(LIBSRC:.c=.o)
7272
LIBOBJ:= $(LIBOBJ:.cpp=.o)
7373
LIBOBJ:= $(addprefix $(OBJDIR)/,$(LIBOBJ))
7474
ifdef BIT_IDENTICAL_FLOATING_POINT
75-
LIBOBJ+=$(BUILD)/fdlibm/libm.a $(LIBS)
75+
LIBOBJ+=$(BUILD)/fdlibm/$(LIBM_LIB) $(LIBS)
7676
endif
7777

7878
#############################################################################

building/win64ARMv8/common/Makefile.WinSDK.tools.paths

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,6 @@ else
1919
override MSYS2_BIN:=$(subst \,/,$(MSYS2_BIN))
2020
endif
2121

22-
# For llvm-tools ar and ranlib, make both available in the MSYS environment.
23-
# Do not install binutils but the package mingw-w64-clang-aarch64-llvm-tools.
24-
$(shell ln -f -s ${MSYS2_BIN}../../clangarm64/bin/ar ${MSYS2_BIN}ar)
25-
$(shell ln -f -s ${MSYS2_BIN}../../clangarm64/bin/ranlib ${MSYS2_BIN}ranlib)
26-
27-
2822
#############################################################################
2923
# Set paths to the Windows SDK (and tools) and Visual Studio (and tools)
3024
#

0 commit comments

Comments
 (0)