[OpenWrt-Devel] [PATCH] util-linux: Fix widechar check

Rosen Penev rosenp at gmail.com
Wed Jul 17 21:30:00 EDT 2019


Patch is an upstream backport.

Fixes compilation when -Werror=implicit-function-declaration is passed.

Signed-off-by: Rosen Penev <rosenp at gmail.com>
---
 package/utils/util-linux/Makefile             |  2 +-
 .../util-linux/patches/010-stdlib.h.patch     | 26 +++++++++++++++++++
 2 files changed, 27 insertions(+), 1 deletion(-)
 create mode 100644 package/utils/util-linux/patches/010-stdlib.h.patch

diff --git a/package/utils/util-linux/Makefile b/package/utils/util-linux/Makefile
index 261a9615ef..3ce6354ec3 100644
--- a/package/utils/util-linux/Makefile
+++ b/package/utils/util-linux/Makefile
@@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=util-linux
 PKG_VERSION:=2.34
-PKG_RELEASE:=1
+PKG_RELEASE:=2
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
 PKG_SOURCE_URL:=@KERNEL/linux/utils/$(PKG_NAME)/v2.34
diff --git a/package/utils/util-linux/patches/010-stdlib.h.patch b/package/utils/util-linux/patches/010-stdlib.h.patch
new file mode 100644
index 0000000000..49745c7dc7
--- /dev/null
+++ b/package/utils/util-linux/patches/010-stdlib.h.patch
@@ -0,0 +1,26 @@
+From 1632856ef19efb50c57c939b82a9ff712b3c0b09 Mon Sep 17 00:00:00 2001
+From: Florian Weimer <fweimer at redhat.com>
+Date: Fri, 5 Jul 2019 17:20:27 +0200
+Subject: [PATCH] build-sys: Include <stdlib.h> in ./configure wchar_t test
+
+Without #include <stdlib.h>, this configure check fails for strict
+C99/C11 compilers which do not support implicit function declarations
+(which are a C90 feature removed from C99).
+
+Signed-off-by: Karel Zak <kzak at redhat.com>
+---
+ configure.ac | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/configure.ac b/configure.ac
+index a840e20ee..997b6388c 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -752,6 +752,7 @@ UL_REQUIRES_COMPILE([widechar], [[
+   #include <wchar.h>
+   #include <wctype.h>
+   #include <stdio.h>
++  #include <stdlib.h>
+   ]], [[
+     wchar_t wc;
+     wint_t w;
-- 
2.17.1


_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel



More information about the openwrt-devel mailing list