Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .github/_typos.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Configuration for the `typos` spell checker (.github/workflows/Typos.yml)
[default.extend-words]
# `invokee` is deliberate terminology (the resolved callee behind a dispatch
# trampoline), not a typo of "invoked"/"invoke"
invokee = "invokee"
4 changes: 2 additions & 2 deletions .github/workflows/Typos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,12 @@ jobs:
| tar -xz -C "${{ runner.temp }}/typos" ./typos
"${{ runner.temp }}/typos/typos" --version

echo -n $NEW_FILES | xargs "${{ runner.temp }}/typos/typos" --format json >> ${{ runner.temp }}/new_typos.jsonl || true
echo -n $NEW_FILES | xargs "${{ runner.temp }}/typos/typos" --config .github/_typos.toml --format json >> ${{ runner.temp }}/new_typos.jsonl || true
git checkout FETCH_HEAD -- $OLD_FILES
if [ -z "$OLD_FILES" ]; then
touch "${{ runner.temp }}/old_typos.jsonl" # No old files, so no old typos.
else
echo -n $OLD_FILES | xargs "${{ runner.temp }}/typos/typos" --format json >> ${{ runner.temp }}/old_typos.jsonl || true
echo -n $OLD_FILES | xargs "${{ runner.temp }}/typos/typos" --config .github/_typos.toml --format json >> ${{ runner.temp }}/old_typos.jsonl || true
fi


Expand Down
4 changes: 4 additions & 0 deletions base/methodshow.jl
Original file line number Diff line number Diff line change
Expand Up @@ -387,6 +387,10 @@ end
show(io::IO, ms::MethodList) = show_method_table(io, ms)
show(io::IO, ::MIME"text/plain", ms::MethodList) = show_method_table(io, ms)
show(io::IO, mt::Core.MethodTable) = print(io, mt.module, ".", mt.name, " is a Core.MethodTable with ", length(mt), " methods.")
show(io::IO, c::Core.ABIAdapterCache) = print(io, "Core.ABIAdapterCache with ",
ccall(:jl_typemap_count, Csize_t, (Any,), getfield(c, :cache)), " entries.")
show(io::IO, c::Core.DispatchTrampolineCache) = print(io, "Core.DispatchTrampolineCache with ",
ccall(:jl_typemap_count, Csize_t, (Any,), getfield(c, :cache)), " entries.")

function inbase(m::Module)
if m == Base
Expand Down
48 changes: 40 additions & 8 deletions cli/loader_lib.c
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,41 @@ static void * load_library(const char * rel_path, const char * src_dir, int err)
return handle;
}

// case-insensitive strcmp
static int istrcmp(const char *val, const char *token) {
for (; *token; val++, token++) {
char c = *val;
if (c >= 'A' && c <= 'Z')
c += 'a' - 'A';
if (c != *token)
return 0;
}
return *val == '\0';
}

// intended to match Base.get_bool_env
static int env_var_bool(const char *name, int *value) {
#if defined(_OS_WINDOWS_)
char val[8];
DWORD val_len = GetEnvironmentVariableA(name, val, sizeof(val));
if (val_len == 0 || val_len >= sizeof(val)) /* unset, or too long to be a token */
return 0;
#else
const char *val = getenv(name);
if (val == NULL)
return 0;
#endif
if (istrcmp(val, "t") || istrcmp(val, "true") || istrcmp(val, "y") || istrcmp(val, "yes") || istrcmp(val, "1")) {
*value = 1;
return 1;
}
if (istrcmp(val, "f") || istrcmp(val, "false") || istrcmp(val, "n") || istrcmp(val, "no") || istrcmp(val, "0")) {
*value = 0;
return 1;
}
return 0;
}

static void * lookup_symbol(const void * lib_handle, const char * symbol_name) {
#ifdef _OS_WINDOWS_
return GetProcAddress((HMODULE) lib_handle, symbol_name);
Expand Down Expand Up @@ -323,13 +358,7 @@ __attribute__((constructor)) void jl_load_libjulia_internal(void) {
int probe_successful = 0;

// Check to see if the user has disabled libstdc++ probing
char *probevar = getenv("JULIA_PROBE_LIBSTDCXX");
if (probevar) {
if (strcmp(probevar, "1") == 0 || strcmp(probevar, "yes") == 0)
do_probe = 1;
else if (strcmp(probevar, "0") == 0 || strcmp(probevar, "no") == 0)
do_probe = 0;
}
env_var_bool("JULIA_PROBE_LIBSTDCXX", &do_probe);
if (do_probe) {
const char *cxxpath = libstdcxxprobe();
if (cxxpath) {
Expand Down Expand Up @@ -362,7 +391,10 @@ __attribute__((constructor)) void jl_load_libjulia_internal(void) {
libjulia_internal = load_library(curr_dep, lib_dir, 1);
} else if (special_idx == 2) {
// This special library is `libjulia-codegen`
libjulia_codegen = load_library(curr_dep, lib_dir, 0);
int load_codegen = 1;
env_var_bool("JULIA_LOAD_CODEGEN_LIB", &load_codegen);
if (load_codegen)
libjulia_codegen = load_library(curr_dep, lib_dir, 0);
}
special_idx++;
} else {
Expand Down
8 changes: 8 additions & 0 deletions doc/src/manual/environment-variables.md
Original file line number Diff line number Diff line change
Expand Up @@ -616,3 +616,11 @@ Arguments to be passed to the LLVM backend.
### `JULIA_FALLBACK_REPL`

Forces the fallback repl instead of REPL.jl.

### `JULIA_LOAD_CODEGEN_LIB`

If set to a false value (`0`, `f`, `false`, `n`, or `no`, case-insensitive),
the loader does not load `libjulia-codegen`, and the fallback
(interpreter-only) implementations in `libjulia-internal` are used instead —
exactly as if the library were absent from the installation. Intended for
testing and debugging the no-codegen configuration.
2 changes: 1 addition & 1 deletion src/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ SRCS := \
simplevector runtime_intrinsics precompile jloptions mtarraylist \
threading scheduler stackwalk null_sysimage \
method jlapi signal-handling safepoint timing subtype rtutils \
crc32c APInt processor ircode opaque_closure codegen-stubs coverage runtime_ccall engine \
crc32c APInt processor ircode opaque_closure abi_adapter dispatch_trampoline codegen-stubs coverage runtime_ccall engine \
$(GC_SRCS)

RT_LLVMLINK :=
Expand Down
Loading