Skip to content

Commit a29d777

Browse files
authored
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
1 parent 4fec69b commit a29d777

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

build_defs.bzl

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,10 @@ def pybind_extension(
6868
linkopts = linkopts + select({
6969
"@platforms//os:osx": ["-undefined", "dynamic_lookup"],
7070
Label("@pybind11//:msvc_compiler"): [],
71-
"//conditions:default": ["-Wl,-Bsymbolic"],
71+
"//conditions:default": [
72+
"-Wl,-Bsymbolic",
73+
"-Wl,-z,undefs",
74+
],
7275
}),
7376
linkshared = 1,
7477
tags = tags,

0 commit comments

Comments
 (0)