dash: fix build with musl
PATCH 1/1 dash: fix build with musl
musl libc requires the getopt.h header for the definition of 'optreset'.
Fixes:
http://autobuild.buildroot.net/results/c23/c233ade479d6124ed7b382f2aa9859fe509d7bca/
http://autobuild.buildroot.net/results/081/0813c13c2a978316e6fa9a3cdbd5512612f5c374/
http://autobuild.buildroot.net/results/182/18230384d8225fbd7fddabfcbd685eaa38e31b31/
--- .../0002-histedit-fix-build-with-musl-libc.patch | 35 ++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 package/dash/0002-histedit-fix-build-with-musl-libc.patch
package/dash/0002-histedit-fix-build-with-musl-libc.patch new file +35 -0
@@ -0,0 +1,35 @@ +From 2da5b72c704fed10f1b04b5432ac6b078d016fae Mon Sep 17 00:00:00 2001 +From: Baruch Siach <[email protected]> +Date: Fri, 2 Mar 2018 08:25:36 +0200 +Subject: [PATCH] histedit: fix build with musl libc + +musl libc defines the optreset BSD extension only in getopt.h. This +fixes the following build failure: + +histedit.c: In function 'histcmd': +histedit.c:220:2: error: 'optreset' undeclared (first use in this function) + optreset = 1; optind = 1; /* initialize getopt */ + ^~~~~~~~ + +Signed-off-by: Baruch Siach <[email protected]> +--- +Upstream status: https://www.mail-archive.com/dash at vger.kernel.org/msg01389.html + + src/histedit.c | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/src/histedit.c b/src/histedit.c +index 94465d785cc9..f5c90aba873b 100644 +--- a/src/histedit.c ++++ b/src/histedit.c +@@ -39,6 +39,7 @@ + #include <stdio.h> + #include <stdlib.h> + #include <unistd.h> ++#include <getopt.h> + /* + * Editline and history functions (and glue). + */ +-- +2.16.1 +
Signature · 1 line
2.16.1
PATCH 1/1 dash: fix build with musl
Quoted 9 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
"Baruch" == Baruch Siach <[email protected]> writes:
musl libc requires the
getopt.hheader for the definition of 'optreset'. Fixes:
http://autobuild.buildroot.net/results/c23/c233ade479d6124ed7b382f2aa9859fe509d7bca/
http://autobuild.buildroot.net/results/081/0813c13c2a978316e6fa9a3cdbd5512612f5c374/
http://autobuild.buildroot.net/results/182/18230384d8225fbd7fddabfcbd685eaa38e31b31/Signed-off-by Baruch Siach <[email protected]>
Committed, thanks.
Signature · 1 line
Bye, Peter Korsgaard