From: DRC Date: Tue, 27 Feb 2018 01:41:59 +0000 (-0600) Subject: Make SIMD syms private for x86[-64]/Mach-O builds X-Git-Tag: 1.5.90~26 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=367a838626576b4ff2a47cbd5a494199b800dc48;p=libjpeg-turbo Make SIMD syms private for x86[-64]/Mach-O builds ... if building with YASM. NASM doesn't currently support the necessary directives. Closes #212 --- diff --git a/BUILDING.md b/BUILDING.md index 0e63964..429963e 100644 --- a/BUILDING.md +++ b/BUILDING.md @@ -18,6 +18,9 @@ Build Requirements when building macho64 objects.) NASM or YASM can be obtained from [MacPorts](http://www.macports.org/) or [Homebrew](http://brew.sh/). * If using YASM, 1.2.0 or later is required. + - NOTE: Currently, if it is desirable to hide the SIMD function symbols in + Mac executables or shared libraries that statically link with + libjpeg-turbo, then YASM must be used when building libjpeg-turbo. * If building on Windows, **nasm.exe**/**yasm.exe** should be in your `PATH`. The binary RPMs released by the NASM project do not work on older Linux diff --git a/ChangeLog.md b/ChangeLog.md index 7bac416..a5e6c86 100644 --- a/ChangeLog.md +++ b/ChangeLog.md @@ -107,9 +107,10 @@ actual security issues, should they arise in the future. algorithm that caused incorrect dithering in the output image. This algorithm now produces bitwise-identical results to the unmerged algorithms. -12. The SIMD function symbols for x86[-64]/ELF, MIPS/ELF, and iOS/ARM[64] -builds are now private. This prevents those symbols from being exposed in -applications or shared libraries that link statically with libjpeg-turbo. +12. The SIMD function symbols for x86[-64]/ELF, MIPS/ELF, macOS/x86[-64] (if +libjpeg-turbo is built with YASM), and iOS/ARM[64] builds are now private. +This prevents those symbols from being exposed in applications or shared +libraries that link statically with libjpeg-turbo. 1.5.3 diff --git a/simd/nasm/jsimdext.inc b/simd/nasm/jsimdext.inc index e91e009..fc9c855 100644 --- a/simd/nasm/jsimdext.inc +++ b/simd/nasm/jsimdext.inc @@ -194,11 +194,17 @@ section .note.GNU-stack noalloc noexec nowrite progbits %ifdef ELF ; ----(nasm -felf[64] -DELF ...)-------- %define GLOBAL_FUNCTION(name) global EXTN(name):function hidden %define GLOBAL_DATA(name) global EXTN(name):data hidden -;%elifdef MACHO ; ----(nasm -fmacho -DMACHO ...)-------- -;%define GLOBAL_FUNCTION(name) global EXTN(name):private_extern -;%define GLOBAL_DATA(name) global EXTN(name):private_extern -%else +%elifdef MACHO ; ----(nasm -fmacho -DMACHO ...)-------- +%ifdef __YASM_VER__ +%define GLOBAL_FUNCTION(name) global EXTN(name):private_extern +%define GLOBAL_DATA(name) global EXTN(name):private_extern +%endif +%endif + +%ifndef GLOBAL_FUNCTION %define GLOBAL_FUNCTION(name) global EXTN(name) +%endif +%ifndef GLOBAL_DATA %define GLOBAL_DATA(name) global EXTN(name) %endif