24750280 libtiff delivers incorrect header for 32bit compilation
authorVladimir Marek <Vladimir.Marek@oracle.com>
Wed, 28 Sep 2016 18:30:26 +0200
changeset 7045 f341fa83572f
parent 7044 cab2f9628501
child 7047 65ca2ca3ea90
24750280 libtiff delivers incorrect header for 32bit compilation
components/desktop/libtiff/Makefile
components/desktop/libtiff/TESTING
--- a/components/desktop/libtiff/Makefile	Mon Oct 03 13:12:13 2016 -0700
+++ b/components/desktop/libtiff/Makefile	Wed Sep 28 18:30:26 2016 +0200
@@ -67,12 +67,20 @@
 
 build:          $(BUILD_32_and_64)
 
-install:        $(INSTALL_32_and_64)
+install:        $(INSTALL_32_and_64) $(BUILD_DIR)/.merged-header
 
 test:           $(TEST_32_and_64)
 
 system-test:    $(SYSTEM_TESTS_NOT_IMPLEMENTED)
 
+$(BUILD_DIR)/.merged-header: $(BUILD_DIR_32)/.installed $(BUILD_DIR_64)/.installed
+	-$(RM) $(PROTO_DIR)/usr/include/tiffconf.h
+	$(GDIFF) -D _LP64 \
+            $(BUILD_DIR_32)/libtiff/tiffconf.h $(BUILD_DIR_64)/libtiff/tiffconf.h \
+            > $(PROTO_DIR)/usr/include/tiffconf.h; \
+	diffstatus=$$? ; \
+	if (( $$diffstatus != 1 )) ; then exit $$diffstatus ; fi
+
 REQUIRED_PACKAGES += compress/xz
 REQUIRED_PACKAGES += image/library/libjpeg
 REQUIRED_PACKAGES += library/zlib
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/components/desktop/libtiff/TESTING	Wed Sep 28 18:30:26 2016 +0200
@@ -0,0 +1,38 @@
+cd /var/tmp
+
+cat > a.c <<EOT
+#include <tiffconf.h>
+#include <stdio.h>
+
+int main(void) {
+        printf("8=%d\n", sizeof(TIFF_INT64_T));
+        printf("8=%d\n", sizeof(TIFF_UINT64_T));
+        printf("%d=%d\n", sizeof(ssize_t), sizeof(TIFF_SSIZE_T));
+}
+EOT
+
+GCC=gcc
+CC=/ws/on12-tools/SUNWspro/solarisstudio12.4/bin/cc
+
+$GCC -m32 a.c && ./a.out
+$GCC -m64 a.c && ./a.out
+$CC -m32 a.c && ./a.out
+$CC -m64 a.c && ./a.out
+
+Output should be:
+8=8
+8=8
+4=4
+...
+8=8
+8=8
+8=8
+...
+8=8
+8=8
+4=4
+...
+8=8
+8=8
+8=8
+