This is the mail archive of the gdb-cvs@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[binutils-gdb] AArch64: Fix the gdb build with musl libc


https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=51b4f73a37c2e7eec31e932fc3c8dae879735f63

commit 51b4f73a37c2e7eec31e932fc3c8dae879735f63
Author: Szabolcs Nagy <szabolcs.nagy@arm.com>
Date:   Thu Dec 13 17:47:17 2018 +0000

    AArch64: Fix the gdb build with musl libc
    
    Including asm/sigcontext.h together with libc headers is not valid. In
    general linux headers may not work with libc headers, so mixing them
    should be avoided, especially when the linux header defines types that
    are also exposed in libc headers.
    
    In case of asm/sigcontext.h glibc happens to work because glibc signal.h
    directly includes it, but e.g. in musl libc signal.h replicates the
    sigcontext.h definitions in an abi compatible way which are in conflict
    with the linux definitions when both headers are included.
    
    Since old linux headers or old libc headers may not have the necessary
    definitions, gdb has to replicate the definitions it relies on anyway.
    Which is fine since all definitions must be ABI stable. For linux apis
    that are not available via libc headers, replicating the definitions in
    gdb is the most reliable way to use them.
    
    Note: asm/ptrace.h includes asm/sigcontext.h in some versions of linux
    headers, which is just as problematic and should be fixed in linux.
    
    gdb/ChangeLog:
    
    	* nat/aarch64-sve-linux-ptrace.h: Include signal.h instead of
    	asm/sigcontext.h.

Diff:
---
 gdb/ChangeLog                      | 5 +++++
 gdb/nat/aarch64-sve-linux-ptrace.h | 2 +-
 2 files changed, 6 insertions(+), 1 deletion(-)

diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 695bc05..d5e376c 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,8 @@
+2018-12-17  Szabolcs Nagy  <szabolcs.nagy@arm.com>
+
+	* nat/aarch64-sve-linux-ptrace.h: Include signal.h instead of
+	asm/sigcontext.h.
+
 2018-12-17  Philippe Waroquiers  <philippe.waroquiers@skynet.be>
 
 	* nat/linux-ptrace.c (kill_child): Fix ARI warning by removing
diff --git a/gdb/nat/aarch64-sve-linux-ptrace.h b/gdb/nat/aarch64-sve-linux-ptrace.h
index 029e753..172ae39 100644
--- a/gdb/nat/aarch64-sve-linux-ptrace.h
+++ b/gdb/nat/aarch64-sve-linux-ptrace.h
@@ -20,7 +20,7 @@
 #ifndef AARCH64_SVE_LINUX_PTRACE_H
 #define AARCH64_SVE_LINUX_PTRACE_H
 
-#include <asm/sigcontext.h>
+#include <signal.h>
 #include <sys/utsname.h>
 #include <sys/ptrace.h>
 #include <asm/ptrace.h>


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]