external/swiftshader
Revisión | e3621dca154207c1df41123a94b4691f95185adf (tree) |
---|---|
Tiempo | 2020-02-27 00:51:34 |
Autor | Nicolas Capens <capn@goog...> |
Commiter | Nicolas Capens |
Build with -Bsymbolic to prevent symbol preemption
The CMake build was already using -fvisibility=protected, which has the
same effect but uses duplicate symbol entries for internal/external use.
Bug: b/148240133
Change-Id: I8069a1b293a6ec0604be32179ed591ffaa645ed7
Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/41648
Presubmit-Ready: Nicolas Capens <nicolascapens@google.com>
Tested-by: Nicolas Capens <nicolascapens@google.com>
Reviewed-by: Antonio Maiorano <amaiorano@google.com>
@@ -293,8 +293,9 @@ macro(set_shared_library_export_map TARGET DIR) | ||
293 | 293 | set_property(TARGET ${TARGET} APPEND_STRING PROPERTY LINK_FLAGS " -Wl,--version-script=${DIR}/${TARGET}.lds") |
294 | 294 | set_property(TARGET ${TARGET} APPEND_STRING PROPERTY LINK_DEPENDS "${DIR}/${TARGET}.lds;") |
295 | 295 | |
296 | - # Don't allow symbols to be overridden by another module. | |
297 | - set_property(TARGET ${TARGET} APPEND_STRING PROPERTY COMPILE_FLAGS " -fvisibility=protected") | |
296 | + # -Bsymbolic binds symbol references to their global definitions within | |
297 | + # a shared object, thereby preventing symbol preemption. | |
298 | + set_property(TARGET ${TARGET} APPEND_STRING PROPERTY COMPILE_FLAGS " -Wl,-Bsymbolic") | |
298 | 299 | |
299 | 300 | if(ARCH STREQUAL "mipsel" OR ARCH STREQUAL "mips64el") |
300 | 301 | # MIPS supports sysv hash-style only. |
@@ -555,6 +555,12 @@ cc_defaults { | ||
555 | 555 | "-Wno-non-virtual-dtor", |
556 | 556 | ], |
557 | 557 | |
558 | + ldflags: [ | |
559 | + // -Bsymbolic binds symbol references to their global definitions within | |
560 | + // a shared object, thereby preventing symbol preemption. | |
561 | + "-Wl,-Bsymbolic", | |
562 | + ], | |
563 | + | |
558 | 564 | local_include_dirs: [ "Vulkan" ], |
559 | 565 | |
560 | 566 | version_script: "Vulkan/android_vk_swiftshader.lds", |
@@ -158,8 +158,12 @@ swiftshader_shared_library("swiftshader_libvulkan") { | ||
158 | 158 | inputs = [ |
159 | 159 | "vk_swiftshader.lds", |
160 | 160 | ] |
161 | - ldflags = [ "-Wl,--version-script=" + | |
162 | - rebase_path("vk_swiftshader.lds", root_build_dir) ] | |
161 | + ldflags = [ | |
162 | + # -Bsymbolic binds symbol references to their global definitions within | |
163 | + # a shared object, thereby preventing symbol preemption. | |
164 | + "-Wl,-Bsymbolic", | |
165 | + "-Wl,--version-script=" + | |
166 | + rebase_path("vk_swiftshader.lds", root_build_dir) ] | |
163 | 167 | } |
164 | 168 | |
165 | 169 | deps = [ |