| Brad Bishop | 1a4b7ee | 2018-12-16 17:11:34 -0800 | [diff] [blame] | 1 | From e596ae99059c28fa9bb3461e03e7ecaacbf41727 Mon Sep 17 00:00:00 2001 | 
|  | 2 | From: Andrea Adami <andrea.adami@gmail.com> | 
|  | 3 | Date: Wed, 23 May 2018 15:34:59 +0200 | 
|  | 4 | Subject: [PATCH] libmissing.h: fix klibc build when using glibc toolchain | 
|  | 5 |  | 
|  | 6 | klibc lacks execinfo.h so adda guard around it. | 
|  | 7 | Note: build with musl toolchain is ok even without this patch. | 
|  | 8 |  | 
|  | 9 | Fix build error: | 
|  | 10 |  | 
|  | 11 | | In file included from ../git/lib/execinfo.c:1:0: | 
|  | 12 | | ../git/include/libmissing.h:7:10: fatal error: execinfo.h: | 
|  | 13 | No such file or directory | 
|  | 14 |  | 
|  | 15 | Upstream-Status: Inappropriate [klibc specific] | 
|  | 16 |  | 
|  | 17 | Signed-off-by: Andrea Adami <andrea.adami@gmail.com> | 
|  | 18 | --- | 
|  | 19 | include/libmissing.h | 2 ++ | 
|  | 20 | 1 file changed, 2 insertions(+) | 
|  | 21 |  | 
|  | 22 | diff --git a/include/libmissing.h b/include/libmissing.h | 
|  | 23 | index 0196033..832c372 100644 | 
|  | 24 | --- a/include/libmissing.h | 
|  | 25 | +++ b/include/libmissing.h | 
|  | 26 | @@ -3,9 +3,11 @@ | 
|  | 27 |  | 
|  | 28 | #include "config.h" | 
|  | 29 |  | 
|  | 30 | +#ifndef __KLIBC__ | 
|  | 31 | #ifdef HAVE_EXECINFO_H | 
|  | 32 | #include <execinfo.h> | 
|  | 33 | #endif | 
|  | 34 | +#endif | 
|  | 35 |  | 
|  | 36 | #ifndef HAVE_EXECINFO_H | 
|  | 37 | int backtrace(void **buffer, int size); | 
|  | 38 | -- | 
|  | 39 | 2.7.4 | 
|  | 40 |  |