Add -Wl,-z,undefs to linux links (#90)
If the user's toolchain / global settings imply -z,defs, this is
necessary similar to the macOS flags to allow libpython symbols to be
undefined
diff --git a/build_defs.bzl b/build_defs.bzl
index 5c88f1c..1b10d11 100644
--- a/build_defs.bzl
+++ b/build_defs.bzl
@@ -68,7 +68,10 @@
linkopts = linkopts + select({
"@platforms//os:osx": ["-undefined", "dynamic_lookup"],
Label("@pybind11//:msvc_compiler"): [],
- "//conditions:default": ["-Wl,-Bsymbolic"],
+ "//conditions:default": [
+ "-Wl,-Bsymbolic",
+ "-Wl,-z,undefs",
+ ],
}),
linkshared = 1,
tags = tags,