diff options
author | kste <kste@google.com> | 2020-05-08 07:54:33 -0700 |
---|---|---|
committer | Copybara-Service <copybara-worker@google.com> | 2020-05-08 07:55:05 -0700 |
commit | 0f7ace75c6d93e468e1706cba980d849a2be6cb4 (patch) | |
tree | fe5353c79d97b20e83ab09234da043b8a83b1b01 /python/tools | |
parent | 2c85214b9d0c755ccf001a64e462da6711ae6ff7 (diff) | |
download | tink-0f7ace75c6d93e468e1706cba980d849a2be6cb4.tar.gz |
Update copts and linkopts flags for pybind_extensions.
This adds flags to hide symbols by default;for pybind_extensions to avoid unwanted interaction between generated shared objects.
PiperOrigin-RevId: 310557045
Diffstat (limited to 'python/tools')
-rw-r--r-- | python/tools/build_defs/tink_python_rules.bzl | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/python/tools/build_defs/tink_python_rules.bzl b/python/tools/build_defs/tink_python_rules.bzl index 7cff9e560..7b15c0907 100644 --- a/python/tools/build_defs/tink_python_rules.bzl +++ b/python/tools/build_defs/tink_python_rules.bzl @@ -5,6 +5,7 @@ def tink_pybind_extension( srcs = [], hdrs = [], copts = [], + linkopts = [], features = ["-use_header_modules"], deps = []): """ @@ -20,6 +21,7 @@ def tink_pybind_extension( srcs: source files corresponding to the target hdrs: header files corresponding to the target copts: flags for the compiler + linkopts: flags for the linker features: features enabled for Bazel deps: dependencies of the target @@ -33,7 +35,11 @@ def tink_pybind_extension( linkshared = 1, linkstatic = 1, srcs = srcs + hdrs, - copts = copts, + copts = copts + ["-fvisibility=hidden"], + linkopts = linkopts + select({ + "@pybind11//:osx": [], + "//conditions:default": ["-Wl,-Bsymbolic"], + }), features = features, deps = deps, ) |