All of lore.kernel.org
 help / color / mirror / Atom feed
From: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
To: buildroot@busybox.net
Subject: [Buildroot] [PATCH] Revert "package/gdb: prevent gdbserver being selected for RISC-V builds"
Date: Wed, 30 Dec 2020 23:35:59 +0100	[thread overview]
Message-ID: <20201230233559.5ea5c26b@windsurf> (raw)
In-Reply-To: <20201204014549.2669932-1-vgupta@synopsys.com>

Hello,

On Thu,  3 Dec 2020 17:45:49 -0800
Vineet Gupta <Vineet.Gupta1@synopsys.com> wrote:

> This reverts commit 44a9babcc67cd011e957ba9fd1cf741891957c12.
> 
> As of Buildroot 2020.11 (glibc build of qemu_riscv64_virt_defconfig),
> cross-gdb for RISCV buildis fine and can also attach to a qemu
> instance, so remove the gate on not building it.
> 
> Signed-off-by: Vineet Gupta <vgupta@synopsys.com>

I am sorry, but I don't see how this can work. RISC-V support in
gdbserver was only added in upstream gdb in commit
bf84f7066626c78884436e1c39fb60f04c665f21, which first appeared in gdb
10.1.

And indeed, when I build:

BR2_riscv=y
BR2_TOOLCHAIN_EXTERNAL=y
BR2_TOOLCHAIN_EXTERNAL_DOWNLOAD=y
BR2_TOOLCHAIN_EXTERNAL_URL="http://autobuild.buildroot.net/toolchains/tarballs/br-riscv64-musl-2020.02.tar.bz2"
BR2_TOOLCHAIN_EXTERNAL_GCC_9=y
BR2_TOOLCHAIN_EXTERNAL_HEADERS_4_19=y
BR2_TOOLCHAIN_EXTERNAL_CUSTOM_MUSL=y
BR2_TOOLCHAIN_EXTERNAL_CXX=y
BR2_PACKAGE_HOST_GDB=y
BR2_INIT_NONE=y
BR2_SYSTEM_BIN_SH_NONE=y
# BR2_PACKAGE_BUSYBOX is not set
BR2_PACKAGE_GDB=y
# BR2_TARGET_ROOTFS_TAR is not set

It fails to build gdbserver, with:

Error: target not supported by gdbserver.

However, if I build:

BR2_riscv=y
BR2_TOOLCHAIN_EXTERNAL=y
BR2_TOOLCHAIN_EXTERNAL_DOWNLOAD=y
BR2_TOOLCHAIN_EXTERNAL_URL="http://autobuild.buildroot.net/toolchains/tarballs/br-riscv64-musl-2020.02.tar.bz2"
BR2_TOOLCHAIN_EXTERNAL_GCC_9=y
BR2_TOOLCHAIN_EXTERNAL_HEADERS_4_19=y
BR2_TOOLCHAIN_EXTERNAL_CUSTOM_MUSL=y
BR2_TOOLCHAIN_EXTERNAL_CXX=y
BR2_PACKAGE_HOST_GDB=y
BR2_GDB_VERSION_10=y
BR2_INIT_NONE=y
BR2_SYSTEM_BIN_SH_NONE=y
# BR2_PACKAGE_BUSYBOX is not set
BR2_PACKAGE_GDB=y
# BR2_TARGET_ROOTFS_TAR is not set

which uses gdb 10.x, then indeed, the gdbserver configure script
recognizes RISC-V as a supported CPU architecture, but it fails to
build with:

../../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
../../gdbserver/linux-riscv-low.cc: In function ?void riscv_store_fpregset(regcache*, const void*)?:
../../gdbserver/linux-riscv-low.cc:156:19: error: ?ELF_NFPREG? was not declared in this scope; did you mean ?ELF_NGREG??
  156 |   for (i = 0; i < ELF_NFPREG - 1; i++, regbuf += flen)
      |                   ^~~~~~~~~~
      |                   ELF_NGREG

Note: this is with a musl toolchain, it is possible that it builds fine
with a glibc toolchain.

But regardless of that, RISC-V support in gdbserver only appeared in
gdb 10.x, so I don't see how your patch could have worked, as we only
introduced gdb 10.x support in Buildroot yesterday.

Could you clarify ?

Best regards,

Thomas
-- 
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com

  parent reply	other threads:[~2020-12-30 22:35 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-12-04  1:45 [Buildroot] [PATCH] Revert "package/gdb: prevent gdbserver being selected for RISC-V builds" Vineet Gupta
2020-12-04  8:13 ` Thomas Petazzoni
2020-12-04  8:26   ` Vineet Gupta
2020-12-04 17:15 ` Alistair Francis
2020-12-30 22:35 ` Thomas Petazzoni [this message]
2021-01-05  2:35   ` Vineet Gupta

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=20201230233559.5ea5c26b@windsurf \
    --to=thomas.petazzoni@bootlin.com \
    --cc=buildroot@busybox.net \
    /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 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.