Make _TIFFBuiltinCODECS be const data.

Actually, this makes it .rel.ro data, but still better than r/w. From
my recollection, VMS is the one place where this would need to be r/w,
so invert the ifdef.

Change-Id: I3602dbde318fba27280c96d63819a20c77eae1c8
Reviewed-on: https://pdfium-review.googlesource.com/c/pdfium/+/74837
Reviewed-by: Lei Zhang <thestig@chromium.org>
Commit-Queue: Tom Sepez <tsepez@chromium.org>
diff --git a/third_party/libtiff/0032-builtin-codecs.patch b/third_party/libtiff/0032-builtin-codecs.patch
new file mode 100644
index 0000000..b30cc42
--- /dev/null
+++ b/third_party/libtiff/0032-builtin-codecs.patch
@@ -0,0 +1,26 @@
+diff --git a/third_party/libtiff/tif_codec.c b/third_party/libtiff/tif_codec.c
+index b6c04f01d..f909b20c1 100644
+--- a/third_party/libtiff/tif_codec.c
++++ b/third_party/libtiff/tif_codec.c
+@@ -80,7 +80,7 @@ static int NotConfigured(TIFF*, int);
+ /*
+  * Compression schemes statically built into the library.
+  */
+-#ifdef VMS
++#ifndef VMS
+ const TIFFCodec _TIFFBuiltinCODECS[] = {
+ #else
+ TIFFCodec _TIFFBuiltinCODECS[] = {
+diff --git a/third_party/libtiff/tiffiop.h b/third_party/libtiff/tiffiop.h
+index ba7b2659a..b345996ab 100644
+--- a/third_party/libtiff/tiffiop.h
++++ b/third_party/libtiff/tiffiop.h
+@@ -452,7 +452,7 @@ extern int TIFFInitZSTD(TIFF*, int);
+ #ifdef WEBP_SUPPORT
+ extern int TIFFInitWebP(TIFF*, int);
+ #endif
+-#ifdef VMS
++#ifndef VMS
+ extern const TIFFCodec _TIFFBuiltinCODECS[];
+ #else
+ extern TIFFCodec _TIFFBuiltinCODECS[];
diff --git a/third_party/libtiff/README.pdfium b/third_party/libtiff/README.pdfium
index 4c97a25..4691827 100644
--- a/third_party/libtiff/README.pdfium
+++ b/third_party/libtiff/README.pdfium
@@ -14,3 +14,4 @@
 0027-build-config.patch: #define variables so their value can be used by #if.
 0028-nstrips-OOM.patch: return error for excess number of tiles/strips.
 0031-safe_size_ingtStripContig.patch: return error if the size to read overflow from int32.
+0032-builtin-codecs.patch: make _TIFFBuiltinCODECS const data.
diff --git a/third_party/libtiff/tif_codec.c b/third_party/libtiff/tif_codec.c
index b6c04f0..f909b20 100644
--- a/third_party/libtiff/tif_codec.c
+++ b/third_party/libtiff/tif_codec.c
@@ -80,7 +80,7 @@
 /*
  * Compression schemes statically built into the library.
  */
-#ifdef VMS
+#ifndef VMS
 const TIFFCodec _TIFFBuiltinCODECS[] = {
 #else
 TIFFCodec _TIFFBuiltinCODECS[] = {
diff --git a/third_party/libtiff/tiffiop.h b/third_party/libtiff/tiffiop.h
index ba7b265..b345996 100644
--- a/third_party/libtiff/tiffiop.h
+++ b/third_party/libtiff/tiffiop.h
@@ -452,7 +452,7 @@
 #ifdef WEBP_SUPPORT
 extern int TIFFInitWebP(TIFF*, int);
 #endif
-#ifdef VMS
+#ifndef VMS
 extern const TIFFCodec _TIFFBuiltinCODECS[];
 #else
 extern TIFFCodec _TIFFBuiltinCODECS[];