compiling glibc using -fasynchronous-unwind-tables for arm

Abhijit Ray Chaudhury abhijit.ray.chaudhury@gmail.com
Tue Mar 21 11:30:35 GMT 2023


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> 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>>
> 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>>
> 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> .
> >         Does the build work if you manually adds the
> -fasynchronous-unwind-tables
> >         on config.make?
> >
>


More information about the Libc-help mailing list