public inbox for libc-help@sourceware.org
 help / color / mirror / Atom feed
From: Adhemerval Zanella Netto <adhemerval.zanella@linaro.org>
To: Abhijit Ray Chaudhury <abhijit.ray.chaudhury@gmail.com>
Cc: Florian Weimer <fweimer@redhat.com>,
	Adhemerval Zanella Netto via Libc-help <libc-help@sourceware.org>
Subject: Re: compiling glibc using -fasynchronous-unwind-tables for arm
Date: Wed, 22 Mar 2023 08:56:00 -0300	[thread overview]
Message-ID: <ecf37d75-2fe7-86c9-e9e1-d115e58f4c6e@linaro.org> (raw)
In-Reply-To: <CAACKNgV3NEGwso1TbDiK3ytnDqfV_wgbJ4Z8uN-XAZT47rN5Bg@mail.gmail.com>

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 <adhemerval.zanella@linaro.org <mailto:adhemerval.zanella@linaro.org>> 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 <abhijit.ray.chaudhury@gmail.com <mailto:abhijit.ray.chaudhury@gmail.com> <mailto:abhijit.ray.chaudhury@gmail.com <mailto:abhijit.ray.chaudhury@gmail.com>>> 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 <adhemerval.zanella@linaro.org <mailto:adhemerval.zanella@linaro.org> <mailto:adhemerval.zanella@linaro.org <mailto:adhemerval.zanella@linaro.org>>> 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 <https://sourceware.org/bugzilla/show_bug.cgi?id=29621> <https://sourceware.org/bugzilla/show_bug.cgi?id=29621 <https://sourceware.org/bugzilla/show_bug.cgi?id=29621>> .
>     >         Does the build work if you manually adds the -fasynchronous-unwind-tables
>     >         on config.make?
>     >
> 

      reply	other threads:[~2023-03-22 11:56 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-09 10:04 Abhijit Ray Chaudhury
2023-03-14  9:18 ` Abhijit Ray Chaudhury
2023-03-14 18:47 ` Adhemerval Zanella Netto
2023-03-15  8:36   ` Abhijit Ray Chaudhury
2023-03-15 12:59     ` Adhemerval Zanella Netto
2023-03-15 14:20       ` Florian Weimer
2023-03-15 19:52         ` Adhemerval Zanella Netto
2023-03-16 10:59           ` Abhijit Ray Chaudhury
2023-03-17 13:37             ` Abhijit Ray Chaudhury
2023-03-20 17:00               ` Adhemerval Zanella Netto
2023-03-21 11:30                 ` Abhijit Ray Chaudhury
2023-03-22 11:56                   ` Adhemerval Zanella Netto [this message]

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=ecf37d75-2fe7-86c9-e9e1-d115e58f4c6e@linaro.org \
    --to=adhemerval.zanella@linaro.org \
    --cc=abhijit.ray.chaudhury@gmail.com \
    --cc=fweimer@redhat.com \
    --cc=libc-help@sourceware.org \
    /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).