From 1dd558e05e23b21c3a566f516f33dca78151d4e5 Mon Sep 17 00:00:00 2001 From: Kristoffer Carlsson Date: Fri, 28 Nov 2025 21:05:22 +0100 Subject: [PATCH 01/10] bump Pkg to latest 1.13 --- .../Pkg-855b49be9441fd759817a5b6468c009d2e4d6c14.tar.gz/md5 | 1 + .../Pkg-855b49be9441fd759817a5b6468c009d2e4d6c14.tar.gz/sha512 | 1 + .../Pkg-d0be1daf22f15da346e83429b323a82554ef241c.tar.gz/md5 | 1 - .../Pkg-d0be1daf22f15da346e83429b323a82554ef241c.tar.gz/sha512 | 1 - stdlib/Pkg.version | 2 +- 5 files changed, 3 insertions(+), 3 deletions(-) create mode 100644 deps/checksums/Pkg-855b49be9441fd759817a5b6468c009d2e4d6c14.tar.gz/md5 create mode 100644 deps/checksums/Pkg-855b49be9441fd759817a5b6468c009d2e4d6c14.tar.gz/sha512 delete mode 100644 deps/checksums/Pkg-d0be1daf22f15da346e83429b323a82554ef241c.tar.gz/md5 delete mode 100644 deps/checksums/Pkg-d0be1daf22f15da346e83429b323a82554ef241c.tar.gz/sha512 diff --git a/deps/checksums/Pkg-855b49be9441fd759817a5b6468c009d2e4d6c14.tar.gz/md5 b/deps/checksums/Pkg-855b49be9441fd759817a5b6468c009d2e4d6c14.tar.gz/md5 new file mode 100644 index 0000000000000..876c6044e88d0 --- /dev/null +++ b/deps/checksums/Pkg-855b49be9441fd759817a5b6468c009d2e4d6c14.tar.gz/md5 @@ -0,0 +1 @@ +8dd3bf1fde5e4fc0bc63e48da80a3a7b diff --git a/deps/checksums/Pkg-855b49be9441fd759817a5b6468c009d2e4d6c14.tar.gz/sha512 b/deps/checksums/Pkg-855b49be9441fd759817a5b6468c009d2e4d6c14.tar.gz/sha512 new file mode 100644 index 0000000000000..4fa758f646277 --- /dev/null +++ b/deps/checksums/Pkg-855b49be9441fd759817a5b6468c009d2e4d6c14.tar.gz/sha512 @@ -0,0 +1 @@ +849e0c89e8a7fcc2ae06e935cfac85998cbeedb6df7ca7e6332c51e56c16a1348d0ec186368221876ccfec550bf89dc1e021a5d7731c1282da2c62c26584aae8 diff --git a/deps/checksums/Pkg-d0be1daf22f15da346e83429b323a82554ef241c.tar.gz/md5 b/deps/checksums/Pkg-d0be1daf22f15da346e83429b323a82554ef241c.tar.gz/md5 deleted file mode 100644 index 51c075ed23ea1..0000000000000 --- a/deps/checksums/Pkg-d0be1daf22f15da346e83429b323a82554ef241c.tar.gz/md5 +++ /dev/null @@ -1 +0,0 @@ -c98454356432e070a718a4b840f8619f diff --git a/deps/checksums/Pkg-d0be1daf22f15da346e83429b323a82554ef241c.tar.gz/sha512 b/deps/checksums/Pkg-d0be1daf22f15da346e83429b323a82554ef241c.tar.gz/sha512 deleted file mode 100644 index 302306e0f43ad..0000000000000 --- a/deps/checksums/Pkg-d0be1daf22f15da346e83429b323a82554ef241c.tar.gz/sha512 +++ /dev/null @@ -1 +0,0 @@ -21fb5ed78bde81a7d2cf9bfe77a2bd52b5e792505cc2c55564366e5283af66f5cf60baf8b0cbb89b690bf424669c6b71220484eee4d65832d27ebe10a0334bb2 diff --git a/stdlib/Pkg.version b/stdlib/Pkg.version index eecee7a5cb6f2..ba9ce8d97e1fc 100644 --- a/stdlib/Pkg.version +++ b/stdlib/Pkg.version @@ -1,4 +1,4 @@ PKG_BRANCH = release-1.13 -PKG_SHA1 = d0be1daf22f15da346e83429b323a82554ef241c +PKG_SHA1 = 855b49be9441fd759817a5b6468c009d2e4d6c14 PKG_GIT_URL := https://github.com/JuliaLang/Pkg.jl.git PKG_TAR_URL = https://api.github.com/repos/JuliaLang/Pkg.jl/tarball/$1 From c422981c5f9065b79765c3895af3608e53ed9ba8 Mon Sep 17 00:00:00 2001 From: Kristoffer Carlsson Date: Mon, 10 Nov 2025 22:32:35 +0100 Subject: [PATCH 02/10] allow finding stdlibs that are normal packages in the manifest but are now stdlibs (#60061) This helps handling manifest from earlier julia versions. This is kind of the `locate` version of the `identify` fallback in https://github.com/JuliaLang/julia/pull/56148. Need to write a test when this happens (and verify that this fix works). Noted in a slack #gripes comment. --------- Co-authored-by: KristofferC Co-authored-by: Max Horn (cherry picked from commit 6fddac850a00441cc5d3833cc3c441132cd49a5f) --- base/loading.jl | 3 ++ test/loading.jl | 11 +++- .../project/deps/BadStdlibDeps2/Manifest.toml | 54 +++++++++++++++++++ test/project/deps/BadStdlibDeps2/Project.toml | 2 + 4 files changed, 69 insertions(+), 1 deletion(-) create mode 100644 test/project/deps/BadStdlibDeps2/Manifest.toml create mode 100644 test/project/deps/BadStdlibDeps2/Project.toml diff --git a/base/loading.jl b/base/loading.jl index 7dfa1e8b1492e..7c44b68f57413 100644 --- a/base/loading.jl +++ b/base/loading.jl @@ -470,6 +470,8 @@ function locate_package_env(pkg::PkgId, stopenv::Union{String, Nothing}=nothing) path = manifest_uuid_path(env, pkg) # missing is used as a sentinel to stop looking further down in envs if path === missing + # Before stopping, try stdlib fallback + is_stdlib(pkg) && @goto stdlib_fallback path = nothing @goto done end @@ -481,6 +483,7 @@ function locate_package_env(pkg::PkgId, stopenv::Union{String, Nothing}=nothing) stopenv == env && break end end + @label stdlib_fallback # Allow loading of stdlibs if the name/uuid are given # e.g. if they have been explicitly added to the project/manifest mbypath = manifest_uuid_path(Sys.STDLIB, pkg) diff --git a/test/loading.jl b/test/loading.jl index d13bc4ea648f1..4a616f8992375 100644 --- a/test/loading.jl +++ b/test/loading.jl @@ -1536,12 +1536,21 @@ end mktempdir() do depot # This manifest has a LibGit2 entry that is missing LibGit2_jll, which should be # handled by falling back to the stdlib Project.toml for dependency truth. - badmanifest_test_dir = joinpath(@__DIR__, "project", "deps", "BadStdlibDeps.jl") + badmanifest_test_dir = joinpath(@__DIR__, "project", "deps", "BadStdlibDeps") @test success(addenv( `$(Base.julia_cmd()) --project=$badmanifest_test_dir --startup-file=no -e 'using LibGit2'`, "JULIA_DEPOT_PATH" => depot * Base.Filesystem.pathsep(), )) end + mktempdir() do depot + # This manifest has a LibGit2 entry that has a LibGit2_jll with a git-tree-hash1 + # which simulates an old manifest where LibGit2_jll was not a stdlib + badmanifest_test_dir2 = joinpath(@__DIR__, "project", "deps", "BadStdlibDeps2") + @test success(addenv( + `$(Base.julia_cmd()) --project=$badmanifest_test_dir2 --startup-file=no -e 'using LibGit2'`, + "JULIA_DEPOT_PATH" => depot * Base.Filesystem.pathsep(), + )) + end end @testset "code coverage disabled during precompilation" begin diff --git a/test/project/deps/BadStdlibDeps2/Manifest.toml b/test/project/deps/BadStdlibDeps2/Manifest.toml new file mode 100644 index 0000000000000..988efc8da56f3 --- /dev/null +++ b/test/project/deps/BadStdlibDeps2/Manifest.toml @@ -0,0 +1,54 @@ +# This file is machine-generated - editing it directly is not advised + +julia_version = "1.12.0-DEV" +manifest_format = "2.0" +project_hash = "dc9d33b0ee13d9466bdb75b8d375808a534a79ec" + +[[deps.Artifacts]] +uuid = "56f22d72-fd6d-98f1-02f0-08ddc0907c33" +version = "1.11.0" + +[[deps.LibGit2]] +deps = ["NetworkOptions", "Printf", "SHA", "LibGit2_jll"] +uuid = "76f85450-5226-5b5a-8eaa-529ad045b433" +version = "1.11.0" + +# This is an stdlib but intentionally has a git-tree-sha1 because +# we are emulating that the manifest comes from a version where +# LibGit2_jll was not an stdlib +[[deps.LibGit2_jll]] +deps = ["Artifacts", "LibSSH2_jll", "Libdl", "MbedTLS_jll"] +git-tree-sha1 = "1111111111111111111111111111111111111111" +uuid = "e37daf67-58a4-590a-8e99-b0245dd2ffc5" +version = "1.8.0+0" + +[[deps.LibSSH2_jll]] +deps = ["Artifacts", "Libdl", "MbedTLS_jll"] +uuid = "29816b5a-b9ab-546f-933c-edad1886dfa8" +version = "1.11.0+1" + +[[deps.Libdl]] +uuid = "8f399da3-3557-5675-b5ff-fb832c97cbdb" +version = "1.11.0" + +[[deps.MbedTLS_jll]] +deps = ["Artifacts", "Libdl"] +uuid = "c8ffd9c3-330d-5841-b78e-0817d7145fa1" +version = "2.28.6+1" + +[[deps.NetworkOptions]] +uuid = "ca575930-c2e3-43a9-ace4-1e988b2c1908" +version = "1.2.0" + +[[deps.Printf]] +deps = ["Unicode"] +uuid = "de0858da-6303-5e67-8744-51eddeeeb8d7" +version = "1.11.0" + +[[deps.SHA]] +uuid = "ea8e919c-243c-51af-8825-aaa63cd721ce" +version = "0.7.0" + +[[deps.Unicode]] +uuid = "4ec0a83e-493e-50e2-b9ac-8f72acf5a8f5" +version = "1.11.0" diff --git a/test/project/deps/BadStdlibDeps2/Project.toml b/test/project/deps/BadStdlibDeps2/Project.toml new file mode 100644 index 0000000000000..223889185ea15 --- /dev/null +++ b/test/project/deps/BadStdlibDeps2/Project.toml @@ -0,0 +1,2 @@ +[deps] +LibGit2 = "76f85450-5226-5b5a-8eaa-529ad045b433" From 663640cc16a530397cf522f93abe02d9ec2ec5ab Mon Sep 17 00:00:00 2001 From: deroulers Date: Thu, 13 Nov 2025 17:56:33 +0100 Subject: [PATCH 03/10] Remove precompile-time tempfiles from TEMP_CLEANUP (#60106) When starting julia, `Base.Filesystem.TEMP_CLEANUP` should be empty, but is being left with these two files. The proposed fix is to set up temporary files created by function `generate_precompile_statements` in `contrib/generate_precompile.jl` to have no automatic cleanup. This won't do harm since they will be removed by the cleanup of the temporary directory created by the call to `mktempdir` in function `generate_precompile_statements` (see the call `rm(tmpdir, recursive=true)` in `base/file.jl`). These should be removed by the atexit hook, but we didn't run `Base.__init__` or `Base.Filesystem.__postinit__` hooks to re-register this cleanup handler in the sys.so generation process (only in sysbase.so). To test this issue, one can do: `$ mkdir $TMPDIR/JuliaBuild` `$ OLDTMPDIR=$TMPDIR` `$ export TMPDIR=$TMPDIR/JuliaBuild` `$ cd ` `$ ` `$ strings usr/lib/julia/sys.dylib|less # shows that the temp. dir. JuliaBuild is hardcoded in the binaries` `$ TMPDIR=$OLDTMPDIR` `$ chmod u-x $TMPDIR/JuliaBuild` `$ # should try to use $TMPDIR/JuliaBuild which is now inaccessible` Without the fix, the last step triggers the infinite loop of ``Failed to clean up temporary path''. With the fix, one can see that the binaries (`usr/lib/julia/sys.dylib`) do not contain the temp. dir. anymore, and the infinite loop of errors is not triggered. Or simply by observing that `./julia -E 'Base.Filesystem.TEMP_CLEANUP'` is not empty. Fix #60078 (cherry picked from commit 1eea4b63334013aa1f2347b45c1a0772f108bdb0) --- contrib/generate_precompile.jl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/contrib/generate_precompile.jl b/contrib/generate_precompile.jl index 293d82334719b..eae2fba8308d3 100644 --- a/contrib/generate_precompile.jl +++ b/contrib/generate_precompile.jl @@ -348,8 +348,8 @@ generate_precompile_statements() = try # Make sure `ansi_enablecursor` is printe uuid = "$pkguuid" """) touch(joinpath(pkgpath, "Manifest.toml")) - tmp_prec = tempname(prec_path) - tmp_proc = tempname(prec_path) + tmp_prec = tempname(prec_path; cleanup=false) + tmp_proc = tempname(prec_path; cleanup=false) s = """ pushfirst!(DEPOT_PATH, $(repr(joinpath(prec_path,"depot")))); Base.PRECOMPILE_TRACE_COMPILE[] = $(repr(tmp_prec)); From 3d7be5a01badbd19fde3521db789da814e194f19 Mon Sep 17 00:00:00 2001 From: Kristoffer Carlsson Date: Wed, 19 Nov 2025 12:33:08 +0100 Subject: [PATCH 04/10] allow finding stdlibs that are normal packages in the manifest but are now stdlibs (#60104) (cherry picked from commit 3c647006b1743253f4d3a6d015abd62213ee79f5) --- test/loading.jl | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/test/loading.jl b/test/loading.jl index 4a616f8992375..4baf979cf128a 100644 --- a/test/loading.jl +++ b/test/loading.jl @@ -1533,13 +1533,23 @@ end end @testset "Fallback for stdlib deps if manifest deps aren't found" begin + s = Sys.iswindows() ? ';' : ':' mktempdir() do depot # This manifest has a LibGit2 entry that is missing LibGit2_jll, which should be # handled by falling back to the stdlib Project.toml for dependency truth. badmanifest_test_dir = joinpath(@__DIR__, "project", "deps", "BadStdlibDeps") @test success(addenv( `$(Base.julia_cmd()) --project=$badmanifest_test_dir --startup-file=no -e 'using LibGit2'`, - "JULIA_DEPOT_PATH" => depot * Base.Filesystem.pathsep(), + "JULIA_DEPOT_PATH" => string(depot * Base.Filesystem.pathsep(), s), + )) + end + mktempdir() do depot + # This manifest has a LibGit2 entry that has a LibGit2_jll with a git-tree-hash1 + # which simulates an old manifest where LibGit2_jll was not a stdlib + badmanifest_test_dir2 = joinpath(@__DIR__, "project", "deps", "BadStdlibDeps2") + @test success(addenv( + `$(Base.julia_cmd()) --project=$badmanifest_test_dir2 --startup-file=no -e 'using LibGit2'`, + "JULIA_DEPOT_PATH" => string(depot * Base.Filesystem.pathsep(), s), )) end mktempdir() do depot From 158029b09b6a87e6c87cd0a432960dcb3162f5f0 Mon Sep 17 00:00:00 2001 From: Cody Tapscott <84105208+topolarity@users.noreply.github.com> Date: Wed, 19 Nov 2025 15:17:52 -0500 Subject: [PATCH 05/10] Add uninitialized multi-versioning trampoline for autoinit support (#60171) This adds a single-use autoinit trampoline for multiversioning-aliased functions. "First call" sequence: trampoline -> autoinit trampoline -> arch-specific call Subsequent calls: trampoline -> arch-specific call (cherry picked from commit b1afe0366246bb85854e1069dad96de09178771c) --- src/llvm-multiversioning.cpp | 98 ++++++++++++------- test/llvmpasses/multiversioning-clone-only.ll | 20 +++- test/llvmpasses/multiversioning-x86.ll | 2 +- 3 files changed, 80 insertions(+), 40 deletions(-) diff --git a/src/llvm-multiversioning.cpp b/src/llvm-multiversioning.cpp index e9276526ef263..5387ae1ed93ba 100644 --- a/src/llvm-multiversioning.cpp +++ b/src/llvm-multiversioning.cpp @@ -378,6 +378,8 @@ struct CloneCtx { void clone_partial(Group &grp, Target &tgt); uint32_t get_func_id(Function *F) const; std::pair get_reloc_slot(Function *F) const; + + Function *create_trampoline(Function *F, GlobalVariable *slot, bool autoinit=false); void rewrite_alias(GlobalAlias *alias, Function* F); MDNode *tbaa_const; @@ -493,6 +495,53 @@ void CloneCtx::prepare_vmap(ValueToValueMapTy &vmap) } } +Function *CloneCtx::create_trampoline(Function *F, GlobalVariable *slot, bool autoinit) +{ + Function *trampoline = + Function::Create(F->getFunctionType(), GlobalValue::ExternalLinkage, "", &M); + + trampoline->copyAttributesFrom(F); + trampoline->setVisibility(GlobalValue::HiddenVisibility); + trampoline->setDSOLocal(true); + + // drop multiversioning attributes + trampoline->removeFnAttr("julia.mv.reloc"); + trampoline->removeFnAttr("julia.mv.clones"); + + auto BB = BasicBlock::Create(F->getContext(), "top", trampoline); + IRBuilder<> irbuilder(BB); + + if (autoinit) { + irbuilder.CreateCall(F->getParent()->getOrInsertFunction( + XSTR(jl_autoinit_and_adopt_thread), + PointerType::get(F->getContext(), 0) + )); + } + + auto ptr = irbuilder.CreateLoad(F->getType(), slot); + ptr->setMetadata(llvm::LLVMContext::MD_tbaa, tbaa_const); + ptr->setMetadata(llvm::LLVMContext::MD_invariant_load, MDNode::get(F->getContext(), None)); + + SmallVector Args; + for (auto &arg : trampoline->args()) + Args.push_back(&arg); + auto call = irbuilder.CreateCall(F->getFunctionType(), ptr, ArrayRef(Args)); + if (F->isVarArg()) { + assert(!TT.isARM() && !TT.isPPC() && "musttail not supported on ARM/PPC!"); + call->setTailCallKind(CallInst::TCK_MustTail); + } else { + call->setTailCallKind(CallInst::TCK_Tail); + + } + + if (F->getReturnType() == Type::getVoidTy(F->getContext())) + irbuilder.CreateRetVoid(); + else + irbuilder.CreateRet(call); + + return trampoline; +} + void CloneCtx::prepare_slots() { for (auto &F : orig_funcs) { @@ -507,7 +556,12 @@ void CloneCtx::prepare_slots() else { auto id = get_func_id(F); const_relocs[id] = GV; - GV->setInitializer(Constant::getNullValue(F->getType())); + + // Initialize with a single-use trampoline that calls `jl_autoinit_and_adopt_thread`, + // so that auto-initialization works with multi-versioned entrypoints. + Function *trampoline = create_trampoline(F, GV, /* autoinit */ true); + trampoline->setName(F->getName() + ".autoinit_trampoline"); + GV->setInitializer(trampoline); } } } @@ -665,45 +719,21 @@ void CloneCtx::rewrite_alias(GlobalAlias *alias, Function *F) { assert(!is_vector(F->getFunctionType())); - Function *trampoline = - Function::Create(F->getFunctionType(), alias->getLinkage(), "", &M); - trampoline->copyAttributesFrom(F); - trampoline->takeName(alias); - trampoline->setVisibility(alias->getVisibility()); - trampoline->setDSOLocal(alias->isDSOLocal()); - // drop multiversioning attributes, add alias attribute for testing purposes - trampoline->removeFnAttr("julia.mv.reloc"); - trampoline->removeFnAttr("julia.mv.clones"); - trampoline->addFnAttr("julia.mv.alias"); - trampoline->setDLLStorageClass(alias->getDLLStorageClass()); - alias->eraseFromParent(); - uint32_t id; GlobalVariable *slot; std::tie(id, slot) = get_reloc_slot(F); + assert(slot); - auto BB = BasicBlock::Create(F->getContext(), "top", trampoline); - IRBuilder<> irbuilder(BB); + Function *trampoline = create_trampoline(F, slot, /* autoinit */ false); + trampoline->addFnAttr("julia.mv.alias"); // add alias attribute for testing purposes - auto ptr = irbuilder.CreateLoad(F->getType(), slot); - ptr->setMetadata(llvm::LLVMContext::MD_tbaa, tbaa_const); - ptr->setMetadata(llvm::LLVMContext::MD_invariant_load, MDNode::get(F->getContext(), None)); - - SmallVector Args; - for (auto &arg : trampoline->args()) - Args.push_back(&arg); - auto call = irbuilder.CreateCall(F->getFunctionType(), ptr, ArrayRef(Args)); - if (F->isVarArg()) { - assert(!TT.isARM() && !TT.isPPC() && "musttail not supported on ARM/PPC!"); - call->setTailCallKind(CallInst::TCK_MustTail); - } else { - call->setTailCallKind(CallInst::TCK_Tail); - } + trampoline->takeName(alias); + trampoline->setLinkage(alias->getLinkage()); + trampoline->setVisibility(alias->getVisibility()); + trampoline->setDSOLocal(alias->isDSOLocal()); + trampoline->setDLLStorageClass(alias->getDLLStorageClass()); - if (F->getReturnType() == Type::getVoidTy(F->getContext())) - irbuilder.CreateRetVoid(); - else - irbuilder.CreateRet(call); + alias->eraseFromParent(); } void CloneCtx::fix_gv_uses() diff --git a/test/llvmpasses/multiversioning-clone-only.ll b/test/llvmpasses/multiversioning-clone-only.ll index 00f0db0aa1e91..c4f5257a59988 100644 --- a/test/llvmpasses/multiversioning-clone-only.ll +++ b/test/llvmpasses/multiversioning-clone-only.ll @@ -7,7 +7,7 @@ ; CHECK: @jl_fvar_idxs = hidden constant [1 x i32] zeroinitializer ; CHECK: @jl_gvar_idxs = hidden constant [0 x i32] zeroinitializer ; OPAQUE: @subtarget_cloned_gv = hidden global ptr null -; OPAQUE: @subtarget_cloned.reloc_slot = hidden global ptr null +; OPAQUE: @subtarget_cloned.reloc_slot = hidden global ptr @subtarget_cloned.autoinit_trampoline ; CHECK: @jl_fvar_count = hidden constant i64 1 ; OPAQUE: @jl_fvar_ptrs = hidden global [1 x ptr] [ptr @subtarget_cloned] ; CHECK: @jl_clone_slots = hidden constant [5 x i32] @@ -57,7 +57,7 @@ define noundef i32 @subtarget_cloned(i32 noundef %0) #2 { ; COM: should fixup this callsite since 2 is cloned for a subtarget ; CHECK: define{{.*}}@call_subtarget_cloned({{.*}}#[[CALL_SUBTARGET_CLONED_DEFAULT_ATTRS:[0-9]+]] ; CHECK-NEXT: [[FUNC_PTR:%[0-9]+]] = load{{.*}}@subtarget_cloned.reloc_slot{{.*}}!tbaa ![[TBAA_CONST_METADATA:[0-9]+]], !invariant.load -; CHECK-NEXT: call{{.*}}[[FUNC_PTR]] +; CHECK-NEXT: call{{.*}}[[FUNC_PTR]]({{.*}}) ; CHECK: ret i32 define noundef i32 @call_subtarget_cloned(i32 noundef %0) #3 { %2 = call noundef i32 @subtarget_cloned(i32 noundef %0) @@ -66,13 +66,23 @@ define noundef i32 @call_subtarget_cloned(i32 noundef %0) #3 { ; CHECK: define{{.*}}@call_subtarget_cloned_but_not_cloned({{.*}}#[[BORING_DEFAULT_ATTRS]] ; CHECK-NEXT: [[FUNC_PTR:%[0-9]+]] = load{{.*}}@subtarget_cloned.reloc_slot{{.*}}!tbaa ![[TBAA_CONST_METADATA]], !invariant.load -; CHECK-NEXT: call{{.*}}[[FUNC_PTR]] +; CHECK-NEXT: call{{.*}}[[FUNC_PTR]]({{.*}}) ; CHECK: ret i32 define noundef i32 @call_subtarget_cloned_but_not_cloned(i32 noundef %0) #0 { %2 = call noundef i32 @subtarget_cloned(i32 noundef %0) ret i32 %2 } +; COM: check that the autoinit trampoline is generated correctly +; CHECK: define{{.*}}@subtarget_cloned.autoinit_trampoline({{.*}} +; CHECK-NEXT: top: +; CHECK-NEXT: call ptr @ijl_autoinit_and_adopt_thread() +; CHECK-NEXT: [[FUNC_PTR:%[0-9]+]] = load ptr, ptr @subtarget_cloned.reloc_slot{{.*}}!tbaa ![[TBAA_CONST_METADATA]], !invariant.load +; CHECK-NEXT: call{{.*}}[[FUNC_PTR]]({{.*}}) +; CHECK: ret i32 + +declare ptr @ijl_autoinit_and_adopt_thread() + ; CHECK: define{{.*}}@boring.1({{.*}}#[[BORING_CLONEALL_ATTRS:[0-9]+]] ; CHECK-NEXT: ret i32 %0 @@ -106,10 +116,10 @@ define noundef i32 @call_subtarget_cloned_but_not_cloned(i32 noundef %0) #0 { ; CHECK-NOT: @subtarget_cloned_but_not_cloned.2 ; COM: check for alias being rewritten to a function trampoline -; CHECK: define{{.*}}@subtarget_cloned_aliased{{.*}}#[[SUBTARGET_ALIASED_ATTRS:[0-9]+]] +; CHECK: define{{.*}}@subtarget_cloned_aliased{{[^.]*}}#[[SUBTARGET_ALIASED_ATTRS:[0-9]+]] ; CHECK-NOT: } ; CHECK: [[FUNC_PTR:%[0-9]+]] = load{{.*}}@subtarget_cloned.reloc_slot{{.*}}!tbaa ![[TBAA_CONST_METADATA]], !invariant.load -; CHECK-NEXT: call{{.*}}[[FUNC_PTR]] +; CHECK-NEXT: call{{.*}}[[FUNC_PTR]]({{.*}}) ; CHECK: ret i32 ; CHECK: attributes #[[BORING_DEFAULT_ATTRS]] diff --git a/test/llvmpasses/multiversioning-x86.ll b/test/llvmpasses/multiversioning-x86.ll index ff4a8abba5252..e2918d0c20eec 100644 --- a/test/llvmpasses/multiversioning-x86.ll +++ b/test/llvmpasses/multiversioning-x86.ll @@ -11,7 +11,7 @@ ; OPAQUE: @jl_gvar_ptrs = global [0 x ptr] zeroinitializer, align 8 ; CHECK: @jl_fvar_idxs = hidden constant [5 x i32] [i32 0, i32 1, i32 2, i32 3, i32 4], align 8 ; CHECK: @jl_gvar_idxs = hidden constant [0 x i32] zeroinitializer, align 8 -; OPAQUE: @simd_test.reloc_slot = hidden global ptr null +; OPAQUE: @simd_test.reloc_slot = hidden global ptr @simd_test.autoinit_trampoline ; OPAQUE: @jl_fvar_ptrs = hidden global [5 x ptr] [ptr @boring, ptr @fastmath_test, ptr @loop_test, ptr @simd_test, ptr @simd_test_call] ; OPAQUE: @jl_clone_slots = hidden constant [3 x i32] [i32 1, i32 3, i32 trunc (i64 sub (i64 ptrtoint (ptr @simd_test.reloc_slot to i64), i64 ptrtoint (ptr @jl_clone_slots to i64)) to i32)] ; CHECK: @jl_clone_idxs = hidden constant [10 x i32] [i32 -2147483647, i32 3, i32 -2147483647, i32 3, i32 4, i32 1, i32 1, i32 2, i32 -2147483645, i32 4] From 7c03272e55b320fb59c5442574184c3008b805fb Mon Sep 17 00:00:00 2001 From: Max Horn Date: Fri, 21 Nov 2025 12:09:20 +0100 Subject: [PATCH 06/10] Better order for stdlibs in the Julia manual navbar (#60155) Resolves #50351 albeit with a bit of a hack. I deliberately left "The Julia REPL" alone (so it is still sorted under "REPL") as that felt more natural to me compared to sorting it under "Julia" but obviously this could easily be changed as well. (cherry picked from commit 9af9b15844705c0d82fcf3ba4878e5e0e2983982) --- doc/make.jl | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/doc/make.jl b/doc/make.jl index 9a2c2146b3d1b..ef9548c22a1ed 100644 --- a/doc/make.jl +++ b/doc/make.jl @@ -228,6 +228,15 @@ BaseDocs = [ StdlibDocs = [stdlib.targetfile for stdlib in STDLIB_DOCS] +# HACK: get nicer sorting here, even though we don't have the header +# of the .md files at hand. +sort!(StdlibDocs, by=function(x) + x = replace(x, "stdlib/" => "") + startswith(x, "Libdl") && return lowercase("Dynamic Linker") + startswith(x, "Test") && return lowercase("Unit Testing") + return lowercase(x) +end) + DevDocs = [ "Documentation of Julia's Internals" => [ "devdocs/init.md", From 833b4d7d828452d8883f45d9f97db81b38ee5853 Mon Sep 17 00:00:00 2001 From: Max Horn Date: Mon, 24 Nov 2025 18:10:08 +0100 Subject: [PATCH 07/10] Bump Documenter to 1.16.1 (#60215) (cherry picked from commit ae42e5fe078e5da4148126d203d091fe5d1d5b78) --- deps/jlutilities/documenter/Manifest.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/deps/jlutilities/documenter/Manifest.toml b/deps/jlutilities/documenter/Manifest.toml index b13b4b48880a4..c52fbb709b087 100644 --- a/deps/jlutilities/documenter/Manifest.toml +++ b/deps/jlutilities/documenter/Manifest.toml @@ -146,7 +146,7 @@ version = "1.0.0" [[deps.LibCURL_jll]] deps = ["Artifacts", "CompilerSupportLibraries_jll", "LibSSH2_jll", "Libdl", "OpenSSL_jll", "Zlib_jll", "Zstd_jll", "nghttp2_jll"] uuid = "deac9b47-8bc7-5906-a0fe-35ac56dc84c0" -version = "8.16.0+0" +version = "8.17.0+0" [[deps.LibGit2]] deps = ["LibGit2_jll", "NetworkOptions", "Printf", "SHA"] From 7146fc35418cb04dfe805412daafc3aba0dbf0b8 Mon Sep 17 00:00:00 2001 From: "Viral B. Shah" Date: Tue, 25 Nov 2025 04:29:42 -0500 Subject: [PATCH 08/10] Remove list of stdlibs on the intro page (#60219) Fix #59786 Many of these links do not even exist and are broken. But even then, it is simply not the right place for such deep dive content. Co-authored-by: Viral B. Shah (cherry picked from commit 6d6224db9959791b05772072426bfcb7614ea0ce) --- doc/src/index.md | 54 +++++++----------------------------------------- 1 file changed, 8 insertions(+), 46 deletions(-) diff --git a/doc/src/index.md b/doc/src/index.md index 7d781f25b4235..dea0c11dc1c8b 100644 --- a/doc/src/index.md +++ b/doc/src/index.md @@ -32,18 +32,6 @@ Markdown.parse(""" """) ``` -## [Important Links](@id man-important-links) - -Below is a non-exhaustive list of links that will be useful as you learn and use the Julia programming language. - -- [Julia Homepage](https://julialang.org) -- [Install Julia](https://julialang.org/install/) -- [Discussion forum](https://discourse.julialang.org) -- [Julia YouTube](https://www.youtube.com/user/JuliaLanguage) -- [Find Julia Packages](https://julialang.org/packages/) -- [Learning Resources](https://julialang.org/learning/) -- [Read and write blogs on Julia](https://forem.julialang.org) - ## [Introduction](@id man-introduction) Scientific computing has traditionally required the highest performance, yet domain experts have @@ -127,39 +115,13 @@ language. In addition to the above, some advantages of Julia over comparable sys * Powerful shell-like capabilities for managing other processes * Lisp-like macros and other metaprogramming facilities -## [Julia Standard Modules and the Standard Library](@id man-standard-modules-stdlib) - -The Julia runtime comes with [standard modules](@ref standard-modules), -which are essential namespaces that are usually loaded automatically. - -```@docs; canonical=false -Core -Base -``` - -Julia's `Base` module contains various [useful submodules](@ref base-submodules). - -### [The Standard Library](@id man-stdlib) - -The Julia standard library contains additional, commonly used packages that are installed alongside the Julia runtime by default. -To use a standard library package, it is first necessary to load the package with a [`using`](@ref) or [`import`](@ref) statement. -Links to available standard library packages are provided below, -and may also be found in the website sidebar. -Their source code is available in the `Sys.STDLIB` directory of a Julia installation. - -```@eval -import Markdown -list = sort(filter(x -> match(r"_jll$", x) === nothing, readdir(Sys.STDLIB))) -Markdown.parse(join("- [`" .* list .* "`](stdlib/" .* list .* ".html)", "\n")) -``` +## [Important Links](@id man-important-links) -Julia also provides various standard, pre-built binary libraries -of established software that is written in other languages. -By convention, these packages have names that end with `_jll`. -The [`using`](@ref) statement can load symbol names from these binary libraries: +A non-exhaustive list of links that will be useful as you learn and use the Julia programming language: -```@eval -import Markdown -list = sort(filter(x -> match(r"_jll$", x) !== nothing, readdir(Sys.STDLIB))) -Markdown.parse(join("- [`" .* list .* "`](stdlib/" .* list .* ".html)", "\n")) -``` +- [Julia Homepage](https://julialang.org) +- [Install Julia](https://julialang.org/install/) +- [Discussion forum](https://discourse.julialang.org) +- [Julia YouTube](https://www.youtube.com/user/JuliaLanguage) +- [Find Julia Packages](https://julialang.org/packages/) +- [Learning Resources](https://julialang.org/learning/) From 53d2c5b7dce8214ca93fe7779ef840cfcea029ee Mon Sep 17 00:00:00 2001 From: Keno Fischer Date: Tue, 25 Nov 2025 03:25:36 -0500 Subject: [PATCH 09/10] Use jlutilities mechanism for external package required in test (#60232) (cherry picked from commit 4394713d0267791505154db570a19478c3039a33) --- .../extras/CompilerDevTools/test/testpkg.jl | 1 - JuliaLowering/Manifest.toml | 16 +++++++ deps/jlutilities/objectfile/Manifest.toml | 28 +++++++++++ deps/jlutilities/objectfile/Project.toml | 2 + test/runtests.jl | 1 + test/stdlib_dependencies.jl | 47 ++++++++++++------- 6 files changed, 78 insertions(+), 17 deletions(-) create mode 100644 JuliaLowering/Manifest.toml create mode 100644 deps/jlutilities/objectfile/Manifest.toml create mode 100644 deps/jlutilities/objectfile/Project.toml diff --git a/Compiler/extras/CompilerDevTools/test/testpkg.jl b/Compiler/extras/CompilerDevTools/test/testpkg.jl index b31459219c8dd..f658a48862d2c 100644 --- a/Compiler/extras/CompilerDevTools/test/testpkg.jl +++ b/Compiler/extras/CompilerDevTools/test/testpkg.jl @@ -1,6 +1,5 @@ using Pkg Pkg.activate(dirname(@__DIR__)) do - Pkg.instantiate() include("runtests.jl") end diff --git a/JuliaLowering/Manifest.toml b/JuliaLowering/Manifest.toml new file mode 100644 index 0000000000000..1a5f6860b185c --- /dev/null +++ b/JuliaLowering/Manifest.toml @@ -0,0 +1,16 @@ +# This file is machine-generated - editing it directly is not advised + +julia_version = "1.14.0-DEV" +manifest_format = "2.1" +project_hash = "16f6f8d58c46fe20d68a941bfaddb4590471548a" + +[[deps.JuliaLowering]] +deps = ["JuliaSyntax"] +path = "." +uuid = "f3c80556-a63f-4383-b822-37d64f81a311" +version = "1.0.0-DEV" + +[[deps.JuliaSyntax]] +path = "../JuliaSyntax" +uuid = "70703baa-626e-46a2-a12c-08ffd08c73b4" +version = "2.0.0-DEV" diff --git a/deps/jlutilities/objectfile/Manifest.toml b/deps/jlutilities/objectfile/Manifest.toml new file mode 100644 index 0000000000000..5b1d6d29db365 --- /dev/null +++ b/deps/jlutilities/objectfile/Manifest.toml @@ -0,0 +1,28 @@ +# This file is machine-generated - editing it directly is not advised + +julia_version = "1.14.0-DEV" +manifest_format = "2.1" +project_hash = "23b8253b8eadb7ba5d7489bb56f38819b7150654" + +[[deps.ObjectFile]] +deps = ["Reexport", "StructIO"] +git-tree-sha1 = "22faba70c22d2f03e60fbc61da99c4ebfc3eb9ba" +registries = "General" +uuid = "d8793406-e978-5875-9003-1fc021f44a92" +version = "0.5.0" + +[[deps.Reexport]] +git-tree-sha1 = "45e428421666073eab6f2da5c9d310d99bb12f9b" +registries = "General" +uuid = "189a3867-3050-52da-a836-e630ba90ab69" +version = "1.2.2" + +[[deps.StructIO]] +git-tree-sha1 = "c581be48ae1cbf83e899b14c07a807e1787512cc" +registries = "General" +uuid = "53d494c1-5632-5724-8f4c-31dff12d585f" +version = "0.3.1" + +[registries.General] +url = "https://github.com/JuliaRegistries/General.git" +uuid = "23338594-aafe-5451-b93e-139f81909106" diff --git a/deps/jlutilities/objectfile/Project.toml b/deps/jlutilities/objectfile/Project.toml new file mode 100644 index 0000000000000..acdde4be0965e --- /dev/null +++ b/deps/jlutilities/objectfile/Project.toml @@ -0,0 +1,2 @@ +[deps] +ObjectFile = "d8793406-e978-5875-9003-1fc021f44a92" diff --git a/test/runtests.jl b/test/runtests.jl index b7e35e6e14662..4c847884939ac 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -28,6 +28,7 @@ end const rmwait_timeout = running_under_rr() ? 300 : 30 +ENV["JULIA_TEST_BUILDROOT"] = buildroot if use_revise # First put this at the top of the DEPOT PATH to install revise if necessary. # Once it's loaded, we swizzle it to the end, to avoid confusing any tests. diff --git a/test/stdlib_dependencies.jl b/test/stdlib_dependencies.jl index 7e24834b8c442..f034c650c75a0 100644 --- a/test/stdlib_dependencies.jl +++ b/test/stdlib_dependencies.jl @@ -1,14 +1,37 @@ # This file is a part of Julia. License is MIT: https://julialang.org/license using Libdl -using Pkg using Test -prev_env = Base.active_project() -Pkg.activate(temp=true) -Pkg.add(Pkg.PackageSpec(name="ObjectFile", uuid="d8793406-e978-5875-9003-1fc021f44a92", version="0.4")) -using ObjectFile -try +# Load ObjectFile.jl from the vendored jlutilities depot +buildroot = get(ENV, "JULIA_TEST_BUILDROOT", joinpath(@__DIR__, "..")) +depspath = joinpath(buildroot, "deps", "jlutilities") +if ispath(depspath) + depspath = realpath(depspath) + # With a source-tree use the vendored depot + pushfirst!(DEPOT_PATH, joinpath(depspath, "depot")) + using Pkg + old_active_project = Base.active_project() + Base.redirect_stdout(devnull) do + Base.redirect_stderr(devnull) do + Pkg.activate(realpath(joinpath(@__DIR__, "..", "deps", "jlutilities", "objectfile"))) + Pkg.instantiate() + end + end + using ObjectFile + popfirst!(DEPOT_PATH) + Base.set_active_project(old_active_project) +else + # Without a source-tree - expect that the user has installed it for us - warn otherwise + ObjectFile_pkgid = Base.PkgId(Base.UUID("d8793406-e978-5875-9003-1fc021f44a92"), "ObjectFile") + if Base.locate_package(ObjectFile_pkgid) !== nothing + @eval using ObjectFile + end +end + +if !@isdefined(ObjectFile) + @warn("ObjectFile.jl not available; skipping stdlib JLL dependency tests") +else strip_soversion(lib::AbstractString) = Base.BinaryPlatforms.parse_dl_name_version(lib)[1] function get_deps_objectfile_macos(lib_path::String) @@ -249,8 +272,8 @@ try # This is a manually-managed special case if stdlib_name == "libblastrampoline_jll" && - prop_name == :libblastrampoline && - extraneous_deps in (["libopenblas64_"], ["libopenblas"]) + prop_name == :libblastrampoline && + extraneous_deps in (["libopenblas64_"], ["libopenblas"]) deps_mismatch = false end @@ -315,12 +338,4 @@ try end end end - -finally - if prev_env !== nothing - Pkg.activate(prev_env) - else - # If no previous environment, activate the default one - Pkg.activate() - end end From af3e3bb21e4cae85fb4694451c725adf54748cc1 Mon Sep 17 00:00:00 2001 From: Kristoffer Carlsson Date: Sat, 29 Nov 2025 20:54:18 +0100 Subject: [PATCH 10/10] bump Pkg to latest 1.13 --- .../Pkg-4f9884fdb867f2c928ba43dc41da5f150aaec4ab.tar.gz/md5 | 1 + .../Pkg-4f9884fdb867f2c928ba43dc41da5f150aaec4ab.tar.gz/sha512 | 1 + .../Pkg-855b49be9441fd759817a5b6468c009d2e4d6c14.tar.gz/md5 | 1 - .../Pkg-855b49be9441fd759817a5b6468c009d2e4d6c14.tar.gz/sha512 | 1 - stdlib/Pkg.version | 2 +- 5 files changed, 3 insertions(+), 3 deletions(-) create mode 100644 deps/checksums/Pkg-4f9884fdb867f2c928ba43dc41da5f150aaec4ab.tar.gz/md5 create mode 100644 deps/checksums/Pkg-4f9884fdb867f2c928ba43dc41da5f150aaec4ab.tar.gz/sha512 delete mode 100644 deps/checksums/Pkg-855b49be9441fd759817a5b6468c009d2e4d6c14.tar.gz/md5 delete mode 100644 deps/checksums/Pkg-855b49be9441fd759817a5b6468c009d2e4d6c14.tar.gz/sha512 diff --git a/deps/checksums/Pkg-4f9884fdb867f2c928ba43dc41da5f150aaec4ab.tar.gz/md5 b/deps/checksums/Pkg-4f9884fdb867f2c928ba43dc41da5f150aaec4ab.tar.gz/md5 new file mode 100644 index 0000000000000..45f5692993470 --- /dev/null +++ b/deps/checksums/Pkg-4f9884fdb867f2c928ba43dc41da5f150aaec4ab.tar.gz/md5 @@ -0,0 +1 @@ +cb635b45a66cab302b34bf56367e69d7 diff --git a/deps/checksums/Pkg-4f9884fdb867f2c928ba43dc41da5f150aaec4ab.tar.gz/sha512 b/deps/checksums/Pkg-4f9884fdb867f2c928ba43dc41da5f150aaec4ab.tar.gz/sha512 new file mode 100644 index 0000000000000..c512a594e877d --- /dev/null +++ b/deps/checksums/Pkg-4f9884fdb867f2c928ba43dc41da5f150aaec4ab.tar.gz/sha512 @@ -0,0 +1 @@ +40a0495141d6b220bbc6b4119369cdc86b22498ca6a9c83eba47aec397c4c92afa5776e9043b1545a3111ace0317ca0c2412d0ba51731a7505742f47545a5530 diff --git a/deps/checksums/Pkg-855b49be9441fd759817a5b6468c009d2e4d6c14.tar.gz/md5 b/deps/checksums/Pkg-855b49be9441fd759817a5b6468c009d2e4d6c14.tar.gz/md5 deleted file mode 100644 index 876c6044e88d0..0000000000000 --- a/deps/checksums/Pkg-855b49be9441fd759817a5b6468c009d2e4d6c14.tar.gz/md5 +++ /dev/null @@ -1 +0,0 @@ -8dd3bf1fde5e4fc0bc63e48da80a3a7b diff --git a/deps/checksums/Pkg-855b49be9441fd759817a5b6468c009d2e4d6c14.tar.gz/sha512 b/deps/checksums/Pkg-855b49be9441fd759817a5b6468c009d2e4d6c14.tar.gz/sha512 deleted file mode 100644 index 4fa758f646277..0000000000000 --- a/deps/checksums/Pkg-855b49be9441fd759817a5b6468c009d2e4d6c14.tar.gz/sha512 +++ /dev/null @@ -1 +0,0 @@ -849e0c89e8a7fcc2ae06e935cfac85998cbeedb6df7ca7e6332c51e56c16a1348d0ec186368221876ccfec550bf89dc1e021a5d7731c1282da2c62c26584aae8 diff --git a/stdlib/Pkg.version b/stdlib/Pkg.version index ba9ce8d97e1fc..2970f3583bdf3 100644 --- a/stdlib/Pkg.version +++ b/stdlib/Pkg.version @@ -1,4 +1,4 @@ PKG_BRANCH = release-1.13 -PKG_SHA1 = 855b49be9441fd759817a5b6468c009d2e4d6c14 +PKG_SHA1 = 4f9884fdb867f2c928ba43dc41da5f150aaec4ab PKG_GIT_URL := https://github.com/JuliaLang/Pkg.jl.git PKG_TAR_URL = https://api.github.com/repos/JuliaLang/Pkg.jl/tarball/$1