Skip to content

Commit

Permalink
We accidentally flipped the meaning of LBT_USE_RTLD_DEEPBIND
Browse files Browse the repository at this point in the history
Add test for `LBT_USE_RTLD_DEEPBIND`
  • Loading branch information
staticfloat committed Jun 14, 2024
1 parent 77227d2 commit fc053fe
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
4 changes: 1 addition & 3 deletions src/libblastrampoline.c
Original file line number Diff line number Diff line change
Expand Up @@ -415,17 +415,15 @@ __attribute__((constructor)) void init(void) {
printf("libblastrampoline initializing from %s\n", lookup_self_path());
}

#if !defined(LBT_DEEPBINDLESS)
// If LBT_USE_RTLD_DEEPBIND == "0", we avoid using RTLD_DEEPBIND on a
// deepbind-capable system. This is mostly useful for sanitizers, which
// abhor such library loading shenanigans.
if (env_match_bool("LBT_USE_RTLD_DEEPBIND", 1)) {
if (!env_match_bool("LBT_USE_RTLD_DEEPBIND", 1)) {
use_deepbind = 0x00;
if (verbose) {
printf("LBT_USE_RTLD_DEEPBIND=0 detected; avoiding usage of RTLD_DEEPBIND\n");
}
}
#endif // !defined(LBT_DEEPBINDLESS)

if (env_match_bool("LBT_STRICT", 0)) {
if (verbose) {
Expand Down
9 changes: 9 additions & 0 deletions test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,15 @@ lbt_dir = joinpath(lbt_dir, binlib)
run_test(cdotc_fail, blastrampoline_link_name(), libdirs, openblas_interface, OpenBLAS_jll.libopenblas_path)
end
=#

withenv("LBT_USE_RTLD_DEEPBIND" => "false") do
dgemm_deepbindless = (
"dgemm_test",
("||C||^2 is: 24.3384", "avoiding usage of RTLD_DEEPBIND"),
true,
)
run_test(dgemm_deepbindless, blastrampoline_link_name(), libdirs, openblas_interface, OpenBLAS_jll.libopenblas_path)
end
end

# And again, but this time with OpenBLAS32_jll
Expand Down

0 comments on commit fc053fe

Please sign in to comment.