From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id LYugHusucGIC3wMAWB0awg (envelope-from ) for ; Mon, 02 May 2022 15:20:11 -0400 Received: by simark.ca (Postfix, from userid 112) id 726F61E058; Mon, 2 May 2022 15:20:11 -0400 (EDT) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-3.9 required=5.0 tests=BAYES_00,MAILING_LIST_MULTI, NICE_REPLY_A autolearn=ham autolearn_force=no version=3.4.6 Received: from sourceware.org (server2.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPS id 732AC1E01D for ; Mon, 2 May 2022 15:20:10 -0400 (EDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id B89973858C50 for ; Mon, 2 May 2022 19:20:09 +0000 (GMT) Received: from nx109.node02.secure-mailgate.com (nx109.node02.secure-mailgate.com [192.162.87.109]) by sourceware.org (Postfix) with ESMTPS id 0ED0F385780C for ; Mon, 2 May 2022 19:16:58 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 0ED0F385780C 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 node02.secure-mailgate.com with esmtps (TLSv1.2:AES128-GCM-SHA256:128) (Exim 4.92) (envelope-from ) id 1nlbXR-00EAiu-Bl; Mon, 02 May 2022 21:16:55 +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 B503B281160; Mon, 2 May 2022 21:16:51 +0200 (CEST) X-SecureMailgate-Identity: zied.guermazi@trande.de;host202.checkdomain.de Message-ID: <0d4b1f05-221c-d0ef-bc7c-af24a56f56a4@trande.de> Date: Mon, 2 May 2022 21:16:51 +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 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> <2ab7945d-5355-586c-1af5-7b465586d01c@trande.de> <12ded5b8-54c4-b336-2fbf-1a0417ce4361@palves.net> From: Zied Guermazi In-Reply-To: <12ded5b8-54c4-b336-2fbf-1a0417ce4361@palves.net> X-PPP-Message-ID: <20220502191652.1115652.35224@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.10) X-Recommended-Action: accept X-Filter-ID: Pt3MvcO5N4iKaDQ5O6lkdGlMVN6RH8bjRMzItlySaT/jLy8d1PNpjgub5NIWZo0gPUtbdvnXkggZ 3YnVId/Y5jcf0yeVQAvfjHznO7+bT5zRfK4njRWCJG0FcgrR1735zbDY5X7FlQjMaRPaTaQCQPV5 DbUBqLytzyC5la7K3rkmoppQSi55Sdqw1rYV0B9r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nye387kQHAOo+ydIm8 X-Report-Abuse-To: spam@node04.secure-mailgate.com 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: , Cc: gdb-patches@sourceware.org Errors-To: gdb-patches-bounces+public-inbox=simark.ca@sourceware.org Sender: "Gdb-patches" hi Pedro, the issue was observed twice: once when building on x86 using "../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 once when building natively on Debian on aarch64 by using "../binutils-gdb/configure --disable-ld --disable-gold --disable-gas --disable-sim --disable-gprofng --with-arm-cs" I will change the comment and re-submit the patch Kind Regards Zied Guermazi. On 02.05.22 20:55, Pedro Alves wrote: > On 2022-05-02 19:01, Zied Guermazi wrote: >> 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 sethttps://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) > OK, thanks, that clarifies things. I wasn't aware of that patch series. The build and target machines (in autoconf terms) are > really irrelevant here. The only machine that matters here is the host one. > >> 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. > Did you really run configure on one machine, and then typed "make" on a different machine? > Anyhow, doesn't matter. > >> 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. > Right. > > So in the commit log, instead of: > > "PAGE_SIZE is not defined in all build configurations, e.g cross compiling > for aarch64 GNU/Linux machine. This patch gets the value at runtime using > posix call sysconf (_SC_PAGESIZE)" > > don't mention cross compiling at all, as that just confuses things. > > I'd suggest instead: > > "Currently, linux-btrace.c is only built when the host is x86 or x86_64 GNU/Linux. > Later patches will add btrace support on ARM processors using ARM Coresight ETM traces. > That ran into the fact that PAGE_SIZE is not defined on Aarch64. This patch fixes that > by getting the page size value at runtime using POSIX sysconf(_SC_PAGESIZE) instead." > > Pedro Alves -- *Zied Guermazi* founder Trande GmbH Leuschnerstraße 2 69469 Weinheim/Germany Mobile: +491722645127 mailto:zied.guermazi@trande.de *Trande GmbH* Leuschnerstraße 2, D-69469 Weinheim; Telefon: +491722645127 Sitz der Gesellschaft: Weinheim- Registergericht: AG Mannheim HRB 736209 - Geschäftsführung: Zied Guermazi *Confidentiality Note* This message is intended only for the use of the named recipient(s) and may contain confidential and/or privileged information. If you are not the intended recipient, please contact the sender and delete the message. Any unauthorized use of the information contained in this message is prohibited.