From 1001e63bd8309b58880902e70f65115952b1db04 Mon Sep 17 00:00:00 2001 From: Phil Sutter Date: Fri, 29 Oct 2021 23:30:43 +0200 Subject: gnutls: Fix build with uclibc-ng Recent gnutls update introduced "gnulib module fopen" (gl/fopen.c) which tries to get fopen() declaration from stdio.h by defining __need_FILE before including the header. While this seems unnecessary for the purpose (alegedly __need_FILE is used by headers including stdio.h to get the FILE declaration while avoiding namespace pollution), uClibc-ng's stdio.h behaves unexpected if __need_FILE is defined: 1) features.h is not included, therefore __BEGIN_NAMESPACE_STD (and likely more) is not known later on 2) it declares *only* FILE, nothing else To avoid these problems, don't define __need_FILE in gnutls and pray this works with other libc's as well. Actually one should fix uClibc-ng instead. Signed-off-by: Phil Sutter --- package/gnutls/patches/0001-uclibc.patch | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 package/gnutls/patches/0001-uclibc.patch (limited to 'package/gnutls') diff --git a/package/gnutls/patches/0001-uclibc.patch b/package/gnutls/patches/0001-uclibc.patch new file mode 100644 index 000000000..b1b90016a --- /dev/null +++ b/package/gnutls/patches/0001-uclibc.patch @@ -0,0 +1,32 @@ +diff -ur gnutls-3.6.16.orig/gl/fopen.c gnutls-3.6.16/gl/fopen.c +--- gnutls-3.6.16.orig/gl/fopen.c 2021-05-24 10:04:41.000000000 +0200 ++++ gnutls-3.6.16/gl/fopen.c 2021-10-29 14:28:33.850290352 +0200 +@@ -19,12 +19,10 @@ + /* If the user's config.h happens to include , let it include only + the system's here, so that orig_fopen doesn't recurse to + rpl_fopen. */ +-#define __need_FILE + #include + + /* Get the original definition of fopen. It might be defined as a macro. */ + #include +-#undef __need_FILE + + static FILE * + orig_fopen (const char *filename, const char *mode) +diff -ur gnutls-3.6.16.orig/src/gl/fopen.c gnutls-3.6.16/src/gl/fopen.c +--- gnutls-3.6.16.orig/src/gl/fopen.c 2021-05-24 10:05:13.000000000 +0200 ++++ gnutls-3.6.16/src/gl/fopen.c 2021-10-29 14:28:41.435290892 +0200 +@@ -19,12 +19,10 @@ + /* If the user's config.h happens to include , let it include only + the system's here, so that orig_fopen doesn't recurse to + rpl_fopen. */ +-#define __need_FILE + #include + + /* Get the original definition of fopen. It might be defined as a macro. */ + #include +-#undef __need_FILE + + static FILE * + orig_fopen (const char *filename, const char *mode) -- cgit v1.2.3