* RISC-V: `ld.so' fails linking against `libgcc.a' built at `-O0' (was: Re: [PATCH] Allow memset local PLT reference for RISC-V.)
[not found] ` <alpine.LFD.2.21.2007120146590.24175@redsun52.ssa.fujisawa.hgst.com>
@ 2020-07-14 2:07 ` Maciej W. Rozycki
2020-07-14 5:21 ` RISC-V: `ld.so' fails linking against `libgcc.a' built at `-O0' Andreas Schwab
0 siblings, 1 reply; 4+ messages in thread
From: Maciej W. Rozycki @ 2020-07-14 2:07 UTC (permalink / raw)
To: Alistair Francis
Cc: Jim Wilson, Florian Weimer, Andreas Schwab, Alistair Francis,
libc-alpha, gcc
On Sun, 12 Jul 2020, Maciej W. Rozycki wrote:
> I don't think we have a way to redirect the reference to `__GI_memset'.
Additionally, I need to mention that where `libgcc.a' has been built at
`-O0', RV32 `ld.so' fails linking due to unresolved `malloc' and `free'
references from numerous `libgcc.a' objects. This is because those
objects pull in the exception unwinder; specifically `__divdi3',
`__moddi3', and `__umoddi3' all include a call to `_Unwind_Resume' each.
Arguably this might probably be called a deficiency in libgcc, however
the objects are built with `-fexceptions -fnon-call-exceptions' and at
`-O0' GCC might not be able to see through code that no exception may
happen there. Therefore I am not sure offhand if this needs to be
considered a GCC or glibc bug.
Maciej
.../bin/../lib/gcc/riscv64-linux-gnu/10.0.1/../../../../riscv64-linux-gnu/bin/ld: .../obj/glibc-boot/ilp32/elf/librtld.os: in function `init_dwarf_reg_size_table':
.../src/gcc/libgcc/unwind-dw2.c:1572: undefined reference to `malloc'
.../bin/../lib/gcc/riscv64-linux-gnu/10.0.1/../../../../riscv64-linux-gnu/bin/ld: .../obj/glibc-boot/ilp32/elf/librtld.os: in function `uw_init_context_1':
.../src/gcc/libgcc/unwind-dw2.c:1613: undefined reference to `malloc'
.../bin/../lib/gcc/riscv64-linux-gnu/10.0.1/../../../../riscv64-linux-gnu/bin/ld: .../obj/glibc-boot/ilp32/elf/librtld.os: in function `uw_install_context_1':
.../src/gcc/libgcc/unwind-dw2.c:1694: undefined reference to `free'
.../bin/../lib/gcc/riscv64-linux-gnu/10.0.1/../../../../riscv64-linux-gnu/bin/ld: .../src/gcc/libgcc/unwind-dw2.c:1711: undefined reference to `free'
.../bin/../lib/gcc/riscv64-linux-gnu/10.0.1/../../../../riscv64-linux-gnu/bin/ld: .../obj/glibc-boot/ilp32/elf/librtld.os: in function `_Unwind_ForcedUnwind_Phase2':
.../src/gcc/libgcc/unwind.inc:152: undefined reference to `malloc'
.../bin/../lib/gcc/riscv64-linux-gnu/10.0.1/../../../../riscv64-linux-gnu/bin/ld: .../src/gcc/libgcc/unwind.inc:163: undefined reference to `malloc'
.../bin/../lib/gcc/riscv64-linux-gnu/10.0.1/../../../../riscv64-linux-gnu/bin/ld: .../obj/glibc-boot/ilp32/elf/librtld.os: in function `_Unwind_DeleteException':
.../src/gcc/libgcc/unwind.inc:281: undefined reference to `free'
collect2: error: ld returned 1 exit status
Makefile:554: recipe for target '.../obj/glibc-boot/ilp32/elf/ld.so' failed
make[2]: *** [.../obj/glibc-boot/ilp32/elf/ld.so] Error 1
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: RISC-V: `ld.so' fails linking against `libgcc.a' built at `-O0'
2020-07-14 2:07 ` RISC-V: `ld.so' fails linking against `libgcc.a' built at `-O0' (was: Re: [PATCH] Allow memset local PLT reference for RISC-V.) Maciej W. Rozycki
@ 2020-07-14 5:21 ` Andreas Schwab
2020-07-14 6:27 ` Richard Biener
0 siblings, 1 reply; 4+ messages in thread
From: Andreas Schwab @ 2020-07-14 5:21 UTC (permalink / raw)
To: Maciej W. Rozycki
Cc: Alistair Francis, Jim Wilson, Florian Weimer, Alistair Francis,
libc-alpha, gcc
On Jul 14 2020, Maciej W. Rozycki wrote:
> Arguably this might probably be called a deficiency in libgcc, however
> the objects are built with `-fexceptions -fnon-call-exceptions'
I consider that broken. It doesn't make any sense to build a lowlevel
runtime library like libgcc with exceptions.
Andreas.
--
Andreas Schwab, schwab@linux-m68k.org
GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510 2552 DF73 E780 A9DA AEC1
"And now for something completely different."
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: RISC-V: `ld.so' fails linking against `libgcc.a' built at `-O0'
2020-07-14 5:21 ` RISC-V: `ld.so' fails linking against `libgcc.a' built at `-O0' Andreas Schwab
@ 2020-07-14 6:27 ` Richard Biener
2020-07-14 9:35 ` Maciej W. Rozycki
0 siblings, 1 reply; 4+ messages in thread
From: Richard Biener @ 2020-07-14 6:27 UTC (permalink / raw)
To: Andreas Schwab
Cc: Maciej W. Rozycki, Florian Weimer, GCC Development,
GNU C Library, Alistair Francis, Alistair Francis
On Tue, Jul 14, 2020 at 7:24 AM Andreas Schwab <schwab@linux-m68k.org> wrote:
>
> On Jul 14 2020, Maciej W. Rozycki wrote:
>
> > Arguably this might probably be called a deficiency in libgcc, however
> > the objects are built with `-fexceptions -fnon-call-exceptions'
>
> I consider that broken. It doesn't make any sense to build a lowlevel
> runtime library like libgcc with exceptions.
Indeed - you only need to be able to unwind through those, so
-fasynchronous-unwind-tables should be used.
Richard.
> Andreas.
>
> --
> Andreas Schwab, schwab@linux-m68k.org
> GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510 2552 DF73 E780 A9DA AEC1
> "And now for something completely different."
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: RISC-V: `ld.so' fails linking against `libgcc.a' built at `-O0'
2020-07-14 6:27 ` Richard Biener
@ 2020-07-14 9:35 ` Maciej W. Rozycki
0 siblings, 0 replies; 4+ messages in thread
From: Maciej W. Rozycki @ 2020-07-14 9:35 UTC (permalink / raw)
To: Richard Biener
Cc: Andreas Schwab, Florian Weimer, GCC Development, GNU C Library,
Alistair Francis, Alistair Francis
On Tue, 14 Jul 2020, Richard Biener wrote:
> > > Arguably this might probably be called a deficiency in libgcc, however
> > > the objects are built with `-fexceptions -fnon-call-exceptions'
> >
> > I consider that broken. It doesn't make any sense to build a lowlevel
> > runtime library like libgcc with exceptions.
>
> Indeed - you only need to be able to unwind through those, so
> -fasynchronous-unwind-tables should be used.
This is libgcc's default however, only overridden for a couple of ARM
targets, for the very reason to avoid pulling in the unwinder, according
to the associated comments. This was added with commit fc6aa0a98a0c some
3 months before commit b932f770f70d added `-fasynchronous-unwind-tables'
as a supported compiler option, all back in 2001, so we've had it for
quite a while now.
The RISC-V target doesn't appear to produce any division overflow traps,
which would necessarily have to be arranged by a software convention like
with, say, the MIPS target, as the relevant hardware instructions do not
trigger an exception under any conditions.
By switching to `-fasynchronous-unwind-tables' the ARM override can also
go presumably, right?
Maciej
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2020-07-14 9:35 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
[not found] <20200622211034.659739-1-alistair.francis@wdc.com>
[not found] ` <CAKmqyKP7oPUacAmgGFS-2kQHRFvaeTt8g0tVTv=yu-QGquwZzg@mail.gmail.com>
[not found] ` <87o8p21bjh.fsf@oldenburg2.str.redhat.com>
[not found] ` <CAKmqyKM7o93vT0b4Se_AEcnjvvCYG0gfRK5i0NTZ_1+wjmUUtg@mail.gmail.com>
[not found] ` <87366dx35x.fsf@oldenburg2.str.redhat.com>
[not found] ` <CAKmqyKMkSGSbQw8Mzjpb_VauQPCSLQwUE_17q1ysBtGLefSh1A@mail.gmail.com>
[not found] ` <87sgedvnq3.fsf@oldenburg2.str.redhat.com>
[not found] ` <CAKmqyKOuZwLS4949UGxZaRH3HdLcGgLmjpGjZ8fnnNUWysHASQ@mail.gmail.com>
[not found] ` <87o8p1vnb9.fsf@oldenburg2.str.redhat.com>
[not found] ` <CAKmqyKPKkzBGaYJvh63QEZ0aCUSvJTT-9kMx5fP6VtMDVjBf3w@mail.gmail.com>
[not found] ` <87ftadvmnv.fsf@oldenburg2.str.redhat.com>
[not found] ` <87r1txyfew.fsf@igel.home>
[not found] ` <87a70lvm48.fsf@oldenburg2.str.redhat.com>
[not found] ` <CAFyWVaYwb_QANjeZjedNG9WTDWhWdcw6NLpR4NOwVHxRCpSv5g@mail.gmail.com>
[not found] ` <alpine.LFD.2.21.2007010129040.9519@redsun52.ssa.fujisawa.hgst.com>
[not found] ` <CAKmqyKOjm9t7+y3vKP+8DFPd27Sf1DXMwqHFszxADJOoHKk+dg@mail.gmail.com>
[not found] ` <alpine.LFD.2.21.2007120146590.24175@redsun52.ssa.fujisawa.hgst.com>
2020-07-14 2:07 ` RISC-V: `ld.so' fails linking against `libgcc.a' built at `-O0' (was: Re: [PATCH] Allow memset local PLT reference for RISC-V.) Maciej W. Rozycki
2020-07-14 5:21 ` RISC-V: `ld.so' fails linking against `libgcc.a' built at `-O0' Andreas Schwab
2020-07-14 6:27 ` Richard Biener
2020-07-14 9:35 ` Maciej W. Rozycki
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).