ref: db41156a28c3d612a713f7d0fae283169494a187
parent: a22ba99d4279479c86e24a1dd81bd5e20ba999a1
author: Johann <johannkoenig@google.com>
date: Thu Apr 2 06:59:01 EDT 2020
x86inc.asm: only set visibility for chromium builds Reapply and update a4b47b89f. This restores the previous version's behavior avoiding issues with builds that may split sources on directory boundaries; protected visibility may work in this case. BUG=webm:1679 Change-Id: I36011727485847dd11f06782bc6beddedc39019c
--- a/third_party/x86inc/README.libvpx_new
+++ b/third_party/x86inc/README.libvpx_new
@@ -15,3 +15,4 @@
Copy PIC 'GLOBAL' macros from x86_abi_support.asm
Use .text instead of .rodata on macho to avoid broken tables in PIC mode.
Use .text with no alignment for aout.
+Only use 'hidden' visibility with Chromium.
--- a/third_party/x86inc/x86inc.asm_new
+++ b/third_party/x86inc/x86inc.asm_new
@@ -208,7 +208,17 @@
%endif
; End PIC macros from vpx_ports/x86_abi_support.asm.
-%define HAVE_PRIVATE_EXTERN 1
+; libvpx explicitly sets visibilty in shared object builds. Avoid setting
+; visibility to hidden as it may break builds that split sources on e.g.,
+; directory boundaries.
+%ifdef CHROMIUM
+ %define VISIBILITY hidden
+ %define HAVE_PRIVATE_EXTERN 1
+%else
+ %define VISIBILITY
+ %define HAVE_PRIVATE_EXTERN 0
+%endif
+
%ifdef __NASM_VER__
%use smartalign
%if __NASM_VERSION_ID__ < 0x020e0000 ; 2.14
@@ -839,7 +849,7 @@
%xdefine current_function_section __SECT__
%if FORMAT_ELF
%if %1
- global %2:function hidden
+ global %2:function VISIBILITY
%else
global %2:function
%endif
@@ -864,7 +874,7 @@
; Create a global symbol from a local label with the correct name mangling and type
%macro cglobal_label 1
%if FORMAT_ELF
- global current_function %+ %1:function hidden
+ global current_function %+ %1:function VISIBILITY
%elif FORMAT_MACHO && HAVE_PRIVATE_EXTERN
global current_function %+ %1:private_extern
%else
@@ -891,7 +901,7 @@
%macro const 1-2+
%xdefine %1 mangle(private_prefix %+ _ %+ %1)
%if FORMAT_ELF
- global %1:data hidden
+ global %1:data VISIBILITY
%elif FORMAT_MACHO && HAVE_PRIVATE_EXTERN
global %1:private_extern
%else