From 0dde76e5e074d7db9d23540bf0a6e13b2ee5c441 Mon Sep 17 00:00:00 2001 From: Valentin Churavy Date: Wed, 19 Oct 2022 18:07:21 -0400 Subject: [PATCH] Mimick a JLL even more --- base/linking.jl | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/base/linking.jl b/base/linking.jl index 277a6ace6ed379..cf920924c58008 100644 --- a/base/linking.jl +++ b/base/linking.jl @@ -1,3 +1,4 @@ +# This file is a part of Julia. License is MIT: https://julialang.org/license module Linking # inlined LLD_jll @@ -44,7 +45,7 @@ function adjust_ENV!(env::Dict, PATH::String, LIBPATH::String, adjust_PATH::Bool return env end -function __init__() +function __init_lld_path() # Prefer our own bundled lld, but if we don't have one, pick it up off of the PATH # If this is an in-tree build, `lld` will live in `tools`. Otherwise, it'll be in `libexec` for bundled_lld_path in (joinpath(Sys.BINDIR, Base.LIBEXECDIR, lld_exe), @@ -56,6 +57,11 @@ function __init__() end end lld_path[] = something(Sys.which(lld_exe), lld_exe) + return +end + +function __init__() + __init_lld_path() PATH[] = dirname(lld_path[]) if Sys.iswindows() # On windows, the dynamic libraries (.dll) are in Sys.BINDIR ("usr\\bin")