Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: "Yann E. MORIN" <yann.morin.1998@free.fr>
To: Fabrice Fontaine <fontaine.fabrice@gmail.com>
Cc: buildroot@buildroot.org
Subject: Re: [Buildroot] [PATCH 1/1] package/gdb: fix musl build on riscv
Date: Thu, 11 Nov 2021 22:33:01 +0100	[thread overview]
Message-ID: <20211111213301.GG2609@scaer> (raw)
In-Reply-To: <20211110223244.2116243-1-fontaine.fabrice@gmail.com>

Fabrice, All,

On 2021-11-10 23:32 +0100, Fabrice Fontaine spake thusly:
> Fix the following build failure raised since gdb 10.1 and
> https://github.com/bminor/binutils-gdb/commit/bf84f7066626c78884436e1c39fb60f04c665f21:
> 
> ../../gdbserver/linux-riscv-low.cc: In function 'void riscv_fill_fpregset(regcache*, void*)':
> ../../gdbserver/linux-riscv-low.cc:140:19: error: 'ELF_NFPREG' was not declared in this scope; did you mean 'ELF_NGREG'?
>   140 |   for (i = 0; i < ELF_NFPREG - 1; i++, regbuf += flen)
>       |                   ^~~~~~~~~~
>       |                   ELF_NGREG
> 
> musl fixed the issue with
> https://github.com/ifduyue/musl/commit/e5d2823631bbfebacf48e1a34ed28f28d7cb2570
> 
> Fixes:
>  - http://autobuild.buildroot.org/results/16b19198980ce9c81a618b3f6e8dc9fe28247a28
> 
> Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
> ---
>  .../10.2/0007-fix-musl-build-on-riscv.patch   | 60 +++++++++++++++++++
>  .../11.1/0007-fix-musl-build-on-riscv.patch   | 60 +++++++++++++++++++
>  2 files changed, 120 insertions(+)
>  create mode 100644 package/gdb/10.2/0007-fix-musl-build-on-riscv.patch
>  create mode 100644 package/gdb/11.1/0007-fix-musl-build-on-riscv.patch
> 
> diff --git a/package/gdb/10.2/0007-fix-musl-build-on-riscv.patch b/package/gdb/10.2/0007-fix-musl-build-on-riscv.patch
> new file mode 100644
> index 0000000000..983f3b30d0
> --- /dev/null
> +++ b/package/gdb/10.2/0007-fix-musl-build-on-riscv.patch
> @@ -0,0 +1,60 @@
> +From c3fdbc0a24c83246f951ba79c7167547da979ae5 Mon Sep 17 00:00:00 2001
> +From: Fabrice Fontaine <fontaine.fabrice@gmail.com>
> +Date: Wed, 10 Nov 2021 23:14:54 +0100
> +Subject: [PATCH] fix musl build on riscv
> +
> +Fix the following build failure raised with musl:
> +
> +../../gdbserver/linux-riscv-low.cc: In function 'void riscv_fill_fpregset(regcache*, void*)':
> +../../gdbserver/linux-riscv-low.cc:140:19: error: 'ELF_NFPREG' was not declared in this scope; did you mean 'ELF_NGREG'?
> +  140 |   for (i = 0; i < ELF_NFPREG - 1; i++, regbuf += flen)
> +      |                   ^~~~~~~~~~
> +      |                   ELF_NGREG
> +
> +musl fixed the issue with
> +https://github.com/ifduyue/musl/commit/e5d2823631bbfebacf48e1a34ed28f28d7cb2570

I've changed the URL to point to the official upstream repository rather
than the unofficial cone on Github.

It is also unfortunate that we have to have those patches on gdb... :-(

Applied to master, thanks.

Regards,
Yann E. MORIN.

> +Fixes:
> + - http://autobuild.buildroot.org/results/16b19198980ce9c81a618b3f6e8dc9fe28247a28
> +
> +Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
> +---
> + gdb/nat/riscv-linux-tdesc.c  | 5 +++++
> + gdbserver/linux-riscv-low.cc | 5 +++++
> + 2 files changed, 10 insertions(+)
> +
> +diff --git a/gdb/nat/riscv-linux-tdesc.c b/gdb/nat/riscv-linux-tdesc.c
> +index 837b1707e0f..667c013006a 100644
> +--- a/gdb/nat/riscv-linux-tdesc.c
> ++++ b/gdb/nat/riscv-linux-tdesc.c
> +@@ -31,6 +31,11 @@
> + # define NFPREG 33
> + #endif
> + 
> ++/* Work around musl breakage since version 1.1.24.  */
> ++#ifndef ELF_NFPREG
> ++# define ELF_NFPREG 33
> ++#endif
> ++
> + /* See nat/riscv-linux-tdesc.h.  */
> + 
> + struct riscv_gdbarch_features
> +diff --git a/gdbserver/linux-riscv-low.cc b/gdbserver/linux-riscv-low.cc
> +index 8bf97ea4aa3..1142dbc7b16 100644
> +--- a/gdbserver/linux-riscv-low.cc
> ++++ b/gdbserver/linux-riscv-low.cc
> +@@ -30,6 +30,11 @@
> + # define NFPREG 33
> + #endif
> + 
> ++/* Work around musl breakage since version 1.1.24.  */
> ++#ifndef ELF_NFPREG
> ++# define ELF_NFPREG 33
> ++#endif
> ++
> + /* Linux target op definitions for the RISC-V architecture.  */
> + 
> + class riscv_target : public linux_process_target
> +-- 
> +2.33.0
> +
> diff --git a/package/gdb/11.1/0007-fix-musl-build-on-riscv.patch b/package/gdb/11.1/0007-fix-musl-build-on-riscv.patch
> new file mode 100644
> index 0000000000..983f3b30d0
> --- /dev/null
> +++ b/package/gdb/11.1/0007-fix-musl-build-on-riscv.patch
> @@ -0,0 +1,60 @@
> +From c3fdbc0a24c83246f951ba79c7167547da979ae5 Mon Sep 17 00:00:00 2001
> +From: Fabrice Fontaine <fontaine.fabrice@gmail.com>
> +Date: Wed, 10 Nov 2021 23:14:54 +0100
> +Subject: [PATCH] fix musl build on riscv
> +
> +Fix the following build failure raised with musl:
> +
> +../../gdbserver/linux-riscv-low.cc: In function 'void riscv_fill_fpregset(regcache*, void*)':
> +../../gdbserver/linux-riscv-low.cc:140:19: error: 'ELF_NFPREG' was not declared in this scope; did you mean 'ELF_NGREG'?
> +  140 |   for (i = 0; i < ELF_NFPREG - 1; i++, regbuf += flen)
> +      |                   ^~~~~~~~~~
> +      |                   ELF_NGREG
> +
> +musl fixed the issue with
> +https://github.com/ifduyue/musl/commit/e5d2823631bbfebacf48e1a34ed28f28d7cb2570
> +
> +Fixes:
> + - http://autobuild.buildroot.org/results/16b19198980ce9c81a618b3f6e8dc9fe28247a28
> +
> +Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
> +---
> + gdb/nat/riscv-linux-tdesc.c  | 5 +++++
> + gdbserver/linux-riscv-low.cc | 5 +++++
> + 2 files changed, 10 insertions(+)
> +
> +diff --git a/gdb/nat/riscv-linux-tdesc.c b/gdb/nat/riscv-linux-tdesc.c
> +index 837b1707e0f..667c013006a 100644
> +--- a/gdb/nat/riscv-linux-tdesc.c
> ++++ b/gdb/nat/riscv-linux-tdesc.c
> +@@ -31,6 +31,11 @@
> + # define NFPREG 33
> + #endif
> + 
> ++/* Work around musl breakage since version 1.1.24.  */
> ++#ifndef ELF_NFPREG
> ++# define ELF_NFPREG 33
> ++#endif
> ++
> + /* See nat/riscv-linux-tdesc.h.  */
> + 
> + struct riscv_gdbarch_features
> +diff --git a/gdbserver/linux-riscv-low.cc b/gdbserver/linux-riscv-low.cc
> +index 8bf97ea4aa3..1142dbc7b16 100644
> +--- a/gdbserver/linux-riscv-low.cc
> ++++ b/gdbserver/linux-riscv-low.cc
> +@@ -30,6 +30,11 @@
> + # define NFPREG 33
> + #endif
> + 
> ++/* Work around musl breakage since version 1.1.24.  */
> ++#ifndef ELF_NFPREG
> ++# define ELF_NFPREG 33
> ++#endif
> ++
> + /* Linux target op definitions for the RISC-V architecture.  */
> + 
> + class riscv_target : public linux_process_target
> +-- 
> +2.33.0
> +
> -- 
> 2.33.0
> 
> _______________________________________________
> buildroot mailing list
> buildroot@buildroot.org
> https://lists.buildroot.org/mailman/listinfo/buildroot

-- 
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 561 099 427 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

  reply	other threads:[~2021-11-11 21:33 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-10 22:32 [Buildroot] [PATCH 1/1] package/gdb: fix musl build on riscv Fabrice Fontaine
2021-11-11 21:33 ` Yann E. MORIN [this message]
2021-11-17 21:37 ` Peter Korsgaard

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20211111213301.GG2609@scaer \
    --to=yann.morin.1998@free.fr \
    --cc=buildroot@buildroot.org \
    --cc=fontaine.fabrice@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox