Skip to content

Commit fc053fe

Browse files
committed
We accidentally flipped the meaning of LBT_USE_RTLD_DEEPBIND
Add test for `LBT_USE_RTLD_DEEPBIND`
1 parent 77227d2 commit fc053fe

File tree

2 files changed

+10
-3
lines changed

2 files changed

+10
-3
lines changed

src/libblastrampoline.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -415,17 +415,15 @@ __attribute__((constructor)) void init(void) {
415415
printf("libblastrampoline initializing from %s\n", lookup_self_path());
416416
}
417417

418-
#if !defined(LBT_DEEPBINDLESS)
419418
// If LBT_USE_RTLD_DEEPBIND == "0", we avoid using RTLD_DEEPBIND on a
420419
// deepbind-capable system. This is mostly useful for sanitizers, which
421420
// abhor such library loading shenanigans.
422-
if (env_match_bool("LBT_USE_RTLD_DEEPBIND", 1)) {
421+
if (!env_match_bool("LBT_USE_RTLD_DEEPBIND", 1)) {
423422
use_deepbind = 0x00;
424423
if (verbose) {
425424
printf("LBT_USE_RTLD_DEEPBIND=0 detected; avoiding usage of RTLD_DEEPBIND\n");
426425
}
427426
}
428-
#endif // !defined(LBT_DEEPBINDLESS)
429427

430428
if (env_match_bool("LBT_STRICT", 0)) {
431429
if (verbose) {

test/runtests.jl

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,15 @@ lbt_dir = joinpath(lbt_dir, binlib)
142142
run_test(cdotc_fail, blastrampoline_link_name(), libdirs, openblas_interface, OpenBLAS_jll.libopenblas_path)
143143
end
144144
=#
145+
146+
withenv("LBT_USE_RTLD_DEEPBIND" => "false") do
147+
dgemm_deepbindless = (
148+
"dgemm_test",
149+
("||C||^2 is: 24.3384", "avoiding usage of RTLD_DEEPBIND"),
150+
true,
151+
)
152+
run_test(dgemm_deepbindless, blastrampoline_link_name(), libdirs, openblas_interface, OpenBLAS_jll.libopenblas_path)
153+
end
145154
end
146155

147156
# And again, but this time with OpenBLAS32_jll

0 commit comments

Comments
 (0)