Skip to contentSkip to conversation

arch/um: compile with modern headers

PATCH In review Jason A. Donenfeld 2 participants 3 messages Dec 13, 2017 – Dec 14, 2017

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 arch/um: compile with modern headers

Recent libcs have gotten a bit more strict, so we actually need to include the right headers and use the right types. This enables UML to compile again.

---
 arch/um/os-Linux/file.c   | 1 +
 arch/um/os-Linux/signal.c | 3 ++-
 arch/x86/um/stub_segv.c   | 3 ++-
 3 files changed, 5 insertions(+), 2 deletions(-)
arch/um/os-Linux/file.c +1 -0
index 2db18cbbb0ea..c0197097c86e 100644
@@ -12,6 +12,7 @@
 #include <sys/mount.h>
 #include <sys/socket.h>
 #include <sys/stat.h>
+#include <sys/sysmacros.h>
 #include <sys/un.h>
 #include <sys/types.h>
 #include <os.h>
arch/um/os-Linux/signal.c +2 -1
index a86d7cc2c2d8..bf0acb8aad8b 100644
@@ -16,6 +16,7 @@
 #include <os.h>
 #include <sysdep/mcontext.h>
 #include <um_malloc.h>
+#include <sys/ucontext.h>
 
 void (*sig_info[NSIG])(int, struct siginfo *, struct uml_pt_regs *) = {
 	[SIGTRAP]	= relay_signal,
@@ -159,7 +160,7 @@ static void (*handlers[_NSIG])(int sig, struct siginfo *si, mcontext_t *mc) = {
 
 static void hard_handler(int sig, siginfo_t *si, void *p)
 {
-	struct ucontext *uc = p;
+	ucontext_t *uc = p;
 	mcontext_t *mc = &uc->uc_mcontext;
 	unsigned long pending = 1UL << sig;
 
arch/x86/um/stub_segv.c +2 -1
index 1518d2805ae8..27361cbb7ca9 100644
@@ -6,11 +6,12 @@
 #include <sysdep/stub.h>
 #include <sysdep/faultinfo.h>
 #include <sysdep/mcontext.h>
+#include <sys/ucontext.h>
 
 void __attribute__ ((__section__ (".__syscall_stub")))
 stub_segv_handler(int sig, siginfo_t *info, void *p)
 {
-	struct ucontext *uc = p;
+	ucontext_t *uc = p;
 
 	GET_FAULTINFO_FROM_MC(*((struct faultinfo *) STUB_DATA),
 			      &uc->uc_mcontext);
Signature · 1 line
2.15.1
#1 lore raw

Jason,

Am Mittwoch, 13. Dezember 2017, 18:22:30 CET schrieb Jason A. Donenfeld:

Quoted 54 lines

Recent libcs have gotten a bit more strict, so we actually need to include the right headers and use the right types. This enables UML to compile again.

---
 arch/um/os-Linux/file.c   | 1 +
 arch/um/os-Linux/signal.c | 3 ++-
 arch/x86/um/stub_segv.c   | 3 ++-
 3 files changed, 5 insertions(+), 2 deletions(-)
arch/um/os-Linux/file.c +1 -0
index 2db18cbbb0ea..c0197097c86e 100644
@@ -12,6 +12,7 @@
 #include <sys/mount.h>
 #include <sys/socket.h>
 #include <sys/stat.h>
+#include <sys/sysmacros.h>
 #include <sys/un.h>
 #include <sys/types.h>
 #include <os.h>
arch/um/os-Linux/signal.c +2 -1
index a86d7cc2c2d8..bf0acb8aad8b 100644
@@ -16,6 +16,7 @@
 #include <os.h>
 #include <sysdep/mcontext.h>
 #include <um_malloc.h>
+#include <sys/ucontext.h>
 
 void (*sig_info[NSIG])(int, struct siginfo *, struct uml_pt_regs *) = {
 	[SIGTRAP]	= relay_signal,
@@ -159,7 +160,7 @@ static void (*handlers[_NSIG])(int sig, struct siginfo
 *si, mcontext_t *mc) = {
 
 static void hard_handler(int sig, siginfo_t *si, void *p)
 {
-	struct ucontext *uc = p;
+	ucontext_t *uc = p;
 	mcontext_t *mc = &uc->uc_mcontext;
 	unsigned long pending = 1UL << sig;
arch/x86/um/stub_segv.c +0 -0
index 1518d2805ae8..27361cbb7ca9 100644
@@ -6,11 +6,12 @@
 #include <sysdep/stub.h>
 #include <sysdep/faultinfo.h>
 #include <sysdep/mcontext.h>

arch/x86/um/stub_segv.c line 17

Quoted 10 lines
arch/x86/um/stub_segv.c +2 -1
+#include <sys/ucontext.h>
 
 void __attribute__ ((__section__ (".__syscall_stub")))
 stub_segv_handler(int sig, siginfo_t *info, void *p)
 {
-	struct ucontext *uc = p;
+	ucontext_t *uc = p;
 
 	GET_FAULTINFO_FROM_MC(*((struct faultinfo *) STUB_DATA),
 			      &uc->uc_mcontext);

Can you please rebase your fix on linux-next?
I have already a very similar fix in the pipe.

Thanks,
//richard

#2 lore raw

PATCH 1/1 arch/um: compile with modern headers

Recent libcs have gotten a bit more strict, so we actually need to include the right headers and use the right types. This enables UML to compile again.

---
Rebased on linux-next, by request.

 arch/um/os-Linux/file.c   | 1 +
 arch/um/os-Linux/signal.c | 1 +
 arch/x86/um/stub_segv.c   | 1 +
 3 files changed, 3 insertions(+)
arch/um/os-Linux/file.c +1 -0
index 2db18cbbb0ea..c0197097c86e 100644
@@ -12,6 +12,7 @@
 #include <sys/mount.h>
 #include <sys/socket.h>
 #include <sys/stat.h>
+#include <sys/sysmacros.h>
 #include <sys/un.h>
 #include <sys/types.h>
 #include <os.h>
arch/um/os-Linux/signal.c +1 -0
index a5c0c909c48b..bf0acb8aad8b 100644
@@ -16,6 +16,7 @@
 #include <os.h>
 #include <sysdep/mcontext.h>
 #include <um_malloc.h>
+#include <sys/ucontext.h>
 
 void (*sig_info[NSIG])(int, struct siginfo *, struct uml_pt_regs *) = {
 	[SIGTRAP]	= relay_signal,
arch/x86/um/stub_segv.c +1 -0
index fd6825537b97..27361cbb7ca9 100644
@@ -6,6 +6,7 @@
 #include <sysdep/stub.h>
 #include <sysdep/faultinfo.h>
 #include <sysdep/mcontext.h>
+#include <sys/ucontext.h>
 
 void __attribute__ ((__section__ (".__syscall_stub")))
 stub_segv_handler(int sig, siginfo_t *info, void *p)
Signature · 1 line
2.15.1