From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-oa1-x2e.google.com (mail-oa1-x2e.google.com [IPv6:2001:4860:4864:20::2e]) by sourceware.org (Postfix) with ESMTPS id BD8153858C1F for ; Wed, 22 Mar 2023 11:56:04 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org BD8153858C1F Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=linaro.org Received: by mail-oa1-x2e.google.com with SMTP id 586e51a60fabf-17ac5ee3f9cso19083233fac.12 for ; Wed, 22 Mar 2023 04:56:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1679486164; h=content-transfer-encoding:in-reply-to:organization:from:references :cc:to:content-language:subject:user-agent:mime-version:date :message-id:from:to:cc:subject:date:message-id:reply-to; bh=5y44dzGM80o5cTq4j2paqOAzK72xG9Yv+Y2D3C8qW54=; b=NyGcz+djtBAVQzYaKeP9NI9TS1gvaGVMlGVh2dchEuJsdpGpvCZF2qF59kgV7R3Mmo t4VMdSPT0yK1fI0xO2jtkesGy7q6rifTrU/qazAe73no2eeZLnhFP785yLkahyh6N/pV NAR4pa8JOS8gqx42p1YhJ0BhrAol4iiOqzJFJj9/TYFGo9i0U/ZByC/sq3F6QzIhDPsJ S1c8nupbJ55JNdQQJ7V1wtyb79aJjOZ6FdbVVc8hpqOJr9feBbZePvECdp3j75rJ4WzW zE2XHBDofqnbyZfsFUPXyImOrnsbZ6GbdN47OKR31SkPdaEPehlHVPdqnG4GGZDZEjMq 3S8w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1679486164; h=content-transfer-encoding:in-reply-to:organization:from:references :cc:to:content-language:subject:user-agent:mime-version:date :message-id:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=5y44dzGM80o5cTq4j2paqOAzK72xG9Yv+Y2D3C8qW54=; b=EvQXoNMjznbF2wQdzTA2/dagy73UPJ2Ov0/m/mZYFM8tjN+pdZPXwmaj1glRF3EHW+ oIKs6OmF3pV8CLvRUE2Ubw2bd1oQ2n0NOmEVNxQHqcnfbM/8pJbQFyysvxGrJAOUXEOo TvNfSvsZ4qP7wu11vPcuHbCQr72C1hpvIXqJcFsLfWKSxPRwfeW+ZMyuTa+Konln8Ooq 1k+LTV88QWY0K8WnBhUPv6UhJdsIbYxbfBNQ48Dj+Q8b7BEeq/mU/ft8sy4PCH1u9W5D VMDTGlTJWNnsdbCwpkvOebZpZTnopu1STouq5C1wCeZtE6BlrCrtMBdhVfMTsf5+NFxm 7Bow== X-Gm-Message-State: AO0yUKX1a9JyGGZEy8TQmmjqbJJyUAeShpbolbZ4wdv/8+uWDqPbRqhc foUHZRknul4sR4RIJRkk6JjJYXX/UEC+/1Ni25ICTQ== X-Google-Smtp-Source: AK7set/9u9awu+TAOx/jBgNsojnD4UA5lWegxm1xeOeVdRtth9W0L1Y466xlu+6O+l+JGkK6S/XMwQ== X-Received: by 2002:a05:6871:54a:b0:17a:b1ab:7f8a with SMTP id t10-20020a056871054a00b0017ab1ab7f8amr1304428oal.3.1679486163888; Wed, 22 Mar 2023 04:56:03 -0700 (PDT) Received: from ?IPV6:2804:1b3:a7c0:c260:d4b6:6c90:6159:ac3d? ([2804:1b3:a7c0:c260:d4b6:6c90:6159:ac3d]) by smtp.gmail.com with ESMTPSA id tl3-20020a0568718a0300b001777dc4dac1sm5081344oab.39.2023.03.22.04.56.02 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 22 Mar 2023 04:56:03 -0700 (PDT) Message-ID: Date: Wed, 22 Mar 2023 08:56:00 -0300 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0) Gecko/20100101 Thunderbird/102.9.0 Subject: Re: compiling glibc using -fasynchronous-unwind-tables for arm Content-Language: en-US To: Abhijit Ray Chaudhury Cc: Florian Weimer , Adhemerval Zanella Netto via Libc-help References: <6c8e0fc6-9e86-6fc7-433f-cf5df16a6b03@linaro.org> <87jzzi14fx.fsf@oldenburg.str.redhat.com> <7d1b9611-13d1-65f0-9b47-0f7d01cec66c@linaro.org> <6dbfce9e-31c8-f158-f13d-4f91ca40efd8@linaro.org> From: Adhemerval Zanella Netto Organization: Linaro In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-5.7 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: Hi Abhijit, I am not sure why you need to build all glibc with -fasynchronous-unwind-tables, my understanding you need either to improve debugability or performance profiling on workloads with signals. And I think this is similar to https://sourceware.org/bugzilla/show_bug.cgi?id=29621 , and if it were the case where libgcc was built with -fexceptions but without optimization we can't support it on glibc at the moment (as Florian has added on last comment). On 21/03/23 08:30, Abhijit Ray Chaudhury wrote: > Hi Adhemerval, > > In my build environment gcc toolchain is installed in docker through apt. I will try to find the source code and build . > > Can you please let me know why you are concentrating on the resolution of " __aeabi_unwind_cpp_pr0" symbol ? I thought if you give "-fasynchronous-unwind-tables -fno-unwind-tables", gcc should not even generate the " __aeabi_unwind_cpp_pr0" symbol. My toolchain wrongly generates it . > > Is my understanding correct? > > Kindly advise, > -Abhijit > > On Mon, Mar 20, 2023 at 10:30 PM Adhemerval Zanella Netto > wrote: > > The -fasynchronous-unwind-table usually is used so backtraces works through signal handlers. > Could you check if you build your toolchain with optimization flags (so libgcc is built with > -O2) you can also build with -fasynchronous-unwind-table? > > On 17/03/23 10:37, Abhijit Ray Chaudhury wrote: > > Hello Adhemerval, > > > > I could compile glibc with -funwind-table instead of -fasynchronous-unwind-table. I noticed glibc uses one of the flags for different files. As far as stack unwinding is concerned , what is the difference between -fasynchronous-unwind-table and  -funwind-table ? > > > > Thanking You, > > -Abhijit > > > > On Thu, Mar 16, 2023 at 4:29 PM Abhijit Ray Chaudhury >> wrote: > > > >     Hi, > > > >     I think the problem lies with the precedence of seemingly conflicting CFLAGS "-fasynchronous-unwind-tables -fno-unwind-tables" supplied to my cross toolchain gcc. I compiled a simple C file with " -fasynchronous-unwind-tables" , it generated an undefined symbol " `__aeabi_unwind_cpp_pr0'" although compilation was successful without -static flag. Then I compiled with " -fasynchronous-unwind-tables -fno-unwind-tables", it still generated the undefined symbol " `__aeabi_unwind_cpp_pr0'". It suggests " -fno-unwind-tables" does not stop unwind information in the ELF when I have " -fasynchronous-unwind-tables" . I then compiled with " -funwind-tables -fno-unwind-table", I did not find  undefined symbol " `__aeabi_unwind_cpp_pr0'"in the generated ELF. > > > >     So I will compile glibc with " -funwind-table" instead of " -fasynchronous-unwind-table" and let you know the result. > > > >     Do you see any problem with this approach ? > > > >     Thanking You, > >     -Abhijit > > > >     On Thu, Mar 16, 2023 at 1:22 AM Adhemerval Zanella Netto >> wrote: > > > > > > > >         On 15/03/23 11:20, Florian Weimer wrote: > >         > * Adhemerval Zanella Netto via Libc-help: > >         > > >         >> And I have tested with both: > >         >> > >         >> CC="arm-glibc-linux-gnueabihf-gcc -fasynchronous-unwind-tables" > >         >> > >         >> and > >         >> > >         >> CC=arm-glibc-linux-gnueabihf-gcc CFLAGS="-O2 -fasynchronous-unwind-tables" > >         >> > >         >> I also tested with gcc from ubuntu22 to check if this might something > >         >> I haven't enabled on my toolchain (since I don't build all languages), > >         >> but again I did not see any issue. > >         > > >         > It probably depends on whether libgcc.a has been built with > >         > optimizations or not. > > > >         Indeed this looks like https://sourceware.org/bugzilla/show_bug.cgi?id=29621 > . > >         Does the build work if you manually adds the -fasynchronous-unwind-tables > >         on config.make? > > >