forked from JuliaLang/julia
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCompilerSupportLibraries_jll.jl
More file actions
175 lines (160 loc) · 5.56 KB
/
CompilerSupportLibraries_jll.jl
File metadata and controls
175 lines (160 loc) · 5.56 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
# This file is a part of Julia. License is MIT: https://julialang.org/license
## dummy stub for https://github.com/JuliaBinaryWrappers/CompilerSupportLibraries_jll.jl
baremodule CompilerSupportLibraries_jll
using Base, Libdl, Base.BinaryPlatforms
export libgfortran, libstdcxx, libgomp, libatomic, libgcc_s
# These get calculated in __init__()
const PATH = Ref("")
const PATH_list = String[]
const LIBPATH = Ref("")
const LIBPATH_list = String[]
artifact_dir::String = ""
libatomic_path::String = ""
const libatomic = LazyLibrary(
if Sys.iswindows()
BundledLazyLibraryPath("libatomic-1.dll")
elseif Sys.isapple()
BundledLazyLibraryPath("libatomic.1.dylib")
elseif Sys.isfreebsd()
BundledLazyLibraryPath("libatomic.so.3")
elseif Sys.islinux()
BundledLazyLibraryPath("libatomic.so.1")
else
error("CompilerSupportLibraries_jll: Library 'libatomic' is not available for $(Sys.KERNEL)")
end
)
if Sys.iswindows() || Sys.isapple() || arch(HostPlatform()) ∈ ("x86_64", "i686")
global libquadmath_path::String = ""
const libquadmath = LazyLibrary(
if Sys.iswindows()
BundledLazyLibraryPath("libquadmath-0.dll")
elseif Sys.isapple()
BundledLazyLibraryPath("libquadmath.0.dylib")
elseif (Sys.islinux() || Sys.isfreebsd()) && arch(HostPlatform()) ∈ ("x86_64", "i686")
BundledLazyLibraryPath("libquadmath.so.0")
else
error("CompilerSupportLibraries_jll: Library 'libquadmath' is not available for $(Sys.KERNEL)")
end
)
end
libgcc_s_path::String = ""
const libgcc_s = LazyLibrary(
if Sys.iswindows()
if arch(HostPlatform()) == "x86_64"
BundledLazyLibraryPath("libgcc_s_seh-1.dll")
else
BundledLazyLibraryPath("libgcc_s_sjlj-1.dll")
end
elseif Sys.isapple()
if arch(HostPlatform()) == "aarch64" || libgfortran_version(HostPlatform()) == v"5"
BundledLazyLibraryPath("libgcc_s.1.1.dylib")
else
BundledLazyLibraryPath("libgcc_s.1.dylib")
end
elseif Sys.islinux() || Sys.isfreebsd()
BundledLazyLibraryPath("libgcc_s.so.1")
else
error("CompilerSupportLibraries_jll: Library 'libgcc_s' is not available for $(Sys.KERNEL)")
end
)
libgfortran_path::String = ""
const libgfortran = LazyLibrary(
if Sys.iswindows()
BundledLazyLibraryPath(string("libgfortran-", libgfortran_version(HostPlatform()).major, ".dll"))
elseif Sys.isapple()
BundledLazyLibraryPath(string("libgfortran.", libgfortran_version(HostPlatform()).major, ".dylib"))
elseif Sys.islinux() || Sys.isfreebsd()
BundledLazyLibraryPath(string("libgfortran.so.", libgfortran_version(HostPlatform()).major))
else
error("CompilerSupportLibraries_jll: Library 'libgfortran' is not available for $(Sys.KERNEL)")
end;
dependencies = @static if @isdefined(libquadmath)
LazyLibrary[libgcc_s, libquadmath]
else
LazyLibrary[libgcc_s]
end
)
libstdcxx_path::String = ""
const libstdcxx = LazyLibrary(
if Sys.iswindows()
BundledLazyLibraryPath("libstdc++-6.dll")
elseif Sys.isapple()
BundledLazyLibraryPath("libstdc++.6.dylib")
elseif Sys.islinux() || Sys.isfreebsd()
BundledLazyLibraryPath("libstdc++.so.6")
else
error("CompilerSupportLibraries_jll: Library 'libstdcxx' is not available for $(Sys.KERNEL)")
end;
dependencies = LazyLibrary[libgcc_s]
)
libgomp_path::String = ""
const libgomp = LazyLibrary(
if Sys.iswindows()
BundledLazyLibraryPath("libgomp-1.dll")
elseif Sys.isapple()
BundledLazyLibraryPath("libgomp.1.dylib")
elseif Sys.islinux() || Sys.isfreebsd()
BundledLazyLibraryPath("libgomp.so.1")
else
error("CompilerSupportLibraries_jll: Library 'libgomp' is not available for $(Sys.KERNEL)")
end;
dependencies = if Sys.iswindows()
LazyLibrary[libgcc_s]
else
LazyLibrary[]
end
)
# only define if isfile
let
if Sys.iswindows() || Sys.isapple() || libc(HostPlatform()) != "musl"
_libssp_path = if Sys.iswindows()
BundledLazyLibraryPath("libssp-0.dll")
elseif Sys.isapple()
BundledLazyLibraryPath("libssp.0.dylib")
elseif Sys.islinux() && libc(HostPlatform()) != "musl"
BundledLazyLibraryPath("libssp.so.0")
end
if isfile(string(_libssp_path))
global libssp_path::String = ""
@eval const libssp = LazyLibrary($(_libssp_path))
end
end
end
# Conform to LazyJLLWrappers API
function eager_mode()
if @isdefined(libatomic)
dlopen(libatomic)
end
dlopen(libgcc_s)
dlopen(libgomp)
if @isdefined libquadmath
dlopen(libquadmath)
end
if @isdefined libssp
dlopen(libssp)
end
dlopen(libgfortran)
dlopen(libstdcxx)
end
is_available() = true
function __init__()
global libatomic_path = string(libatomic.path)
global libgcc_s_path = string(libgcc_s.path)
global libgomp_path = string(libgomp.path)
if @isdefined libquadmath_path
global libquadmath_path = string(libquadmath.path)
end
if @isdefined libssp_path
global libssp_path = string(libssp.path)
end
global libgfortran_path = string(libgfortran.path)
global libstdcxx_path = string(libstdcxx.path)
global artifact_dir = dirname(Sys.BINDIR)
LIBPATH[] = dirname(libgcc_s_path)
push!(LIBPATH_list, LIBPATH[])
end
if Base.generating_output()
precompile(eager_mode, ())
precompile(is_available, ())
end
end # module CompilerSupportLibraries_jll