From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from nx227.node01.secure-mailgate.com (nx227.node01.secure-mailgate.com [89.22.108.227]) by sourceware.org (Postfix) with ESMTPS id D58703858C50 for ; Mon, 2 May 2022 18:02:06 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org D58703858C50 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=trande.de Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=trande.de Received: from host202.checkdomain.de ([185.137.168.148]) by node01.secure-mailgate.com with esmtps (TLSv1.2:AES128-GCM-SHA256:128) (Exim 4.92) (envelope-from ) id 1nlaMt-005SKw-Ew; Mon, 02 May 2022 20:02:02 +0200 X-SecureMailgate-Identity: zied.guermazi@trande.de;host202.checkdomain.de Received: from [192.168.178.42] (dynamic-077-012-056-220.77.12.pool.telefonica.de [77.12.56.220]) (Authenticated sender: zied.guermazi@trande.de) by host202.checkdomain.de (Postfix) with ESMTPSA id 64C4C280125; Mon, 2 May 2022 20:01:53 +0200 (CEST) X-SecureMailgate-Identity: zied.guermazi@trande.de;host202.checkdomain.de Message-ID: <2ab7945d-5355-586c-1af5-7b465586d01c@trande.de> Date: Mon, 2 May 2022 20:01:52 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.8.1 Subject: Re: [PATCH 1/1] get page size using sysconf (_SC_PAGESIZE) instead of PAGE_SIZE Content-Language: en-US To: Pedro Alves , Andreas Schwab , Tom Tromey Cc: gdb-patches@sourceware.org References: <20220430121623.42196-1-zied.guermazi@trande.de> <20220430121623.42196-2-zied.guermazi@trande.de> <87ee1e92kp.fsf@igel.home> <47159933-7e6a-ab66-b0b8-1b184a469e6c@trande.de> <877d7691jf.fsf@igel.home> <87y1zm7mfl.fsf@igel.home> <44259e87-d19f-189b-123e-39ea9f06c763@trande.de> <87tuaa7l1v.fsf@igel.home> From: Zied Guermazi In-Reply-To: X-PPP-Message-ID: <20220502180153.772997.25006@host202.checkdomain.de> X-PPP-Vhost: trande.de X-Originating-IP: 185.137.168.148 X-SecureMailgate-Domain: host202.checkdomain.de X-SecureMailgate-Username: 185.137.168.148 Authentication-Results: secure-mailgate.com; auth=pass smtp.auth=185.137.168.148@host202.checkdomain.de X-SecureMailgate-Outgoing-Class: ham X-SecureMailgate-Outgoing-Evidence: Combined (0.15) X-Recommended-Action: accept X-Filter-ID: Pt3MvcO5N4iKaDQ5O6lkdGlMVN6RH8bjRMzItlySaT9WLQux0N3HQm8ltz8rnu+BPUtbdvnXkggZ 3YnVId/Y5jcf0yeVQAvfjHznO7+bT5zRfK4njRWCJG0FcgrR1735zbDY5X7FlQjMaRPaTaQCQPV5 DbUBqLytzyC5la7K3rkmoppQSi55Sdqw1rYV0B9rBPAEBcgWKKRZUIrpsbLz9i8qre87JdYGYK/O KxdSfI3S6SVcTDfu4zA3T/zuN4cDL9n2pe7DtS+zgSBd+xvkfrk5JPeAOPgn+kMHnHQHwyz6z+jJ yS3b/n7c49sQqPved4P1mwXpMwdyCvEWO7jQBHGNYtNkyXnw++vBeaFdojPSXhtH1wvQPcHSOkT2 jP0o2FXcs4D4C8A9asoL7PfvXkdX9lgZ8EzqS/IY6P98izRz04A+KjVTmimDIMaTi9DTCzCvRwvq VEAQMkdN/mM3fHBCK6Rs8kNktWJu4Ts1inkqNTPk0oN0zQyN/zObPf6Lcq2Q3m0uyFjcKGsvPbB7 4+JoXRpLguwg6NRhldFI7hyWFAxcDQpGqcjJd1pnFZeWRAwX31WVY5lWjWxuGSRuxdubC9mr8z6I HdZqlhyTNKnLEb80N0C134M8BRaj6qg1ak1m4yXZGkWsX85EIGofsQa2lXR+hQvtqLwVKWonezkL ukeZ67PBIzLv5uyzsYRGIveD1kaqoOX9s49As8Lf9lhkp3Y933tMSCEF1/JBDp8HdhNPPnkm6mou ln4cCCfo1ayOhy8N4VS6YKxXmDGQKfvg7iEFLP+SSY+Av5+AiC7J7+9kcUFFG7DP0qq7uJ5lRxUH cdZkCrkR5mEJVTVFiH+/4QRe4M8DVVqLwsAjg/BaLAD3QZWmsJmaItjdbUJrzwlBJvpYqxWpUlq0 41+VMGQQ6pjUs/yvFExLvZ3BizLTPpuFqUUQz+mM8JAD4ECW0HEIzZWvVfzfuaF7TEGxfp7GbsKo u9IOOm93KKlMGQie+7bfhKEMmA4mb4yoqBErqf+asSmaqnj585TcPUHdgHLYM3A6BXfvel8OEFDb U52+iYMqdUJhf4dQDnInxTwQb7J03YdKSaiNBzoSj7K4bZGtVRIMEWPFlI/yiSofP4zz+MB5agRP eUe5aygoOxRpsxqbRNE0tdLAOBh4VtDD4TOhYGdFz7upXd6kuhnG4wd+mBa4cVcOYt9AmTHtPiSq Mfa8TiLtwnwLgT5Yr8J7Xjh/80L7nScm7RIFAOvW4ErEs/KrnC7vpROp/TctEuS+ X-Report-Abuse-To: spam@node04.secure-mailgate.com X-Spam-Status: No, score=-4.1 required=5.0 tests=BAYES_00, BODY_8BITS, HTML_MESSAGE, KAM_DMARC_STATUS, NICE_REPLY_A, SPF_HELO_NONE, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Content-Filtered-By: Mailman/MimeDel 2.1.29 X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 02 May 2022 18:02:09 -0000 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?