From: Zied Guermazi <zied.guermazi@trande.de>
To: Pedro Alves <pedro@palves.net>,
Andreas Schwab <schwab@linux-m68k.org>,
Tom Tromey <tom@tromey.com>
Cc: gdb-patches@sourceware.org
Subject: Re: [PATCH 1/1] get page size using sysconf (_SC_PAGESIZE) instead of PAGE_SIZE
Date: Mon, 2 May 2022 20:01:52 +0200 [thread overview]
Message-ID: <2ab7945d-5355-586c-1af5-7b465586d01c@trande.de> (raw)
In-Reply-To: <a0ff4906-be40-b4c3-63ed-74428523a21c@palves.net>
hi Pedro,
I think I can clarify the situation here by giving more insight on the
context. A short explanation is needed.
In current build system linux-btrace.c is only included when the host is
a Linux running of an i386 cpu. (see gdb/configure.nat). so the point of
Andreas is pertinent with no further explanations of additional planned
changes.
This patch is a preparation for another patch set for adding btrace on
arm processors using ARM Coresight ETM traces. (see the patch set
https://pi.simark.ca/gdb-patches/20210531213307.275079-1-zied.guermazi@trande.de/#r
). Markus Metzger in his review recommended submitting this change in a
separated patch.
In the patch set for adding btrace on arm, there is a need to build
linux-btrace.c for hosts linux/aarch64 and linux/arm. gdb/configure.nat
at line 233 looks now as following:
"
/ linux)//
// case ${gdb_host_cpu} in//
// aarch64)//
// # Host: AArch64 based machine running GNU/Linux//
// NATDEPFILES="${NATDEPFILES} aarch64-nat.o aarch64-linux-nat.o \//
// aarch32-linux-nat.o nat/aarch64-hw-point.o \//
// nat/aarch64-linux-hw-point.o \//
// nat/aarch64-linux.o \//
//*nat/linux-btrace.o* \//
// nat/aarch64-sve-linux-ptrace.o \//
// nat/aarch64-mte-linux-ptrace.o"//
// ;;//
// arc)//
// # Host: ARC based machine running GNU/Linux//
// NATDEPFILES="${NATDEPFILES} arc-linux-nat.o"//
// ;;//
// arm)//
// # Host: ARM based machine running GNU/Linux//
// NATDEPFILES="${NATDEPFILES} arm-linux-nat.o \//
// aarch32-linux-nat.o *nat/linux-btrace.o*"//
// ;;/
"
which means that the file is now included in the build for linux/aarch64
and linux/arm
I have observed this issue when the build machine was an intel x86,
host and target were both aarch64-linux (and also arm-linux)
using following configuration
"../binutils-gdb/configure --host aarch64-linux-gnu
--target=aarch64-linux-gnu --disable-ld --disable-gold --disable-gas
--disable-sim --disable-gprofng --with-arm-cs "
and when building natively on Debian on aarch64 and Debian on arm.
I was getting following build error message
"
/../../binutils-gdb/gdb/nat/linux-btrace.c:799:30: error: ‘PAGE_SIZE’
was not declared in this scope; did you mean ‘PTRACE_SEIZE’?//
// 799 | scoped_mmap data (nullptr, PAGE_SIZE, PROT_READ |
PROT_WRITE, MAP_SHARED,//
// | ^~~~~~~~~//
// | PTRACE_SEIZE/
"
The issue was fixed with this patch.
Kind Regards
Zied Guermazi
On 02.05.22 18:46, Pedro Alves wrote:
> On 2022-04-30 14:33, Andreas Schwab wrote:
>> On Apr 30 2022, Zied Guermazi wrote:
>>
>>> PAGE_SIZE for target system was not defined, in other cases PAGE_SIZE of
>>> the host system was used etc... :).
>> This file is only used in a native configuration.
>>
> Zied, when you said:
>
> "the issue was first observed when activating this code while compiling on an x86 for an arm target."
>
> are you talking about:
>
> --build=x86_64-linux --host=aarch64-linux
>
> or:
> --host=x86_64-linux --target=aarch64-linux
>
> ?
>
> I agree with Andreas -- linux-btrace.c is only included in the build on x86 hosts, so why are you seeing
> this? Did you tweak gdb/configure.nat to include linux-btrace.c in other configurations? Or gdb/configure.tgt?
> What exactly did you do?
next prev parent reply other threads:[~2022-05-02 18:02 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-04-30 12:16 [PATCH v4 0/1] " Zied Guermazi
2022-04-30 12:16 ` [PATCH 1/1] " Zied Guermazi
2022-04-30 12:29 ` Andreas Schwab
2022-04-30 12:32 ` Zied Guermazi
2022-04-30 12:52 ` Andreas Schwab
2022-04-30 12:58 ` Zied Guermazi
2022-04-30 13:03 ` Andreas Schwab
2022-04-30 13:25 ` Zied Guermazi
2022-04-30 13:33 ` Andreas Schwab
2022-05-02 16:46 ` Pedro Alves
2022-05-02 18:01 ` Zied Guermazi [this message]
2022-05-02 18:55 ` Pedro Alves
2022-05-02 19:16 ` Zied Guermazi
2022-05-02 16:38 ` Tom Tromey
2022-05-02 16:50 ` Pedro Alves
2022-05-02 17:04 ` Tom Tromey
2022-05-02 17:08 ` Pedro Alves
-- strict thread matches above, loose matches on Subject: below --
2022-04-24 21:15 [PATCH 0/1] btrace: " Zied Guermazi
2022-04-24 21:15 ` [PATCH 1/1] " Zied Guermazi
2022-04-25 5:03 ` Metzger, Markus T
2022-04-25 7:02 ` Zied Guermazi
2022-04-25 7:36 ` Metzger, Markus T
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=2ab7945d-5355-586c-1af5-7b465586d01c@trande.de \
--to=zied.guermazi@trande.de \
--cc=gdb-patches@sourceware.org \
--cc=pedro@palves.net \
--cc=schwab@linux-m68k.org \
--cc=tom@tromey.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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).