Skip to content

Commit 351130d

Browse files
committed
[julia-git] fix extension loading
1 parent 2d374d6 commit 351130d

24 files changed

Lines changed: 106 additions & 98 deletions

alarmcn/julia-git/0001-Force-enable-GDB-debug-info-registration.patch

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,18 @@
1-
From ae341f2350fffcbf88b799b4ab3c8c78e6cfc8d0 Mon Sep 17 00:00:00 2001
1+
From 1bc170a65756fa5d171d40589a3c1f6770ac09d7 Mon Sep 17 00:00:00 2001
22
From: Yichao Yu <yyc1992@gmail.com>
33
Date: Sat, 3 Oct 2020 08:45:51 -0400
44
Subject: [PATCH 01/11] Force enable GDB debug info registration
55

6+
Actually force disabling it to work around LLVM 22 support bug
67
---
78
src/codegen.cpp | 2 +-
89
1 file changed, 1 insertion(+), 1 deletion(-)
910

1011
diff --git a/src/codegen.cpp b/src/codegen.cpp
11-
index a83a900ee6..d4984b24e3 100644
12+
index 559d69e346..d91e926bd5 100644
1213
--- a/src/codegen.cpp
1314
+++ b/src/codegen.cpp
14-
@@ -10864,7 +10864,7 @@ extern "C" void jl_init_llvm(void)
15+
@@ -11046,7 +11046,7 @@ extern "C" void jl_init_llvm(void)
1516

1617
bool jl_using_gdb_jitevents = false;
1718
// Register GDB event listener

alarmcn/julia-git/0002-Fix-source-file-paths.patch

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
From aa7ac18cefa10e3ecd3452c2116128d0f41fc7d1 Mon Sep 17 00:00:00 2001
1+
From 04e823d469034c53a41ebc3c0e5fbab81b4a56bd Mon Sep 17 00:00:00 2001
22
From: Yichao Yu <yyc1992@gmail.com>
33
Date: Sun, 19 Jul 2020 09:40:32 -0400
44
Subject: [PATCH 02/11] Fix source file paths

alarmcn/julia-git/0003-Clear-soname-and-hard-code-system-lib-path.patch

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
From 910d6cdeae0944715474625d653d9ea7950fbf9d Mon Sep 17 00:00:00 2001
1+
From f846c0552d7f3e442fdf9ea254856363a4311c04 Mon Sep 17 00:00:00 2001
22
From: Yichao Yu <yyc1992@gmail.com>
33
Date: Tue, 22 Jun 2021 10:35:16 -0400
44
Subject: [PATCH 03/11] Clear soname and hard code system lib path

alarmcn/julia-git/0004-Support-loading-extensions-from-STDLIB.patch

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
1-
From 943c1b35bae4ca6f23d8c9cb1b6054349815f472 Mon Sep 17 00:00:00 2001
1+
From 11f8c991d90507f9fa5f09ff2c7fad9ed59e48b3 Mon Sep 17 00:00:00 2001
22
From: Yichao Yu <yyc1992@gmail.com>
33
Date: Wed, 30 Aug 2023 09:28:03 -0400
44
Subject: [PATCH 04/11] Support loading extensions from STDLIB
55

66
---
7-
base/loading.jl | 48 ++++++++++++++++++++++++++++++++++++++++++++++++
8-
1 file changed, 48 insertions(+)
7+
base/loading.jl | 51 +++++++++++++++++++++++++++++++++++++++++++++++++
8+
1 file changed, 51 insertions(+)
99

1010
diff --git a/base/loading.jl b/base/loading.jl
11-
index 10e3420015..cc91335fbe 100644
11+
index fec5c81f2d..9640830392 100644
1212
--- a/base/loading.jl
1313
+++ b/base/loading.jl
1414
@@ -1343,6 +1343,34 @@ end
@@ -46,7 +46,7 @@ index 10e3420015..cc91335fbe 100644
4646
path, project_file = entry_point_and_project_file(dir, pkg.name)
4747
if project_file === nothing
4848
pkg.uuid === nothing || return nothing
49-
@@ -1652,11 +1680,31 @@ const EXT_PRIMED = Dict{PkgId,Vector{PkgId}}() # Extension -> Parent + Triggers
49+
@@ -1701,11 +1729,34 @@ const EXT_PRIMED = Dict{PkgId,Vector{PkgId}}() # Extension -> Parent + Triggers
5050
const EXT_DORMITORY = Dict{PkgId,Vector{ExtensionId}}() # Trigger -> Extensions that can be triggered by it
5151
const EXT_DORMITORY_FAILED = ExtensionId[]
5252

@@ -56,13 +56,16 @@ index 10e3420015..cc91335fbe 100644
5656
+ project_file = normpath(joinpath(pkgdir, proj))
5757
+ isfile_casesensitive(project_file) || continue
5858
+ entry = parsed_toml(project_file)
59-
+ weakdeps = get(entry, "weakdeps", nothing)::Union{Nothing, Vector{String}, Dict{String,Any}}
6059
+ extensions = get(entry, "extensions", nothing)::Union{Nothing, Dict{String, Any}}
61-
+ # Require STDLIB weakdeps to include the UUIDs
62-
+ if weakdeps isa Dict{String, Any} && extensions !== nothing
63-
+ _insert_extension_triggers(pkg, extensions, weakdeps)
64-
+ return true
60+
+ if extensions === nothing
61+
+ continue
6562
+ end
63+
+ # Require STDLIB weakdeps to include the UUIDs
64+
+ weakdeps = get(Dict{String, Any}, entry, "weakdeps")::Dict{String,Any}
65+
+ deps = get(Dict{String, Any}, entry, "deps")::Dict{String,Any}
66+
+ total_deps = merge(weakdeps, deps)
67+
+ _insert_extension_triggers(pkg, extensions, total_deps)
68+
+ return true
6669
+ end
6770
+ return false
6871
+end

alarmcn/julia-git/0005-julia-git-add-a-safeguard-for-bad-unwinding.patch

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
From 787cdbc5a95d4aa3be2f25fcd50320d56b93a870 Mon Sep 17 00:00:00 2001
1+
From 27cfe539e2daf922ea93460a7f48ed0a6e73105c Mon Sep 17 00:00:00 2001
22
From: Yichao Yu <yyc1992@gmail.com>
33
Date: Tue, 3 Oct 2023 19:00:59 -0400
44
Subject: [PATCH 05/11] [julia-git] add a safeguard for bad unwinding
@@ -8,7 +8,7 @@ Subject: [PATCH 05/11] [julia-git] add a safeguard for bad unwinding
88
1 file changed, 2 insertions(+)
99

1010
diff --git a/src/stackwalk.c b/src/stackwalk.c
11-
index 79a15ecdd8..95520a7e82 100644
11+
index a0a0ad3274..9650d15bf4 100644
1212
--- a/src/stackwalk.c
1313
+++ b/src/stackwalk.c
1414
@@ -292,6 +292,8 @@ JL_DLLEXPORT jl_value_t *jl_backtrace_from_here(int returnsp, int skip)

alarmcn/julia-git/0006-Disable-UCX-signal-handler.patch

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
From da01816272939e2538aa1b5c83629ea239736f2f Mon Sep 17 00:00:00 2001
1+
From 36fc6114bd42ac1440a526df646f27eeb3cb1d62 Mon Sep 17 00:00:00 2001
22
From: Yichao Yu <yyc1992@gmail.com>
33
Date: Mon, 26 May 2025 23:20:16 -0400
44
Subject: [PATCH 06/11] Disable UCX signal handler

alarmcn/julia-git/0007-julia-git-Better-support-for-loading-packages-from-s.patch

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
From bc66bbab3a454fbaff7239c3bd8517ebcf15891a Mon Sep 17 00:00:00 2001
1+
From d3eb64adb4038c86af3d2d60978801f4dc0a697c Mon Sep 17 00:00:00 2001
22
From: Yichao Yu <yyc1992@gmail.com>
33
Date: Fri, 15 Aug 2025 12:24:38 -0400
44
Subject: [PATCH 07/11] [julia-git] Better support for loading packages from
@@ -9,7 +9,7 @@ Subject: [PATCH 07/11] [julia-git] Better support for loading packages from
99
1 file changed, 4 insertions(+)
1010

1111
diff --git a/base/loading.jl b/base/loading.jl
12-
index cc91335fbe..d343596b5f 100644
12+
index 9640830392..f9bc145d7c 100644
1313
--- a/base/loading.jl
1414
+++ b/base/loading.jl
1515
@@ -1313,6 +1313,10 @@ function explicit_manifest_entry_load_spec(manifest_file::String, pkg::PkgId, en

alarmcn/julia-git/0008-Reduce-likelyhood-of-symbol-conflict.patch

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
From 9732371d453f8041ff55bfb76c94effadcce245c Mon Sep 17 00:00:00 2001
1+
From 862d6b958312908c7b9373a6cd2c6109beb12432 Mon Sep 17 00:00:00 2001
22
From: Yichao Yu <yyc1992@gmail.com>
33
Date: Sun, 24 Aug 2025 19:28:22 -0400
44
Subject: [PATCH 08/11] Reduce likelyhood of symbol conflict

alarmcn/julia-git/0009-codegen-add-support-for-llvm-22.patch

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
From d919ba7970703320ccfd2f41a81e14084bb74049 Mon Sep 17 00:00:00 2001
1+
From 2628dd59664b2768af344cd5f02afc484027f83d Mon Sep 17 00:00:00 2001
22
From: Jameson Nash <vtjnash@gmail.com>
33
Date: Wed, 29 Jul 2026 15:12:45 +0000
44
Subject: [PATCH 09/11] codegen: add support for llvm-22
@@ -18,10 +18,10 @@ Subject: [PATCH 09/11] codegen: add support for llvm-22
1818
11 files changed, 95 insertions(+), 18 deletions(-)
1919

2020
diff --git a/src/Makefile b/src/Makefile
21-
index 8292c7bbe2..15b21e35ad 100644
21+
index 7398a14da9..4d06db230e 100644
2222
--- a/src/Makefile
2323
+++ b/src/Makefile
24-
@@ -765,16 +765,18 @@ SA_EXCEPTIONS-gc-stock.c := -Xanalyzer -analyzer-config -Xana
24+
@@ -767,16 +767,18 @@ SA_EXCEPTIONS-gc-stock.c := -Xanalyzer -analyzer-config -Xana
2525
# these need to be annotated (and possibly fixed)
2626
SKIP_GC_CHECK := codegen.cpp rtutils.c
2727

@@ -101,10 +101,10 @@ index 2664fee69f..b9f01b2658 100644
101101
const MemRegion *R = LVal.getAsRegion();
102102
if (!R) {
103103
diff --git a/src/codegen.cpp b/src/codegen.cpp
104-
index d4984b24e3..ba339d0715 100644
104+
index d91e926bd5..d604d672ef 100644
105105
--- a/src/codegen.cpp
106106
+++ b/src/codegen.cpp
107-
@@ -10477,7 +10477,7 @@ jl_code_info_t *jl_get_method_ir(jl_code_instance_t *ci)
107+
@@ -10659,7 +10659,7 @@ jl_code_info_t *jl_get_method_ir(jl_code_instance_t *ci)
108108
void emit_always_inline(jl_codegen_output_t &out,
109109
unique_function<jl_code_info_t *(jl_code_instance_t *)> get_src)
110110
{
@@ -152,7 +152,7 @@ index 26b95fdb16..f82a192367 100644
152152

153153
MCContext Ctx(TheTriple, MAI.get(), MRI.get(), STI.get(), &SrcMgr);
154154
diff --git a/src/jitlayers.cpp b/src/jitlayers.cpp
155-
index dbf874ec79..07bee4f783 100644
155+
index a1c4556275..5f292a78b2 100644
156156
--- a/src/jitlayers.cpp
157157
+++ b/src/jitlayers.cpp
158158
@@ -14,7 +14,11 @@
@@ -167,7 +167,7 @@ index dbf874ec79..07bee4f783 100644
167167
#if JL_LLVM_VERSION >= 210000
168168
# include <llvm/ExecutionEngine/Orc/SelfExecutorProcessControl.h>
169169
#endif
170-
@@ -2118,9 +2122,11 @@ void JuliaOJIT::enableJITDebuggingSupport()
170+
@@ -2125,9 +2129,11 @@ void JuliaOJIT::enableJITDebuggingSupport()
171171
{
172172
orc::SymbolMap GDBFunctions;
173173
addAbsoluteToMap(GDBFunctions,llvm_orc_registerJITLoaderGDBAllocAction);
@@ -180,7 +180,7 @@ index dbf874ec79..07bee4f783 100644
180180
if (TM->getTargetTriple().isOSBinFormatMachO()) {
181181
auto RegisterSym = cantFail(
182182
safelookup(ES, {&JD}, ES.intern("_llvm_orc_registerJITLoaderGDBAllocAction")));
183-
@@ -2129,8 +2135,22 @@ void JuliaOJIT::enableJITDebuggingSupport()
183+
@@ -2136,8 +2142,22 @@ void JuliaOJIT::enableJITDebuggingSupport()
184184
}
185185
#ifndef _COMPILER_ASAN_ENABLED_ // TODO: Fix duplicated sections spam #51794
186186
else if (TM->getTargetTriple().isOSBinFormatELF()) {
@@ -203,7 +203,7 @@ index dbf874ec79..07bee4f783 100644
203203
}
204204
#endif
205205
}
206-
@@ -2356,7 +2376,7 @@ bool JuliaOJIT::linkOutput(orc::MaterializationResponsibility &MR, MemoryBufferR
206+
@@ -2363,7 +2383,7 @@ bool JuliaOJIT::linkOutput(orc::MaterializationResponsibility &MR, MemoryBufferR
207207
continue;
208208
}
209209
JL_GC_PROMISE_ROOTED(CI);
@@ -213,10 +213,10 @@ index dbf874ec79..07bee4f783 100644
213213
return false;
214214
if (auto *DestSym = findLinkGraphSymbolByName(G, Dest);
215215
diff --git a/src/jitlayers.h b/src/jitlayers.h
216-
index 6b3de497a0..bb5a882bf3 100644
216+
index 47af9acda6..abb46a2132 100644
217217
--- a/src/jitlayers.h
218218
+++ b/src/jitlayers.h
219-
@@ -410,7 +410,10 @@ private:
219+
@@ -419,7 +419,10 @@ private:
220220

221221
struct jl_linker_info_t {
222222
DenseMap<jl_code_instance_t *, jl_codeinst_funcs_t<orc::SymbolStringPtr>> ci_funcs;
@@ -228,7 +228,7 @@ index 6b3de497a0..bb5a882bf3 100644
228228
call_targets;
229229
DenseMap<void *, orc::SymbolStringPtr> global_targets;
230230
};
231-
@@ -456,7 +459,9 @@ public:
231+
@@ -465,7 +468,9 @@ public:
232232

233233
public:
234234
// outputs
@@ -240,10 +240,10 @@ index 6b3de497a0..bb5a882bf3 100644
240240
DenseMap<jl_code_instance_t *, jl_llvm_functions_t> ci_funcs;
241241
SmallVector<std::pair<jl_code_instance_t *, GlobalVariable *>, 0> external_fns;
242242
diff --git a/src/julia_threads.h b/src/julia_threads.h
243-
index 605e1c73e3..48c571d0a3 100644
243+
index 24ec348c2d..6e2d48c9a2 100644
244244
--- a/src/julia_threads.h
245245
+++ b/src/julia_threads.h
246-
@@ -166,7 +166,7 @@ typedef struct _jl_tls_states_t {
246+
@@ -215,7 +215,7 @@ typedef struct _jl_tls_states_t {
247247
struct _jl_task_t *root_task;
248248
struct _jl_timing_block_t *timing_stack;
249249
// This is the location of our copy_stack
@@ -283,7 +283,7 @@ index a3f07f03e4..214def0c9e 100644
283283
#else
284284
CallInst::Create(pass.lifetime_start, {sz, ptr}, "", orig);
285285
diff --git a/src/llvm-late-gc-lowering.cpp b/src/llvm-late-gc-lowering.cpp
286-
index 309916001d..30a3bbbb40 100644
286+
index c9a75759de..690cb08509 100644
287287
--- a/src/llvm-late-gc-lowering.cpp
288288
+++ b/src/llvm-late-gc-lowering.cpp
289289
@@ -182,8 +182,15 @@ static std::pair<Value*,int> FindBaseValue(const State &S, Value *V, bool UseCac

alarmcn/julia-git/0010-Fix-gcc_s-search.patch

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
From 4fb3d3204bf0f9354f1eebcbb4573c32ea5993d5 Mon Sep 17 00:00:00 2001
1+
From 71c4f79be332fa771d96c868e0dfe6c0e4d24e66 Mon Sep 17 00:00:00 2001
22
From: Yichao Yu <yyc1992@gmail.com>
33
Date: Wed, 5 Aug 2026 00:49:20 -0400
44
Subject: [PATCH 10/11] Fix gcc_s search

0 commit comments

Comments
 (0)