Skip to content

Commit

Permalink
Merge pull request #48011 from JuliaLang/backports-release-1.8
Browse files Browse the repository at this point in the history
Backports for Julia 1.8.5
  • Loading branch information
KristofferC committed Jan 5, 2023
2 parents 00177eb + cb73296 commit 0efc765
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 3 deletions.
2 changes: 2 additions & 0 deletions base/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,8 @@ else
$(eval $(call symlink_system_library,CSL,libgcc_s,1))
endif
endif
else
$(eval $(call symlink_system_library,CSL,libgcc_s,1))
endif
ifneq (,$(LIBGFORTRAN_VERSION))
$(eval $(call symlink_system_library,CSL,libgfortran,$(LIBGFORTRAN_VERSION)))
Expand Down
2 changes: 1 addition & 1 deletion src/aotcompile.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -442,7 +442,7 @@ static void injectCRTAlias(Module &M, StringRef name, StringRef alias, FunctionT
if (!target) {
target = Function::Create(FT, Function::ExternalLinkage, alias, M);
}
Function *interposer = Function::Create(FT, Function::WeakAnyLinkage, name, M);
Function *interposer = Function::Create(FT, Function::InternalLinkage, name, M);
appendToCompilerUsed(M, {interposer});

llvm::IRBuilder<> builder(BasicBlock::Create(M.getContext(), "top", interposer));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ libstdcxx_handle = C_NULL
libstdcxx_path = ""
libgomp_handle = C_NULL
libgomp_path = ""
libssp_handle = C_NULL
libssp_path = ""

if Sys.iswindows()
if arch(HostPlatform()) == "x86_64"
Expand All @@ -31,6 +33,7 @@ if Sys.iswindows()
const libgfortran = string("libgfortran-", libgfortran_version(HostPlatform()).major, ".dll")
const libstdcxx = "libstdc++-6.dll"
const libgomp = "libgomp-1.dll"
const libssp = "libssp-0.dll"
elseif Sys.isapple()
if arch(HostPlatform()) == "aarch64" || libgfortran_version(HostPlatform()) == v"5"
const libgcc_s = "@rpath/libgcc_s.1.1.dylib"
Expand All @@ -40,11 +43,15 @@ elseif Sys.isapple()
const libgfortran = string("@rpath/", "libgfortran.", libgfortran_version(HostPlatform()).major, ".dylib")
const libstdcxx = "@rpath/libstdc++.6.dylib"
const libgomp = "@rpath/libgomp.1.dylib"
const libssp = "@rpath/libssp.0.dylib"
else
const libgcc_s = "libgcc_s.so.1"
const libgfortran = string("libgfortran.so.", libgfortran_version(HostPlatform()).major)
const libstdcxx = "libstdc++.so.6"
const libgomp = "libgomp.so.1"
if libc(HostPlatform()) != "musl"
const libssp = "libssp.so.0"
end
end

function __init__()
Expand All @@ -56,6 +63,10 @@ function __init__()
global libstdcxx_path = dlpath(libstdcxx_handle)
global libgomp_handle = dlopen(libgomp)
global libgomp_path = dlpath(libgomp_handle)
@static if libc(HostPlatform()) != "musl"
global libssp_handle = dlopen(libssp)
global libssp_path = dlpath(libssp_handle)
end
global artifact_dir = dirname(Sys.BINDIR)
LIBPATH[] = dirname(libgcc_s_path)
push!(LIBPATH_list, LIBPATH[])
Expand Down
5 changes: 4 additions & 1 deletion stdlib/CompilerSupportLibraries_jll/test/runtests.jl
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
# This file is a part of Julia. License is MIT: https://julialang.org/license

using Test, CompilerSupportLibraries_jll
using Test, CompilerSupportLibraries_jll, Base.BinaryPlatforms

@testset "CompilerSupportLibraries_jll" begin
@test isfile(CompilerSupportLibraries_jll.libgcc_s_path)
@test isfile(CompilerSupportLibraries_jll.libgfortran_path)
@test isfile(CompilerSupportLibraries_jll.libstdcxx_path)
@test isfile(CompilerSupportLibraries_jll.libgomp_path)
if libc(HostPlatform()) != "musl"
@test isfile(CompilerSupportLibraries_jll.libssp_path)
end
end
2 changes: 1 addition & 1 deletion stdlib/OpenBLAS_jll/src/OpenBLAS_jll.jl
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ function __init__()
!haskey(ENV, "OMP_NUM_THREADS")
# We set this to `1` here, and then LinearAlgebra will update
# to the true value in its `__init__()` function.
ENV["OPENBLAS_NUM_THREADS"] = "1"
ENV["OPENBLAS_DEFAULT_NUM_THREADS"] = "1"
end

global libopenblas_handle = dlopen(libopenblas)
Expand Down

0 comments on commit 0efc765

Please sign in to comment.