Build TurboJPEG/OSS with a version script to prevent any non-global symbols from being accessible (this is to protect against potential namespace conflicts when preloading it into an application via VirtualGL.)

This commit is contained in:
DRC
2010-02-16 05:03:51 +00:00
parent 70d9c0bd55
commit 27c9e4290d
3 changed files with 32 additions and 1 deletions

View File

@@ -16,7 +16,14 @@ libjpeg_la_SOURCES = $(HDRS) jcapimin.c jcapistd.c jccoefct.c jccolor.c \
jfdctflt.c jfdctfst.c jfdctint.c jidctflt.c jidctfst.c jidctint.c \
jidctred.c jquant1.c jquant2.c jutils.c jmemmgr.c jmemnobs.c
libturbojpeg_la_SOURCES = $(libjpeg_la_SOURCES) turbojpegl.c turbojpeg.h
libturbojpeg_la_SOURCES = $(libjpeg_la_SOURCES) turbojpegl.c turbojpeg.h \
turbojpeg-mapfile
if VERSION_SCRIPT
libturbojpeg_la_LDFLAGS += -Wl,--version-script,$(srcdir)/turbojpeg-mapfile
endif
if WITH_SIMD

View File

@@ -26,6 +26,17 @@ AC_PROG_INSTALL
AC_PROG_LIBTOOL
AC_PROG_LN_S
AC_MSG_CHECKING([whether the linker supports version scripts])
LDVER=`$LD --help < /dev/null 2>/dev/null | grep version-script`
if test "$LDVER"; then
VERSION_SCRIPT=yes
AC_MSG_RESULT(yes)
else
VERSION_SCRIPT=no
AC_MSG_RESULT(no)
fi
AM_CONDITIONAL(VERSION_SCRIPT, test "x$VERSION_SCRIPT" = "xyes")
if test "x${GCC}" = "xyes"; then
if test "x${SAVED_CFLAGS}" = "x"; then
CFLAGS=-O3

13
turbojpeg-mapfile Executable file
View File

@@ -0,0 +1,13 @@
{
global:
tjInitCompress;
tjCompress;
TJBUFSIZE;
tjInitDecompress;
tjDecompressHeader;
tjDecompress;
tjDestroy;
tjGetErrorStr;
local:
*;
};