All of lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH v2 1/6] gdb: introduce BR2_PACKAGE_GDB_ARCH_SUPPORTS
@ 2017-06-09 13:29 Thomas Petazzoni
  2017-06-09 13:29 ` [Buildroot] [PATCH v2 2/6] gdb: not available on ARM noMMU and OpenRISC Thomas Petazzoni
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: Thomas Petazzoni @ 2017-06-09 13:29 UTC (permalink / raw)
  To: buildroot

Before adding more architecture dependencies to gdb, let's introduce a
BR2_PACKAGE_GDB_ARCH_SUPPORTS, to avoid duplicating this list of
dependencies between the Config.in comment and the main Config.in
option.

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
---
Changes since v1:
 - None
---
 package/gdb/Config.in | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/package/gdb/Config.in b/package/gdb/Config.in
index 026cdea..3acc6ef 100644
--- a/package/gdb/Config.in
+++ b/package/gdb/Config.in
@@ -1,11 +1,17 @@
+config BR2_PACKAGE_GDB_ARCH_SUPPORTS
+	bool
+	default y
+	depends on !BR2_bfin
+	depends on !BR2_nios2
+
 comment "gdb/gdbserver needs a toolchain w/ threads, threads debug"
-	depends on !BR2_nios2 && !BR2_bfin
+	depends on BR2_PACKAGE_GDB_ARCH_SUPPORTS
 	depends on !BR2_TOOLCHAIN_HAS_THREADS || !BR2_TOOLCHAIN_HAS_THREADS_DEBUG
 
 config BR2_PACKAGE_GDB
 	bool "gdb"
 	depends on BR2_TOOLCHAIN_HAS_THREADS && BR2_TOOLCHAIN_HAS_THREADS_DEBUG
-	depends on !BR2_nios2 && !BR2_bfin
+	depends on BR2_PACKAGE_GDB_ARCH_SUPPORTS
 	# When the external toolchain gdbserver is copied to the
 	# target, we don't allow building a separate gdbserver. The
 	# one from the external toolchain should be used.
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [Buildroot] [PATCH v2 2/6] gdb: not available on ARM noMMU and OpenRISC
  2017-06-09 13:29 [Buildroot] [PATCH v2 1/6] gdb: introduce BR2_PACKAGE_GDB_ARCH_SUPPORTS Thomas Petazzoni
@ 2017-06-09 13:29 ` Thomas Petazzoni
  2017-06-09 13:29 ` [Buildroot] [PATCH v2 3/6] gdb: add patches to fix musl build on ppc(64)(le) and sh Thomas Petazzoni
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: Thomas Petazzoni @ 2017-06-09 13:29 UTC (permalink / raw)
  To: buildroot

Neither gdb nor gdbserver have support for ARM noMMU and OpenRISC, so
let's disable gdb on those architectures.

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
---
Changes since v1:
 - Fixed BR2_openrisc to BR2_or1k
---
 package/gdb/Config.in      | 2 ++
 package/gdb/Config.in.host | 2 ++
 2 files changed, 4 insertions(+)

diff --git a/package/gdb/Config.in b/package/gdb/Config.in
index 3acc6ef..67ef010 100644
--- a/package/gdb/Config.in
+++ b/package/gdb/Config.in
@@ -1,8 +1,10 @@
 config BR2_PACKAGE_GDB_ARCH_SUPPORTS
 	bool
 	default y
+	depends on !((BR2_arm || BR2_armeb) && BR2_BINFMT_FLAT)
 	depends on !BR2_bfin
 	depends on !BR2_nios2
+	depends on !BR2_or1k
 
 comment "gdb/gdbserver needs a toolchain w/ threads, threads debug"
 	depends on BR2_PACKAGE_GDB_ARCH_SUPPORTS
diff --git a/package/gdb/Config.in.host b/package/gdb/Config.in.host
index cd763aa..027300e 100644
--- a/package/gdb/Config.in.host
+++ b/package/gdb/Config.in.host
@@ -6,7 +6,9 @@ config BR2_PACKAGE_HOST_GDB
 	# allow to build a cross-gdb, as the one of the external
 	# toolchain should be used.
 	depends on !BR2_TOOLCHAIN_EXTERNAL_GDB_SERVER_COPY
+	depends on !((BR2_arm || BR2_armeb) && BR2_BINFMT_FLAT)
 	depends on !BR2_nios2
+	depends on !BR2_openrisc
 	help
 	  Build a cross gdb that runs on the host machine and debugs
 	  programs running on the target. It requires 'gdbserver'
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [Buildroot] [PATCH v2 3/6] gdb: add patches to fix musl build on ppc(64)(le) and sh
  2017-06-09 13:29 [Buildroot] [PATCH v2 1/6] gdb: introduce BR2_PACKAGE_GDB_ARCH_SUPPORTS Thomas Petazzoni
  2017-06-09 13:29 ` [Buildroot] [PATCH v2 2/6] gdb: not available on ARM noMMU and OpenRISC Thomas Petazzoni
@ 2017-06-09 13:29 ` Thomas Petazzoni
  2017-06-09 13:29 ` [Buildroot] [PATCH v2 4/6] gcc: add patch to support musl on SuperH in gcc 5.x Thomas Petazzoni
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: Thomas Petazzoni @ 2017-06-09 13:29 UTC (permalink / raw)
  To: buildroot

This commit small patches to gdb that fix redefined structures build
problems that occur when building on PowerPC, PowerPC64, PowerPC64le and
SuperH with the musl C library.

The PowerPC(64)(le) patch was taken from the Yocto Project, the SuperH
patch was inspired from the PowerPC patch. The issue has also been
reported upstream to the musl developers:

  http://www.openwall.com/lists/musl/2017/06/03/1

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
---
Changes since v1:
 - None
---
 ...Define-pt_regs-uapi_pt_regs-on-GLIBC-syst.patch | 53 ++++++++++++++++++++++
 ...efine-pt_-dsp-regs-uapi_pt_-dsp-regs-on-G.patch | 41 +++++++++++++++++
 ...Define-pt_regs-uapi_pt_regs-on-GLIBC-syst.patch | 53 ++++++++++++++++++++++
 ...efine-pt_-dsp-regs-uapi_pt_-dsp-regs-on-G.patch | 41 +++++++++++++++++
 ...Define-pt_regs-uapi_pt_regs-on-GLIBC-syst.patch | 53 ++++++++++++++++++++++
 ...efine-pt_-dsp-regs-uapi_pt_-dsp-regs-on-G.patch | 41 +++++++++++++++++
 6 files changed, 282 insertions(+)
 create mode 100644 package/gdb/7.10.1/0008-ppc-ptrace-Define-pt_regs-uapi_pt_regs-on-GLIBC-syst.patch
 create mode 100644 package/gdb/7.10.1/0009-sh-ptrace-Define-pt_-dsp-regs-uapi_pt_-dsp-regs-on-G.patch
 create mode 100644 package/gdb/7.11.1/0003-ppc-ptrace-Define-pt_regs-uapi_pt_regs-on-GLIBC-syst.patch
 create mode 100644 package/gdb/7.11.1/0004-sh-ptrace-Define-pt_-dsp-regs-uapi_pt_-dsp-regs-on-G.patch
 create mode 100644 package/gdb/7.12.1/0002-ppc-ptrace-Define-pt_regs-uapi_pt_regs-on-GLIBC-syst.patch
 create mode 100644 package/gdb/7.12.1/0003-sh-ptrace-Define-pt_-dsp-regs-uapi_pt_-dsp-regs-on-G.patch

diff --git a/package/gdb/7.10.1/0008-ppc-ptrace-Define-pt_regs-uapi_pt_regs-on-GLIBC-syst.patch b/package/gdb/7.10.1/0008-ppc-ptrace-Define-pt_regs-uapi_pt_regs-on-GLIBC-syst.patch
new file mode 100644
index 0000000..c280831
--- /dev/null
+++ b/package/gdb/7.10.1/0008-ppc-ptrace-Define-pt_regs-uapi_pt_regs-on-GLIBC-syst.patch
@@ -0,0 +1,53 @@
+From 3964e15443c5cdfca6723987c8ef1ef6cf984d41 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Sat, 6 Aug 2016 17:32:50 -0700
+Subject: [PATCH] ppc/ptrace: Define pt_regs uapi_pt_regs on !GLIBC systems
+
+Upstream-Status: Pending
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
+---
+ gdb/gdbserver/linux-ppc-low.c | 6 ++++++
+ gdb/nat/ppc-linux.h           | 6 ++++++
+ 2 files changed, 12 insertions(+)
+
+diff --git a/gdb/gdbserver/linux-ppc-low.c b/gdb/gdbserver/linux-ppc-low.c
+index 188fac0..f71d5ab 100644
+--- a/gdb/gdbserver/linux-ppc-low.c
++++ b/gdb/gdbserver/linux-ppc-low.c
+@@ -21,7 +21,13 @@
+ #include "linux-low.h"
+ 
+ #include <elf.h>
++#if !defined(__GLIBC__)
++# define pt_regs uapi_pt_regs
++#endif
+ #include <asm/ptrace.h>
++#if !defined(__GLIBC__)
++# undef pt_regs
++#endif
+ 
+ #include "nat/ppc-linux.h"
+ 
+diff --git a/gdb/nat/ppc-linux.h b/gdb/nat/ppc-linux.h
+index 0ff2223..c978daa 100644
+--- a/gdb/nat/ppc-linux.h
++++ b/gdb/nat/ppc-linux.h
+@@ -18,7 +18,13 @@
+ #ifndef PPC_LINUX_H
+ #define PPC_LINUX_H 1
+ 
++#if !defined(__GLIBC__)
++# define pt_regs uapi_pt_regs
++#endif
+ #include <asm/ptrace.h>
++#if !defined(__GLIBC__)
++# undef pt_regs
++#endif
+ #include <asm/cputable.h>
+ 
+ /* This sometimes isn't defined.  */
+-- 
+2.7.4
+
diff --git a/package/gdb/7.10.1/0009-sh-ptrace-Define-pt_-dsp-regs-uapi_pt_-dsp-regs-on-G.patch b/package/gdb/7.10.1/0009-sh-ptrace-Define-pt_-dsp-regs-uapi_pt_-dsp-regs-on-G.patch
new file mode 100644
index 0000000..50f9512
--- /dev/null
+++ b/package/gdb/7.10.1/0009-sh-ptrace-Define-pt_-dsp-regs-uapi_pt_-dsp-regs-on-G.patch
@@ -0,0 +1,41 @@
+From 1662a42e980c3f605000b23fda86ab24ceb69d32 Mon Sep 17 00:00:00 2001
+From: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
+Date: Sat, 3 Jun 2017 21:23:52 +0200
+Subject: [PATCH] sh/ptrace: Define pt_{dsp,}regs uapi_pt_{dsp,}regs on !GLIBC
+ systems
+
+Fixes a pt_{dsp,}regs redefinition when building with the musl C library
+on SuperH.
+
+Inspired by
+http://git.yoctoproject.org/clean/cgit.cgi/poky/plain/meta/recipes-devtools/gdb/gdb/0004-ppc-ptrace-Define-pt_regs-uapi_pt_regs-on-GLIBC-syst.patch,
+adapted for SuperH.
+
+Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
+---
+ gdb/gdbserver/linux-sh-low.c | 8 ++++++++
+ 1 file changed, 8 insertions(+)
+
+diff --git a/gdb/gdbserver/linux-sh-low.c b/gdb/gdbserver/linux-sh-low.c
+index 218d4d3..c4ada84 100644
+--- a/gdb/gdbserver/linux-sh-low.c
++++ b/gdb/gdbserver/linux-sh-low.c
+@@ -27,7 +27,15 @@ extern const struct target_desc *tdesc_sh;
+ #include <sys/reg.h>
+ #endif
+ 
++#if !defined(__GLIBC__)
++# define pt_regs uapi_pt_regs
++# define pt_dspregs uapi_pt_dspregs
++#endif
+ #include <asm/ptrace.h>
++#if !defined(__GLIBC__)
++# undef pt_regs
++# undef pt_dspregs
++#endif
+ 
+ #define sh_num_regs 41
+ 
+-- 
+2.7.4
+
diff --git a/package/gdb/7.11.1/0003-ppc-ptrace-Define-pt_regs-uapi_pt_regs-on-GLIBC-syst.patch b/package/gdb/7.11.1/0003-ppc-ptrace-Define-pt_regs-uapi_pt_regs-on-GLIBC-syst.patch
new file mode 100644
index 0000000..1e7f6b6
--- /dev/null
+++ b/package/gdb/7.11.1/0003-ppc-ptrace-Define-pt_regs-uapi_pt_regs-on-GLIBC-syst.patch
@@ -0,0 +1,53 @@
+From 7438f3e5a41adf54cf82cd82d3d52244e77d7d05 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Sat, 6 Aug 2016 17:32:50 -0700
+Subject: [PATCH] ppc/ptrace: Define pt_regs uapi_pt_regs on !GLIBC systems
+
+Upstream-Status: Pending
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
+---
+ gdb/gdbserver/linux-ppc-low.c | 6 ++++++
+ gdb/nat/ppc-linux.h           | 6 ++++++
+ 2 files changed, 12 insertions(+)
+
+diff --git a/gdb/gdbserver/linux-ppc-low.c b/gdb/gdbserver/linux-ppc-low.c
+index 2145c50..777905d 100644
+--- a/gdb/gdbserver/linux-ppc-low.c
++++ b/gdb/gdbserver/linux-ppc-low.c
+@@ -21,7 +21,13 @@
+ #include "linux-low.h"
+ 
+ #include <elf.h>
++#if !defined(__GLIBC__)
++# define pt_regs uapi_pt_regs
++#endif
+ #include <asm/ptrace.h>
++#if !defined(__GLIBC__)
++# undef pt_regs
++#endif
+ 
+ #include "nat/ppc-linux.h"
+ 
+diff --git a/gdb/nat/ppc-linux.h b/gdb/nat/ppc-linux.h
+index 85fbcd8..cbec9c5 100644
+--- a/gdb/nat/ppc-linux.h
++++ b/gdb/nat/ppc-linux.h
+@@ -18,7 +18,13 @@
+ #ifndef PPC_LINUX_H
+ #define PPC_LINUX_H 1
+ 
++#if !defined(__GLIBC__)
++# define pt_regs uapi_pt_regs
++#endif
+ #include <asm/ptrace.h>
++#if !defined(__GLIBC__)
++# undef pt_regs
++#endif
+ #include <asm/cputable.h>
+ 
+ /* This sometimes isn't defined.  */
+-- 
+2.7.4
+
diff --git a/package/gdb/7.11.1/0004-sh-ptrace-Define-pt_-dsp-regs-uapi_pt_-dsp-regs-on-G.patch b/package/gdb/7.11.1/0004-sh-ptrace-Define-pt_-dsp-regs-uapi_pt_-dsp-regs-on-G.patch
new file mode 100644
index 0000000..f8c9e59
--- /dev/null
+++ b/package/gdb/7.11.1/0004-sh-ptrace-Define-pt_-dsp-regs-uapi_pt_-dsp-regs-on-G.patch
@@ -0,0 +1,41 @@
+From b7cbde12595599768bf2831e311a8ab265322313 Mon Sep 17 00:00:00 2001
+From: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
+Date: Sat, 3 Jun 2017 21:23:52 +0200
+Subject: [PATCH] sh/ptrace: Define pt_{dsp,}regs uapi_pt_{dsp,}regs on !GLIBC
+ systems
+
+Fixes a pt_{dsp,}regs redefinition when building with the musl C library
+on SuperH.
+
+Inspired by
+http://git.yoctoproject.org/clean/cgit.cgi/poky/plain/meta/recipes-devtools/gdb/gdb/0004-ppc-ptrace-Define-pt_regs-uapi_pt_regs-on-GLIBC-syst.patch,
+adapted for SuperH.
+
+Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
+---
+ gdb/gdbserver/linux-sh-low.c | 8 ++++++++
+ 1 file changed, 8 insertions(+)
+
+diff --git a/gdb/gdbserver/linux-sh-low.c b/gdb/gdbserver/linux-sh-low.c
+index 38612e2..3195d0d 100644
+--- a/gdb/gdbserver/linux-sh-low.c
++++ b/gdb/gdbserver/linux-sh-low.c
+@@ -27,7 +27,15 @@ extern const struct target_desc *tdesc_sh;
+ #include <sys/reg.h>
+ #endif
+ 
++#if !defined(__GLIBC__)
++# define pt_regs uapi_pt_regs
++# define pt_dspregs uapi_pt_dspregs
++#endif
+ #include <asm/ptrace.h>
++#if !defined(__GLIBC__)
++# undef pt_regs
++# undef pt_dspregs
++#endif
+ 
+ #define sh_num_regs 41
+ 
+-- 
+2.7.4
+
diff --git a/package/gdb/7.12.1/0002-ppc-ptrace-Define-pt_regs-uapi_pt_regs-on-GLIBC-syst.patch b/package/gdb/7.12.1/0002-ppc-ptrace-Define-pt_regs-uapi_pt_regs-on-GLIBC-syst.patch
new file mode 100644
index 0000000..f6ec1d7
--- /dev/null
+++ b/package/gdb/7.12.1/0002-ppc-ptrace-Define-pt_regs-uapi_pt_regs-on-GLIBC-syst.patch
@@ -0,0 +1,53 @@
+From c45f07aec83ccb732ece970cb387f2db8b6896e4 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Sat, 6 Aug 2016 17:32:50 -0700
+Subject: [PATCH] ppc/ptrace: Define pt_regs uapi_pt_regs on !GLIBC systems
+
+Upstream-Status: Pending
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
+---
+ gdb/gdbserver/linux-ppc-low.c | 6 ++++++
+ gdb/nat/ppc-linux.h           | 6 ++++++
+ 2 files changed, 12 insertions(+)
+
+diff --git a/gdb/gdbserver/linux-ppc-low.c b/gdb/gdbserver/linux-ppc-low.c
+index 33a9feb..1a9141f 100644
+--- a/gdb/gdbserver/linux-ppc-low.c
++++ b/gdb/gdbserver/linux-ppc-low.c
+@@ -21,7 +21,13 @@
+ #include "linux-low.h"
+ 
+ #include <elf.h>
++#if !defined(__GLIBC__)
++# define pt_regs uapi_pt_regs
++#endif
+ #include <asm/ptrace.h>
++#if !defined(__GLIBC__)
++# undef pt_regs
++#endif
+ 
+ #include "nat/ppc-linux.h"
+ #include "linux-ppc-tdesc.h"
+diff --git a/gdb/nat/ppc-linux.h b/gdb/nat/ppc-linux.h
+index 5837ea1..7233929 100644
+--- a/gdb/nat/ppc-linux.h
++++ b/gdb/nat/ppc-linux.h
+@@ -18,7 +18,13 @@
+ #ifndef PPC_LINUX_H
+ #define PPC_LINUX_H 1
+ 
++#if !defined(__GLIBC__)
++# define pt_regs uapi_pt_regs
++#endif
+ #include <asm/ptrace.h>
++#if !defined(__GLIBC__)
++# undef pt_regs
++#endif
+ #include <asm/cputable.h>
+ 
+ /* This sometimes isn't defined.  */
+-- 
+2.7.4
+
diff --git a/package/gdb/7.12.1/0003-sh-ptrace-Define-pt_-dsp-regs-uapi_pt_-dsp-regs-on-G.patch b/package/gdb/7.12.1/0003-sh-ptrace-Define-pt_-dsp-regs-uapi_pt_-dsp-regs-on-G.patch
new file mode 100644
index 0000000..4f142ec
--- /dev/null
+++ b/package/gdb/7.12.1/0003-sh-ptrace-Define-pt_-dsp-regs-uapi_pt_-dsp-regs-on-G.patch
@@ -0,0 +1,41 @@
+From 00a0ba059f01784e8da5cec3439ea2d6c4a2ef40 Mon Sep 17 00:00:00 2001
+From: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
+Date: Sat, 3 Jun 2017 21:23:52 +0200
+Subject: [PATCH] sh/ptrace: Define pt_{dsp,}regs uapi_pt_{dsp,}regs on !GLIBC
+ systems
+
+Fixes a pt_{dsp,}regs redefinition when building with the musl C library
+on SuperH.
+
+Inspired by
+http://git.yoctoproject.org/clean/cgit.cgi/poky/plain/meta/recipes-devtools/gdb/gdb/0004-ppc-ptrace-Define-pt_regs-uapi_pt_regs-on-GLIBC-syst.patch,
+adapted for SuperH.
+
+Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
+---
+ gdb/gdbserver/linux-sh-low.c | 8 ++++++++
+ 1 file changed, 8 insertions(+)
+
+diff --git a/gdb/gdbserver/linux-sh-low.c b/gdb/gdbserver/linux-sh-low.c
+index ac084c9..08e104a 100644
+--- a/gdb/gdbserver/linux-sh-low.c
++++ b/gdb/gdbserver/linux-sh-low.c
+@@ -27,7 +27,15 @@ extern const struct target_desc *tdesc_sh;
+ #include <sys/reg.h>
+ #endif
+ 
++#if !defined(__GLIBC__)
++# define pt_regs uapi_pt_regs
++# define pt_dspregs uapi_pt_dspregs
++#endif
+ #include <asm/ptrace.h>
++#if !defined(__GLIBC__)
++# undef pt_regs
++# undef pt_dspregs
++#endif
+ 
+ #define sh_num_regs 41
+ 
+-- 
+2.7.4
+
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [Buildroot] [PATCH v2 4/6] gcc: add patch to support musl on SuperH in gcc 5.x
  2017-06-09 13:29 [Buildroot] [PATCH v2 1/6] gdb: introduce BR2_PACKAGE_GDB_ARCH_SUPPORTS Thomas Petazzoni
  2017-06-09 13:29 ` [Buildroot] [PATCH v2 2/6] gdb: not available on ARM noMMU and OpenRISC Thomas Petazzoni
  2017-06-09 13:29 ` [Buildroot] [PATCH v2 3/6] gdb: add patches to fix musl build on ppc(64)(le) and sh Thomas Petazzoni
@ 2017-06-09 13:29 ` Thomas Petazzoni
  2017-06-09 13:29 ` [Buildroot] [PATCH v2 5/6] uclibc: properly set UCLIBC_HAS_MMU option Thomas Petazzoni
  2017-06-09 13:29 ` [Buildroot] [PATCH v2 6/6] gdb: fix build of gdbserver on m68k/coldfire Thomas Petazzoni
  4 siblings, 0 replies; 6+ messages in thread
From: Thomas Petazzoni @ 2017-06-09 13:29 UTC (permalink / raw)
  To: buildroot

Building a toolchain for SuperH/musl works, but the toolchain generate
bogus binaries, because the path to the program interpreter is not
known (and therefore is /dev/null).

This commit backports a patch from gcc 6.x to make SuperH support with
musl work properly.

The patch is not needed in gcc >= 6.x because the musl support is
upstream. The patch is not needed for gcc 4.9 because we had a
different musl support patch that had support for all architectures in
one patch.

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
---
Changes since v1:
 - New patch in the series
---
 package/gcc/5.4.0/912-sh-musl-support.patch | 50 +++++++++++++++++++++++++++++
 1 file changed, 50 insertions(+)
 create mode 100644 package/gcc/5.4.0/912-sh-musl-support.patch

diff --git a/package/gcc/5.4.0/912-sh-musl-support.patch b/package/gcc/5.4.0/912-sh-musl-support.patch
new file mode 100644
index 0000000..6fdfacc
--- /dev/null
+++ b/package/gcc/5.4.0/912-sh-musl-support.patch
@@ -0,0 +1,50 @@
+From 6e9cad5fc3bdd0a1fa24ae172d4d4c1e3179a51c Mon Sep 17 00:00:00 2001
+From: nsz <nsz@138bc75d-0d04-0410-961f-82ee72b054a4>
+Date: Tue, 20 Oct 2015 18:13:15 +0000
+Subject: [PATCH] musl support for sh
+
+	* config/sh/linux.h (MUSL_DYNAMIC_LINKER): Define.
+	(MUSL_DYNAMIC_LINKER_E, MUSL_DYNAMIC_LINKER_FP): Define.
+
+git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk at 229095 138bc75d-0d04-0410-961f-82ee72b054a4
+[Thomas: backport from gcc 6.x]
+Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
+---
+ gcc/config/sh/linux.h | 21 +++++++++++++++++++++
+ 1 file changed, 21 insertions(+)
+
+diff --git a/gcc/config/sh/linux.h b/gcc/config/sh/linux.h
+index 0f5d614..61cf777 100644
+--- a/gcc/config/sh/linux.h
++++ b/gcc/config/sh/linux.h
+@@ -43,6 +43,27 @@ along with GCC; see the file COPYING3.  If not see
+ 
+ #define TARGET_ASM_FILE_END file_end_indicate_exec_stack
+ 
++#if TARGET_ENDIAN_DEFAULT == MASK_LITTLE_ENDIAN
++#define MUSL_DYNAMIC_LINKER_E "%{mb:eb}"
++#else
++#define MUSL_DYNAMIC_LINKER_E "%{!ml:eb}"
++#endif
++
++#if TARGET_CPU_DEFAULT & (MASK_HARD_SH2A_DOUBLE | MASK_SH4)
++/* "-nofpu" if any nofpu option is specified.  */
++#define MUSL_DYNAMIC_LINKER_FP \
++  "%{m1|m2|m2a-nofpu|m3|m4-nofpu|m4-100-nofpu|m4-200-nofpu|m4-300-nofpu|" \
++  "m4-340|m4-400|m4-500|m4al:-nofpu}"
++#else
++/* "-nofpu" if none of the hard fpu options are specified.  */
++#define MUSL_DYNAMIC_LINKER_FP "%{m2a|m4|m4-100|m4-200|m4-300|m4a:;:-nofpu}"
++#endif
++
++#undef MUSL_DYNAMIC_LINKER
++#define MUSL_DYNAMIC_LINKER \
++  "/lib/ld-musl-sh" MUSL_DYNAMIC_LINKER_E MUSL_DYNAMIC_LINKER_FP \
++  "%{mfdpic:-fdpic}.so.1"
++
+ #define GLIBC_DYNAMIC_LINKER "/lib/ld-linux.so.2"
+ 
+ #undef SUBTARGET_LINK_EMUL_SUFFIX
+-- 
+2.7.4
+
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [Buildroot] [PATCH v2 5/6] uclibc: properly set UCLIBC_HAS_MMU option
  2017-06-09 13:29 [Buildroot] [PATCH v2 1/6] gdb: introduce BR2_PACKAGE_GDB_ARCH_SUPPORTS Thomas Petazzoni
                   ` (2 preceding siblings ...)
  2017-06-09 13:29 ` [Buildroot] [PATCH v2 4/6] gcc: add patch to support musl on SuperH in gcc 5.x Thomas Petazzoni
@ 2017-06-09 13:29 ` Thomas Petazzoni
  2017-06-09 13:29 ` [Buildroot] [PATCH v2 6/6] gdb: fix build of gdbserver on m68k/coldfire Thomas Petazzoni
  4 siblings, 0 replies; 6+ messages in thread
From: Thomas Petazzoni @ 2017-06-09 13:29 UTC (permalink / raw)
  To: buildroot

gdbserver's code looks at both UCLIBC_USE_MMU *and* UCLIBC_HAS_MMU to
decide whether to enable the no-MMU code. So far, on noMMU platforms,
UCLIBC_HAS_MMU was still set to 'y'. This commit adjusts this, which is
a step forward in getting gdbserver to build on m68k/coldfire.

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
---
Changes since v1:
 - New patch in the series
---
 package/uclibc/uclibc.mk | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/package/uclibc/uclibc.mk b/package/uclibc/uclibc.mk
index a5a20ea..fa970df 100644
--- a/package/uclibc/uclibc.mk
+++ b/package/uclibc/uclibc.mk
@@ -253,10 +253,12 @@ endif
 
 ifeq ($(BR2_USE_MMU),y)
 define UCLIBC_MMU_CONFIG
+	$(call KCONFIG_ENABLE_OPT,ARCH_HAS_MMU,$(@D)/.config)
 	$(call KCONFIG_ENABLE_OPT,ARCH_USE_MMU,$(@D)/.config)
 endef
 else
 define UCLIBC_MMU_CONFIG
+	$(call KCONFIG_DISABLE_OPT,ARCH_HAS_MMU,$(@D)/.config)
 	$(call KCONFIG_DISABLE_OPT,ARCH_USE_MMU,$(@D)/.config)
 endef
 endif
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [Buildroot] [PATCH v2 6/6] gdb: fix build of gdbserver on m68k/coldfire
  2017-06-09 13:29 [Buildroot] [PATCH v2 1/6] gdb: introduce BR2_PACKAGE_GDB_ARCH_SUPPORTS Thomas Petazzoni
                   ` (3 preceding siblings ...)
  2017-06-09 13:29 ` [Buildroot] [PATCH v2 5/6] uclibc: properly set UCLIBC_HAS_MMU option Thomas Petazzoni
@ 2017-06-09 13:29 ` Thomas Petazzoni
  4 siblings, 0 replies; 6+ messages in thread
From: Thomas Petazzoni @ 2017-06-09 13:29 UTC (permalink / raw)
  To: buildroot

This commit adds a small patch to gdb that fixes the build of gdbserver
on m68k/coldfire:

../nat/linux-ptrace.c: In function 'linux_fork_to_function':
../nat/linux-ptrace.c:282:19: warning: implicit declaration of function 'clone' [-Wimplicit-function-declaration]
       child_pid = clone (function, child_stack + STACK_SIZE,
                   ^
../nat/linux-ptrace.c:283:5: error: 'CLONE_VM' undeclared (first use in this function)
     CLONE_VM | SIGCHLD, child_stack + STACK_SIZE * 2);
     ^
../nat/linux-ptrace.c:283:5: note: each undeclared identifier is reported only once for each function it appears in

Thanks to Waldemar for pointing out the patch fixing this issue.

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
---
Changes since v1:
 - New patch in the series
---
 .../0010-Fix-gdbserver-build-on-uClibc-noMMU.patch | 32 ++++++++++++++++++++++
 .../0005-Fix-gdbserver-build-on-uClibc-noMMU.patch | 32 ++++++++++++++++++++++
 .../0004-Fix-gdbserver-build-on-uClibc-noMMU.patch | 32 ++++++++++++++++++++++
 3 files changed, 96 insertions(+)
 create mode 100644 package/gdb/7.10.1/0010-Fix-gdbserver-build-on-uClibc-noMMU.patch
 create mode 100644 package/gdb/7.11.1/0005-Fix-gdbserver-build-on-uClibc-noMMU.patch
 create mode 100644 package/gdb/7.12.1/0004-Fix-gdbserver-build-on-uClibc-noMMU.patch

diff --git a/package/gdb/7.10.1/0010-Fix-gdbserver-build-on-uClibc-noMMU.patch b/package/gdb/7.10.1/0010-Fix-gdbserver-build-on-uClibc-noMMU.patch
new file mode 100644
index 0000000..3f877b3
--- /dev/null
+++ b/package/gdb/7.10.1/0010-Fix-gdbserver-build-on-uClibc-noMMU.patch
@@ -0,0 +1,32 @@
+From 6de192acd4807d7fd57caf451567f09308bd8350 Mon Sep 17 00:00:00 2001
+From: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
+Date: Fri, 9 Jun 2017 10:19:32 +0200
+Subject: [PATCH] Fix gdbserver build on uClibc/noMMU
+
+The noMMU specific code requires including <sched.h>.
+
+Originally from
+https://cgit.openadk.org/cgi/cgit/openadk.git/plain/package/gdbserver/patches/nommu.patch.
+
+Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
+---
+ gdb/nat/linux-ptrace.h | 3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+diff --git a/gdb/nat/linux-ptrace.h b/gdb/nat/linux-ptrace.h
+index be6c395..c9f85aa 100644
+--- a/gdb/nat/linux-ptrace.h
++++ b/gdb/nat/linux-ptrace.h
+@@ -23,7 +23,8 @@ struct buffer;
+ #include <sys/ptrace.h>
+ 
+ #ifdef __UCLIBC__
+-#if !(defined(__UCLIBC_HAS_MMU__) || defined(__ARCH_HAS_MMU__))
++#include <sched.h>
++#if !(defined(__UCLIBC_HAS_MMU__) || defined(__ARCH_USE_MMU__))
+ /* PTRACE_TEXT_ADDR and friends.  */
+ #include <asm/ptrace.h>
+ #define HAS_NOMMU
+-- 
+2.7.4
+
diff --git a/package/gdb/7.11.1/0005-Fix-gdbserver-build-on-uClibc-noMMU.patch b/package/gdb/7.11.1/0005-Fix-gdbserver-build-on-uClibc-noMMU.patch
new file mode 100644
index 0000000..fc8b3ac
--- /dev/null
+++ b/package/gdb/7.11.1/0005-Fix-gdbserver-build-on-uClibc-noMMU.patch
@@ -0,0 +1,32 @@
+From d6bf0c57a6bf361ac53887653aa1878e60d56335 Mon Sep 17 00:00:00 2001
+From: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
+Date: Fri, 9 Jun 2017 10:19:32 +0200
+Subject: [PATCH] Fix gdbserver build on uClibc/noMMU
+
+The noMMU specific code requires including <sched.h>.
+
+Originally from
+https://cgit.openadk.org/cgi/cgit/openadk.git/plain/package/gdbserver/patches/nommu.patch.
+
+Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
+---
+ gdb/nat/linux-ptrace.h | 3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+diff --git a/gdb/nat/linux-ptrace.h b/gdb/nat/linux-ptrace.h
+index 0a23bcb..35b7cbb 100644
+--- a/gdb/nat/linux-ptrace.h
++++ b/gdb/nat/linux-ptrace.h
+@@ -23,7 +23,8 @@ struct buffer;
+ #include "nat/gdb_ptrace.h"
+ 
+ #ifdef __UCLIBC__
+-#if !(defined(__UCLIBC_HAS_MMU__) || defined(__ARCH_HAS_MMU__))
++#include <sched.h>
++#if !(defined(__UCLIBC_HAS_MMU__) || defined(__ARCH_USE_MMU__))
+ /* PTRACE_TEXT_ADDR and friends.  */
+ #include <asm/ptrace.h>
+ #define HAS_NOMMU
+-- 
+2.7.4
+
diff --git a/package/gdb/7.12.1/0004-Fix-gdbserver-build-on-uClibc-noMMU.patch b/package/gdb/7.12.1/0004-Fix-gdbserver-build-on-uClibc-noMMU.patch
new file mode 100644
index 0000000..cbdfc4d
--- /dev/null
+++ b/package/gdb/7.12.1/0004-Fix-gdbserver-build-on-uClibc-noMMU.patch
@@ -0,0 +1,32 @@
+From 430ab62f356d9e45e2231b0483ee33eaf3af5df3 Mon Sep 17 00:00:00 2001
+From: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
+Date: Fri, 9 Jun 2017 10:19:32 +0200
+Subject: [PATCH] Fix gdbserver build on uClibc/noMMU
+
+The noMMU specific code requires including <sched.h>.
+
+Originally from
+https://cgit.openadk.org/cgi/cgit/openadk.git/plain/package/gdbserver/patches/nommu.patch.
+
+Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
+---
+ gdb/nat/linux-ptrace.h | 3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+diff --git a/gdb/nat/linux-ptrace.h b/gdb/nat/linux-ptrace.h
+index 5954945..80bb674 100644
+--- a/gdb/nat/linux-ptrace.h
++++ b/gdb/nat/linux-ptrace.h
+@@ -23,7 +23,8 @@ struct buffer;
+ #include "nat/gdb_ptrace.h"
+ 
+ #ifdef __UCLIBC__
+-#if !(defined(__UCLIBC_HAS_MMU__) || defined(__ARCH_HAS_MMU__))
++#include <sched.h>
++#if !(defined(__UCLIBC_HAS_MMU__) || defined(__ARCH_USE_MMU__))
+ /* PTRACE_TEXT_ADDR and friends.  */
+ #include <asm/ptrace.h>
+ #define HAS_NOMMU
+-- 
+2.7.4
+
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2017-06-09 13:29 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-06-09 13:29 [Buildroot] [PATCH v2 1/6] gdb: introduce BR2_PACKAGE_GDB_ARCH_SUPPORTS Thomas Petazzoni
2017-06-09 13:29 ` [Buildroot] [PATCH v2 2/6] gdb: not available on ARM noMMU and OpenRISC Thomas Petazzoni
2017-06-09 13:29 ` [Buildroot] [PATCH v2 3/6] gdb: add patches to fix musl build on ppc(64)(le) and sh Thomas Petazzoni
2017-06-09 13:29 ` [Buildroot] [PATCH v2 4/6] gcc: add patch to support musl on SuperH in gcc 5.x Thomas Petazzoni
2017-06-09 13:29 ` [Buildroot] [PATCH v2 5/6] uclibc: properly set UCLIBC_HAS_MMU option Thomas Petazzoni
2017-06-09 13:29 ` [Buildroot] [PATCH v2 6/6] gdb: fix build of gdbserver on m68k/coldfire Thomas Petazzoni

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.