--- libtiff/tiffiop.h.orig +++ libtiff/tiffiop.h @@ -70,6 +70,8 @@ typedef TIFF_UINT64_T uint64; #include "tiffio.h" #include "tif_dir.h" +#pragma GCC visibility push(hidden) + #ifndef STRIP_SIZE_DEFAULT # define STRIP_SIZE_DEFAULT 8192 #endif @@ -341,6 +343,7 @@ extern TIFFCodec _TIFFBuiltinCODECS[]; #if defined(__cplusplus) } #endif +#pragma GCC visibility pop #endif /* _TIFFIOP_ */ /* vim: set ts=8 sts=8 sw=8 noet: */ --- libtiff/tif_predict.h.orig +++ libtiff/tif_predict.h @@ -30,6 +30,8 @@ * ``Library-private'' Support for the Predictor Tag */ +#pragma GCC visibility push(hidden) + /* * Codecs that want to support the Predictor tag must place * this structure first in their private state block so that @@ -65,6 +67,7 @@ extern int TIFFPredictorCleanup(TIFF*); #if defined(__cplusplus) } #endif +#pragma GCC visibility pop #endif /* _TIFFPREDICT_ */ /* vim: set ts=8 sts=8 sw=8 noet: */ --- libtiff/tif_dir.h.orig +++ libtiff/tif_dir.h @@ -29,7 +29,7 @@ /* * ``Library-private'' Directory-related Definitions. */ - +#pragma GCC visibility push(hidden) /* * Internal format of a TIFF directory entry. */ @@ -199,6 +199,7 @@ extern TIFFFieldInfo* _TIFFCreateAnonFi #if defined(__cplusplus) } #endif +#pragma GCC visibility pop #endif /* _TIFFDIR_ */ /* vim: set ts=8 sts=8 sw=8 noet: */ --- tools/Makefile.am.orig +++ tools/Makefile.am @@ -62,6 +62,8 @@ if HAVE_RPATH AM_LDFLAGS = $(LIBDIR) endif +AM_CFLAGS = -fwhole-program + bmp2tiff_SOURCES = bmp2tiff.c bmp2tiff_LDADD = $(LIBTIFF) $(LIBPORT) @@ -86,7 +88,9 @@ ras2tiff_LDADD = $(LIBTIFF) $(LIBPORT) raw2tiff_SOURCES = raw2tiff.c raw2tiff_LDADD = $(LIBTIFF) $(LIBPORT) -rgb2ycbcr_SOURCES = rgb2ycbcr.c +#uses private functions. +rgb2ycbcr_CFLAGS = -fno-whole-program +rgb2ycbcr_SOURCES = rgb2ycbcr.c $(top_srcdir)/libtiff/tif_aux.c rgb2ycbcr_LDADD = $(LIBTIFF) $(LIBPORT) thumbnail_SOURCES = thumbnail.c @@ -100,8 +104,9 @@ tiff2pdf_LDADD = $(LIBTIFF) $(LIBPORT) tiff2ps_SOURCES = tiff2ps.c tiff2ps_LDADD = $(LIBTIFF) $(LIBPORT) - -tiff2rgba_SOURCES = tiff2rgba.c +# Uses private functions +tiff2rgba_CFLAGS = -fno-whole-program +tiff2rgba_SOURCES = tiff2rgba.c $(top_srcdir)/libtiff/tif_aux.c tiff2rgba_LDADD = $(LIBTIFF) $(LIBPORT) tiffcmp_SOURCES = tiffcmp.c --- port/dummy.c.orig +++ port/dummy.c @@ -4,6 +4,7 @@ * Dummy function, just to be ensure that the library always will be created. */ +__attribute__ ((visibility ("hidden"))) void libport_dummy_function() { --- port/libport.h.orig +++ port/libport.h @@ -25,13 +25,13 @@ #ifndef _LIBPORT_ #define _LIBPORT_ - +__attribute__ ((visibility ("hidden"))) int getopt(int argc, char * const argv[], const char *optstring); extern char *optarg; extern int opterr; extern int optind; extern int optopt; - +__attribute__ ((visibility ("hidden"))) int strcasecmp(const char *s1, const char *s2); #ifndef HAVE_GETOPT