]> xenbits.xensource.com Git - unikraft/libs/newlib.git/commitdiff
patches: Allow including custom malloc.h headers
authorCostin Lupu <costin.lupu@cs.pub.ro>
Thu, 22 Aug 2019 10:10:56 +0000 (13:10 +0300)
committerCostin Lupu <costin.lupu@cs.pub.ro>
Mon, 26 Aug 2019 13:50:14 +0000 (16:50 +0300)
We found this while porting Go runtime. The libgo library had its own malloc.h
header which it tried to include, but because of global include paths it
included the malloc.h of newlib. We workaround this by defining
_INCLUDE_MALLOC_H_ guard before including newlib's malloc.h and including our
own malloc.h next.

Signed-off-by: Costin Lupu <costin.lupu@cs.pub.ro>
Reviewed-by: Charalampos Mainas <charalampos.mainas@neclab.eu>
patches/0008-Apply-hackish-patch-in-order-to-include-custom-mallo.patch [new file with mode: 0644]

diff --git a/patches/0008-Apply-hackish-patch-in-order-to-include-custom-mallo.patch b/patches/0008-Apply-hackish-patch-in-order-to-include-custom-mallo.patch
new file mode 100644 (file)
index 0000000..28d5fcc
--- /dev/null
@@ -0,0 +1,26 @@
+From 5671ec3aeb7f237e0c5d25f13a7f2004756b6eea Mon Sep 17 00:00:00 2001
+From: Costin Lupu <costin.lup@gmail.com>
+Date: Fri, 16 Aug 2019 23:09:15 +0200
+Subject: [PATCH] Apply hackish patch in order to include custom malloc.h
+ header first
+
+Signed-off-by: Costin Lupu <costin.lupu@cs.pub.ro>
+---
+ newlib/libc/include/malloc.h | 3 +++
+ 1 file changed, 3 insertions(+)
+
+diff --git a/newlib/libc/include/malloc.h b/newlib/libc/include/malloc.h
+index 41b5efd..682dde4 100644
+--- a/newlib/libc/include/malloc.h
++++ b/newlib/libc/include/malloc.h
+@@ -166,4 +166,7 @@ extern void cfree _PARAMS ((_PTR));
+ }
+ #endif
++#else
++#include_next <malloc.h>
++
+ #endif /* _INCLUDE_MALLOC_H_ */
+-- 
+2.20.1
+