@@ -6,78 +6,57 @@ baremodule CompilerSupportLibraries_jll
66using Base, Libdl, Base. BinaryPlatforms
77Base. Experimental. @compiler_options compile= min optimize= 0 infer= false
88
9- const PATH_list = String[]
10- const LIBPATH_list = String[]
11-
12- export libgfortran, libstdcxx, libgomp
13-
14- # These get calculated in __init__()
15- const PATH = Ref (" " )
16- const LIBPATH = Ref (" " )
17- artifact_dir:: String = " "
18- libgfortran_handle:: Ptr{Cvoid} = C_NULL
19- libgfortran_path:: String = " "
20- libstdcxx_handle:: Ptr{Cvoid} = C_NULL
21- libstdcxx_path:: String = " "
22- libgomp_handle:: Ptr{Cvoid} = C_NULL
23- libgomp_path:: String = " "
9+ export libgcc_s, libgomp, libstdcxx, libquadmath, libgfortran, libssp
2410
2511if Sys. iswindows ()
2612 if arch (HostPlatform ()) == " x86_64"
27- const libgcc_s = " libgcc_s_seh-1.dll"
13+ const libgcc_s_name = " bin/ libgcc_s_seh-1.dll"
2814 else
29- const libgcc_s = " libgcc_s_sjlj-1.dll"
15+ const libgcc_s_name = " bin/ libgcc_s_sjlj-1.dll"
3016 end
31- const libgfortran = string (" libgfortran-" , libgfortran_version (HostPlatform ()). major, " .dll" )
32- const libstdcxx = " libstdc++-6.dll"
33- const libgomp = " libgomp-1.dll"
34- const libssp = " libssp-0.dll"
17+ const libgomp_name = " bin/libgomp-1.dll"
18+ const libstdcxx_name = " bin/libstdc++-6.dll"
19+ const libquadmath_name = " bin/libquadmath-0.dll"
20+ const libgfortran_name = string (" bin/libgfortran-" , libgfortran_version (HostPlatform ()). major, " .dll" )
21+ const libssp_name = " bin/libssp-0.dll"
3522elseif Sys. isapple ()
3623 if arch (HostPlatform ()) == " aarch64" || libgfortran_version (HostPlatform ()) == v " 5"
37- const libgcc_s = " @rpath /libgcc_s.1.1.dylib"
24+ const libgcc_s_name = " lib /libgcc_s.1.1.dylib"
3825 else
39- const libgcc_s = " @rpath /libgcc_s.1.dylib"
26+ const libgcc_s_name = " lib /libgcc_s.1.dylib"
4027 end
41- const libgfortran = string (" @rpath/" , " libgfortran." , libgfortran_version (HostPlatform ()). major, " .dylib" )
42- const libstdcxx = " @rpath/libstdc++.6.dylib"
43- const libgomp = " @rpath/libgomp.1.dylib"
44- const libssp = " @rpath/libssp.0.dylib"
28+ const libgomp_name = " lib/libgomp.1.dylib"
29+ const libstdcxx_name = " lib/libstdc++.6.dylib"
30+ const libquadmath_name = " lib/libquadmath.0.dylib"
31+ const libgfortran_name = string (" lib/" , " libgfortran." , libgfortran_version (HostPlatform ()). major, " .dylib" )
32+ const libssp_name = " lib/libssp.0.dylib"
4533else
46- const libgcc_s = " libgcc_s.so.1"
47- const libgfortran = string (" libgfortran.so." , libgfortran_version (HostPlatform ()). major)
48- const libstdcxx = " libstdc++.so.6"
49- const libgomp = " libgomp.so.1"
34+ const libgcc_s_name = " lib/libgcc_s.so.1"
35+ const libgomp_name = " lib/libgomp.so.1"
36+ const libstdcxx_name = " lib/libstdc++.so.6"
37+ const libquadmath_name = " lib/libquadmath.so.0"
38+ const libgfortran_name = string (" lib/libgfortran.so." , libgfortran_version (HostPlatform ()). major)
5039 if libc (HostPlatform ()) != " musl"
51- const libssp = " libssp.so.0"
40+ const libssp_name = " lib/ libssp.so.0"
5241 end
5342end
5443
55- function __init__ ()
56- global libgcc_s_handle = dlopen (libgcc_s)
57- global libgcc_s_path = dlpath (libgcc_s_handle)
58- global libgfortran_handle = dlopen (libgfortran)
59- global libgfortran_path = dlpath (libgfortran_handle)
60- global libstdcxx_handle = dlopen (libstdcxx)
61- global libstdcxx_path = dlpath (libstdcxx_handle)
62- global libgomp_handle = dlopen (libgomp)
63- global libgomp_path = dlpath (libgomp_handle)
64- @static if libc (HostPlatform ()) != " musl"
65- dlopen (libssp; throw_error = false )
66- end
67- global artifact_dir = dirname (Sys. BINDIR)
68- LIBPATH[] = dirname (libgcc_s_path)
69- push! (LIBPATH_list, LIBPATH[])
44+ const libgcc_s_path = BundledLazyLibraryPath (libgcc_s_name)
45+ const libgomp_path = BundledLazyLibraryPath (libgomp_name)
46+ const libstdcxx_path = BundledLazyLibraryPath (libstdcxx_name)
47+ const libquadmath_path = BundledLazyLibraryPath (libquadmath_name)
48+ const libgfortran_path = BundledLazyLibraryPath (libgfortran_name)
49+ if libc (HostPlatform ()) != " musl"
50+ const libssp_path = BundledLazyLibraryPath (libssp_name)
7051end
7152
72- # JLLWrappers API compatibility shims. Note that not all of these will really make sense.
73- # For instance, `find_artifact_dir()` won't actually be the artifact directory, because
74- # there isn't one. It instead returns the overall Julia prefix.
75- is_available () = true
76- find_artifact_dir () = artifact_dir
77- dev_jll () = error (" stdlib JLLs cannot be dev'ed" )
78- best_wrapper = nothing
79- get_libgfortran_path () = libgfortran_path
80- get_libstdcxx_path () = libstdcxx_path
81- get_libgomp_path () = libgomp_path
53+ const libgcc_s = LazyLibrary (libgcc_s_path)
54+ const libgomp = LazyLibrary (libgomp_path)
55+ const libstdcxx = LazyLibrary (libstdcxx_path; dependencies= [libgcc_s])
56+ const libquadmath = LazyLibrary (libquadmath_path)
57+ const libgfortran = LazyLibrary (libgfortran_path; dependencies= [libquadmath, libgcc_s])
58+ if libc (HostPlatform ()) != " musl"
59+ const libssp = LazyLibrary (libssp_path)
60+ end
8261
8362end # module CompilerSupportLibraries_jll
0 commit comments