Skip to content

Commit

Permalink
Mimick a JLL even more
Browse files Browse the repository at this point in the history
  • Loading branch information
vchuravy committed Oct 19, 2022
1 parent d3f0340 commit 0dde76e
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion base/linking.jl
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# This file is a part of Julia. License is MIT: https://julialang.org/license
module Linking

# inlined LLD_jll
Expand Down Expand Up @@ -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),
Expand All @@ -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")
Expand Down

0 comments on commit 0dde76e

Please sign in to comment.