git: fix build with with no threads
PATCH 1/1 git: fix build with with no threads
When building git with toolchain that don't have thread support, we get following build errors:
CC builtin/hash-object.o
builtin/grep.c: In function 'grep_submodule_launch':
builtin/grep.c:596:34: error: dereferencing pointer to incomplete type 'struct work_item'
status = capture_command(&cp, &w->out, 0);
^
builtin/grep.c: In function 'grep_submodule':
builtin/grep.c:644:20: error: storage size of 'w' isn't known
struct work_item w;
^ make[2]: *** [builtin/grep.o] Error 1
make[2]: *** Waiting for unfinished jobs....
Add two upstream patches to fix this issue.
Fixes:
http://autobuild.buildroot.net/results/94b/94bce9a99a5ce9894a6918774ab75e23d12c1394/
--- .../git/0001-grep-set-default-output-method.patch | 59 +++++++++++++++ ...ep-fix-builds-with-with-no-thread-support.patch | 87 ++++++++++++++++++++++ 2 files changed, 146 insertions(+) create mode 100644 package/git/0001-grep-set-default-output-method.patch create mode 100644 package/git/0002-grep-fix-builds-with-with-no-thread-support.patch
package/git/0001-grep-set-default-output-method.patch new file +59 -0
@@ -0,0 +1,59 @@ +From 379642bcd8d89db52feba88a651e4e56d6ac5767 Mon Sep 17 00:00:00 2001 +From: Brandon Williams <[email protected]> +Date: Fri, 17 Mar 2017 11:41:54 -0700 +Subject: [PATCH] grep: set default output method + +Signed-off-by: Brandon Williams <[email protected]> +Signed-off-by: Junio C Hamano <[email protected]> +Signed-off-by: Rahul Bedarkar <[email protected]> +--- + grep.c | 12 +++++++----- + 1 file changed, 7 insertions(+), 5 deletions(-) + +diff --git a/grep.c b/grep.c +index 0dbdc1d..56ef0ec 100644 +--- a/grep.c ++++ b/grep.c +@@ -12,6 +12,11 @@ static int grep_source_is_binary(struct grep_source *gs); + + static struct grep_opt grep_defaults; + ++static void std_output(struct grep_opt *opt, const void *buf, size_t size) ++{ ++ fwrite(buf, size, 1, stdout); ++} ++ + /* + * Initialize the grep_defaults template with hardcoded defaults. + * We could let the compiler do this, but without C99 initializers +@@ -42,6 +47,7 @@ void init_grep_defaults(void) + color_set(opt->color_selected, ""); + color_set(opt->color_sep, GIT_COLOR_CYAN); + opt->color = -1; ++ opt->output = std_output; + } + + static int parse_pattern_type_arg(const char *opt, const char *arg) +@@ -152,6 +158,7 @@ void grep_init(struct grep_opt *opt, const char *prefix) + opt->pathname = def->pathname; + opt->regflags = def->regflags; + opt->relative = def->relative; ++ opt->output = def->output; + + color_set(opt->color_context, def->color_context); + color_set(opt->color_filename, def->color_filename); +@@ -1379,11 +1386,6 @@ static int look_ahead(struct grep_opt *opt, + return 0; + } + +-static void std_output(struct grep_opt *opt, const void *buf, size_t size) +-{ +- fwrite(buf, size, 1, stdout); +-} +- + static int fill_textconv_grep(struct userdiff_driver *driver, + struct grep_source *gs) + { +-- +2.6.2 +
package/git/0002-grep-fix-builds-with-with-no-thread-support.patch new file +87 -0
87 lines not on this page · raw message
Signature · 1 line
2.6.2
Thomas Petazzoni
AppliedPATCH 1/1 git: fix build with with no threads
Hello,
Quoted 20 lines · Rahul Bedarkar
When building git with toolchain that don't have thread support, we get following build errors:
CC
builtin/hash-object.o
builtin/grep.c: In function 'grep_submodule_launch':
builtin/grep.c:596:34: error: dereferencing pointer to incomplete type 'structwork_item'status = capture_command(&cp, &w->out, 0); ^ builtin/grep.c: In function 'grep_submodule': builtin/grep.c:644:20: error: storage size of 'w' isn't known struct work_item w; ^make[2]: *** [
builtin/grep.o] Error 1
make[2]: *** Waiting for unfinished jobs....Add two upstream patches to fix this issue.
Fixes:
http://autobuild.buildroot.net/results/94b/94bce9a99a5ce9894a6918774ab75e23d12c1394/
Quoted 7 lines
Signed-off-by Rahul Bedarkar <[email protected]>--- .../git/0001-grep-set-default-output-method.patch | 59 +++++++++++++++ ...ep-fix-builds-with-with-no-thread-support.patch | 87 ++++++++++++++++++++++ 2 files changed, 146 insertions(+) create mode 100644 package/git/0001-grep-set-default-output-method.patch create mode 100644 package/git/0002-grep-fix-builds-with-with-no-thread-support.patch
Applied to master, thanks.
Thomas
Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons Embedded Linux, Kernel and Android engineering http://free-electrons.com