diff --git a/deps/llvm.mk b/deps/llvm.mk index 83b9a66ec608e..37f8f9d6ea7e7 100644 --- a/deps/llvm.mk +++ b/deps/llvm.mk @@ -239,6 +239,21 @@ endif # declare that all patches must be applied before running ./configure $(LLVM_BUILDDIR_withtype)/build-configured: | $(LLVM_PATCH_PREV) +# Apply Julia's specific patches if requested, e.g. if not using Julia's fork of LLVM. +ifeq ($(LLVM_APPLY_JULIA_PATCHES), 1) +# Download Julia's patchset. +$(BUILDDIR)/julia-patches.patch: + $(JLDOWNLOAD) $@ $(LLVM_JULIA_DIFF_GITHUB_REPO)/compare/$(LLVM_BASE_REF)...$(LLVM_JULIA_REF).diff + +# Apply the patch. +$(SRCCACHE)/$(LLVM_SRC_DIR)/julia-patches.patch-applied: $(BUILDDIR)/julia-patches.patch $(SRCCACHE)/$(LLVM_SRC_DIR)/source-extracted + cd $(SRCCACHE)/$(LLVM_SRC_DIR) && patch -p1 < $(realpath $<) + echo 1 > $@ + +# Require application of Julia's patchset before configuring LLVM. +$(LLVM_BUILDDIR_withtype)/build-configured: | $(SRCCACHE)/$(LLVM_SRC_DIR)/julia-patches.patch-applied +endif + $(LLVM_BUILDDIR_withtype)/build-configured: $(SRCCACHE)/$(LLVM_SRC_DIR)/source-extracted mkdir -p $(dir $@) cd $(dir $@) && \ diff --git a/deps/llvm.version b/deps/llvm.version index e35db3bd6aed2..4e7969994141e 100644 --- a/deps/llvm.version +++ b/deps/llvm.version @@ -1,7 +1,23 @@ +# -*- makefile -*- + ## jll artifact LLVM_JLL_NAME := libLLVM LLVM_ASSERT_JLL_VER := 15.0.7+5 ## source build +# Version number of LLVM LLVM_VER := 15.0.7 +# Git branch name in `LLVM_GIT_URL` repository LLVM_BRANCH=julia-15.0.7-5 +# Git ref in `LLVM_GIT_URL` repository LLVM_SHA1=julia-15.0.7-5 + +## Following options are used to automatically fetch patchset from Julia's fork. This is +## useful if you want to build an external LLVM while still applying Julia's patches. +# Set to 1 if you want to automatically apply Julia's patches to a different fork of LLVM. +LLVM_APPLY_JULIA_PATCHES := 0 +# GitHub repository to use for fetching the Julia patches to apply to LLVM source code. +LLVM_JULIA_DIFF_GITHUB_REPO := https://github.com/llvm/llvm-project +# Base GitHub ref for generating the diff. +LLVM_BASE_REF := llvm:llvmorg-15.0.7 +# Julia fork's GitHub ref for generating the diff. +LLVM_JULIA_REF := JuliaLang:julia-15.0.7-5