Skip to contentSkip to conversation

package/gdb: fix build of 8.1.1 on ARM cortex A8

PATCH New Fabrice Fontaine 3 participants 3 messages May 12, 2019 – May 26, 2019

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 package/gdb: fix build of 8.1.1 on ARM cortex A8

Fixes:
- http://autobuild.buildroot.org/results/a81eb395bd95306fcbb07c1443c9134fd63fa379

---
 ...P_HWBKPT-before-including-gdb_wait-h.patch | 54 +++++++++++++++++++
 1 file changed, 54 insertions(+)
 create mode 100644 package/gdb/8.1.1/0007-gdb-Fix-ia64-defining-TRAP_HWBKPT-before-including-gdb_wait-h.patch
package/gdb/8.1.1/0007-gdb-Fix-ia64-defining-TRAP_HWBKPT-before-including-gdb_wait-h.patch new file +54 -0
new file mode 100644
index 0000000000..1e85d9314c
@@ -0,0 +1,54 @@
+From 5a6c3296a7a90694ad4042f6256f3da6d4fa4ee8 Mon Sep 17 00:00:00 2001
+From: James Clarke <[email protected]>
+Date: Fri, 19 Jan 2018 17:22:49 +0000
+Subject: [PATCH] gdb: Fix ia64 defining TRAP_HWBKPT before including
+ gdb_wait.h
+
+On ia64, gdb_wait.h eventually includes siginfo-consts-arch.h, which
+contains an enum with TRAP_HWBKPT, along with a #define. Thus we cannot
+define TRAP_HWBKPT to 4 beforehand, and so gdb_wait.h must be included
+earlier; include it from linux-ptrace.h so it can never come afterwards.
+
+gdb/ChangeLog:
+
+	* nat/linux-ptrace.c: Remove unnecessary reinclusion of
+	gdb_ptrace.h, and move including gdb_wait.h ...
+	* nat/linux-ptrace.h: ... to here.
+
+Signed-off-by: Fabrice Fontaine <[email protected]>
+[Retrieved (and updated to remove ChangeLog update) from:
+https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;a=commit;h=5a6c3296a7a90694ad4042f6256f3da6d4fa4ee8]
+---
+ gdb/ChangeLog          | 6 ++++++
+ gdb/nat/linux-ptrace.c | 2 --
+ gdb/nat/linux-ptrace.h | 1 +
+ 3 files changed, 7 insertions(+), 2 deletions(-)
+
+diff --git a/gdb/nat/linux-ptrace.c b/gdb/nat/linux-ptrace.c
+index 5c4ddc9..1f21ef0 100644
+--- a/gdb/nat/linux-ptrace.c
++++ b/gdb/nat/linux-ptrace.c
+@@ -21,8 +21,6 @@
+ #include "linux-procfs.h"
+ #include "linux-waitpid.h"
+ #include "buffer.h"
+-#include "gdb_wait.h"
+-#include "gdb_ptrace.h"
+ #ifdef HAVE_SYS_PROCFS_H
+ #include <sys/procfs.h>
+ #endif
+diff --git a/gdb/nat/linux-ptrace.h b/gdb/nat/linux-ptrace.h
+index 60967a3..dc180fb 100644
+--- a/gdb/nat/linux-ptrace.h
++++ b/gdb/nat/linux-ptrace.h
+@@ -21,6 +21,7 @@
+ struct buffer;
+ 
+ #include "nat/gdb_ptrace.h"
++#include "gdb_wait.h"
+ 
+ #ifdef __UCLIBC__
+ #if !(defined(__UCLIBC_HAS_MMU__) || defined(__ARCH_HAS_MMU__))
+-- 
+2.9.3
+
Signature · 1 line
2.20.1
#1 lore raw

PATCH 1/1 package/gdb: fix build of 8.1.1 on ARM cortex A8

Hello Fabrice,

Quoted 4 lines · On Sun, 12 May 2019 12:11:47 +0200 Fabrice Fontaine…

Fixes:
- http://autobuild.buildroot.org/results/a81eb395bd95306fcbb07c1443c9134fd63fa379

This commit log was a bit terse, and the issue is not related to ARM
Cortex-A8: it happens on all architectures. You only see it on ARM Cortex A8 in the autobuilders because it's the only architecture with an internal glibc configuration, which means it's the only testing glibc 2.29. Indeed the root source of the build failure is the bump from glibc 2.28 to 2.29.

If you look at http://autobuild.buildroot.net/?reason=gdb% you can clearly see the pattern that the issue started appearing on March 17, 2019. Guess what was merged on March 15, 2019 ? The bump to glibc 2.29.

So, I improved the commit log to explain which glibc change broke this, and why an IA64-related build fix in gdb is in fact needed on other architectures. So the commit log now goes like this:

package/gdb: fix build of 8.1.1 since the bump to glibc 2.29

Between glibc 2.28 and glibc 2.29, commit 89983cb37c9319806a551e8fe9f3a11ff8f973e1 ("Update siginfo constants from Linux kernel (bug 21286)") was merged. This commit moved the TRAP_HWBKPT definition from an IA64-specific header to an architecture-agnostic header.

This change exhibited a build issue that until then was only visible on IA64 (which Buildroot does not support). This Buildroot commit backports a patch from gdb upstream (which is in gdb since 8.2) which mentions IA64 because it was originally meant to fix only the IA64-related issue. But the glibc change, this change has become visible on all architectures.

Fixes:

- http://autobuild.buildroot.org/results/a81eb395bd95306fcbb07c1443c9134fd63fa379

[Thomas: extend commit log]

I have applied with this improved commit log.

However, nothing indicates that this problem does not exist on older versions of gdb. Could you check the status of gdb 7.12 and 8.0 with glibc 2.29 ?

Thanks!

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
#2 lore raw

PATCH 1/1 package/gdb: fix build of 8.1.1 on ARM cortex A8

Quoted 34 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Thomas" == Thomas Petazzoni <[email protected]> writes:

Hello Fabrice,

Quoted 4 lines · On Sun, 12 May 2019 12:11:47 +0200 Fabrice Fontaine…

Fixes:
- http://autobuild.buildroot.org/results/a81eb395bd95306fcbb07c1443c9134fd63fa379

This commit log was a bit terse, and the issue is not related to ARM
Cortex-A8: it happens on all architectures. You only see it on ARM Cortex A8 in the autobuilders because it's the only architecture with an internal glibc configuration, which means it's the only testing glibc 2.29. Indeed the root source of the build failure is the bump from glibc 2.28 to 2.29.

If you look at http://autobuild.buildroot.net/?reason=gdb% you can clearly see the pattern that the issue started appearing on March 17, 2019. Guess what was merged on March 15, 2019 ? The bump to glibc 2.29.

So, I improved the commit log to explain which glibc change broke this, and why an IA64-related build fix in gdb is in fact needed on other architectures. So the commit log now goes like this:

package/gdb: fix build of 8.1.1 since the bump to glibc 2.29

Between glibc 2.28 and glibc 2.29, commit 89983cb37c9319806a551e8fe9f3a11ff8f973e1 ("Update siginfo constants from Linux kernel (bug 21286)") was merged. This commit moved the TRAP_HWBKPT definition from an IA64-specific header to an architecture-agnostic header.

Quoted 6 lines

This change exhibited a build issue that until then was only visible on IA64 (which Buildroot does not support). This Buildroot commit backports a patch from gdb upstream (which is in gdb since 8.2) which mentions IA64 because it was originally meant to fix only the IA64-related issue. But the glibc change, this change has become visible on all architectures.

Committed to 2019.02.x, thanks.

Signature · 1 line
Bye, Peter Korsgaard