Android-x86
Fork
Donation

  • R/O
  • HTTP
  • SSH
  • HTTPS

external-swiftshader: Commit

external/swiftshader


Commit MetaInfo

Revisióne3621dca154207c1df41123a94b4691f95185adf (tree)
Tiempo2020-02-27 00:51:34
AutorNicolas Capens <capn@goog...>
CommiterNicolas Capens

Log Message

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>

Cambiar Resumen

Diferencia incremental

--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -293,8 +293,9 @@ macro(set_shared_library_export_map TARGET DIR)
293293 set_property(TARGET ${TARGET} APPEND_STRING PROPERTY LINK_FLAGS " -Wl,--version-script=${DIR}/${TARGET}.lds")
294294 set_property(TARGET ${TARGET} APPEND_STRING PROPERTY LINK_DEPENDS "${DIR}/${TARGET}.lds;")
295295
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")
298299
299300 if(ARCH STREQUAL "mipsel" OR ARCH STREQUAL "mips64el")
300301 # MIPS supports sysv hash-style only.
--- a/src/Android.bp
+++ b/src/Android.bp
@@ -555,6 +555,12 @@ cc_defaults {
555555 "-Wno-non-virtual-dtor",
556556 ],
557557
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+
558564 local_include_dirs: [ "Vulkan" ],
559565
560566 version_script: "Vulkan/android_vk_swiftshader.lds",
--- a/src/Vulkan/BUILD.gn
+++ b/src/Vulkan/BUILD.gn
@@ -158,8 +158,12 @@ swiftshader_shared_library("swiftshader_libvulkan") {
158158 inputs = [
159159 "vk_swiftshader.lds",
160160 ]
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) ]
163167 }
164168
165169 deps = [
Show on old repository browser