-
Notifications
You must be signed in to change notification settings - Fork 297
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[julia-git] Fix broken compilation due to JuliaLang/julia#36588
- Loading branch information
Showing
9 changed files
with
116 additions
and
15 deletions.
There are no files selected for viewing
99 changes: 99 additions & 0 deletions
99
archlinuxcn/julia-git/0001-Fix-broken-linking-and-initialization-due-to-36588.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,99 @@ | ||
From 18daf2967a518634f9d7477d523de5e56ea12cab Mon Sep 17 00:00:00 2001 | ||
From: Yichao Yu <[email protected]> | ||
Date: Thu, 24 Sep 2020 22:10:32 -0400 | ||
Subject: [PATCH 1/7] Fix broken linking and initialization due to #36588 | ||
|
||
And speed up startup. | ||
--- | ||
cli/Makefile | 8 ++++---- | ||
cli/loader_exe.c | 9 +++++++-- | ||
cli/loader_lib.c | 3 +++ | ||
3 files changed, 14 insertions(+), 6 deletions(-) | ||
|
||
diff --git a/cli/Makefile b/cli/Makefile | ||
index 39cabecf1b..3e49a9f781 100644 | ||
--- a/cli/Makefile | ||
+++ b/cli/Makefile | ||
@@ -79,7 +79,7 @@ $(build_bindir)/julia-debug$(EXE): $(BUILDDIR)/Info.plist | ||
endif | ||
|
||
$(build_shlibdir)/libjulialoader.$(JL_MAJOR_MINOR_SHLIB_EXT): $(LIB_OBJS) | ||
- @$(call PRINT_LINK, $(CC) $(LOADER_CFLAGS) -shared $(SHIPFLAGS) $^ -o $@ $(LOADER_LDFLAGS) $(RPATH_LIB)) | ||
+ @$(call PRINT_LINK, $(CC) $(LOADER_CFLAGS) -shared $(SHIPFLAGS) $^ -o $@ $(LOADER_LDFLAGS) $(RPATH_LIB)) $(build_shlibdir)/libjulia.$(JL_MAJOR_MINOR_SHLIB_EXT) | ||
ifneq ($(OS), WINNT) | ||
@ln -sf $(notdir $@) $(build_shlibdir)/libjulialoader.$(JL_MAJOR_SHLIB_EXT) | ||
@ln -sf $(notdir $@) $(build_shlibdir)/libjulialoader.$(SHLIB_EXT) | ||
@@ -87,17 +87,17 @@ endif | ||
|
||
|
||
$(build_shlibdir)/libjulialoader-debug.$(JL_MAJOR_MINOR_SHLIB_EXT): $(LIB_DOBJS) | ||
- @$(call PRINT_LINK, $(CC) $(LOADER_CFLAGS) -shared $(DEBUGFLAGS) $^ -o $@ $(LOADER_LDFLAGS) $(RPATH_LIB)) | ||
+ @$(call PRINT_LINK, $(CC) $(LOADER_CFLAGS) -shared $(DEBUGFLAGS) $^ -o $@ $(LOADER_LDFLAGS) $(RPATH_LIB)) $(build_shlibdir)/libjulia-debug.$(JL_MAJOR_MINOR_SHLIB_EXT) | ||
ifneq ($(OS), WINNT) | ||
@ln -sf $(notdir $@) $(build_shlibdir)/libjulialoader-debug.$(JL_MAJOR_SHLIB_EXT) | ||
@ln -sf $(notdir $@) $(build_shlibdir)/libjulialoader-debug.$(SHLIB_EXT) | ||
endif | ||
|
||
$(build_bindir)/julia$(EXE): $(OBJS) | ||
- @$(call PRINT_LINK, $(CC) $(LOADER_CFLAGS) $(SHIPFLAGS) $^ -o $@ $(LOADER_LDFLAGS) $(RPATH)) | ||
+ @$(call PRINT_LINK, $(CC) $(LOADER_CFLAGS) $(SHIPFLAGS) $^ -o $@ $(LOADER_LDFLAGS) $(RPATH) $(build_shlibdir)/libjulia.$(JL_MAJOR_MINOR_SHLIB_EXT)) | ||
|
||
$(build_bindir)/julia-debug$(EXE): $(DOBJS) | ||
- @$(call PRINT_LINK, $(CC) $(LOADER_CFLAGS) $(DEBUGFLAGS) $^ -o $@ $(LOADER_LDFLAGS) $(RPATH)) | ||
+ @$(call PRINT_LINK, $(CC) $(LOADER_CFLAGS) $(DEBUGFLAGS) $^ -o $@ $(LOADER_LDFLAGS) $(RPATH) $(build_shlibdir)/libjulia-debug.$(JL_MAJOR_MINOR_SHLIB_EXT)) | ||
|
||
|
||
clean: | $(CLEAN_TARGETS) | ||
diff --git a/cli/loader_exe.c b/cli/loader_exe.c | ||
index 74d8a150dc..12fcd1a2aa 100644 | ||
--- a/cli/loader_exe.c | ||
+++ b/cli/loader_exe.c | ||
@@ -6,13 +6,18 @@ extern "C" { | ||
|
||
/* Define ptls getter, as this cannot be defined within a shared library. */ | ||
#if !defined(_OS_WINDOWS_) && !defined(_OS_DARWIN_) | ||
-__attribute__ ((visibility("default"))) JL_CONST_FUNC void * jl_get_ptls_states_static(void) | ||
+void jl_set_ptls_states_getter(void *(*f)(void)); | ||
+static JL_CONST_FUNC void * jl_get_ptls_states_static(void) | ||
{ | ||
/* Because we can't #include <julia.h> in this file, we define a TLS state object with | ||
* hopefully enough room; at last check, the `jl_tls_states_t` struct was <16KB. */ | ||
static __attribute__((tls_model("local-exec"))) __thread char tls_states[32768]; | ||
return &tls_states; | ||
} | ||
+__attribute__((constructor)) void jl_register_ptls_states_getter(void) | ||
+{ | ||
+ jl_set_ptls_states_getter(jl_get_ptls_states_static); | ||
+} | ||
#endif | ||
|
||
#ifdef _OS_WINDOWS_ | ||
@@ -27,7 +32,7 @@ int main(int argc, char * argv[]) | ||
{ | ||
#endif | ||
// Immediately get the current exe dir, allowing us to calculate relative paths. | ||
- const char * exe_dir = get_exe_dir(); | ||
+ const char * exe_dir = NULL; // get_exe_dir(); | ||
|
||
#ifdef _OS_WINDOWS_ | ||
// Convert Windows wchar_t values to UTF8 | ||
diff --git a/cli/loader_lib.c b/cli/loader_lib.c | ||
index a8ab0b9837..7530693d74 100644 | ||
--- a/cli/loader_lib.c | ||
+++ b/cli/loader_lib.c | ||
@@ -131,9 +131,12 @@ const char * get_exe_dir() | ||
return exe_dir; | ||
} | ||
|
||
+int repl_entrypoint(int argc, char *argv[]); | ||
+ | ||
// Load libjulia and run the REPL with the given arguments (in UTF-8 format) | ||
int load_repl(const char * exe_dir, int argc, char * argv[]) | ||
{ | ||
+ return repl_entrypoint(argc, (char **)argv); | ||
// Pre-load libraries that libjulia needs. | ||
int deps_len = strlen(dep_libs); | ||
char * curr_dep = &dep_libs[0]; | ||
-- | ||
2.28.0 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
From 292218f0e1d7895622f89f36bd5a1de5a7618435 Mon Sep 17 00:00:00 2001 | ||
From ed5cbaf4e0897f58efa41f4fcf5a9e44a700cd28 Mon Sep 17 00:00:00 2001 | ||
From: Yichao Yu <[email protected]> | ||
Date: Sun, 19 Jul 2020 09:40:32 -0400 | ||
Subject: [PATCH 2/7] Fix source file paths | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
From 245461fb6c105700c13354818a298de194052901 Mon Sep 17 00:00:00 2001 | ||
From 7a167f64eb72a3f505b42b31fcc22bfbd32a9c2d Mon Sep 17 00:00:00 2001 | ||
From: Yichao Yu <[email protected]> | ||
Date: Sat, 22 Aug 2020 10:19:15 -0400 | ||
Subject: [PATCH 3/7] Optimize allocation of arrays | ||
|
@@ -11,10 +11,10 @@ Subject: [PATCH 3/7] Optimize allocation of arrays | |
4 files changed, 115 insertions(+), 12 deletions(-) | ||
|
||
diff --git a/base/boot.jl b/base/boot.jl | ||
index e653a82399..f23621a966 100644 | ||
index 7c8d05cc13..c6db3a37e5 100644 | ||
--- a/base/boot.jl | ||
+++ b/base/boot.jl | ||
@@ -430,19 +430,11 @@ const NTuple{N,T} = Tuple{Vararg{T,N}} | ||
@@ -445,19 +445,11 @@ const NTuple{N,T} = Tuple{Vararg{T,N}} | ||
struct UndefInitializer end | ||
const undef = UndefInitializer() | ||
# type and dimensionality specified, accepting dims as series of Ints | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
From 59f66247961e29c46db7cd0102fc26a586b0ffdd Mon Sep 17 00:00:00 2001 | ||
From 8e660c4cc342feb40ce75f15b11d7eb79cbdf6fe Mon Sep 17 00:00:00 2001 | ||
From: Yichao Yu <[email protected]> | ||
Date: Mon, 31 Aug 2020 12:44:58 -0400 | ||
Subject: [PATCH 4/7] Enable basic AA in O2 | ||
|
2 changes: 1 addition & 1 deletion
2
archlinuxcn/julia-git/0005-Add-ccall-special-cases-for-a-few-more-libc-function.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
From 3b1bfd92c3dd65a6b8786ef580e24bff1e8446c4 Mon Sep 17 00:00:00 2001 | ||
From 5a0feed8efc1476e7d0faa40d4addfc847a4eaf9 Mon Sep 17 00:00:00 2001 | ||
From: Yichao Yu <[email protected]> | ||
Date: Fri, 21 Aug 2020 10:29:29 -0400 | ||
Subject: [PATCH 5/7] Add ccall special cases for a few more libc functions | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
From 363ae638f7dab9666953d272ba0ea634fa621e1b Mon Sep 17 00:00:00 2001 | ||
From 2a57b5286e544ad4178de9d652e05e70df15bdcc Mon Sep 17 00:00:00 2001 | ||
From: Yichao Yu <[email protected]> | ||
Date: Fri, 21 Aug 2020 13:15:02 -0400 | ||
Subject: [PATCH 6/7] Optimize objectid in codegen | ||
|
2 changes: 1 addition & 1 deletion
2
archlinuxcn/julia-git/0007-Mark-more-functions-as-not-safepoint-in-codegen.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
From 1d1ab6de59ad420562176257724a39e9e8b161c4 Mon Sep 17 00:00:00 2001 | ||
From 5cf5068bdc64a6fe37380271b64d3aecf1ecda85 Mon Sep 17 00:00:00 2001 | ||
From: Yichao Yu <[email protected]> | ||
Date: Thu, 13 Aug 2020 02:24:27 -0400 | ||
Subject: [PATCH 7/7] Mark more functions as not safepoint in codegen. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -20,4 +20,4 @@ repo_depends: | |
update_on: | ||
- source: vcs | ||
- source: manual | ||
manual: 29 | ||
manual: 30 |