From c3bc61051d7f12b4c682efa7a5460bbc8815649e Mon Sep 17 00:00:00 2001 From: V3n3RiX Date: Fri, 7 Jan 2022 22:48:01 +0000 Subject: gentoo resync : 07.01.2022 --- .../julia/files/julia-1.1.0-fix_build_system.patch | 53 --- .../julia/files/julia-1.6.0-fix-system-csl.patch | 271 --------------- dev-lang/julia/files/julia-1.6.5-libgit-1.2.patch | 17 + .../files/julia-1.6.5-llvm_13_compat_part_1.patch | 172 ++++++++++ .../files/julia-1.6.5-llvm_13_compat_part_2.patch | 80 +++++ .../files/julia-1.6.5-llvm_13_compat_part_3.patch | 375 +++++++++++++++++++++ .../files/julia-1.6.5-make-install-no-build.patch | 17 + .../julia/files/julia-1.7.0-do_not_set_rpath.patch | 29 -- .../julia/files/julia-1.7.0-hardcoded-libs.patch | 72 ---- dev-lang/julia/files/julia-1.7.0-libgit-1.2.patch | 17 - .../files/julia-1.7.0-llvm_13_compat_part_1.patch | 172 ---------- .../files/julia-1.7.0-llvm_13_compat_part_2.patch | 80 ----- .../files/julia-1.7.0-llvm_13_compat_part_3.patch | 375 --------------------- .../files/julia-1.7.0-make-install-no-build.patch | 17 - .../julia/files/julia-1.7.1-do_not_set_rpath.patch | 11 + .../julia/files/julia-1.7.1-hardcoded-libs.patch | 72 ++++ 16 files changed, 744 insertions(+), 1086 deletions(-) delete mode 100644 dev-lang/julia/files/julia-1.1.0-fix_build_system.patch delete mode 100644 dev-lang/julia/files/julia-1.6.0-fix-system-csl.patch create mode 100644 dev-lang/julia/files/julia-1.6.5-libgit-1.2.patch create mode 100644 dev-lang/julia/files/julia-1.6.5-llvm_13_compat_part_1.patch create mode 100644 dev-lang/julia/files/julia-1.6.5-llvm_13_compat_part_2.patch create mode 100644 dev-lang/julia/files/julia-1.6.5-llvm_13_compat_part_3.patch create mode 100644 dev-lang/julia/files/julia-1.6.5-make-install-no-build.patch delete mode 100644 dev-lang/julia/files/julia-1.7.0-do_not_set_rpath.patch delete mode 100644 dev-lang/julia/files/julia-1.7.0-hardcoded-libs.patch delete mode 100644 dev-lang/julia/files/julia-1.7.0-libgit-1.2.patch delete mode 100644 dev-lang/julia/files/julia-1.7.0-llvm_13_compat_part_1.patch delete mode 100644 dev-lang/julia/files/julia-1.7.0-llvm_13_compat_part_2.patch delete mode 100644 dev-lang/julia/files/julia-1.7.0-llvm_13_compat_part_3.patch delete mode 100644 dev-lang/julia/files/julia-1.7.0-make-install-no-build.patch create mode 100644 dev-lang/julia/files/julia-1.7.1-do_not_set_rpath.patch create mode 100644 dev-lang/julia/files/julia-1.7.1-hardcoded-libs.patch (limited to 'dev-lang/julia/files') diff --git a/dev-lang/julia/files/julia-1.1.0-fix_build_system.patch b/dev-lang/julia/files/julia-1.1.0-fix_build_system.patch deleted file mode 100644 index 394f5900a90e..000000000000 --- a/dev-lang/julia/files/julia-1.1.0-fix_build_system.patch +++ /dev/null @@ -1,53 +0,0 @@ -diff --git a/Make.inc b/Make.inc -index 81ff923..79e47f1 100644 ---- a/Make.inc -+++ b/Make.inc -@@ -185,7 +185,7 @@ USE_GPL_LIBS ?= 1 - # Directories where said libraries get installed to - prefix ?= $(BUILDROOT)/julia-$(JULIA_COMMIT) - bindir := $(prefix)/bin --libdir := $(prefix)/lib -+libdir := $(prefix)/GENTOOLIBDIR - libexecdir := $(prefix)/libexec - datarootdir := $(prefix)/share - docdir := $(datarootdir)/doc/julia -@@ -417,7 +417,7 @@ ifneq ($(OS), WINNT) - JCXXFLAGS += -pedantic - endif - DEBUGFLAGS := -O0 -ggdb2 -DJL_DEBUG_BUILD -fstack-protector-all --SHIPFLAGS := -O3 -ggdb2 -falign-functions -+SHIPFLAGS := GENTOOCFLAGS - endif - - ifeq ($(USECLANG),1) -@@ -428,7 +428,7 @@ JCFLAGS := -pipe $(fPIC) -fno-strict-aliasing -D_FILE_OFFSET_BITS=64 - JCPPFLAGS := -fasynchronous-unwind-tables - JCXXFLAGS := -pipe $(fPIC) -fno-rtti -pedantic - DEBUGFLAGS := -O0 -g -DJL_DEBUG_BUILD -fstack-protector-all --SHIPFLAGS := -O3 -g -+SHIPFLAGS := GENTOOCFLAGS - ifeq ($(OS), Darwin) - ifeq ($(USE_LIBCPP), 1) - MACOSX_VERSION_MIN := 10.8 -@@ -457,7 +457,7 @@ JCFLAGS := -std=gnu11 -pipe $(fPIC) -fno-strict-aliasing -D_FILE_OFFSET_BITS=64 - JCPPFLAGS := - JCXXFLAGS := -pipe $(fPIC) -fno-rtti - DEBUGFLAGS := -O0 -g -DJL_DEBUG_BUILD -fstack-protector-all --SHIPFLAGS := -O3 -g -falign-functions -+SHIPFLAGS := GENTOOCFLAGS - endif - - ifeq ($(USECCACHE), 1) -diff --git a/doc/Makefile b/doc/Makefile -index 99e60ee..2027fb5 100644 ---- a/doc/Makefile -+++ b/doc/Makefile -@@ -30,7 +30,7 @@ deps: UnicodeData.txt - $(JLCHECKSUM) UnicodeData.txt - - clean: -- -rm -rf _build/* deps/* docbuild.log UnicodeData.txt -+ @echo "Do not clean doc/_build/html. Just use it..." - - cleanall: clean - diff --git a/dev-lang/julia/files/julia-1.6.0-fix-system-csl.patch b/dev-lang/julia/files/julia-1.6.0-fix-system-csl.patch deleted file mode 100644 index 90a097197bff..000000000000 --- a/dev-lang/julia/files/julia-1.6.0-fix-system-csl.patch +++ /dev/null @@ -1,271 +0,0 @@ -From 71d7a8a8c12b72bfa362ae955d2ce4dfbdf5b8ba Mon Sep 17 00:00:00 2001 -From: Elliot Saba -Date: Fri, 26 Mar 2021 18:40:07 +0000 -Subject: [PATCH 1/2] [build] Add `symlink_system_library` calls for CSL - -We differentiate between a `USE_BINARYBUILDER_CSL=0` configuration -(where we copy the CSL libraries into the Julia build tree) versus a -`USE_SYSTEM_CSL=1` configuration (where we symlink them in a manner -similar to other system libararies) ---- - Make.inc | 23 +++++++++++++- - base/Makefile | 88 ++++++++++++++++++++++++++++++--------------------- - deps/csl.mk | 40 ++++++++--------------- - 3 files changed, 87 insertions(+), 64 deletions(-) - -diff --git a/Make.inc b/Make.inc -index 519720a861ed7..7cba05806e684 100644 ---- a/Make.inc -+++ b/Make.inc -@@ -596,6 +596,21 @@ else - SHLIB_EXT := so - endif - -+ifeq ($(OS),WINNT) -+define versioned_libname -+$$(if $(2),$(1)-$(2).$(SHLIB_EXT),$(1).$(SHLIB_EXT)) -+endef -+else ifeq ($(OS),Darwin) -+define versioned_libname -+$$(if $(2),$(1).$(2).$(SHLIB_EXT),$(1).$(SHLIB_EXT)) -+endef -+else -+define versioned_libname -+$$(if $(2),$(1).$(SHLIB_EXT).$(2),$(1).$(SHLIB_EXT)) -+endef -+endif -+ -+ - ifeq ($(SHLIB_EXT), so) - define SONAME_FLAGS - -Wl,-soname=$1 -@@ -1147,6 +1162,8 @@ BB_TRIPLET_LIBGFORTRAN := $(subst $(SPACE),-,$(filter-out cxx%,$(subst -,$(SPACE - BB_TRIPLET_CXXABI := $(subst $(SPACE),-,$(filter-out libgfortran%,$(subst -,$(SPACE),$(BB_TRIPLET_LIBGFORTRAN_CXXABI)))) - BB_TRIPLET := $(subst $(SPACE),-,$(filter-out cxx%,$(filter-out libgfortran%,$(subst -,$(SPACE),$(BB_TRIPLET_LIBGFORTRAN_CXXABI))))) - -+LIBGFORTRAN_VERSION := $(subst libgfortran,,$(filter libgfortran%,$(subst -,$(SPACE),$(BB_TRIPLET_LIBGFORTRAN)))) -+ - # This is the set of projects that BinaryBuilder dependencies are hooked up for. - BB_PROJECTS := BLASTRAMPOLINE OPENBLAS LLVM SUITESPARSE OPENLIBM GMP MBEDTLS LIBSSH2 NGHTTP2 MPFR CURL LIBGIT2 PCRE LIBUV LIBUNWIND DSFMT OBJCONV ZLIB P7ZIP CSL - define SET_BB_DEFAULT -@@ -1479,8 +1496,12 @@ ifneq ($(findstring $(OS),Linux FreeBSD),) - LIBGCC_NAME := libgcc_s.$(SHLIB_EXT).1 - endif - -- -+# USE_SYSTEM_CSL causes it to get symlinked into build_private_shlibdir -+ifeq ($(USE_SYSTEM_CSL),1) -+LIBGCC_BUILD_DEPLIB := $(call dep_lib_path,$(build_libdir),$(build_private_shlibdir)/$(LIBGCC_NAME)) -+else - LIBGCC_BUILD_DEPLIB := $(call dep_lib_path,$(build_libdir),$(build_shlibdir)/$(LIBGCC_NAME)) -+endif - LIBGCC_INSTALL_DEPLIB := $(call dep_lib_path,$(libdir),$(private_shlibdir)/$(LIBGCC_NAME)) - - # USE_SYSTEM_LIBM and USE_SYSTEM_OPENLIBM causes it to get symlinked into build_private_shlibdir -diff --git a/base/Makefile b/base/Makefile -index e024e546f94d3..2bef6aab7f1f4 100644 ---- a/base/Makefile -+++ b/base/Makefile -@@ -169,53 +169,69 @@ endif - # echo "$$P" - - define symlink_system_library --symlink_$1: $$(build_private_libdir)/$1.$$(SHLIB_EXT) --$$(build_private_libdir)/$1.$$(SHLIB_EXT): -- REALPATH=`$$(call spawn,$$(build_depsbindir)/libwhich) -p $$(notdir $$@)` && \ -- $$(call resolve_path,REALPATH) && \ -- [ -e "$$$$REALPATH" ] && \ -- ([ ! -e "$$@" ] || rm "$$@") && \ -- echo ln -sf "$$$$REALPATH" "$$@" && \ -- ln -sf "$$$$REALPATH" "$$@" --ifneq ($2,) --ifneq ($$(USE_SYSTEM_$2),0) --SYMLINK_SYSTEM_LIBRARIES += symlink_$1 --endif -+libname_$2 := $$(notdir $(call versioned_libname,$2,$3)) -+libpath_$2 := $$(shell $$(call spawn,$$(build_depsbindir)/libwhich) -p $$(libname_$2) 2>/dev/null) -+symlink_$2: $$(build_private_libdir)/$$(libname_$2) -+$$(build_private_libdir)/$$(libname_$2): -+ @if [ -e "$$(libpath_$2)" ]; then \ -+ REALPATH=$$(libpath_$2); \ -+ $$(call resolve_path,REALPATH) && \ -+ [ -e "$$$$REALPATH" ] && \ -+ ([ ! -e "$$@" ] || rm "$$@") && \ -+ echo ln -sf "$$$$REALPATH" "$$@" && \ -+ ln -sf "$$$$REALPATH" "$$@"; \ -+ else \ -+ if [ "$4" != "ALLOW_FAILURE" ]; then \ -+ echo "System library symlink failure: Unable to locate $$(libname_$2) on your system!" >&2; \ -+ false; \ -+ fi; \ -+ fi -+ifneq ($$(USE_SYSTEM_$1),0) -+SYMLINK_SYSTEM_LIBRARIES += symlink_$2 - endif - endef - - # the following excludes: libuv.a, libutf8proc.a - --$(eval $(call symlink_system_library,$(LIBMNAME))) - ifneq ($(USE_SYSTEM_LIBM),0) --SYMLINK_SYSTEM_LIBRARIES += symlink_$(LIBMNAME) -+$(eval $(call symlink_system_library,LIBM,$(LIBMNAME))) - else ifneq ($(USE_SYSTEM_OPENLIBM),0) --SYMLINK_SYSTEM_LIBRARIES += symlink_$(LIBMNAME) -+$(eval $(call symlink_system_library,OPENLIBM,$(LIBMNAME))) - endif - --$(eval $(call symlink_system_library,libpcre2-8,PCRE)) --$(eval $(call symlink_system_library,libdSFMT,DSFMT)) --$(eval $(call symlink_system_library,$(LIBBLASNAME),BLAS)) -+$(eval $(call symlink_system_library,CSL,libgcc_s,1)) -+ifneq (,$(LIBGFORTRAN_VERSION)) -+$(eval $(call symlink_system_library,CSL,libgfortran,$(LIBGFORTRAN_VERSION))) -+endif -+$(eval $(call symlink_system_library,CSL,libquadmath,0)) -+$(eval $(call symlink_system_library,CSL,libstdc++,6)) -+# We allow libssp, libatomic and libgomp to fail as they are not available on all systems -+$(eval $(call symlink_system_library,CSL,libssp,0,ALLOW_FAILURE)) -+$(eval $(call symlink_system_library,CSL,libatomic,1,ALLOW_FAILURE)) -+$(eval $(call symlink_system_library,CSL,libgomp,1,ALLOW_FAILURE)) -+$(eval $(call symlink_system_library,PCRE,libpcre2-8)) -+$(eval $(call symlink_system_library,DSFMT,libdSFMT)) -+$(eval $(call symlink_system_library,BLAS,$(LIBBLASNAME))) - ifneq ($(LIBLAPACKNAME),$(LIBBLASNAME)) --$(eval $(call symlink_system_library,$(LIBLAPACKNAME),LAPACK)) -+$(eval $(call symlink_system_library,LAPACK,$(LIBLAPACKNAME))) - endif --$(eval $(call symlink_system_library,libgmp,GMP)) --$(eval $(call symlink_system_library,libmpfr,MPFR)) --$(eval $(call symlink_system_library,libmbedtls,MBEDTLS)) --$(eval $(call symlink_system_library,libmbedcrypto,MBEDTLS)) --$(eval $(call symlink_system_library,libmbedx509,MBEDTLS)) --$(eval $(call symlink_system_library,libssh2,LIBSSH2)) --$(eval $(call symlink_system_library,libnghttp2,NGHTTP2)) --$(eval $(call symlink_system_library,libcurl,CURL)) --$(eval $(call symlink_system_library,libgit2,LIBGIT2)) --$(eval $(call symlink_system_library,libamd,SUITESPARSE)) --$(eval $(call symlink_system_library,libcamd,SUITESPARSE)) --$(eval $(call symlink_system_library,libccolamd,SUITESPARSE)) --$(eval $(call symlink_system_library,libcholmod,SUITESPARSE)) --$(eval $(call symlink_system_library,libcolamd,SUITESPARSE)) --$(eval $(call symlink_system_library,libumfpack,SUITESPARSE)) --$(eval $(call symlink_system_library,libspqr,SUITESPARSE)) --$(eval $(call symlink_system_library,libsuitesparseconfig,SUITESPARSE)) -+$(eval $(call symlink_system_library,GMP,libgmp)) -+$(eval $(call symlink_system_library,MPFR,libmpfr)) -+$(eval $(call symlink_system_library,MBEDTLS,libmbedtls)) -+$(eval $(call symlink_system_library,MBEDTLS,libmbedcrypto)) -+$(eval $(call symlink_system_library,MBEDTLS,libmbedx509)) -+$(eval $(call symlink_system_library,LIBSSH2,libssh2)) -+$(eval $(call symlink_system_library,NGHTTP2,libnghttp2)) -+$(eval $(call symlink_system_library,CURL,libcurl)) -+$(eval $(call symlink_system_library,LIBGIT2,libgit2)) -+$(eval $(call symlink_system_library,SUITESPARSE,libamd)) -+$(eval $(call symlink_system_library,SUITESPARSE,libcamd)) -+$(eval $(call symlink_system_library,SUITESPARSE,libccolamd)) -+$(eval $(call symlink_system_library,SUITESPARSE,libcholmod)) -+$(eval $(call symlink_system_library,SUITESPARSE,libcolamd)) -+$(eval $(call symlink_system_library,SUITESPARSE,libumfpack)) -+$(eval $(call symlink_system_library,SUITESPARSE,libspqr)) -+$(eval $(call symlink_system_library,SUITESPARSE,libsuitesparseconfig)) - # EXCLUDED LIBRARIES (installed/used, but not vendored for use with dlopen): - # libunwind - endif # WINNT -diff --git a/deps/csl.mk b/deps/csl.mk -index 095d4ceec4a1e..423201cbb5a0c 100644 ---- a/deps/csl.mk -+++ b/deps/csl.mk -@@ -19,48 +19,34 @@ $$(build_shlibdir)/$(1): | $$(build_shlibdir) - [ -n "$$$${SRC_LIB}" ] && cp $$$${SRC_LIB} $$(build_shlibdir) - endef - --ifeq ($(OS),WINNT) --define gen_libname --$$(if $(2),lib$(1)-$(2).$(SHLIB_EXT),lib$(1).$(SHLIB_EXT)) --endef --else ifeq ($(OS),Darwin) --define gen_libname --$$(if $(2),lib$(1).$(2).$(SHLIB_EXT),lib$(1).$(SHLIB_EXT)) --endef --else --define gen_libname --$$(if $(2),lib$(1).$(SHLIB_EXT).$(2),lib$(1).$(SHLIB_EXT)) --endef --endif -- - # libgfortran has multiple names; we're just going to copy any version we can find - # Since we're only looking in the location given by `$(FC)` this should only succeed for one. --$(eval $(call copy_csl,$(call gen_libname,gfortran,3))) --$(eval $(call copy_csl,$(call gen_libname,gfortran,4))) --$(eval $(call copy_csl,$(call gen_libname,gfortran,5))) -+$(eval $(call copy_csl,$(call versioned_libname,libgfortran,3))) -+$(eval $(call copy_csl,$(call versioned_libname,libgfortran,4))) -+$(eval $(call copy_csl,$(call versioned_libname,libgfortran,5))) - - # These are all libraries that we should always have --$(eval $(call copy_csl,$(call gen_libname,quadmath,0))) --$(eval $(call copy_csl,$(call gen_libname,stdc++,6))) --$(eval $(call copy_csl,$(call gen_libname,ssp,0))) --$(eval $(call copy_csl,$(call gen_libname,atomic,1))) --$(eval $(call copy_csl,$(call gen_libname,gomp,1))) -+$(eval $(call copy_csl,$(call versioned_libname,libquadmath,0))) -+$(eval $(call copy_csl,$(call versioned_libname,libstdc++,6))) -+$(eval $(call copy_csl,$(call versioned_libname,libssp,0))) -+$(eval $(call copy_csl,$(call versioned_libname,libatomic,1))) -+$(eval $(call copy_csl,$(call versioned_libname,libgomp,1))) - - ifeq ($(OS),WINNT) - # Windwos has special gcc_s names - ifeq ($(ARCH),i686) --$(eval $(call copy_csl,$(call gen_libname,gcc_s_sjlj,1))) -+$(eval $(call copy_csl,$(call versioned_libname,libgcc_s_sjlj,1))) - else --$(eval $(call copy_csl,$(call gen_libname,gcc_s_seh,1))) -+$(eval $(call copy_csl,$(call versioned_libname,libgcc_s_seh,1))) - endif - else --$(eval $(call copy_csl,$(call gen_libname,gcc_s,1))) -+$(eval $(call copy_csl,$(call versioned_libname,libgcc_s,1))) - endif - # winpthread is only Windows, pthread is only others - ifeq ($(OS),WINNT) --$(eval $(call copy_csl,$(call gen_libname,winpthread,1))) -+$(eval $(call copy_csl,$(call versioned_libname,libwinpthread,1))) - else --$(eval $(call copy_csl,$(call gen_libname,pthread,0))) -+$(eval $(call copy_csl,$(call versioned_libname,libpthread,0))) - endif - - get-csl: - -From 6536b8519b25db844f2a1866d056879cb87d1c66 Mon Sep 17 00:00:00 2001 -From: Elliot Saba -Date: Fri, 26 Mar 2021 22:32:04 +0000 -Subject: [PATCH 2/2] Expand `JL_PRIVATE_LIBS-1` for versioned library names as - well - -Without this, we fail to install things like `libgcc_s.so.1` when -installed into the private libdir by `symlink_system_libraries`. ---- - Makefile | 7 +++++-- - 1 file changed, 5 insertions(+), 2 deletions(-) - -diff --git a/Makefile b/Makefile -index 823ff3b86339d..e08f0e959e1b3 100644 ---- a/Makefile -+++ b/Makefile -@@ -290,8 +290,11 @@ endif - done \ - done - for suffix in $(JL_PRIVATE_LIBS-1) ; do \ -- lib=$(build_private_libdir)/$${suffix}.$(SHLIB_EXT); \ -- $(INSTALL_M) $$lib $(DESTDIR)$(private_libdir) ; \ -+ for lib in $(build_private_libdir)/$${suffix}.$(SHLIB_EXT)*; do \ -+ if [ "$${lib##*.}" != "dSYM" ]; then \ -+ $(INSTALL_M) $$lib $(DESTDIR)$(private_libdir) ; \ -+ fi \ -+ done \ - done - endif - # Install `7z` into libexec/ diff --git a/dev-lang/julia/files/julia-1.6.5-libgit-1.2.patch b/dev-lang/julia/files/julia-1.6.5-libgit-1.2.patch new file mode 100644 index 000000000000..f0abc7b8f60d --- /dev/null +++ b/dev-lang/julia/files/julia-1.6.5-libgit-1.2.patch @@ -0,0 +1,17 @@ +This patch comes from + https://raw.githubusercontent.com/archlinux/svntogit-community/packages/julia/trunk/julia-libgit-1.2.patch + +diff --git a/stdlib/LibGit2/src/types.jl b/stdlib/LibGit2/src/types.jl +index 9ffcaa3646..5f571e7b26 100644 +--- a/stdlib/LibGit2/src/types.jl ++++ b/stdlib/LibGit2/src/types.jl +@@ -230,6 +230,9 @@ Matches the [`git_remote_callbacks`](https://libgit2.org/libgit2/#HEAD/type/git_ + push_update_reference::Ptr{Cvoid} = C_NULL + push_negotiation::Ptr{Cvoid} = C_NULL + transport::Ptr{Cvoid} = C_NULL ++ @static if LibGit2.VERSION >= v"1.2.0" ++ remote_ready::Ptr{Cvoid} = C_NULL ++ end + payload::Any = nothing + @static if LibGit2.VERSION >= v"0.99.0" + resolve_url::Ptr{Cvoid} = C_NULL diff --git a/dev-lang/julia/files/julia-1.6.5-llvm_13_compat_part_1.patch b/dev-lang/julia/files/julia-1.6.5-llvm_13_compat_part_1.patch new file mode 100644 index 000000000000..1398be7ec873 --- /dev/null +++ b/dev-lang/julia/files/julia-1.6.5-llvm_13_compat_part_1.patch @@ -0,0 +1,172 @@ +This patch is from the julialang repository: + https://github.com/JuliaLang/julia/commit/677ce6d3.patch +but reference comes form ARCH Linux juia package + https://github.com/archlinux/svntogit-community/tree/packages/julia/trunk + +From 677ce6d3adc2f70886f72795b0e5c739e75730ee Mon Sep 17 00:00:00 2001 +From: Valentin Churavy +Date: Sat, 28 Aug 2021 16:48:32 +0200 +Subject: [PATCH] [LLVM] Adapt to LLVM 13 changes + +--- + src/cgutils.cpp | 8 +++++++- + src/codegen.cpp | 2 +- + src/disasm.cpp | 8 ++++++++ + src/jitlayers.cpp | 7 +++++++ + src/llvm-late-gc-lowering.cpp | 5 +++-- + src/llvm-multiversioning.cpp | 5 +++++ + src/llvm-remove-addrspaces.cpp | 8 ++++++++ + 7 files changed, 39 insertions(+), 4 deletions(-) + +diff --git a/src/cgutils.cpp b/src/cgutils.cpp +index 4e9917b6b078..928e1a07b2f1 100644 +--- a/src/cgutils.cpp ++++ b/src/cgutils.cpp +@@ -2757,8 +2757,14 @@ static jl_value_t *static_constant_instance(Constant *constant, jl_value_t *jt) + size_t nargs; + if (const auto *CC = dyn_cast(constant)) + nargs = CC->getNumOperands(); +- else if (const auto *CAZ = dyn_cast(constant)) ++ else if (const auto *CAZ = dyn_cast(constant)) { ++#if JL_LLVM_VERSION >= 130000 ++ // SVE: Elsewhere we use `getMinKownValue` ++ nargs = CAZ->getElementCount().getFixedValue(); ++#else + nargs = CAZ->getNumElements(); ++#endif ++ } + else if (const auto *CDS = dyn_cast(constant)) + nargs = CDS->getNumElements(); + else +diff --git a/src/codegen.cpp b/src/codegen.cpp +index 5cc9f66ffaef..9000513151fe 100644 +--- a/src/codegen.cpp ++++ b/src/codegen.cpp +@@ -7394,7 +7394,7 @@ static std::pair, jl_llvm_functions_t> + #endif + continue; + } +- assert(find(pred_begin(PhiBB), pred_end(PhiBB), FromBB) != pred_end(PhiBB)); // consistency check ++ assert(std::find(pred_begin(PhiBB), pred_end(PhiBB), FromBB) != pred_end(PhiBB)); // consistency check + TerminatorInst *terminator = FromBB->getTerminator(); + if (!terminator->getParent()->getUniqueSuccessor()) { + // Can't use `llvm::SplitCriticalEdge` here because +diff --git a/src/disasm.cpp b/src/disasm.cpp +index 6157873ad71c..589f618396ea 100644 +--- a/src/disasm.cpp ++++ b/src/disasm.cpp +@@ -857,8 +857,16 @@ static void jl_dump_asm_internal( + assert(MRI && "Unable to create target register info!"); + + std::unique_ptr MOFI(new MCObjectFileInfo()); ++#if JL_LLVM_VERSION >= 130000 ++ MCSubtargetInfo *MSTI = TheTarget->createMCSubtargetInfo(TheTriple.str(), cpu, features); ++ assert(MSTI && "Unable to create subtarget info!"); ++ ++ MCContext Ctx(TheTriple, MAI.get(), MRI.get(), MSTI, &SrcMgr); ++ MOFI->initMCObjectFileInfo(Ctx, /* PIC */ false, /* LargeCodeModel */ false); ++#else + MCContext Ctx(MAI.get(), MRI.get(), MOFI.get(), &SrcMgr); + MOFI->InitMCObjectFileInfo(TheTriple, /* PIC */ false, Ctx); ++#endif + + // Set up Subtarget and Disassembler + std::unique_ptr +diff --git a/src/jitlayers.cpp b/src/jitlayers.cpp +index 60b1903aaa80..12497cadf491 100644 +--- a/src/jitlayers.cpp ++++ b/src/jitlayers.cpp +@@ -10,6 +10,9 @@ + #include + #include + #include ++#if JL_LLVM_VERSION >= 130000 ++#include ++#endif + #include + #include + #include +@@ -654,7 +657,11 @@ JuliaOJIT::JuliaOJIT(TargetMachine &TM, LLVMContext *LLVMCtx) + MemMgr(createRTDyldMemoryManager()), + JuliaListener(CreateJuliaJITEventListener()), + TSCtx(std::unique_ptr(LLVMCtx)), ++#if JL_LLVM_VERSION >= 130000 ++ ES(cantFail(orc::SelfExecutorProcessControl::Create())), ++#else + ES(), ++#endif + GlobalJD(ES.createBareJITDylib("JuliaGlobals")), + JD(ES.createBareJITDylib("JuliaOJIT")), + ObjectLayer( +diff --git a/src/llvm-late-gc-lowering.cpp b/src/llvm-late-gc-lowering.cpp +index 0aac7638be0d..db8b19bacea5 100644 +--- a/src/llvm-late-gc-lowering.cpp ++++ b/src/llvm-late-gc-lowering.cpp +@@ -709,7 +709,7 @@ void LateLowerGCFrame::LiftSelect(State &S, SelectInst *SI) { + else + Numbers[i] = Number; + } +- if (auto VTy = dyn_cast(SI->getType())) { ++ if (auto VTy = dyn_cast(SI->getType())) { + if (NumRoots != Numbers.size()) { + // broadcast the scalar root number to fill the vector + assert(NumRoots == 1); +@@ -736,11 +736,12 @@ void LateLowerGCFrame::LiftPhi(State &S, PHINode *Phi) { + SmallVector lifted; + std::vector Numbers; + unsigned NumRoots = 1; +- if (auto VTy = dyn_cast(Phi->getType())) { ++ if (auto VTy = dyn_cast(Phi->getType())) { + NumRoots = VTy->getNumElements(); + Numbers.resize(NumRoots); + } + else { ++ // TODO: SVE + assert(isa(Phi->getType()) && "unimplemented"); + } + for (unsigned i = 0; i < NumRoots; ++i) { +diff --git a/src/llvm-multiversioning.cpp b/src/llvm-multiversioning.cpp +index 68081eb53d3a..a82600162fa9 100644 +--- a/src/llvm-multiversioning.cpp ++++ b/src/llvm-multiversioning.cpp +@@ -403,7 +403,12 @@ void CloneCtx::clone_function(Function *F, Function *new_f, ValueToValueMapTy &v + vmap[&*J] = &*DestI++; + } + SmallVector Returns; ++#if JL_LLVM_VERSION >= 130000 ++ // We are cloning into the same module ++ CloneFunctionInto(new_f, F, vmap, CloneFunctionChangeType::GlobalChanges, Returns); ++#else + CloneFunctionInto(new_f, F, vmap, true, Returns); ++#endif + } + + // Clone all clone_all targets. Makes sure that the base targets are all available. +diff --git a/src/llvm-remove-addrspaces.cpp b/src/llvm-remove-addrspaces.cpp +index ada10c8d5f1f..7c6ef093fbce 100644 +--- a/src/llvm-remove-addrspaces.cpp ++++ b/src/llvm-remove-addrspaces.cpp +@@ -345,7 +345,11 @@ bool RemoveAddrspacesPass::runOnModule(Module &M) + for (auto MD : MDs) + NGV->addMetadata( + MD.first, ++#if JL_LLVM_VERSION >= 130000 ++ *MapMetadata(MD.second, VMap)); ++#else + *MapMetadata(MD.second, VMap, RF_MoveDistinctMDs)); ++#endif + + copyComdat(NGV, GV); + +@@ -372,7 +376,11 @@ bool RemoveAddrspacesPass::runOnModule(Module &M) + NF, + F, + VMap, ++#if JL_LLVM_VERSION >= 130000 ++ CloneFunctionChangeType::GlobalChanges, ++#else + /*ModuleLevelChanges=*/true, ++#endif + Returns, + "", + nullptr, diff --git a/dev-lang/julia/files/julia-1.6.5-llvm_13_compat_part_2.patch b/dev-lang/julia/files/julia-1.6.5-llvm_13_compat_part_2.patch new file mode 100644 index 000000000000..5a8c2cde93d5 --- /dev/null +++ b/dev-lang/julia/files/julia-1.6.5-llvm_13_compat_part_2.patch @@ -0,0 +1,80 @@ +This patch is from julialang repository: + https://github.com/JuliaLang/julia/commit/47f9139e.patch +but reference comes form ARCH Linux juia package + https://github.com/archlinux/svntogit-community/tree/packages/julia/trunk + +From 47f9139e88917813cb7beee5e690c48c2ac65de4 Mon Sep 17 00:00:00 2001 +From: Xuanda Yang +Date: Wed, 9 Jun 2021 22:35:14 +0800 +Subject: [PATCH] codegen: replace deprecated llvm::VectorType::getNumElements + with new APIs (#41144) + +--- + src/llvm-late-gc-lowering.cpp | 29 ++++++++++++++++++++++++++--- + 1 file changed, 26 insertions(+), 3 deletions(-) + +diff --git a/src/llvm-late-gc-lowering.cpp b/src/llvm-late-gc-lowering.cpp +index 50015045151b..4df303462d96 100644 +--- a/src/llvm-late-gc-lowering.cpp ++++ b/src/llvm-late-gc-lowering.cpp +@@ -396,8 +396,14 @@ CountTrackedPointers::CountTrackedPointers(Type *T) { + } + if (isa(T)) + count *= cast(T)->getNumElements(); +- else if (isa(T)) ++ else if (isa(T)) { ++#if JL_LLVM_VERSION >= 120000 ++ ElementCount EC = cast(T)->getElementCount(); ++ count *= EC.getKnownMinValue(); ++#else + count *= cast(T)->getNumElements(); ++#endif ++ } + } + if (count == 0) + all = false; +@@ -408,8 +414,14 @@ unsigned getCompositeNumElements(Type *T) { + return ST->getNumElements(); + else if (auto *AT = dyn_cast(T)) + return AT->getNumElements(); +- else ++ else { ++#if JL_LLVM_VERSION >= 120000 ++ ElementCount EC = cast(T)->getElementCount(); ++ return EC.getKnownMinValue(); ++#else + return cast(T)->getNumElements(); ++#endif ++ } + } + + // Walk through a Type, and record the element path to every tracked value inside +@@ -625,8 +637,14 @@ void LateLowerGCFrame::LiftSelect(State &S, SelectInst *SI) { + } + std::vector Numbers; + unsigned NumRoots = 1; +- if (auto VTy = dyn_cast(SI->getType())) ++ if (auto VTy = dyn_cast(SI->getType())) { ++#if JL_LLVM_VERSION >= 120000 ++ ElementCount EC = VTy->getElementCount(); ++ Numbers.resize(EC.getKnownMinValue(), -1); ++#else + Numbers.resize(VTy->getNumElements(), -1); ++#endif ++ } + else + assert(isa(SI->getType()) && "unimplemented"); + assert(!isTrackedValue(SI)); +@@ -686,7 +704,12 @@ void LateLowerGCFrame::LiftSelect(State &S, SelectInst *SI) { + assert(NumRoots == 1); + int Number = Numbers[0]; + Numbers.resize(0); ++#if JL_LLVM_VERSION >= 120000 ++ ElementCount EC = VTy->getElementCount(); ++ Numbers.resize(EC.getKnownMinValue(), Number); ++#else + Numbers.resize(VTy->getNumElements(), Number); ++#endif + } + } + if (!isa(SI->getType())) diff --git a/dev-lang/julia/files/julia-1.6.5-llvm_13_compat_part_3.patch b/dev-lang/julia/files/julia-1.6.5-llvm_13_compat_part_3.patch new file mode 100644 index 000000000000..43b7925a9ce7 --- /dev/null +++ b/dev-lang/julia/files/julia-1.6.5-llvm_13_compat_part_3.patch @@ -0,0 +1,375 @@ +This patch is from: + https://raw.githubusercontent.com/archlinux/svntogit-community/packages/julia/trunk/julia-llvm13.patch + +From 9daa25a5f331a7e1c0f0b222373a853c2ce1462d Mon Sep 17 00:00:00 2001 +From: Valentin Churavy +Date: Tue, 12 Oct 2021 11:56:19 -0400 +Subject: [PATCH 2/6] WIP: add Type to ByVal attribute + +--- + src/abi_aarch64.cpp | 2 +- + src/abi_arm.cpp | 2 +- + src/abi_llvm.cpp | 2 +- + src/abi_ppc64le.cpp | 6 +++++- + src/abi_win32.cpp | 6 +++++- + src/abi_win64.cpp | 9 +++++++-- + src/abi_x86.cpp | 8 ++++++-- + src/abi_x86_64.cpp | 11 ++++++++++- + src/ccall.cpp | 4 ++-- + 9 files changed, 38 insertions(+), 12 deletions(-) + +diff --git a/src/abi_aarch64.cpp b/src/abi_aarch64.cpp +index ce94cc66f0..7ffe107d61 100644 +--- a/src/abi_aarch64.cpp ++++ b/src/abi_aarch64.cpp +@@ -194,7 +194,7 @@ Type *isHFAorHVA(jl_datatype_t *dt, size_t &nele) const + return NULL; + } + +-bool needPassByRef(jl_datatype_t *dt, AttrBuilder &ab) override ++bool needPassByRef(jl_datatype_t *dt, AttrBuilder &ab, Type *Ty) override + { + // B.2 + // If the argument type is an HFA or an HVA, then the argument is used +diff --git a/src/abi_arm.cpp b/src/abi_arm.cpp +index 1a5d3d0651..ed846dfafb 100644 +--- a/src/abi_arm.cpp ++++ b/src/abi_arm.cpp +@@ -23,7 +23,7 @@ + + struct ABI_ARMLayout : AbiLayout { + +-bool needPassByRef(jl_datatype_t *dt, AttrBuilder &ab) override ++bool needPassByRef(jl_datatype_t *dt, AttrBuilder &ab, Type *Ty) override + { + return false; + } +diff --git a/src/abi_llvm.cpp b/src/abi_llvm.cpp +index 1ab30da1b2..dba8f4aa8a 100644 +--- a/src/abi_llvm.cpp ++++ b/src/abi_llvm.cpp +@@ -45,7 +45,7 @@ bool use_sret(jl_datatype_t *ty) override + return false; + } + +-bool needPassByRef(jl_datatype_t *ty, AttrBuilder &ab) override ++bool needPassByRef(jl_datatype_t *ty, AttrBuilder &ab, Type *Ty) override + { + return false; + } +diff --git a/src/abi_ppc64le.cpp b/src/abi_ppc64le.cpp +index dd6f927d9c..35e444ef77 100644 +--- a/src/abi_ppc64le.cpp ++++ b/src/abi_ppc64le.cpp +@@ -101,12 +101,16 @@ bool use_sret(jl_datatype_t *dt) override + return false; + } + +-bool needPassByRef(jl_datatype_t *dt, AttrBuilder &ab) override ++bool needPassByRef(jl_datatype_t *dt, AttrBuilder &ab, Type *Ty) override + { + jl_datatype_t *ty0 = NULL; + bool hva = false; + if (jl_datatype_size(dt) > 64 && isHFA(dt, &ty0, &hva) > 8) { ++#if JL_LLVM_VERSION < 120000 + ab.addAttribute(Attribute::ByVal); ++#else ++ ab.addByValAttr(Ty); ++#endif + return true; + } + return false; +diff --git a/src/abi_win32.cpp b/src/abi_win32.cpp +index af16a0310b..0b34f840e4 100644 +--- a/src/abi_win32.cpp ++++ b/src/abi_win32.cpp +@@ -49,11 +49,15 @@ bool use_sret(jl_datatype_t *dt) override + return true; + } + +-bool needPassByRef(jl_datatype_t *dt, AttrBuilder &ab) override ++bool needPassByRef(jl_datatype_t *dt, AttrBuilder &ab, Type *Ty) override + { + // Use pass by reference for all structs + if (dt->layout->nfields > 0) { ++#if JL_LLVM_VERSION < 120000 + ab.addAttribute(Attribute::ByVal); ++#else ++ ab.addByValAttr(Ty); ++#endif + return true; + } + return false; +diff --git a/src/abi_win64.cpp b/src/abi_win64.cpp +index 16e46a9703..f47802edf1 100644 +--- a/src/abi_win64.cpp ++++ b/src/abi_win64.cpp +@@ -56,14 +56,19 @@ bool use_sret(jl_datatype_t *dt) override + return true; + } + +-bool needPassByRef(jl_datatype_t *dt, AttrBuilder &ab) override ++bool needPassByRef(jl_datatype_t *dt, AttrBuilder &ab, Type *Ty) override + { + nargs++; + size_t size = jl_datatype_size(dt); + if (win64_reg_size(size)) + return false; +- if (nargs <= 4) ++ if (nargs <= 4) { ++#if JL_LLVM_VERSION < 120000 + ab.addAttribute(Attribute::ByVal); ++#else ++ ab.addByValAttr(Ty); ++#endif ++ } + return true; + } + +diff --git a/src/abi_x86.cpp b/src/abi_x86.cpp +index 7a65de028e..c6c0282602 100644 +--- a/src/abi_x86.cpp ++++ b/src/abi_x86.cpp +@@ -67,12 +67,16 @@ bool use_sret(jl_datatype_t *dt) override + return true; + } + +-bool needPassByRef(jl_datatype_t *dt, AttrBuilder &ab) override ++bool needPassByRef(jl_datatype_t *dt, AttrBuilder &ab, Type *Ty) override + { + size_t size = jl_datatype_size(dt); + if (is_complex64(dt) || is_complex128(dt) || (jl_is_primitivetype(dt) && size <= 8)) + return false; +- ab.addAttribute(Attribute::ByVal); ++#if JL_LLVM_VERSION < 120000 ++ ab.addAttribute(Attribute::ByVal); ++#else ++ ab.addByValAttr(Ty); ++#endif + return true; + } + +diff --git a/src/abi_x86_64.cpp b/src/abi_x86_64.cpp +index ac28af3011..5f8256dee4 100644 +--- a/src/abi_x86_64.cpp ++++ b/src/abi_x86_64.cpp +@@ -178,11 +178,15 @@ bool use_sret(jl_datatype_t *dt) override + return sret; + } + +-bool needPassByRef(jl_datatype_t *dt, AttrBuilder &ab) override ++bool needPassByRef(jl_datatype_t *dt, AttrBuilder &ab, Type *Ty) override + { + Classification cl = classify(dt); + if (cl.isMemory) { ++#if JL_LLVM_VERSION < 120000 + ab.addAttribute(Attribute::ByVal); ++#else ++ ab.addByValAttr(Ty); ++#endif + return true; + } + +@@ -202,7 +206,12 @@ bool needPassByRef(jl_datatype_t *dt, AttrBuilder &ab) override + else if (jl_is_structtype(dt)) { + // spill to memory even though we would ordinarily pass + // it in registers ++#if JL_LLVM_VERSION < 120000 + ab.addAttribute(Attribute::ByVal); ++#else ++ Type* Ty = preferred_llvm_type(dt, false); ++ ab.addByValAttr(Ty); ++#endif + return true; + } + return false; +diff --git a/src/ccall.cpp b/src/ccall.cpp +index 66ab84c264..e21c717d41 100644 +--- a/src/ccall.cpp ++++ b/src/ccall.cpp +@@ -291,7 +291,7 @@ class AbiLayout { + public: + virtual ~AbiLayout() {} + virtual bool use_sret(jl_datatype_t *ty) = 0; +- virtual bool needPassByRef(jl_datatype_t *ty, AttrBuilder&) = 0; ++ virtual bool needPassByRef(jl_datatype_t *ty, AttrBuilder&, Type* llvm_t) = 0; + virtual Type *preferred_llvm_type(jl_datatype_t *ty, bool isret) const = 0; + }; + +@@ -1077,7 +1077,7 @@ std::string generate_func_sig(const char *fname) + } + + // Whether or not LLVM wants us to emit a pointer to the data +- bool byRef = abi->needPassByRef((jl_datatype_t*)tti, ab); ++ bool byRef = abi->needPassByRef((jl_datatype_t*)tti, ab, t); + + if (jl_is_cpointer_type(tti)) { + pat = t; + +From 1fe19a197ebbe33c9e60b2ca7d30c2573772b476 Mon Sep 17 00:00:00 2001 +From: Valentin Churavy +Date: Thu, 21 Oct 2021 20:32:39 -0400 +Subject: [PATCH 4/6] [LLVM/Win32] Force stack alignment on module + +--- + src/aotcompile.cpp | 3 +++ + src/ccall.cpp | 3 +++ + src/codegen.cpp | 11 ++++++++++- + 3 files changed, 16 insertions(+), 1 deletion(-) + +diff --git a/src/aotcompile.cpp b/src/aotcompile.cpp +index ffd43ee8d48d..d3dfc744fcd0 100644 +--- a/src/aotcompile.cpp ++++ b/src/aotcompile.cpp +@@ -550,6 +550,9 @@ void jl_dump_native_impl(void *native_code, + std::unique_ptr sysimage(new Module("sysimage", Context)); + sysimage->setTargetTriple(data->M->getTargetTriple()); + sysimage->setDataLayout(data->M->getDataLayout()); ++#if JL_LLVM_VERSION >= 130000 ++ sysimage->setOverrideStackAlignment(data->M->getOverrideStackAlignment()); ++#endif + data->M.reset(); // free memory for data->M + + if (sysimg_data) { +diff --git a/src/ccall.cpp b/src/ccall.cpp +index fb70e53e2814..dd7626c918d0 100644 +--- a/src/ccall.cpp ++++ b/src/ccall.cpp +@@ -891,6 +891,9 @@ static jl_cgval_t emit_llvmcall(jl_codectx_t &ctx, jl_value_t **args, size_t nar + // copy module properties that should always match + Mod->setTargetTriple(jl_Module->getTargetTriple()); + Mod->setDataLayout(jl_Module->getDataLayout()); ++#if JL_LLVM_VERSION >= 130000 ++ Mod->setOverrideStackAlignment(jl_Module->getOverrideStackAlignment()); ++#endif + + // verify the definition + Function *def = Mod->getFunction(ir_name); +diff --git a/src/codegen.cpp b/src/codegen.cpp +index b09eb8db04e0..bc4ea7711a04 100644 +--- a/src/codegen.cpp ++++ b/src/codegen.cpp +@@ -1707,6 +1707,14 @@ static void jl_setup_module(Module *m, const jl_cgparams_t *params = &jl_default + llvm::DEBUG_METADATA_VERSION); + m->setDataLayout(jl_data_layout); + m->setTargetTriple(jl_TargetMachine->getTargetTriple().str()); ++ ++#if defined(_OS_WINDOWS_) && !defined(_CPU_X86_64_) && JL_LLVM_VERSIOn >= 130000 ++ // tell Win32 to assume the stack is always 16-byte aligned, ++ // and to ensure that it is 16-byte aligned for out-going calls, ++ // to ensure compatibility with GCC codes ++ m->setOverrideStackAlignment(16;) ++#endif ++ + } + + Module *jl_create_llvm_module(StringRef name) +@@ -8235,10 +8243,11 @@ extern "C" void jl_init_llvm(void) + + TargetOptions options = TargetOptions(); + //options.PrintMachineCode = true; //Print machine code produced during JIT compiling +-#if defined(_OS_WINDOWS_) && !defined(_CPU_X86_64_) ++#if defined(_OS_WINDOWS_) && !defined(_CPU_X86_64_) && JL_LLVM_VERSION <= 120000 + // tell Win32 to assume the stack is always 16-byte aligned, + // and to ensure that it is 16-byte aligned for out-going calls, + // to ensure compatibility with GCC codes ++ // In LLVM 13 and onwards this has turned into a module option + options.StackAlignmentOverride = 16; + #endif + #ifdef JL_DEBUG_BUILD + +From 7a320647976eb97fdd169b5e85397b9e493e4569 Mon Sep 17 00:00:00 2001 +From: Valentin Churavy +Date: Fri, 22 Oct 2021 15:35:38 -0400 +Subject: [PATCH 5/6] StackProtector is now a module flag + +--- + src/aotcompile.cpp | 1 + + src/ccall.cpp | 1 + + src/codegen.cpp | 6 ++++-- + 3 files changed, 6 insertions(+), 2 deletions(-) + +diff --git a/src/aotcompile.cpp b/src/aotcompile.cpp +index d3dfc744fcd0..05fcca50c4ee 100644 +--- a/src/aotcompile.cpp ++++ b/src/aotcompile.cpp +@@ -551,6 +551,7 @@ void jl_dump_native_impl(void *native_code, + sysimage->setTargetTriple(data->M->getTargetTriple()); + sysimage->setDataLayout(data->M->getDataLayout()); + #if JL_LLVM_VERSION >= 130000 ++ sysimage->setStackProtectorGuard(data->M->getStackProtectorGuard()); + sysimage->setOverrideStackAlignment(data->M->getOverrideStackAlignment()); + #endif + data->M.reset(); // free memory for data->M +diff --git a/src/ccall.cpp b/src/ccall.cpp +index dd7626c918d0..647735edb37d 100644 +--- a/src/ccall.cpp ++++ b/src/ccall.cpp +@@ -892,6 +892,7 @@ static jl_cgval_t emit_llvmcall(jl_codectx_t &ctx, jl_value_t **args, size_t nar + Mod->setTargetTriple(jl_Module->getTargetTriple()); + Mod->setDataLayout(jl_Module->getDataLayout()); + #if JL_LLVM_VERSION >= 130000 ++ Mod->setStackProtectorGuard(jl_Module->getStackProtectorGuard()); + Mod->setOverrideStackAlignment(jl_Module->getOverrideStackAlignment()); + #endif + +diff --git a/src/codegen.cpp b/src/codegen.cpp +index bc4ea7711a04..1a7017d3aeb7 100644 +--- a/src/codegen.cpp ++++ b/src/codegen.cpp +@@ -1714,7 +1714,9 @@ static void jl_setup_module(Module *m, const jl_cgparams_t *params = &jl_default + // to ensure compatibility with GCC codes + m->setOverrideStackAlignment(16;) + #endif +- ++#if defined(JL_DEBUG_BUILD) && JL_LLVM_VERSION >= 130000 ++ m->setStackProtectorGuard("global"); ++#endif + } + + Module *jl_create_llvm_module(StringRef name) + +From e323fc8f7be4ce053dec613076d7dd7517515134 Mon Sep 17 00:00:00 2001 +From: Valentin Churavy +Date: Sun, 24 Oct 2021 15:18:23 -0400 +Subject: [PATCH 6/6] Cleanup MachineObjectFileInfo handling in disassembly + +--- + src/disasm.cpp | 18 +++++++++--------- + 1 file changed, 9 insertions(+), 9 deletions(-) + +diff --git a/src/disasm.cpp b/src/disasm.cpp +index 73b394b77d0b..25e7841bde85 100644 +--- a/src/disasm.cpp ++++ b/src/disasm.cpp +@@ -860,21 +860,21 @@ static void jl_dump_asm_internal( + std::unique_ptr MRI(TheTarget->createMCRegInfo(TheTriple.str())); + assert(MRI && "Unable to create target register info!"); + +- std::unique_ptr MOFI(new MCObjectFileInfo()); +-#if JL_LLVM_VERSION >= 130000 +- MCSubtargetInfo *MSTI = TheTarget->createMCSubtargetInfo(TheTriple.str(), cpu, features); +- assert(MSTI && "Unable to create subtarget info!"); ++ std::unique_ptr STI( ++ TheTarget->createMCSubtargetInfo(TheTriple.str(), cpu, features)); ++ assert(STI && "Unable to create subtarget info!"); + +- MCContext Ctx(TheTriple, MAI.get(), MRI.get(), MSTI, &SrcMgr); +- MOFI->initMCObjectFileInfo(Ctx, /* PIC */ false, /* LargeCodeModel */ false); ++#if JL_LLVM_VERSION >= 130000 ++ MCContext Ctx(TheTriple, MAI.get(), MRI.get(), STI.get(), &SrcMgr); ++ std::unique_ptr MOFI( ++ TheTarget->createMCObjectFileInfo(Ctx, /*PIC=*/false, /*LargeCodeModel=*/ false)); ++ Ctx.setObjectFileInfo(MOFI.get()); + #else ++ std::unique_ptr MOFI(new MCObjectFileInfo()); + MCContext Ctx(MAI.get(), MRI.get(), MOFI.get(), &SrcMgr); + MOFI->InitMCObjectFileInfo(TheTriple, /* PIC */ false, Ctx); + #endif + +- // Set up Subtarget and Disassembler +- std::unique_ptr +- STI(TheTarget->createMCSubtargetInfo(TheTriple.str(), cpu, features)); + std::unique_ptr DisAsm(TheTarget->createMCDisassembler(*STI, Ctx)); + if (!DisAsm) { + rstream << "ERROR: no disassembler for target " << TheTriple.str(); diff --git a/dev-lang/julia/files/julia-1.6.5-make-install-no-build.patch b/dev-lang/julia/files/julia-1.6.5-make-install-no-build.patch new file mode 100644 index 000000000000..0632a6e726f7 --- /dev/null +++ b/dev-lang/julia/files/julia-1.6.5-make-install-no-build.patch @@ -0,0 +1,17 @@ +This pacth comes from + https://raw.githubusercontent.com/archlinux/svntogit-community/packages/julia/trunk/make-install-no-build.patch + +--- julia-1.3.0/Makefile.orig 2019-12-06 12:54:23.879790955 +0000 ++++ julia-1.3.0/Makefile 2019-12-06 12:54:36.329952953 +0000 +@@ -277,11 +277,6 @@ + + + install: $(build_depsbindir)/stringreplace $(BUILDROOT)/doc/_build/html/en/index.html +-ifeq ($(BUNDLE_DEBUG_LIBS),1) +- @$(MAKE) $(QUIET_MAKE) all +-else +- @$(MAKE) $(QUIET_MAKE) release +-endif + @for subdir in $(bindir) $(datarootdir)/julia/stdlib/$(VERSDIR) $(docdir) $(man1dir) $(includedir)/julia $(libdir) $(private_libdir) $(sysconfdir) $(libexecdir); do \ + mkdir -p $(DESTDIR)$$subdir; \ + done diff --git a/dev-lang/julia/files/julia-1.7.0-do_not_set_rpath.patch b/dev-lang/julia/files/julia-1.7.0-do_not_set_rpath.patch deleted file mode 100644 index 24f12d261053..000000000000 --- a/dev-lang/julia/files/julia-1.7.0-do_not_set_rpath.patch +++ /dev/null @@ -1,29 +0,0 @@ ---- a/Makefile 2021-12-21 09:38:26.782829864 +0100 -+++ b/Makefile 2021-12-21 10:52:40.760565902 +0100 -@@ -336,7 +336,7 @@ - install_name_tool -add_rpath @executable_path/$(build_libdir_rel) @executable_path/$(libdir_rel) $(DESTDIR)$(bindir)/$$j; \ - done - endif --else ifneq (,$(findstring $(OS),Linux FreeBSD)) -+else ifneq (,$(findstring $(OS),FreeBSD)) - for j in $(JL_TARGETS) ; do \ - $(PATCHELF) --set-rpath '$$ORIGIN/$(private_libdir_rel):$$ORIGIN/$(libdir_rel)' $(DESTDIR)$(bindir)/$$j; \ - done -@@ -357,7 +357,7 @@ - endif - - # Set rpath for libjulia-internal, which is moving from `../lib` to `../lib/julia`. We only need to do this for Linux/FreeBSD --ifneq (,$(findstring $(OS),Linux FreeBSD)) -+ifneq (,$(findstring $(OS),FreeBSD)) - $(PATCHELF) --set-rpath '$$ORIGIN:$$ORIGIN/$(reverse_private_libdir_rel)' $(DESTDIR)$(private_libdir)/libjulia-internal.$(SHLIB_EXT) - ifeq ($(BUNDLE_DEBUG_LIBS),1) - $(PATCHELF) --set-rpath '$$ORIGIN:$$ORIGIN/$(reverse_private_libdir_rel)' $(DESTDIR)$(private_libdir)/libjulia-internal-debug.$(SHLIB_EXT) -@@ -365,7 +365,7 @@ - endif - - # Set rpath for LLVM.so which is `$ORIGIN/../lib` moving from `../lib` to `../lib/julia`. We only need to do this for Linux/FreeBSD --ifneq (,$(findstring $(OS),Linux FreeBSD)) -+ifneq (,$(findstring $(OS),FreeBSD)) - $(PATCHELF) --set-rpath '$$ORIGIN:$$ORIGIN/$(reverse_private_libdir_rel)' $(DESTDIR)$(private_libdir)/libLLVM.$(SHLIB_EXT) - endif - diff --git a/dev-lang/julia/files/julia-1.7.0-hardcoded-libs.patch b/dev-lang/julia/files/julia-1.7.0-hardcoded-libs.patch deleted file mode 100644 index be7d20368f6d..000000000000 --- a/dev-lang/julia/files/julia-1.7.0-hardcoded-libs.patch +++ /dev/null @@ -1,72 +0,0 @@ -This pacth comes from: - https://raw.githubusercontent.com/archlinux/svntogit-community/packages/julia/trunk/julia-hardcoded-libs.patch - -diff --git a/stdlib/MbedTLS_jll/src/MbedTLS_jll.jl b/stdlib/MbedTLS_jll/src/MbedTLS_jll.jl -index a7ca666b23..b84a42f4e7 100644 ---- a/stdlib/MbedTLS_jll/src/MbedTLS_jll.jl -+++ b/stdlib/MbedTLS_jll/src/MbedTLS_jll.jl -@@ -31,9 +31,9 @@ elseif Sys.isapple() - const libmbedtls = "@rpath/libmbedtls.13.dylib" - const libmbedx509 = "@rpath/libmbedx509.1.dylib" - else -- const libmbedcrypto = "libmbedcrypto.so.5" -- const libmbedtls = "libmbedtls.so.13" -- const libmbedx509 = "libmbedx509.so.1" -+ const libmbedcrypto = "libmbedcrypto.so" -+ const libmbedtls = "libmbedtls.so" -+ const libmbedx509 = "libmbedx509.so" - end - - function __init__() -diff --git a/stdlib/libLLVM_jll/src/libLLVM_jll.jl b/stdlib/libLLVM_jll/src/libLLVM_jll.jl -index fa45e754e5..b51812e3a8 100644 ---- a/stdlib/libLLVM_jll/src/libLLVM_jll.jl -+++ b/stdlib/libLLVM_jll/src/libLLVM_jll.jl -@@ -23,7 +23,7 @@ if Sys.iswindows() - elseif Sys.isapple() - const libLLVM = "@rpath/libLLVM.dylib" - else -- const libLLVM = "libLLVM-12jl.so" -+ const libLLVM = "libLLVM.so" - end - - function __init__() -diff --git a/stdlib/nghttp2_jll/src/nghttp2_jll.jl b/stdlib/nghttp2_jll/src/nghttp2_jll.jl -index 8b98c76ac5..77ad9e3800 100644 ---- a/stdlib/nghttp2_jll/src/nghttp2_jll.jl -+++ b/stdlib/nghttp2_jll/src/nghttp2_jll.jl -@@ -22,7 +22,7 @@ if Sys.iswindows() - elseif Sys.isapple() - const libnghttp2 = "@rpath/libnghttp2.14.dylib" - else -- const libnghttp2 = "libnghttp2.so.14" -+ const libnghttp2 = "libnghttp2.so" - end - - function __init__() -diff --git a/stdlib/LibGit2_jll/src/LibGit2_jll.jl b/stdlib/LibGit2_jll/src/LibGit2_jll.jl -index f0d4b5dda6..2ed3017b51 100644 ---- a/stdlib/LibGit2_jll/src/LibGit2_jll.jl -+++ b/stdlib/LibGit2_jll/src/LibGit2_jll.jl -@@ -23,7 +23,7 @@ if Sys.iswindows() - elseif Sys.isapple() - const libgit2 = "@rpath/libgit2.1.1.dylib" - else -- const libgit2 = "libgit2.so.1.1" -+ const libgit2 = "libgit2.so" - end - - function __init__() -diff --git a/stdlib/OpenLibm_jll/src/OpenLibm_jll.jl b/stdlib/OpenLibm_jll/src/OpenLibm_jll.jl -index 215de8aed6..918d1ffdc2 100644 ---- a/stdlib/OpenLibm_jll/src/OpenLibm_jll.jl -+++ b/stdlib/OpenLibm_jll/src/OpenLibm_jll.jl -@@ -22,7 +22,7 @@ if Sys.iswindows() - elseif Sys.isapple() - const libopenlibm = "@rpath/libopenlibm.3.dylib" - else -- const libopenlibm = "libopenlibm.so.3" -+ const libopenlibm = "libopenlibm.so" - end - - function __init__() diff --git a/dev-lang/julia/files/julia-1.7.0-libgit-1.2.patch b/dev-lang/julia/files/julia-1.7.0-libgit-1.2.patch deleted file mode 100644 index f0abc7b8f60d..000000000000 --- a/dev-lang/julia/files/julia-1.7.0-libgit-1.2.patch +++ /dev/null @@ -1,17 +0,0 @@ -This patch comes from - https://raw.githubusercontent.com/archlinux/svntogit-community/packages/julia/trunk/julia-libgit-1.2.patch - -diff --git a/stdlib/LibGit2/src/types.jl b/stdlib/LibGit2/src/types.jl -index 9ffcaa3646..5f571e7b26 100644 ---- a/stdlib/LibGit2/src/types.jl -+++ b/stdlib/LibGit2/src/types.jl -@@ -230,6 +230,9 @@ Matches the [`git_remote_callbacks`](https://libgit2.org/libgit2/#HEAD/type/git_ - push_update_reference::Ptr{Cvoid} = C_NULL - push_negotiation::Ptr{Cvoid} = C_NULL - transport::Ptr{Cvoid} = C_NULL -+ @static if LibGit2.VERSION >= v"1.2.0" -+ remote_ready::Ptr{Cvoid} = C_NULL -+ end - payload::Any = nothing - @static if LibGit2.VERSION >= v"0.99.0" - resolve_url::Ptr{Cvoid} = C_NULL diff --git a/dev-lang/julia/files/julia-1.7.0-llvm_13_compat_part_1.patch b/dev-lang/julia/files/julia-1.7.0-llvm_13_compat_part_1.patch deleted file mode 100644 index 1398be7ec873..000000000000 --- a/dev-lang/julia/files/julia-1.7.0-llvm_13_compat_part_1.patch +++ /dev/null @@ -1,172 +0,0 @@ -This patch is from the julialang repository: - https://github.com/JuliaLang/julia/commit/677ce6d3.patch -but reference comes form ARCH Linux juia package - https://github.com/archlinux/svntogit-community/tree/packages/julia/trunk - -From 677ce6d3adc2f70886f72795b0e5c739e75730ee Mon Sep 17 00:00:00 2001 -From: Valentin Churavy -Date: Sat, 28 Aug 2021 16:48:32 +0200 -Subject: [PATCH] [LLVM] Adapt to LLVM 13 changes - ---- - src/cgutils.cpp | 8 +++++++- - src/codegen.cpp | 2 +- - src/disasm.cpp | 8 ++++++++ - src/jitlayers.cpp | 7 +++++++ - src/llvm-late-gc-lowering.cpp | 5 +++-- - src/llvm-multiversioning.cpp | 5 +++++ - src/llvm-remove-addrspaces.cpp | 8 ++++++++ - 7 files changed, 39 insertions(+), 4 deletions(-) - -diff --git a/src/cgutils.cpp b/src/cgutils.cpp -index 4e9917b6b078..928e1a07b2f1 100644 ---- a/src/cgutils.cpp -+++ b/src/cgutils.cpp -@@ -2757,8 +2757,14 @@ static jl_value_t *static_constant_instance(Constant *constant, jl_value_t *jt) - size_t nargs; - if (const auto *CC = dyn_cast(constant)) - nargs = CC->getNumOperands(); -- else if (const auto *CAZ = dyn_cast(constant)) -+ else if (const auto *CAZ = dyn_cast(constant)) { -+#if JL_LLVM_VERSION >= 130000 -+ // SVE: Elsewhere we use `getMinKownValue` -+ nargs = CAZ->getElementCount().getFixedValue(); -+#else - nargs = CAZ->getNumElements(); -+#endif -+ } - else if (const auto *CDS = dyn_cast(constant)) - nargs = CDS->getNumElements(); - else -diff --git a/src/codegen.cpp b/src/codegen.cpp -index 5cc9f66ffaef..9000513151fe 100644 ---- a/src/codegen.cpp -+++ b/src/codegen.cpp -@@ -7394,7 +7394,7 @@ static std::pair, jl_llvm_functions_t> - #endif - continue; - } -- assert(find(pred_begin(PhiBB), pred_end(PhiBB), FromBB) != pred_end(PhiBB)); // consistency check -+ assert(std::find(pred_begin(PhiBB), pred_end(PhiBB), FromBB) != pred_end(PhiBB)); // consistency check - TerminatorInst *terminator = FromBB->getTerminator(); - if (!terminator->getParent()->getUniqueSuccessor()) { - // Can't use `llvm::SplitCriticalEdge` here because -diff --git a/src/disasm.cpp b/src/disasm.cpp -index 6157873ad71c..589f618396ea 100644 ---- a/src/disasm.cpp -+++ b/src/disasm.cpp -@@ -857,8 +857,16 @@ static void jl_dump_asm_internal( - assert(MRI && "Unable to create target register info!"); - - std::unique_ptr MOFI(new MCObjectFileInfo()); -+#if JL_LLVM_VERSION >= 130000 -+ MCSubtargetInfo *MSTI = TheTarget->createMCSubtargetInfo(TheTriple.str(), cpu, features); -+ assert(MSTI && "Unable to create subtarget info!"); -+ -+ MCContext Ctx(TheTriple, MAI.get(), MRI.get(), MSTI, &SrcMgr); -+ MOFI->initMCObjectFileInfo(Ctx, /* PIC */ false, /* LargeCodeModel */ false); -+#else - MCContext Ctx(MAI.get(), MRI.get(), MOFI.get(), &SrcMgr); - MOFI->InitMCObjectFileInfo(TheTriple, /* PIC */ false, Ctx); -+#endif - - // Set up Subtarget and Disassembler - std::unique_ptr -diff --git a/src/jitlayers.cpp b/src/jitlayers.cpp -index 60b1903aaa80..12497cadf491 100644 ---- a/src/jitlayers.cpp -+++ b/src/jitlayers.cpp -@@ -10,6 +10,9 @@ - #include - #include - #include -+#if JL_LLVM_VERSION >= 130000 -+#include -+#endif - #include - #include - #include -@@ -654,7 +657,11 @@ JuliaOJIT::JuliaOJIT(TargetMachine &TM, LLVMContext *LLVMCtx) - MemMgr(createRTDyldMemoryManager()), - JuliaListener(CreateJuliaJITEventListener()), - TSCtx(std::unique_ptr(LLVMCtx)), -+#if JL_LLVM_VERSION >= 130000 -+ ES(cantFail(orc::SelfExecutorProcessControl::Create())), -+#else - ES(), -+#endif - GlobalJD(ES.createBareJITDylib("JuliaGlobals")), - JD(ES.createBareJITDylib("JuliaOJIT")), - ObjectLayer( -diff --git a/src/llvm-late-gc-lowering.cpp b/src/llvm-late-gc-lowering.cpp -index 0aac7638be0d..db8b19bacea5 100644 ---- a/src/llvm-late-gc-lowering.cpp -+++ b/src/llvm-late-gc-lowering.cpp -@@ -709,7 +709,7 @@ void LateLowerGCFrame::LiftSelect(State &S, SelectInst *SI) { - else - Numbers[i] = Number; - } -- if (auto VTy = dyn_cast(SI->getType())) { -+ if (auto VTy = dyn_cast(SI->getType())) { - if (NumRoots != Numbers.size()) { - // broadcast the scalar root number to fill the vector - assert(NumRoots == 1); -@@ -736,11 +736,12 @@ void LateLowerGCFrame::LiftPhi(State &S, PHINode *Phi) { - SmallVector lifted; - std::vector Numbers; - unsigned NumRoots = 1; -- if (auto VTy = dyn_cast(Phi->getType())) { -+ if (auto VTy = dyn_cast(Phi->getType())) { - NumRoots = VTy->getNumElements(); - Numbers.resize(NumRoots); - } - else { -+ // TODO: SVE - assert(isa(Phi->getType()) && "unimplemented"); - } - for (unsigned i = 0; i < NumRoots; ++i) { -diff --git a/src/llvm-multiversioning.cpp b/src/llvm-multiversioning.cpp -index 68081eb53d3a..a82600162fa9 100644 ---- a/src/llvm-multiversioning.cpp -+++ b/src/llvm-multiversioning.cpp -@@ -403,7 +403,12 @@ void CloneCtx::clone_function(Function *F, Function *new_f, ValueToValueMapTy &v - vmap[&*J] = &*DestI++; - } - SmallVector Returns; -+#if JL_LLVM_VERSION >= 130000 -+ // We are cloning into the same module -+ CloneFunctionInto(new_f, F, vmap, CloneFunctionChangeType::GlobalChanges, Returns); -+#else - CloneFunctionInto(new_f, F, vmap, true, Returns); -+#endif - } - - // Clone all clone_all targets. Makes sure that the base targets are all available. -diff --git a/src/llvm-remove-addrspaces.cpp b/src/llvm-remove-addrspaces.cpp -index ada10c8d5f1f..7c6ef093fbce 100644 ---- a/src/llvm-remove-addrspaces.cpp -+++ b/src/llvm-remove-addrspaces.cpp -@@ -345,7 +345,11 @@ bool RemoveAddrspacesPass::runOnModule(Module &M) - for (auto MD : MDs) - NGV->addMetadata( - MD.first, -+#if JL_LLVM_VERSION >= 130000 -+ *MapMetadata(MD.second, VMap)); -+#else - *MapMetadata(MD.second, VMap, RF_MoveDistinctMDs)); -+#endif - - copyComdat(NGV, GV); - -@@ -372,7 +376,11 @@ bool RemoveAddrspacesPass::runOnModule(Module &M) - NF, - F, - VMap, -+#if JL_LLVM_VERSION >= 130000 -+ CloneFunctionChangeType::GlobalChanges, -+#else - /*ModuleLevelChanges=*/true, -+#endif - Returns, - "", - nullptr, diff --git a/dev-lang/julia/files/julia-1.7.0-llvm_13_compat_part_2.patch b/dev-lang/julia/files/julia-1.7.0-llvm_13_compat_part_2.patch deleted file mode 100644 index 5a8c2cde93d5..000000000000 --- a/dev-lang/julia/files/julia-1.7.0-llvm_13_compat_part_2.patch +++ /dev/null @@ -1,80 +0,0 @@ -This patch is from julialang repository: - https://github.com/JuliaLang/julia/commit/47f9139e.patch -but reference comes form ARCH Linux juia package - https://github.com/archlinux/svntogit-community/tree/packages/julia/trunk - -From 47f9139e88917813cb7beee5e690c48c2ac65de4 Mon Sep 17 00:00:00 2001 -From: Xuanda Yang -Date: Wed, 9 Jun 2021 22:35:14 +0800 -Subject: [PATCH] codegen: replace deprecated llvm::VectorType::getNumElements - with new APIs (#41144) - ---- - src/llvm-late-gc-lowering.cpp | 29 ++++++++++++++++++++++++++--- - 1 file changed, 26 insertions(+), 3 deletions(-) - -diff --git a/src/llvm-late-gc-lowering.cpp b/src/llvm-late-gc-lowering.cpp -index 50015045151b..4df303462d96 100644 ---- a/src/llvm-late-gc-lowering.cpp -+++ b/src/llvm-late-gc-lowering.cpp -@@ -396,8 +396,14 @@ CountTrackedPointers::CountTrackedPointers(Type *T) { - } - if (isa(T)) - count *= cast(T)->getNumElements(); -- else if (isa(T)) -+ else if (isa(T)) { -+#if JL_LLVM_VERSION >= 120000 -+ ElementCount EC = cast(T)->getElementCount(); -+ count *= EC.getKnownMinValue(); -+#else - count *= cast(T)->getNumElements(); -+#endif -+ } - } - if (count == 0) - all = false; -@@ -408,8 +414,14 @@ unsigned getCompositeNumElements(Type *T) { - return ST->getNumElements(); - else if (auto *AT = dyn_cast(T)) - return AT->getNumElements(); -- else -+ else { -+#if JL_LLVM_VERSION >= 120000 -+ ElementCount EC = cast(T)->getElementCount(); -+ return EC.getKnownMinValue(); -+#else - return cast(T)->getNumElements(); -+#endif -+ } - } - - // Walk through a Type, and record the element path to every tracked value inside -@@ -625,8 +637,14 @@ void LateLowerGCFrame::LiftSelect(State &S, SelectInst *SI) { - } - std::vector Numbers; - unsigned NumRoots = 1; -- if (auto VTy = dyn_cast(SI->getType())) -+ if (auto VTy = dyn_cast(SI->getType())) { -+#if JL_LLVM_VERSION >= 120000 -+ ElementCount EC = VTy->getElementCount(); -+ Numbers.resize(EC.getKnownMinValue(), -1); -+#else - Numbers.resize(VTy->getNumElements(), -1); -+#endif -+ } - else - assert(isa(SI->getType()) && "unimplemented"); - assert(!isTrackedValue(SI)); -@@ -686,7 +704,12 @@ void LateLowerGCFrame::LiftSelect(State &S, SelectInst *SI) { - assert(NumRoots == 1); - int Number = Numbers[0]; - Numbers.resize(0); -+#if JL_LLVM_VERSION >= 120000 -+ ElementCount EC = VTy->getElementCount(); -+ Numbers.resize(EC.getKnownMinValue(), Number); -+#else - Numbers.resize(VTy->getNumElements(), Number); -+#endif - } - } - if (!isa(SI->getType())) diff --git a/dev-lang/julia/files/julia-1.7.0-llvm_13_compat_part_3.patch b/dev-lang/julia/files/julia-1.7.0-llvm_13_compat_part_3.patch deleted file mode 100644 index 43b7925a9ce7..000000000000 --- a/dev-lang/julia/files/julia-1.7.0-llvm_13_compat_part_3.patch +++ /dev/null @@ -1,375 +0,0 @@ -This patch is from: - https://raw.githubusercontent.com/archlinux/svntogit-community/packages/julia/trunk/julia-llvm13.patch - -From 9daa25a5f331a7e1c0f0b222373a853c2ce1462d Mon Sep 17 00:00:00 2001 -From: Valentin Churavy -Date: Tue, 12 Oct 2021 11:56:19 -0400 -Subject: [PATCH 2/6] WIP: add Type to ByVal attribute - ---- - src/abi_aarch64.cpp | 2 +- - src/abi_arm.cpp | 2 +- - src/abi_llvm.cpp | 2 +- - src/abi_ppc64le.cpp | 6 +++++- - src/abi_win32.cpp | 6 +++++- - src/abi_win64.cpp | 9 +++++++-- - src/abi_x86.cpp | 8 ++++++-- - src/abi_x86_64.cpp | 11 ++++++++++- - src/ccall.cpp | 4 ++-- - 9 files changed, 38 insertions(+), 12 deletions(-) - -diff --git a/src/abi_aarch64.cpp b/src/abi_aarch64.cpp -index ce94cc66f0..7ffe107d61 100644 ---- a/src/abi_aarch64.cpp -+++ b/src/abi_aarch64.cpp -@@ -194,7 +194,7 @@ Type *isHFAorHVA(jl_datatype_t *dt, size_t &nele) const - return NULL; - } - --bool needPassByRef(jl_datatype_t *dt, AttrBuilder &ab) override -+bool needPassByRef(jl_datatype_t *dt, AttrBuilder &ab, Type *Ty) override - { - // B.2 - // If the argument type is an HFA or an HVA, then the argument is used -diff --git a/src/abi_arm.cpp b/src/abi_arm.cpp -index 1a5d3d0651..ed846dfafb 100644 ---- a/src/abi_arm.cpp -+++ b/src/abi_arm.cpp -@@ -23,7 +23,7 @@ - - struct ABI_ARMLayout : AbiLayout { - --bool needPassByRef(jl_datatype_t *dt, AttrBuilder &ab) override -+bool needPassByRef(jl_datatype_t *dt, AttrBuilder &ab, Type *Ty) override - { - return false; - } -diff --git a/src/abi_llvm.cpp b/src/abi_llvm.cpp -index 1ab30da1b2..dba8f4aa8a 100644 ---- a/src/abi_llvm.cpp -+++ b/src/abi_llvm.cpp -@@ -45,7 +45,7 @@ bool use_sret(jl_datatype_t *ty) override - return false; - } - --bool needPassByRef(jl_datatype_t *ty, AttrBuilder &ab) override -+bool needPassByRef(jl_datatype_t *ty, AttrBuilder &ab, Type *Ty) override - { - return false; - } -diff --git a/src/abi_ppc64le.cpp b/src/abi_ppc64le.cpp -index dd6f927d9c..35e444ef77 100644 ---- a/src/abi_ppc64le.cpp -+++ b/src/abi_ppc64le.cpp -@@ -101,12 +101,16 @@ bool use_sret(jl_datatype_t *dt) override - return false; - } - --bool needPassByRef(jl_datatype_t *dt, AttrBuilder &ab) override -+bool needPassByRef(jl_datatype_t *dt, AttrBuilder &ab, Type *Ty) override - { - jl_datatype_t *ty0 = NULL; - bool hva = false; - if (jl_datatype_size(dt) > 64 && isHFA(dt, &ty0, &hva) > 8) { -+#if JL_LLVM_VERSION < 120000 - ab.addAttribute(Attribute::ByVal); -+#else -+ ab.addByValAttr(Ty); -+#endif - return true; - } - return false; -diff --git a/src/abi_win32.cpp b/src/abi_win32.cpp -index af16a0310b..0b34f840e4 100644 ---- a/src/abi_win32.cpp -+++ b/src/abi_win32.cpp -@@ -49,11 +49,15 @@ bool use_sret(jl_datatype_t *dt) override - return true; - } - --bool needPassByRef(jl_datatype_t *dt, AttrBuilder &ab) override -+bool needPassByRef(jl_datatype_t *dt, AttrBuilder &ab, Type *Ty) override - { - // Use pass by reference for all structs - if (dt->layout->nfields > 0) { -+#if JL_LLVM_VERSION < 120000 - ab.addAttribute(Attribute::ByVal); -+#else -+ ab.addByValAttr(Ty); -+#endif - return true; - } - return false; -diff --git a/src/abi_win64.cpp b/src/abi_win64.cpp -index 16e46a9703..f47802edf1 100644 ---- a/src/abi_win64.cpp -+++ b/src/abi_win64.cpp -@@ -56,14 +56,19 @@ bool use_sret(jl_datatype_t *dt) override - return true; - } - --bool needPassByRef(jl_datatype_t *dt, AttrBuilder &ab) override -+bool needPassByRef(jl_datatype_t *dt, AttrBuilder &ab, Type *Ty) override - { - nargs++; - size_t size = jl_datatype_size(dt); - if (win64_reg_size(size)) - return false; -- if (nargs <= 4) -+ if (nargs <= 4) { -+#if JL_LLVM_VERSION < 120000 - ab.addAttribute(Attribute::ByVal); -+#else -+ ab.addByValAttr(Ty); -+#endif -+ } - return true; - } - -diff --git a/src/abi_x86.cpp b/src/abi_x86.cpp -index 7a65de028e..c6c0282602 100644 ---- a/src/abi_x86.cpp -+++ b/src/abi_x86.cpp -@@ -67,12 +67,16 @@ bool use_sret(jl_datatype_t *dt) override - return true; - } - --bool needPassByRef(jl_datatype_t *dt, AttrBuilder &ab) override -+bool needPassByRef(jl_datatype_t *dt, AttrBuilder &ab, Type *Ty) override - { - size_t size = jl_datatype_size(dt); - if (is_complex64(dt) || is_complex128(dt) || (jl_is_primitivetype(dt) && size <= 8)) - return false; -- ab.addAttribute(Attribute::ByVal); -+#if JL_LLVM_VERSION < 120000 -+ ab.addAttribute(Attribute::ByVal); -+#else -+ ab.addByValAttr(Ty); -+#endif - return true; - } - -diff --git a/src/abi_x86_64.cpp b/src/abi_x86_64.cpp -index ac28af3011..5f8256dee4 100644 ---- a/src/abi_x86_64.cpp -+++ b/src/abi_x86_64.cpp -@@ -178,11 +178,15 @@ bool use_sret(jl_datatype_t *dt) override - return sret; - } - --bool needPassByRef(jl_datatype_t *dt, AttrBuilder &ab) override -+bool needPassByRef(jl_datatype_t *dt, AttrBuilder &ab, Type *Ty) override - { - Classification cl = classify(dt); - if (cl.isMemory) { -+#if JL_LLVM_VERSION < 120000 - ab.addAttribute(Attribute::ByVal); -+#else -+ ab.addByValAttr(Ty); -+#endif - return true; - } - -@@ -202,7 +206,12 @@ bool needPassByRef(jl_datatype_t *dt, AttrBuilder &ab) override - else if (jl_is_structtype(dt)) { - // spill to memory even though we would ordinarily pass - // it in registers -+#if JL_LLVM_VERSION < 120000 - ab.addAttribute(Attribute::ByVal); -+#else -+ Type* Ty = preferred_llvm_type(dt, false); -+ ab.addByValAttr(Ty); -+#endif - return true; - } - return false; -diff --git a/src/ccall.cpp b/src/ccall.cpp -index 66ab84c264..e21c717d41 100644 ---- a/src/ccall.cpp -+++ b/src/ccall.cpp -@@ -291,7 +291,7 @@ class AbiLayout { - public: - virtual ~AbiLayout() {} - virtual bool use_sret(jl_datatype_t *ty) = 0; -- virtual bool needPassByRef(jl_datatype_t *ty, AttrBuilder&) = 0; -+ virtual bool needPassByRef(jl_datatype_t *ty, AttrBuilder&, Type* llvm_t) = 0; - virtual Type *preferred_llvm_type(jl_datatype_t *ty, bool isret) const = 0; - }; - -@@ -1077,7 +1077,7 @@ std::string generate_func_sig(const char *fname) - } - - // Whether or not LLVM wants us to emit a pointer to the data -- bool byRef = abi->needPassByRef((jl_datatype_t*)tti, ab); -+ bool byRef = abi->needPassByRef((jl_datatype_t*)tti, ab, t); - - if (jl_is_cpointer_type(tti)) { - pat = t; - -From 1fe19a197ebbe33c9e60b2ca7d30c2573772b476 Mon Sep 17 00:00:00 2001 -From: Valentin Churavy -Date: Thu, 21 Oct 2021 20:32:39 -0400 -Subject: [PATCH 4/6] [LLVM/Win32] Force stack alignment on module - ---- - src/aotcompile.cpp | 3 +++ - src/ccall.cpp | 3 +++ - src/codegen.cpp | 11 ++++++++++- - 3 files changed, 16 insertions(+), 1 deletion(-) - -diff --git a/src/aotcompile.cpp b/src/aotcompile.cpp -index ffd43ee8d48d..d3dfc744fcd0 100644 ---- a/src/aotcompile.cpp -+++ b/src/aotcompile.cpp -@@ -550,6 +550,9 @@ void jl_dump_native_impl(void *native_code, - std::unique_ptr sysimage(new Module("sysimage", Context)); - sysimage->setTargetTriple(data->M->getTargetTriple()); - sysimage->setDataLayout(data->M->getDataLayout()); -+#if JL_LLVM_VERSION >= 130000 -+ sysimage->setOverrideStackAlignment(data->M->getOverrideStackAlignment()); -+#endif - data->M.reset(); // free memory for data->M - - if (sysimg_data) { -diff --git a/src/ccall.cpp b/src/ccall.cpp -index fb70e53e2814..dd7626c918d0 100644 ---- a/src/ccall.cpp -+++ b/src/ccall.cpp -@@ -891,6 +891,9 @@ static jl_cgval_t emit_llvmcall(jl_codectx_t &ctx, jl_value_t **args, size_t nar - // copy module properties that should always match - Mod->setTargetTriple(jl_Module->getTargetTriple()); - Mod->setDataLayout(jl_Module->getDataLayout()); -+#if JL_LLVM_VERSION >= 130000 -+ Mod->setOverrideStackAlignment(jl_Module->getOverrideStackAlignment()); -+#endif - - // verify the definition - Function *def = Mod->getFunction(ir_name); -diff --git a/src/codegen.cpp b/src/codegen.cpp -index b09eb8db04e0..bc4ea7711a04 100644 ---- a/src/codegen.cpp -+++ b/src/codegen.cpp -@@ -1707,6 +1707,14 @@ static void jl_setup_module(Module *m, const jl_cgparams_t *params = &jl_default - llvm::DEBUG_METADATA_VERSION); - m->setDataLayout(jl_data_layout); - m->setTargetTriple(jl_TargetMachine->getTargetTriple().str()); -+ -+#if defined(_OS_WINDOWS_) && !defined(_CPU_X86_64_) && JL_LLVM_VERSIOn >= 130000 -+ // tell Win32 to assume the stack is always 16-byte aligned, -+ // and to ensure that it is 16-byte aligned for out-going calls, -+ // to ensure compatibility with GCC codes -+ m->setOverrideStackAlignment(16;) -+#endif -+ - } - - Module *jl_create_llvm_module(StringRef name) -@@ -8235,10 +8243,11 @@ extern "C" void jl_init_llvm(void) - - TargetOptions options = TargetOptions(); - //options.PrintMachineCode = true; //Print machine code produced during JIT compiling --#if defined(_OS_WINDOWS_) && !defined(_CPU_X86_64_) -+#if defined(_OS_WINDOWS_) && !defined(_CPU_X86_64_) && JL_LLVM_VERSION <= 120000 - // tell Win32 to assume the stack is always 16-byte aligned, - // and to ensure that it is 16-byte aligned for out-going calls, - // to ensure compatibility with GCC codes -+ // In LLVM 13 and onwards this has turned into a module option - options.StackAlignmentOverride = 16; - #endif - #ifdef JL_DEBUG_BUILD - -From 7a320647976eb97fdd169b5e85397b9e493e4569 Mon Sep 17 00:00:00 2001 -From: Valentin Churavy -Date: Fri, 22 Oct 2021 15:35:38 -0400 -Subject: [PATCH 5/6] StackProtector is now a module flag - ---- - src/aotcompile.cpp | 1 + - src/ccall.cpp | 1 + - src/codegen.cpp | 6 ++++-- - 3 files changed, 6 insertions(+), 2 deletions(-) - -diff --git a/src/aotcompile.cpp b/src/aotcompile.cpp -index d3dfc744fcd0..05fcca50c4ee 100644 ---- a/src/aotcompile.cpp -+++ b/src/aotcompile.cpp -@@ -551,6 +551,7 @@ void jl_dump_native_impl(void *native_code, - sysimage->setTargetTriple(data->M->getTargetTriple()); - sysimage->setDataLayout(data->M->getDataLayout()); - #if JL_LLVM_VERSION >= 130000 -+ sysimage->setStackProtectorGuard(data->M->getStackProtectorGuard()); - sysimage->setOverrideStackAlignment(data->M->getOverrideStackAlignment()); - #endif - data->M.reset(); // free memory for data->M -diff --git a/src/ccall.cpp b/src/ccall.cpp -index dd7626c918d0..647735edb37d 100644 ---- a/src/ccall.cpp -+++ b/src/ccall.cpp -@@ -892,6 +892,7 @@ static jl_cgval_t emit_llvmcall(jl_codectx_t &ctx, jl_value_t **args, size_t nar - Mod->setTargetTriple(jl_Module->getTargetTriple()); - Mod->setDataLayout(jl_Module->getDataLayout()); - #if JL_LLVM_VERSION >= 130000 -+ Mod->setStackProtectorGuard(jl_Module->getStackProtectorGuard()); - Mod->setOverrideStackAlignment(jl_Module->getOverrideStackAlignment()); - #endif - -diff --git a/src/codegen.cpp b/src/codegen.cpp -index bc4ea7711a04..1a7017d3aeb7 100644 ---- a/src/codegen.cpp -+++ b/src/codegen.cpp -@@ -1714,7 +1714,9 @@ static void jl_setup_module(Module *m, const jl_cgparams_t *params = &jl_default - // to ensure compatibility with GCC codes - m->setOverrideStackAlignment(16;) - #endif -- -+#if defined(JL_DEBUG_BUILD) && JL_LLVM_VERSION >= 130000 -+ m->setStackProtectorGuard("global"); -+#endif - } - - Module *jl_create_llvm_module(StringRef name) - -From e323fc8f7be4ce053dec613076d7dd7517515134 Mon Sep 17 00:00:00 2001 -From: Valentin Churavy -Date: Sun, 24 Oct 2021 15:18:23 -0400 -Subject: [PATCH 6/6] Cleanup MachineObjectFileInfo handling in disassembly - ---- - src/disasm.cpp | 18 +++++++++--------- - 1 file changed, 9 insertions(+), 9 deletions(-) - -diff --git a/src/disasm.cpp b/src/disasm.cpp -index 73b394b77d0b..25e7841bde85 100644 ---- a/src/disasm.cpp -+++ b/src/disasm.cpp -@@ -860,21 +860,21 @@ static void jl_dump_asm_internal( - std::unique_ptr MRI(TheTarget->createMCRegInfo(TheTriple.str())); - assert(MRI && "Unable to create target register info!"); - -- std::unique_ptr MOFI(new MCObjectFileInfo()); --#if JL_LLVM_VERSION >= 130000 -- MCSubtargetInfo *MSTI = TheTarget->createMCSubtargetInfo(TheTriple.str(), cpu, features); -- assert(MSTI && "Unable to create subtarget info!"); -+ std::unique_ptr STI( -+ TheTarget->createMCSubtargetInfo(TheTriple.str(), cpu, features)); -+ assert(STI && "Unable to create subtarget info!"); - -- MCContext Ctx(TheTriple, MAI.get(), MRI.get(), MSTI, &SrcMgr); -- MOFI->initMCObjectFileInfo(Ctx, /* PIC */ false, /* LargeCodeModel */ false); -+#if JL_LLVM_VERSION >= 130000 -+ MCContext Ctx(TheTriple, MAI.get(), MRI.get(), STI.get(), &SrcMgr); -+ std::unique_ptr MOFI( -+ TheTarget->createMCObjectFileInfo(Ctx, /*PIC=*/false, /*LargeCodeModel=*/ false)); -+ Ctx.setObjectFileInfo(MOFI.get()); - #else -+ std::unique_ptr MOFI(new MCObjectFileInfo()); - MCContext Ctx(MAI.get(), MRI.get(), MOFI.get(), &SrcMgr); - MOFI->InitMCObjectFileInfo(TheTriple, /* PIC */ false, Ctx); - #endif - -- // Set up Subtarget and Disassembler -- std::unique_ptr -- STI(TheTarget->createMCSubtargetInfo(TheTriple.str(), cpu, features)); - std::unique_ptr DisAsm(TheTarget->createMCDisassembler(*STI, Ctx)); - if (!DisAsm) { - rstream << "ERROR: no disassembler for target " << TheTriple.str(); diff --git a/dev-lang/julia/files/julia-1.7.0-make-install-no-build.patch b/dev-lang/julia/files/julia-1.7.0-make-install-no-build.patch deleted file mode 100644 index 0632a6e726f7..000000000000 --- a/dev-lang/julia/files/julia-1.7.0-make-install-no-build.patch +++ /dev/null @@ -1,17 +0,0 @@ -This pacth comes from - https://raw.githubusercontent.com/archlinux/svntogit-community/packages/julia/trunk/make-install-no-build.patch - ---- julia-1.3.0/Makefile.orig 2019-12-06 12:54:23.879790955 +0000 -+++ julia-1.3.0/Makefile 2019-12-06 12:54:36.329952953 +0000 -@@ -277,11 +277,6 @@ - - - install: $(build_depsbindir)/stringreplace $(BUILDROOT)/doc/_build/html/en/index.html --ifeq ($(BUNDLE_DEBUG_LIBS),1) -- @$(MAKE) $(QUIET_MAKE) all --else -- @$(MAKE) $(QUIET_MAKE) release --endif - @for subdir in $(bindir) $(datarootdir)/julia/stdlib/$(VERSDIR) $(docdir) $(man1dir) $(includedir)/julia $(libdir) $(private_libdir) $(sysconfdir) $(libexecdir); do \ - mkdir -p $(DESTDIR)$$subdir; \ - done diff --git a/dev-lang/julia/files/julia-1.7.1-do_not_set_rpath.patch b/dev-lang/julia/files/julia-1.7.1-do_not_set_rpath.patch new file mode 100644 index 000000000000..7b8c3c7ba51b --- /dev/null +++ b/dev-lang/julia/files/julia-1.7.1-do_not_set_rpath.patch @@ -0,0 +1,11 @@ +--- a/Makefile 2021-12-21 09:38:26.782829864 +0100 ++++ b/Makefile 2021-12-21 10:52:40.760565902 +0100 +@@ -365,7 +365,7 @@ + endif + + # Set rpath for LLVM.so which is `$ORIGIN/../lib` moving from `../lib` to `../lib/julia`. We only need to do this for Linux/FreeBSD +-ifneq (,$(findstring $(OS),Linux FreeBSD)) ++ifneq (,$(findstring $(OS),FreeBSD)) + $(PATCHELF) --set-rpath '$$ORIGIN:$$ORIGIN/$(reverse_private_libdir_rel)' $(DESTDIR)$(private_libdir)/libLLVM.$(SHLIB_EXT) + endif + diff --git a/dev-lang/julia/files/julia-1.7.1-hardcoded-libs.patch b/dev-lang/julia/files/julia-1.7.1-hardcoded-libs.patch new file mode 100644 index 000000000000..be7d20368f6d --- /dev/null +++ b/dev-lang/julia/files/julia-1.7.1-hardcoded-libs.patch @@ -0,0 +1,72 @@ +This pacth comes from: + https://raw.githubusercontent.com/archlinux/svntogit-community/packages/julia/trunk/julia-hardcoded-libs.patch + +diff --git a/stdlib/MbedTLS_jll/src/MbedTLS_jll.jl b/stdlib/MbedTLS_jll/src/MbedTLS_jll.jl +index a7ca666b23..b84a42f4e7 100644 +--- a/stdlib/MbedTLS_jll/src/MbedTLS_jll.jl ++++ b/stdlib/MbedTLS_jll/src/MbedTLS_jll.jl +@@ -31,9 +31,9 @@ elseif Sys.isapple() + const libmbedtls = "@rpath/libmbedtls.13.dylib" + const libmbedx509 = "@rpath/libmbedx509.1.dylib" + else +- const libmbedcrypto = "libmbedcrypto.so.5" +- const libmbedtls = "libmbedtls.so.13" +- const libmbedx509 = "libmbedx509.so.1" ++ const libmbedcrypto = "libmbedcrypto.so" ++ const libmbedtls = "libmbedtls.so" ++ const libmbedx509 = "libmbedx509.so" + end + + function __init__() +diff --git a/stdlib/libLLVM_jll/src/libLLVM_jll.jl b/stdlib/libLLVM_jll/src/libLLVM_jll.jl +index fa45e754e5..b51812e3a8 100644 +--- a/stdlib/libLLVM_jll/src/libLLVM_jll.jl ++++ b/stdlib/libLLVM_jll/src/libLLVM_jll.jl +@@ -23,7 +23,7 @@ if Sys.iswindows() + elseif Sys.isapple() + const libLLVM = "@rpath/libLLVM.dylib" + else +- const libLLVM = "libLLVM-12jl.so" ++ const libLLVM = "libLLVM.so" + end + + function __init__() +diff --git a/stdlib/nghttp2_jll/src/nghttp2_jll.jl b/stdlib/nghttp2_jll/src/nghttp2_jll.jl +index 8b98c76ac5..77ad9e3800 100644 +--- a/stdlib/nghttp2_jll/src/nghttp2_jll.jl ++++ b/stdlib/nghttp2_jll/src/nghttp2_jll.jl +@@ -22,7 +22,7 @@ if Sys.iswindows() + elseif Sys.isapple() + const libnghttp2 = "@rpath/libnghttp2.14.dylib" + else +- const libnghttp2 = "libnghttp2.so.14" ++ const libnghttp2 = "libnghttp2.so" + end + + function __init__() +diff --git a/stdlib/LibGit2_jll/src/LibGit2_jll.jl b/stdlib/LibGit2_jll/src/LibGit2_jll.jl +index f0d4b5dda6..2ed3017b51 100644 +--- a/stdlib/LibGit2_jll/src/LibGit2_jll.jl ++++ b/stdlib/LibGit2_jll/src/LibGit2_jll.jl +@@ -23,7 +23,7 @@ if Sys.iswindows() + elseif Sys.isapple() + const libgit2 = "@rpath/libgit2.1.1.dylib" + else +- const libgit2 = "libgit2.so.1.1" ++ const libgit2 = "libgit2.so" + end + + function __init__() +diff --git a/stdlib/OpenLibm_jll/src/OpenLibm_jll.jl b/stdlib/OpenLibm_jll/src/OpenLibm_jll.jl +index 215de8aed6..918d1ffdc2 100644 +--- a/stdlib/OpenLibm_jll/src/OpenLibm_jll.jl ++++ b/stdlib/OpenLibm_jll/src/OpenLibm_jll.jl +@@ -22,7 +22,7 @@ if Sys.iswindows() + elseif Sys.isapple() + const libopenlibm = "@rpath/libopenlibm.3.dylib" + else +- const libopenlibm = "libopenlibm.so.3" ++ const libopenlibm = "libopenlibm.so" + end + + function __init__() -- cgit v1.2.3