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.
%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
%xdefine current_function_section __SECT__
%if FORMAT_ELF
%if %1
- global %2:function hidden
+ global %2:function VISIBILITY
%else
global %2:function
%endif
; 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
%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