Skip to content

Commit 966d0af

Browse files
authored
release-1.12: Revert "build: More msys2 fixes (#59028)" (#60374)
1 parent 9494125 commit 966d0af

File tree

9 files changed

+26
-60
lines changed

9 files changed

+26
-60
lines changed

contrib/mac/app/Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,8 @@ dmg/$(APP_NAME): startup.applescript julia.icns
4747
plutil -insert CFBundleVersion -string "$(JULIA_VERSION_OPT_COMMIT)" $@/Contents/Info.plist
4848
plutil -insert NSHumanReadableCopyright -string "$(APP_COPYRIGHT)" $@/Contents/Info.plist
4949
-mkdir -p $@/Contents/Resources/julia
50-
$(MAKE) -C $(JULIAHOME) binary-dist
51-
$(TAR) -xzf $(JULIAHOME)/$(JULIA_BINARYDIST_FILENAME).tar.gz -C $@/Contents/Resources/julia --strip-components 1
50+
make -C $(JULIAHOME) binary-dist
51+
tar zxf $(JULIAHOME)/$(JULIA_BINARYDIST_FILENAME).tar.gz -C $@/Contents/Resources/julia --strip-components 1
5252
find $@/Contents/Resources/julia -type f -exec chmod -w {} \;
5353
# Even though the tarball may already be signed, we re-sign here to make it easier to add
5454
# unsigned executables (like the app launcher) and whatnot, without needing to maintain lists

deps/libgit2.mk

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ ifneq ($(USE_BINARYBUILDER_LIBGIT2),1)
44
LIBGIT2_GIT_URL := https://github.com/libgit2/libgit2.git
55
LIBGIT2_TAR_URL = https://api.github.com/repos/libgit2/libgit2/tarball/$1
66
$(eval $(call git-external,libgit2,LIBGIT2,CMakeLists.txt,,$(SRCCACHE)))
7-
$(SRCCACHE)/$(LIBGIT2_SRC_DIR)/source-extracted: $(MSYS_NONEXISTENT_SYMLINK_TARGET_FIX)
87

98
ifeq ($(USE_SYSTEM_LIBSSH2), 0)
109
$(BUILDDIR)/$(LIBGIT2_SRC_DIR)/build-configured: | $(build_prefix)/manifest/libssh2
@@ -14,15 +13,7 @@ ifeq ($(USE_SYSTEM_OPENSSL), 0)
1413
$(BUILDDIR)/$(LIBGIT2_SRC_DIR)/build-configured: | $(build_prefix)/manifest/openssl
1514
endif
1615

17-
ifeq ($(USE_SYSTEM_PCRE), 0)
18-
$(BUILDDIR)/$(LIBGIT2_SRC_DIR)/build-configured: | $(build_prefix)/manifest/pcre
19-
endif
20-
21-
ifeq ($(USE_SYSTEM_ZLIB), 0)
22-
$(BUILDDIR)/$(LIBGIT2_SRC_DIR)/build-configured: | $(build_prefix)/manifest/zlib
23-
endif
24-
25-
LIBGIT2_OPTS := $(CMAKE_COMMON) -DCMAKE_BUILD_TYPE=Release -DUSE_THREADS=ON -DUSE_BUNDLED_ZLIB=OFF -DUSE_SSH=ON -DREGEX_BACKEND=pcre2 -DBUILD_CLI=OFF -DBUILD_TESTS=OFF
16+
LIBGIT2_OPTS := $(CMAKE_COMMON) -DCMAKE_BUILD_TYPE=Release -DUSE_THREADS=ON -DUSE_BUNDLED_ZLIB=ON -DUSE_SSH=ON -DBUILD_CLI=OFF
2617
ifeq ($(OS),WINNT)
2718
LIBGIT2_OPTS += -DWIN32=ON -DMINGW=ON
2819
ifeq ($(USE_SYSTEM_LIBSSH2), 0)

deps/libssh2.mk

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,9 @@ endif
1717

1818
ifeq ($(OS),WINNT)
1919
LIBSSH2_OPTS += -DCRYPTO_BACKEND=WinCNG -DENABLE_ZLIB_COMPRESSION=OFF
20+
ifeq ($(BUILD_OS),WINNT)
21+
LIBSSH2_OPTS += -G"MSYS Makefiles"
22+
endif
2023
else
2124
LIBSSH2_OPTS += -DCRYPTO_BACKEND=OpenSSL -DENABLE_ZLIB_COMPRESSION=OFF
2225
LIBSSH2_OPTS += -DOPENSSL_ROOT_DIR=$(build_prefix)
@@ -35,7 +38,7 @@ LIBSSH2_SRC_PATH := $(SRCCACHE)/$(LIBSSH2_SRC_DIR)
3538
$(BUILDDIR)/$(LIBSSH2_SRC_DIR)/build-configured: $(LIBSSH2_SRC_PATH)/source-extracted
3639
mkdir -p $(dir $@)
3740
cd $(dir $@) && \
38-
$(CMAKE) $(CMAKE_GENERATOR_COMMAND) $(dir $<) $(LIBSSH2_OPTS)
41+
$(CMAKE) $(dir $<) $(LIBSSH2_OPTS)
3942
echo 1 > $@
4043

4144
$(BUILDDIR)/$(LIBSSH2_SRC_DIR)/build-compiled: $(BUILDDIR)/$(LIBSSH2_SRC_DIR)/build-configured

deps/libuv.mk

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ LIBUV_GIT_URL:=https://github.com/JuliaLang/libuv.git
44
LIBUV_TAR_URL=https://api.github.com/repos/JuliaLang/libuv/tarball/$1
55
$(eval $(call git-external,libuv,LIBUV,configure,,$(SRCCACHE)))
66

7-
UV_CFLAGS := -O2 -DBUILDING_UV_SHARED=1
7+
UV_CFLAGS := -O2
88

99
UV_FLAGS := LDFLAGS="$(LDFLAGS) $(CLDFLAGS) -v"
1010
UV_FLAGS += CFLAGS="$(CFLAGS) $(UV_CFLAGS) $(SANITIZE_OPTS)"

deps/llvm.mk

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,6 @@ ifneq ($(USE_BINARYBUILDER_LLVM), 1)
77
LLVM_GIT_URL:=https://github.com/JuliaLang/llvm-project.git
88
LLVM_TAR_URL=https://api.github.com/repos/JuliaLang/llvm-project/tarball/$1
99
$(eval $(call git-external,llvm,LLVM,CMakeLists.txt,,$(SRCCACHE)))
10-
# LLVM's tarball contains symlinks to non-existent targets. This breaks the
11-
# the default msys strategy `deepcopy` symlink strategy. To workaround this,
12-
# switch to `native` which tries native windows symlinks (possible if the
13-
# machine is in developer mode) - or if not, falls back to cygwin-style
14-
# symlinks. We don't particularly care either way - we just need to symlinks
15-
# to succeed. We could guard this by a uname check, but it's harmless elsewhere,
16-
# so let's not incur the additional overhead.
17-
$(SRCCACHE)/$(LLVM_SRC_DIR)/source-extracted: $(MSYS_NONEXISTENT_SYMLINK_TARGET_FIX)
1810

1911
LLVM_BUILDDIR := $(BUILDDIR)/$(LLVM_SRC_DIR)
2012
LLVM_BUILDDIR_withtype := $(LLVM_BUILDDIR)/build_$(LLVM_BUILDTYPE)

deps/openssl.mk

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ $(BUILDDIR)/openssl-$(OPENSSL_VER)/build-configured: $(SRCCACHE)/openssl-$(OPENS
5959
mkdir -p $(dir $@)
6060
cd $(dir $@) && \
6161
CC="$(CC) $(SANITIZE_OPTS)" CXX="$(CXX) $(SANITIZE_OPTS)" LDFLAGS="$(LDFLAGS) $(RPATH_ESCAPED_ORIGIN) $(SANITIZE_LDFLAGS)" \
62-
$(dir $<)/Configure shared --prefix=$(abspath $(build_prefix)) --libdir=$(abspath $(build_libdir)) $(OPENSSL_TARGET)
62+
$(dir $<)/Configure shared --prefix=$(abspath $(build_prefix)) $(OPENSSL_TARGET)
6363
echo 1 > $@
6464

6565
$(BUILDDIR)/openssl-$(OPENSSL_VER)/build-compiled: $(BUILDDIR)/openssl-$(OPENSSL_VER)/build-configured
@@ -75,16 +75,18 @@ endif
7575
# Override bindir and only install runtime libraries, otherwise they'll go into build_depsbindir.
7676
OPENSSL_INSTALL = \
7777
mkdir -p $2$$(build_shlibdir) && \
78-
$$(MAKE) -C $1 install_runtime_libs $$(MAKE_COMMON) bindir=$$(build_shlibdir) $3 DESTDIR="$2"
78+
$$(MAKE) -C $1 install_dev $$(MAKE_COMMON) bindir=$$(build_shlibdir) $3 DESTDIR="$2"
79+
80+
OPENSSL_POST_INSTALL := \
81+
$(WIN_MAKE_HARD_LINK) $(build_bindir)/libcrypto-*.dll $(build_bindir)/libcrypto.dll && \
82+
$(WIN_MAKE_HARD_LINK) $(build_bindir)/libssl-*.dll $(build_bindir)/libssl.dll && \
83+
$(INSTALL_NAME_CMD)libcrypto.$(SHLIB_EXT) $(build_shlibdir)/libcrypto.$(SHLIB_EXT) && \
84+
$(INSTALL_NAME_CMD)libssl.$(SHLIB_EXT) $(build_shlibdir)/libssl.$(SHLIB_EXT) && \
85+
$(INSTALL_NAME_CHANGE_CMD) $(build_shlibdir)/libcrypto.3.dylib @rpath/libcrypto.$(SHLIB_EXT) $(build_shlibdir)/libssl.$(SHLIB_EXT)
7986

8087
$(eval $(call staged-install, \
8188
openssl,openssl-$(OPENSSL_VER), \
82-
OPENSSL_INSTALL,,, \
83-
$$(WIN_MAKE_HARD_LINK) $(build_bindir)/libcrypto-*.dll $(build_bindir)/libcrypto.dll && \
84-
$$(WIN_MAKE_HARD_LINK) $(build_bindir)/libssl-*.dll $(build_bindir)/libssl.dll && \
85-
$$(INSTALL_NAME_CMD)libcrypto.$$(SHLIB_EXT) $$(build_shlibdir)/libcrypto.$$(SHLIB_EXT) && \
86-
$$(INSTALL_NAME_CMD)libssl.$$(SHLIB_EXT) $$(build_shlibdir)/libssl.$$(SHLIB_EXT) && \
87-
$$(INSTALL_NAME_CHANGE_CMD) $$(build_shlibdir)/libcrypto.3.dylib @rpath/libcrypto.$$(SHLIB_EXT) $$(build_shlibdir)/libssl.$$(SHLIB_EXT)))
89+
OPENSSL_INSTALL,,,$(OPENSSL_POST_INSTALL)))
8890

8991
clean-openssl:
9092
-rm -f $(BUILDDIR)/-openssl-$(OPENSSL_VER)/build-configured $(BUILDDIR)/-openssl-$(OPENSSL_VER)/build-compiled

deps/tools/common.mk

Lines changed: 2 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ CMAKE_COMMON += -DCMAKE_SYSTEM_NAME=Windows
5959
CMAKE_COMMON += -DCMAKE_RC_COMPILER="$$(which $(CROSS_COMPILE)windres)"
6060
endif
6161

62+
# For now this is LLVM specific, but I expect it won't be in the future
6263
ifeq ($(CMAKE_GENERATOR),Ninja)
6364
CMAKE_GENERATOR_COMMAND := -G Ninja
6465
else ifeq ($(CMAKE_GENERATOR),make)
@@ -67,27 +68,6 @@ else
6768
$(error Unknown CMake generator '$(CMAKE_GENERATOR)'. Options are 'Ninja' and 'make')
6869
endif
6970

70-
ifneq (,$(findstring MINGW,$(RAW_BUILD_OS)))
71-
ifneq (,$(shell ldd $(shell which cmake) | grep msys-2.0.dll))
72-
# Detect MSYS2 with cygwin CMake rather than MinGW cmake - the former fails to
73-
# properly drive MinGW tools
74-
override CMAKE := echo "ERROR: CMake is Cygwin CMake, not MinGW CMake. Build will fail. Use 'pacman -S mingw-w64-{i686,x86_64}-cmake'."; exit 1; $(CMAKE)
75-
endif
76-
# In our setup, CMAKE_INSTALL_PREFIX is a relative path inside usr-staging.
77-
# We do not want this converted to a windows path, because our make system
78-
# assumes it to be relative to msys `/`.
79-
override CMAKE := MSYS2_ARG_CONV_EXCL="-DCMAKE_INSTALL_PREFIX" $(CMAKE)
80-
endif
81-
82-
# Some dependencies' tarballs contains symlinks to non-existent targets. This breaks the
83-
# the default msys strategy `deepcopy` symlink strategy. To workaround this,
84-
# switch to `native` which tries native windows symlinks (possible if the
85-
# machine is in developer mode) - or if not, falls back to cygwin-style
86-
# symlinks. We don't particularly care either way - we just need to symlinks
87-
# to succeed. We could guard this by a uname check, but it's harmless elsewhere,
88-
# so let's not incur the additional overhead.
89-
MSYS_NONEXISTENT_SYMLINK_TARGET_FIX := export MSYS=winsymlinks:native
90-
9171
# If the top-level Makefile is called with environment variables,
9272
# they will override the values passed above to ./configure
9373
MAKE_COMMON := DESTDIR="" prefix=$(build_prefix) bindir=$(build_depsbindir) libdir=$(build_libdir) shlibdir=$(build_shlibdir) libexecdir=$(build_libexecdir) datarootdir=$(build_datarootdir) includedir=$(build_includedir) sysconfdir=$(build_sysconfdir) O=
@@ -164,7 +144,7 @@ upper = $(shell echo $1 | tr a-z A-Z)
164144
# this rule ensures that make install is more nearly atomic
165145
# so it's harder to get half-installed (or half-reinstalled) dependencies
166146
# # and enables sharing deps compiles, uninstall, and fast reinstall
167-
MAKE_INSTALL = MSYS2_ARG_CONV_EXCL="prefix=" $$(MAKE) -C $1 install $$(MAKE_COMMON) $3 DESTDIR="$2"
147+
MAKE_INSTALL = +$$(MAKE) -C $1 install $$(MAKE_COMMON) $3 DESTDIR="$2"
168148

169149
define SHLIBFILE_INSTALL
170150
mkdir -p $2/$$(build_shlibdir)

src/Makefile

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ GC_CODEGEN_SRCS += llvm-late-gc-lowering-stock
7575
endif
7676
CODEGEN_SRCS := codegen jitlayers aotcompile debuginfo disasm llvm-simdloop \
7777
llvm-pass-helpers llvm-ptls \
78-
llvm-lower-handlers llvm-propagate-addrspaces \
78+
llvm-lower-handlers llvm-propagate-addrspaces null_sysimage \
7979
llvm-multiversioning llvm-alloc-opt llvm-alloc-helpers cgmemmgr llvm-remove-addrspaces \
8080
llvm-remove-ni llvm-julia-licm llvm-demote-float16 llvm-cpufeatures pipeline llvm_api \
8181
$(GC_CODEGEN_SRCS)
@@ -192,9 +192,7 @@ endif
192192

193193
COMMON_LIBPATHS := -L$(build_libdir) -L$(build_shlibdir)
194194
RT_LIBS := $(WHOLE_ARCHIVE) $(LIBUV) $(WHOLE_ARCHIVE) $(LIBUTF8PROC) $(NO_WHOLE_ARCHIVE) $(LIBUNWIND) $(RT_LLVMLINK) $(OSLIBS) $(LIBTRACYCLIENT) $(LIBITTAPI) $(MMTK_LIB)
195-
# NB: CG needs uv_mutex_* symbols, but we expect to export them from libjulia-internal
196195
CG_LIBS := $(LIBUNWIND) $(CG_LLVMLINK) $(OSLIBS) $(LIBTRACYCLIENT) $(LIBITTAPI) $(MMTK_LIB)
197-
198196
RT_DEBUG_LIBS := $(COMMON_LIBPATHS) $(WHOLE_ARCHIVE) $(BUILDDIR)/flisp/libflisp-debug.a $(WHOLE_ARCHIVE) $(BUILDDIR)/support/libsupport-debug.a -ljulia-debug $(RT_LIBS)
199197
CG_DEBUG_LIBS := $(COMMON_LIBPATHS) $(CG_LIBS) -ljulia-debug -ljulia-internal-debug
200198
RT_RELEASE_LIBS := $(COMMON_LIBPATHS) $(WHOLE_ARCHIVE) $(BUILDDIR)/flisp/libflisp.a $(WHOLE_ARCHIVE) $(BUILDDIR)/support/libsupport.a -ljulia $(RT_LIBS)
@@ -471,10 +469,10 @@ libjulia-codegen-debug: $(build_shlibdir)/libjulia-codegen-debug.$(JL_MAJOR_MINO
471469
libjulia-codegen-debug libjulia-codegen-release: $(PUBLIC_HEADER_TARGETS)
472470

473471
# set the exports for the source files based on where they are getting linked
474-
$(OBJS): SHIPFLAGS += -DJL_LIBRARY_EXPORTS_INTERNAL -DBUILDING_UV_SHARED
475-
$(DOBJS): DEBUGFLAGS += -DJL_LIBRARY_EXPORTS_INTERNAL -DBUILDING_UV_SHARED
476-
$(CODEGEN_OBJS): SHIPFLAGS += -DJL_LIBRARY_EXPORTS_CODEGEN -DUSING_UV_SHARED
477-
$(CODEGEN_DOBJS): DEBUGFLAGS += -DJL_LIBRARY_EXPORTS_CODEGEN -DUSING_UV_SHARED
472+
$(OBJS): SHIPFLAGS += -DJL_LIBRARY_EXPORTS_INTERNAL
473+
$(DOBJS): DEBUGFLAGS += -DJL_LIBRARY_EXPORTS_INTERNAL
474+
$(CODEGEN_OBJS): SHIPFLAGS += -DJL_LIBRARY_EXPORTS_CODEGEN
475+
$(CODEGEN_DOBJS): DEBUGFLAGS += -DJL_LIBRARY_EXPORTS_CODEGEN
478476

479477
clean:
480478
-rm -fr $(build_shlibdir)/libjulia-internal* $(build_shlibdir)/libjulia-codegen* $(build_shlibdir)/libccalltest* $(build_shlibdir)/libllvmcalltest*

src/flisp/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ $(BUILDDIR)/host/Makefile:
117117
@printf "%s\n" 'include $(SRCDIR)/Makefile' >> $@
118118

119119
$(BUILDDIR)/host/$(EXENAME): $(BUILDDIR)/host/Makefile | ${BUILDDIR}/host/flisp.boot
120-
$(MAKE) -C $(BUILDDIR)/host $(EXENAME)
120+
make -C $(BUILDDIR)/host $(EXENAME)
121121

122122

123123
$(BUILDDIR)/host/flisp.boot: $(SRCDIR)/flisp.boot | $(BUILDDIR)/host/Makefile

0 commit comments

Comments
 (0)