From 56de9cdaf8ba4bb0d7868a854423600ed472214e Mon Sep 17 00:00:00 2001 From: Keno Fischer Date: Sat, 9 Mar 2024 00:15:38 -0500 Subject: [PATCH 1/3] Add openlibm to sysimg link line on windows LLVM generates calls to math intrinsics like `trunc` and `rint` (at least in my local i686 mingw) build, so linking to openlibm is required. We already have this on the sysimg link line in `Base.link_image`, so this aligns those options. --- sysimage.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sysimage.mk b/sysimage.mk index b5f47be0160a4..480ce3f8f79e1 100644 --- a/sysimage.mk +++ b/sysimage.mk @@ -17,7 +17,7 @@ $(build_private_libdir)/%.$(SHLIB_EXT): $(build_private_libdir)/%-o.a @$(call PRINT_LINK, $(CXX) $(LDFLAGS) -shared $(fPIC) -L$(build_private_libdir) -L$(build_libdir) -L$(build_shlibdir) -o $@ \ $(WHOLE_ARCHIVE) $< $(NO_WHOLE_ARCHIVE) \ $(if $(findstring -debug,$(notdir $@)),-ljulia-internal-debug -ljulia-debug,-ljulia-internal -ljulia) \ - $$([ $(OS) = WINNT ] && echo '' -lssp)) + $$([ $(OS) = WINNT ] && echo '' -lopenlibm -lssp)) @$(INSTALL_NAME_CMD)$(notdir $@) $@ @$(DSYMUTIL) $@ From 27b2cea24e3ab0d49bd0fea08ca2d4b61cb80ee6 Mon Sep 17 00:00:00 2001 From: Elliot Saba Date: Mon, 17 Jun 2024 10:10:15 -0700 Subject: [PATCH 2/3] Update sysimage.mk --- sysimage.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sysimage.mk b/sysimage.mk index 480ce3f8f79e1..cde011c456c55 100644 --- a/sysimage.mk +++ b/sysimage.mk @@ -17,7 +17,7 @@ $(build_private_libdir)/%.$(SHLIB_EXT): $(build_private_libdir)/%-o.a @$(call PRINT_LINK, $(CXX) $(LDFLAGS) -shared $(fPIC) -L$(build_private_libdir) -L$(build_libdir) -L$(build_shlibdir) -o $@ \ $(WHOLE_ARCHIVE) $< $(NO_WHOLE_ARCHIVE) \ $(if $(findstring -debug,$(notdir $@)),-ljulia-internal-debug -ljulia-debug,-ljulia-internal -ljulia) \ - $$([ $(OS) = WINNT ] && echo '' -lopenlibm -lssp)) + $$([ $(OS) = WINNT ] && echo '' -l$(LIBM) -lssp)) @$(INSTALL_NAME_CMD)$(notdir $@) $@ @$(DSYMUTIL) $@ From bd2b59646e13aea9ba41bfdf20d2db7a254fa45e Mon Sep 17 00:00:00 2001 From: Elliot Saba Date: Mon, 17 Jun 2024 10:21:04 -0700 Subject: [PATCH 3/3] Remove extraneous -l --- sysimage.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sysimage.mk b/sysimage.mk index 5a49c6f775d7e..d0e106d4ce3da 100644 --- a/sysimage.mk +++ b/sysimage.mk @@ -17,7 +17,7 @@ $(build_private_libdir)/%.$(SHLIB_EXT): $(build_private_libdir)/%-o.a @$(call PRINT_LINK, $(CXX) $(LDFLAGS) -shared $(fPIC) -L$(build_private_libdir) -L$(build_libdir) -L$(build_shlibdir) -o $@ \ $(WHOLE_ARCHIVE) $< $(NO_WHOLE_ARCHIVE) \ $(if $(findstring -debug,$(notdir $@)),-ljulia-internal-debug -ljulia-debug,-ljulia-internal -ljulia) \ - $$([ $(OS) = WINNT ] && echo '' -l$(LIBM) -lssp --disable-auto-import --disable-runtime-pseudo-reloc)) + $$([ $(OS) = WINNT ] && echo '' $(LIBM) -lssp --disable-auto-import --disable-runtime-pseudo-reloc)) @$(INSTALL_NAME_CMD)$(notdir $@) $@ @$(DSYMUTIL) $@