Skip to content

Commit 4eaa196

Browse files
authored
Merge pull request #24 from JuliaPackaging/mg/dont-dlopen
Allow `dlopen_flags=nothing` to not dlopen libraries
2 parents b1b8118 + 49039c6 commit 4eaa196

16 files changed

+85
-3
lines changed

Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name = "JLLWrappers"
22
uuid = "692b3bcd-3c85-4b1f-b108-f13ce0eb3210"
33
authors = ["Mosè Giordano", "Elliot Saba"]
4-
version = "1.1.4"
4+
version = "1.2.0"
55

66
[compat]
77
julia = "1.0.0"

src/products/library_generators.jl

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,11 @@ macro init_library_product(product_name, product_path, dlopen_flags)
5858
global $(path_name) = joinpath(artifact_dir, $(product_path))
5959
# Manually `dlopen()` this right now so that future invocations
6060
# of `ccall` with its path/SONAME will find this path immediately.
61-
global $(handle_name) = dlopen($(path_name), $(dlopen_flags))
62-
push!(LIBPATH_list, joinpath(artifact_dir, $(dirname(product_path))))
61+
# dlopen_flags === nothing means to not dlopen the library.
62+
if $(dlopen_flags) !== nothing
63+
global $(handle_name) = dlopen($(path_name), $(dlopen_flags))
64+
push!(LIBPATH_list, joinpath(artifact_dir, $(dirname(product_path))))
65+
end
6366
end,
6467
init_new_library_product(product_name),
6568
)

test/OpenLibm_jll/src/wrappers/aarch64-linux-gnu.jl

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,19 @@ export libopenlibm
33

44
JLLWrappers.@generate_wrapper_header("OpenLibm")
55
JLLWrappers.@declare_library_product(libopenlibm, "libopenlibm.so.3")
6+
JLLWrappers.@declare_library_product(libnonexisting, "libnonexisting.so.0")
67
function __init__()
78
JLLWrappers.@generate_init_header()
89
JLLWrappers.@init_library_product(
910
libopenlibm,
1011
"lib/libopenlibm.so",
1112
RTLD_LAZY | RTLD_DEEPBIND,
1213
)
14+
JLLWrappers.@init_library_product(
15+
libnonexisting,
16+
"lib/libnonexisting.so",
17+
nothing,
18+
)
1319

1420
JLLWrappers.@generate_init_footer()
1521
end # __init__()

test/OpenLibm_jll/src/wrappers/aarch64-linux-musl.jl

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,19 @@ export libopenlibm
33

44
JLLWrappers.@generate_wrapper_header("OpenLibm")
55
JLLWrappers.@declare_library_product(libopenlibm, "libopenlibm.so.3")
6+
JLLWrappers.@declare_library_product(libnonexisting, "libnonexisting.so.0")
67
function __init__()
78
JLLWrappers.@generate_init_header()
89
JLLWrappers.@init_library_product(
910
libopenlibm,
1011
"lib/libopenlibm.so",
1112
RTLD_LAZY | RTLD_DEEPBIND,
1213
)
14+
JLLWrappers.@init_library_product(
15+
libnonexisting,
16+
"lib/libnonexisting.so",
17+
nothing,
18+
)
1319

1420
JLLWrappers.@generate_init_footer()
1521
end # __init__()

test/OpenLibm_jll/src/wrappers/armv7l-linux-gnueabihf.jl

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,19 @@ export libopenlibm
33

44
JLLWrappers.@generate_wrapper_header("OpenLibm")
55
JLLWrappers.@declare_library_product(libopenlibm, "libopenlibm.so.3")
6+
JLLWrappers.@declare_library_product(libnonexisting, "libnonexisting.so.0")
67
function __init__()
78
JLLWrappers.@generate_init_header()
89
JLLWrappers.@init_library_product(
910
libopenlibm,
1011
"lib/libopenlibm.so",
1112
RTLD_LAZY | RTLD_DEEPBIND,
1213
)
14+
JLLWrappers.@init_library_product(
15+
libnonexisting,
16+
"lib/libnonexisting.so",
17+
nothing,
18+
)
1319

1420
JLLWrappers.@generate_init_footer()
1521
end # __init__()

test/OpenLibm_jll/src/wrappers/armv7l-linux-musleabihf.jl

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,19 @@ export libopenlibm
33

44
JLLWrappers.@generate_wrapper_header("OpenLibm")
55
JLLWrappers.@declare_library_product(libopenlibm, "libopenlibm.so.3")
6+
JLLWrappers.@declare_library_product(libnonexisting, "libnonexisting.so.0")
67
function __init__()
78
JLLWrappers.@generate_init_header()
89
JLLWrappers.@init_library_product(
910
libopenlibm,
1011
"lib/libopenlibm.so",
1112
RTLD_LAZY | RTLD_DEEPBIND,
1213
)
14+
JLLWrappers.@init_library_product(
15+
libnonexisting,
16+
"lib/libnonexisting.so",
17+
nothing,
18+
)
1319

1420
JLLWrappers.@generate_init_footer()
1521
end # __init__()

test/OpenLibm_jll/src/wrappers/i686-linux-gnu.jl

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,19 @@ export libopenlibm
33

44
JLLWrappers.@generate_wrapper_header("OpenLibm")
55
JLLWrappers.@declare_library_product(libopenlibm, "libopenlibm.so.3")
6+
JLLWrappers.@declare_library_product(libnonexisting, "libnonexisting.so.0")
67
function __init__()
78
JLLWrappers.@generate_init_header()
89
JLLWrappers.@init_library_product(
910
libopenlibm,
1011
"lib/libopenlibm.so",
1112
RTLD_LAZY | RTLD_DEEPBIND,
1213
)
14+
JLLWrappers.@init_library_product(
15+
libnonexisting,
16+
"lib/libnonexisting.so",
17+
nothing,
18+
)
1319

1420
JLLWrappers.@generate_init_footer()
1521
end # __init__()

test/OpenLibm_jll/src/wrappers/i686-linux-musl.jl

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,19 @@ export libopenlibm
33

44
JLLWrappers.@generate_wrapper_header("OpenLibm")
55
JLLWrappers.@declare_library_product(libopenlibm, "libopenlibm.so.3")
6+
JLLWrappers.@declare_library_product(libnonexisting, "libnonexisting.so.0")
67
function __init__()
78
JLLWrappers.@generate_init_header()
89
JLLWrappers.@init_library_product(
910
libopenlibm,
1011
"lib/libopenlibm.so",
1112
RTLD_LAZY | RTLD_DEEPBIND,
1213
)
14+
JLLWrappers.@init_library_product(
15+
libnonexisting,
16+
"lib/libnonexisting.so",
17+
nothing,
18+
)
1319

1420
JLLWrappers.@generate_init_footer()
1521
end # __init__()

test/OpenLibm_jll/src/wrappers/i686-w64-mingw32.jl

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,19 @@ export libopenlibm
33

44
JLLWrappers.@generate_wrapper_header("OpenLibm")
55
JLLWrappers.@declare_library_product(libopenlibm, "libopenlibm.dll")
6+
JLLWrappers.@declare_library_product(libnonexisting, "libnonexisting.dll")
67
function __init__()
78
JLLWrappers.@generate_init_header()
89
JLLWrappers.@init_library_product(
910
libopenlibm,
1011
"bin/libopenlibm.dll",
1112
RTLD_LAZY | RTLD_DEEPBIND,
1213
)
14+
JLLWrappers.@init_library_product(
15+
libnonexisting,
16+
"bin/libnonexisting.dll",
17+
nothing,
18+
)
1319

1420
JLLWrappers.@generate_init_footer()
1521
end # __init__()

test/OpenLibm_jll/src/wrappers/powerpc64le-linux-gnu.jl

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,19 @@ export libopenlibm
33

44
JLLWrappers.@generate_wrapper_header("OpenLibm")
55
JLLWrappers.@declare_library_product(libopenlibm, "libopenlibm.so.3")
6+
JLLWrappers.@declare_library_product(libnonexisting, "libnonexisting.so.0")
67
function __init__()
78
JLLWrappers.@generate_init_header()
89
JLLWrappers.@init_library_product(
910
libopenlibm,
1011
"lib/libopenlibm.so",
1112
RTLD_LAZY | RTLD_DEEPBIND,
1213
)
14+
JLLWrappers.@init_library_product(
15+
libnonexisting,
16+
"lib/libnonexisting.so",
17+
nothing,
18+
)
1319

1420
JLLWrappers.@generate_init_footer()
1521
end # __init__()

0 commit comments

Comments
 (0)