]> xenbits.xensource.com Git - unikraft/libs/libucontext.git/commitdiff
Add patch for the original code
authorCharalampos Mainas <Charalampos.Mainas@neclab.eu>
Mon, 9 Sep 2019 09:58:00 +0000 (11:58 +0200)
committerCostin Lupu <costin.lup@gmail.com>
Mon, 9 Sep 2019 12:31:33 +0000 (15:31 +0300)
Replace signal.h with musl's ucontext.h. makecontext uses the struct
ucontext_t and this struct is defined in bits/signal.h which included
from ucontext.h. In musl signal.h includes bits/signal.h but this is not
the case with newlib which has no definition for ucontext_t struct.

Signed-off-by: Charalampos Mainas <Charalampos.Mainas@neclab.eu>
Reviewed-by: Costin Lupu <costin.lupu@cs.pub.ro>
patches/0001-Add-ucontext-header-file.patch [new file with mode: 0644]

diff --git a/patches/0001-Add-ucontext-header-file.patch b/patches/0001-Add-ucontext-header-file.patch
new file mode 100644 (file)
index 0000000..37a19a5
--- /dev/null
@@ -0,0 +1,32 @@
+From bbcaae992f53d8648abab5254e81bdf30640911c Mon Sep 17 00:00:00 2001
+From: Charalampos Mainas <Charalampos.Mainas@neclab.eu>
+Date: Wed, 29 May 2019 11:34:03 +0200
+Subject: [PATCH] Add ucontext header file
+
+makecontext uses the struct ucontext_t which is not defined anywhere in
+newlib. In musl signal.h includes bits/signal.h which defines ucontext_t
+struct. Therefore newlib's signal.h is replaced by musl's ucontext.h
+header which includes bits/signal.h.
+
+Signed-off-by: Charalampos Mainas <Charalampos.Mainas@neclab.eu>
+
+---
+ arch/x86_64/makecontext.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/arch/x86_64/makecontext.c b/arch/x86_64/makecontext.c
+index ba6ca59..e272008 100644
+--- a/arch/x86_64/makecontext.c
++++ b/arch/x86_64/makecontext.c
+@@ -13,7 +13,7 @@
+ #define _GNU_SOURCE
+ #include <stddef.h>
+ #include <stdarg.h>
+-#include <signal.h>
++#include <ucontext.h>
+ #include <string.h>
+ #include <stdint.h>
+-- 
+2.17.1
+