Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion contrib/mac/app/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ dmg/$(APP_NAME): startup.applescript julia.icns
plutil -insert CFBundleVersion -string "$(JULIA_VERSION_OPT_COMMIT)" $@/Contents/Info.plist
plutil -insert NSHumanReadableCopyright -string "$(APP_COPYRIGHT)" $@/Contents/Info.plist
-mkdir -p $@/Contents/Resources/julia
make -C $(JULIAHOME) binary-dist
$(MAKE) -C $(JULIAHOME) binary-dist
$(TAR) -xzf $(JULIAHOME)/$(JULIA_BINARYDIST_FILENAME).tar.gz -C $@/Contents/Resources/julia --strip-components 1
find $@/Contents/Resources/julia -type f -exec chmod -w {} \;
# Even though the tarball may already be signed, we re-sign here to make it easier to add
Expand Down
3 changes: 2 additions & 1 deletion deps/libgit2.mk
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ ifneq ($(USE_BINARYBUILDER_LIBGIT2),1)
LIBGIT2_GIT_URL := https://github.com/libgit2/libgit2.git
LIBGIT2_TAR_URL = https://api.github.com/repos/libgit2/libgit2/tarball/$1
$(eval $(call git-external,libgit2,LIBGIT2,CMakeLists.txt,,$(SRCCACHE)))
$(SRCCACHE)/$(LIBGIT2_SRC_DIR)/source-extracted: $(MSYS_NONEXISTENT_SYMLINK_TARGET_FIX)

ifeq ($(USE_SYSTEM_LIBSSH2), 0)
$(BUILDDIR)/$(LIBGIT2_SRC_DIR)/build-configured: | $(build_prefix)/manifest/libssh2
Expand All @@ -21,7 +22,7 @@ ifeq ($(USE_SYSTEM_ZLIB), 0)
$(BUILDDIR)/$(LIBGIT2_SRC_DIR)/build-configured: | $(build_prefix)/manifest/zlib
endif

LIBGIT2_OPTS := $(CMAKE_COMMON) -DCMAKE_BUILD_TYPE=Release -DUSE_THREADS=ON -DUSE_BUNDLED_ZLIB=OFF -DUSE_SSH=ON -DREGEX_BACKEND=pcre2 -DBUILD_CLI=OFF
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
ifeq ($(OS),WINNT)
LIBGIT2_OPTS += -DWIN32=ON -DMINGW=ON
ifeq ($(USE_SYSTEM_LIBSSH2), 0)
Expand Down
5 changes: 1 addition & 4 deletions deps/libssh2.mk
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,6 @@ endif

ifeq ($(OS),WINNT)
LIBSSH2_OPTS += -DCRYPTO_BACKEND=WinCNG -DENABLE_ZLIB_COMPRESSION=OFF
ifeq ($(BUILD_OS),WINNT)
LIBSSH2_OPTS += -G"MSYS Makefiles"
endif
else
LIBSSH2_OPTS += -DCRYPTO_BACKEND=OpenSSL -DENABLE_ZLIB_COMPRESSION=OFF
endif
Expand All @@ -37,7 +34,7 @@ LIBSSH2_SRC_PATH := $(SRCCACHE)/$(LIBSSH2_SRC_DIR)
$(BUILDDIR)/$(LIBSSH2_SRC_DIR)/build-configured: $(LIBSSH2_SRC_PATH)/source-extracted
mkdir -p $(dir $@)
cd $(dir $@) && \
$(CMAKE) -G"Unix Makefiles" $(dir $<) $(LIBSSH2_OPTS)
$(CMAKE) $(CMAKE_GENERATOR_COMMAND) $(dir $<) $(LIBSSH2_OPTS)
echo 1 > $@

$(BUILDDIR)/$(LIBSSH2_SRC_DIR)/build-compiled: $(BUILDDIR)/$(LIBSSH2_SRC_DIR)/build-configured
Expand Down
2 changes: 1 addition & 1 deletion deps/libuv.mk
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ LIBUV_GIT_URL:=https://github.com/JuliaLang/libuv.git
LIBUV_TAR_URL=https://api.github.com/repos/JuliaLang/libuv/tarball/$1
$(eval $(call git-external,libuv,LIBUV,configure,,$(SRCCACHE)))

UV_CFLAGS := -O2
UV_CFLAGS := -O2 -DBUILDING_UV_SHARED=1

UV_FLAGS := LDFLAGS="$(LDFLAGS) $(CLDFLAGS) -v"
UV_FLAGS += CFLAGS="$(CFLAGS) $(UV_CFLAGS) $(SANITIZE_OPTS)"
Expand Down
2 changes: 1 addition & 1 deletion deps/llvm.mk
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ $(eval $(call git-external,llvm,LLVM,CMakeLists.txt,,$(SRCCACHE)))
# symlinks. We don't particularly care either way - we just need to symlinks
# to succeed. We could guard this by a uname check, but it's harmless elsewhere,
# so let's not incur the additional overhead.
$(SRCCACHE)/$(LLVM_SRC_DIR)/source-extracted: export MSYS=winsymlinks:native
$(SRCCACHE)/$(LLVM_SRC_DIR)/source-extracted: $(MSYS_NONEXISTENT_SYMLINK_TARGET_FIX)

LLVM_BUILDDIR := $(BUILDDIR)/$(LLVM_SRC_DIR)
LLVM_BUILDDIR_withtype := $(LLVM_BUILDDIR)/build_$(LLVM_BUILDTYPE)
Expand Down
9 changes: 7 additions & 2 deletions deps/openssl.mk
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ $(BUILDDIR)/openssl-$(OPENSSL_VER)/build-configured: $(SRCCACHE)/openssl-$(OPENS
mkdir -p $(dir $@)
cd $(dir $@) && \
CC="$(CC) $(SANITIZE_OPTS)" CXX="$(CXX) $(SANITIZE_OPTS)" LDFLAGS="$(LDFLAGS) $(RPATH_ESCAPED_ORIGIN) $(SANITIZE_LDFLAGS)" \
$(dir $<)/Configure shared --prefix=$(abspath $(build_prefix)) $(OPENSSL_TARGET)
$(dir $<)/Configure shared --prefix=$(abspath $(build_prefix)) --libdir=$(abspath $(build_libdir)) $(OPENSSL_TARGET)
echo 1 > $@

$(BUILDDIR)/openssl-$(OPENSSL_VER)/build-compiled: $(BUILDDIR)/openssl-$(OPENSSL_VER)/build-configured
Expand All @@ -72,9 +72,14 @@ ifeq ($(OS),$(BUILD_OS))
endif
echo 1 > $@

# Override bindir and only install runtime libraries, otherwise they'll go into build_depsbindir.
OPENSSL_INSTALL = \
mkdir -p $2$$(build_shlibdir) && \
$$(MAKE) -C $1 install_runtime_libs $$(MAKE_COMMON) bindir=$$(build_shlibdir) $3 DESTDIR="$2"

$(eval $(call staged-install, \
openssl,openssl-$(OPENSSL_VER), \
MAKE_INSTALL,,, \
OPENSSL_INSTALL,,, \
$$(WIN_MAKE_HARD_LINK) $(build_bindir)/libcrypto-*.dll $(build_bindir)/libcrypto.dll && \
$$(WIN_MAKE_HARD_LINK) $(build_bindir)/libssl-*.dll $(build_bindir)/libssl.dll && \
$$(INSTALL_NAME_CMD)libcrypto.$$(SHLIB_EXT) $$(build_shlibdir)/libcrypto.$$(SHLIB_EXT) && \
Expand Down
20 changes: 16 additions & 4 deletions deps/tools/common.mk
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,6 @@ endif
CMAKE_COMMON += -DCMAKE_RC_COMPILER="$$(which $(CROSS_COMPILE)windres)"
endif

# For now this is LLVM specific, but I expect it won't be in the future
ifeq ($(CMAKE_GENERATOR),Ninja)
CMAKE_GENERATOR_COMMAND := -G Ninja
else ifeq ($(CMAKE_GENERATOR),make)
Expand All @@ -84,14 +83,27 @@ else
$(error Unknown CMake generator '$(CMAKE_GENERATOR)'. Options are 'Ninja' and 'make')
endif

# Detect MSYS2 with cygwin CMake rather than MinGW cmake - the former fails to
# properly drive MinGW tools
ifneq (,$(findstring MINGW,$(RAW_BUILD_OS)))
ifneq (,$(shell ldd $(shell which cmake) | grep msys-2.0.dll))
# Detect MSYS2 with cygwin CMake rather than MinGW cmake - the former fails to
# properly drive MinGW tools
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)
endif
# In our setup, CMAKE_INSTALL_PREFIX is a relative path inside usr-staging.
# We do not want this converted to a windows path, because our make system
# assumes it to be relative to msys `/`.
override CMAKE := MSYS2_ARG_CONV_EXCL="-DCMAKE_INSTALL_PREFIX" $(CMAKE)
endif

# Some dependencies' tarballs contains symlinks to non-existent targets. This breaks the
# the default msys strategy `deepcopy` symlink strategy. To workaround this,
# switch to `native` which tries native windows symlinks (possible if the
# machine is in developer mode) - or if not, falls back to cygwin-style
# symlinks. We don't particularly care either way - we just need to symlinks
# to succeed. We could guard this by a uname check, but it's harmless elsewhere,
# so let's not incur the additional overhead.
MSYS_NONEXISTENT_SYMLINK_TARGET_FIX := export MSYS=winsymlinks:native

# If the top-level Makefile is called with environment variables,
# they will override the values passed above to ./configure
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=
Expand Down Expand Up @@ -168,7 +180,7 @@ upper = $(shell echo $1 | tr a-z A-Z)
# this rule ensures that make install is more nearly atomic
# so it's harder to get half-installed (or half-reinstalled) dependencies
# # and enables sharing deps compiles, uninstall, and fast reinstall
MAKE_INSTALL = +$$(MAKE) -C $1 install $$(MAKE_COMMON) $3 DESTDIR="$2"
MAKE_INSTALL = MSYS2_ARG_CONV_EXCL="prefix=" $$(MAKE) -C $1 install $$(MAKE_COMMON) $3 DESTDIR="$2"

define SHLIBFILE_INSTALL
mkdir -p $2/$$(build_shlibdir)
Expand Down
8 changes: 6 additions & 2 deletions deps/zstd.mk
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,14 @@ ifneq ($(USE_BINARYBUILDER_ZSTD), 1)
ZSTD_GIT_URL := https://github.com/facebook/zstd.git
ZSTD_TAR_URL = https://api.github.com/repos/facebook/zstd/tarball/$1
$(eval $(call git-external,zstd,ZSTD,,,$(BUILDDIR)))
# See note in llvm.mk for source tarballs with symlinks to non-existent targets
$(BUILDDIR)/$(ZSTD_SRC_DIR)/source-extracted: export MSYS=winsymlinks:native
$(BUILDDIR)/$(ZSTD_SRC_DIR)/source-extracted: $(MSYS_NONEXISTENT_SYMLINK_TARGET_FIX)

ZSTD_BUILD_OPTS := MOREFLAGS="-DZSTD_MULTITHREAD $(fPIC)" bindir=$(build_private_libexecdir)
ifeq ($(OS), WINNT)
# Zstd detects "Windows" not WINNT, ordinarily from the inherited $(OS), but it expects the
# override to be done using TARGET_SYSTEM.
ZSTD_BUILD_OPTS += TARGET_SYSTEM="Windows"
endif

$(BUILDDIR)/$(ZSTD_SRC_DIR)/build-configured: $(BUILDDIR)/$(ZSTD_SRC_DIR)/source-extracted
echo 1 > $@
Expand Down
11 changes: 6 additions & 5 deletions src/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ else
GC_CODEGEN_SRCS += llvm-late-gc-lowering-stock
endif
CODEGEN_SRCS := codegen jitlayers aotcompile debuginfo disasm llvm-simdloop \
llvm-pass-helpers llvm-ptls llvm-propagate-addrspaces null_sysimage \
llvm-pass-helpers llvm-ptls llvm-propagate-addrspaces \
llvm-multiversioning llvm-alloc-opt llvm-alloc-helpers cgmemmgr llvm-remove-addrspaces \
llvm-remove-ni llvm-julia-licm llvm-demote-float16 llvm-cpufeatures llvm-expand-atomic-modify \
pipeline llvm_api \
Expand Down Expand Up @@ -198,6 +198,7 @@ endif

COMMON_LIBPATHS := -L$(build_libdir) -L$(build_shlibdir)
RT_LIBS := $(WHOLE_ARCHIVE) $(LIBUV) $(WHOLE_ARCHIVE) $(LIBUTF8PROC) $(NO_WHOLE_ARCHIVE) $(LIBUNWIND) $(RT_LLVMLINK) $(OSLIBS) $(LIBTRACYCLIENT) $(LIBITTAPI)
# NB: CG needs uv_mutex_* symbols, but we expect to export them from libjulia-internal
CG_LIBS := $(LIBUNWIND) $(CG_LLVMLINK) $(OSLIBS) $(LIBTRACYCLIENT) $(LIBITTAPI)

ifeq (${USE_THIRD_PARTY_GC},mmtk)
Expand Down Expand Up @@ -494,10 +495,10 @@ libjulia-codegen-debug: $(build_shlibdir)/libjulia-codegen-debug.$(JL_MAJOR_MINO
libjulia-codegen-debug libjulia-codegen-release: $(PUBLIC_HEADER_TARGETS)

# set the exports for the source files based on where they are getting linked
$(OBJS): SHIPFLAGS += -DJL_LIBRARY_EXPORTS_INTERNAL
$(DOBJS): DEBUGFLAGS += -DJL_LIBRARY_EXPORTS_INTERNAL
$(CODEGEN_OBJS): SHIPFLAGS += -DJL_LIBRARY_EXPORTS_CODEGEN
$(CODEGEN_DOBJS): DEBUGFLAGS += -DJL_LIBRARY_EXPORTS_CODEGEN
$(OBJS): SHIPFLAGS += -DJL_LIBRARY_EXPORTS_INTERNAL -DBUILDING_UV_SHARED
$(DOBJS): DEBUGFLAGS += -DJL_LIBRARY_EXPORTS_INTERNAL -DBUILDING_UV_SHARED
$(CODEGEN_OBJS): SHIPFLAGS += -DJL_LIBRARY_EXPORTS_CODEGEN -DUSING_UV_SHARED
$(CODEGEN_DOBJS): DEBUGFLAGS += -DJL_LIBRARY_EXPORTS_CODEGEN -DUSING_UV_SHARED

clean:
-rm -fr $(build_shlibdir)/libjulia-internal* $(build_shlibdir)/libjulia-codegen* $(build_shlibdir)/libccalltest* $(build_shlibdir)/libllvmcalltest*
Expand Down
2 changes: 1 addition & 1 deletion src/flisp/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ $(BUILDDIR)/host/Makefile:
@printf "%s\n" 'include $(SRCDIR)/Makefile' >> $@

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


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