unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
* [bug#30654] [PATCH 1/1] gnu: giflib: Make "reallocarray" private, solve glibc@2.26 conflict.
@ 2018-02-28 20:12 Hartmut Goebel
  2018-02-28 20:16 ` [bug#30654] giflib / khtml build failures Hartmut Goebel
                   ` (2 more replies)
  0 siblings, 3 replies; 12+ messages in thread
From: Hartmut Goebel @ 2018-02-28 20:12 UTC (permalink / raw)
  To: 30654

Move the declaration from gif_lib.h to gif_lib_private.h to solve
conflicts when some .c-file #includes both stdlib.h and gif_lib.h.
See also https://sourceforge.net/p/giflib/bugs/110/

* gnu/packages/patches/giflib-make-reallocarray-private.patch: New
  file
* gnu/local.mk (dist_patch_DATA): Register it.
* gnu/packages/image.scm(giflib)[source](patches): New field.
---
 gnu/local.mk                                       |  1 +
 gnu/packages/image.scm                             |  4 ++-
 .../patches/giflib-make-reallocarray-private.patch | 42 ++++++++++++++++++++++
 3 files changed, 46 insertions(+), 1 deletion(-)
 create mode 100644 gnu/packages/patches/giflib-make-reallocarray-private.patch

diff --git a/gnu/local.mk b/gnu/local.mk
index 24368727f..de8161bbb 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -693,6 +693,7 @@ dist_patch_DATA =						\
   %D%/packages/patches/ghostscript-no-header-uuid.patch		\
   %D%/packages/patches/ghostscript-no-header-creationdate.patch \
   %D%/packages/patches/ghostscript-runpath.patch		\
+  %D%/packages/patches/giflib-make-reallocarray-private.patch	\
   %D%/packages/patches/gimp-CVE-2017-17784.patch		\
   %D%/packages/patches/gimp-CVE-2017-17785.patch		\
   %D%/packages/patches/gimp-CVE-2017-17786.patch		\
diff --git a/gnu/packages/image.scm b/gnu/packages/image.scm
index e3e3a3ccc..a39718903 100644
--- a/gnu/packages/image.scm
+++ b/gnu/packages/image.scm
@@ -572,7 +572,9 @@ error-resilience, a Java-viewer for j2k-images, ...")
                                   version ".tar.bz2"))
               (sha256
                (base32
-                "1md83dip8rf29y40cm5r7nn19705f54iraz6545zhwa6y8zyq9yz"))))
+                "1md83dip8rf29y40cm5r7nn19705f54iraz6545zhwa6y8zyq9yz"))
+              (patches (search-patches
+                        "giflib-make-reallocarray-private.patch"))))
     (build-system gnu-build-system)
     (outputs '("bin"                    ; utility programs
                "out"))                  ; library
diff --git a/gnu/packages/patches/giflib-make-reallocarray-private.patch b/gnu/packages/patches/giflib-make-reallocarray-private.patch
new file mode 100644
index 000000000..d29ac05c8
--- /dev/null
+++ b/gnu/packages/patches/giflib-make-reallocarray-private.patch
@@ -0,0 +1,42 @@
+Move the declaration from gif_lib.h to gif_lib_private.h to solve
+conflicts when some .c-file #includes both stdlib.h and gif_lib.h.
+See also https://sourceforge.net/p/giflib/bugs/110/
+
+diff -ur giflib-5.1.4.orig/lib/gifalloc.c giflib-5.1.4/lib/gifalloc.c
+--- giflib-5.1.4.orig/lib/gifalloc.c	2018-02-28 20:31:02.294682673 +0100
++++ giflib-5.1.4/lib/gifalloc.c	2018-02-28 20:39:12.093799085 +0100
+@@ -8,7 +8,7 @@
+ #include <stdio.h>
+ #include <string.h>
+ 
+-#include "gif_lib.h"
++#include "gif_lib_private.h"
+ 
+ #define MAX(x, y)    (((x) > (y)) ? (x) : (y))
+ 
+diff -ur giflib-5.1.4.orig/lib/gif_lib.h giflib-5.1.4/lib/gif_lib.h
+--- giflib-5.1.4.orig/lib/gif_lib.h	2018-02-28 20:31:02.294682673 +0100
++++ giflib-5.1.4/lib/gif_lib.h	2018-02-28 20:31:43.135716712 +0100
+@@ -244,9 +244,6 @@
+                                      GifPixelType ColorTransIn2[]);
+ extern int GifBitSize(int n);
+ 
+-extern void *
+-reallocarray(void *optr, size_t nmemb, size_t size);
+-
+ /******************************************************************************
+  Support for the in-core structures allocation (slurp mode).              
+ ******************************************************************************/
+diff -ur giflib-5.1.4.orig/lib/gif_lib_private.h giflib-5.1.4/lib/gif_lib_private.h
+--- giflib-5.1.4.orig/lib/gif_lib_private.h	2018-02-28 20:31:02.294682673 +0100
++++ giflib-5.1.4/lib/gif_lib_private.h	2018-02-28 20:31:56.208257947 +0100
+@@ -54,6 +54,9 @@
+     bool gif89;
+ } GifFilePrivateType;
+ 
++extern void *
++reallocarray(void *optr, size_t nmemb, size_t size);
++
+ #endif /* _GIF_LIB_PRIVATE_H */
+ 
+ /* end */
-- 
2.13.6

^ permalink raw reply related	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2018-06-22 15:39 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-02-28 20:12 [bug#30654] [PATCH 1/1] gnu: giflib: Make "reallocarray" private, solve glibc@2.26 conflict Hartmut Goebel
2018-02-28 20:16 ` [bug#30654] giflib / khtml build failures Hartmut Goebel
2018-02-28 21:57   ` Danny Milosavljevic
2018-02-28 21:06     ` Hartmut Goebel
2018-02-28 22:18       ` Danny Milosavljevic
2018-02-28 22:10     ` Danny Milosavljevic
2018-02-28 21:46 ` [bug#30654] [PATCH v2 1/1] gnu: giflib: Make "reallocarray" private, solve glibc@2.26 conflict Hartmut Goebel
2018-03-01  4:01   ` Danny Milosavljevic
2018-03-01  7:52     ` Hartmut Goebel
2018-03-17 17:29       ` Manolis Ragkousis
2018-03-17 20:58         ` Hartmut Goebel
2018-06-22 15:37 ` bug#30654: " Gábor Boskovits

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).