[PATCH v5 6/6] Drop dependency on libgcc by importing part of FreeBSD's libquad

Anup Patel anup at brainfault.org
Sun Jul 11 21:02:43 PDT 2021


On Mon, Jul 12, 2021 at 9:25 AM Bin Meng <bmeng.cn at gmail.com> wrote:
>
> On Sun, Jul 11, 2021 at 11:46 PM Anup Patel <anup at brainfault.org> wrote:
> >
> > On Sun, Jul 11, 2021 at 7:58 AM Jessica Clarke <jrtc27 at jrtc27.com> wrote:
> > >
> > > We only need libgcc for 64-bit division on RV32. Whilst GCC toolchains
> > > bundle libgcc, Clang toolchains tend not to ship libclang_rt.builtins
> > > given every compiler is a cross-compiler for every target and so you
> > > would need a silly number of builds of it, with only the native library
> > > available; only vendor-provided Clang toolchains specifically for bare
> > > metal cross-compiling are likely to provide it.
> > >
> > > Thus, import part of FreeBSD's implementation of the division support
> > > functions needed and stop linking against libgcc.
> > >
> > > Signed-off-by: Jessica Clarke <jrtc27 at jrtc27.com>
> >
> > I tried this patch with GCC linux toolchain and U-Boot SPL and it worked
> > fine for me. Other please try LLVM and bare-metal toolchain at your end
> > and if you see any issue then please send a fix patch.
> >
> > Reviewed-by: Anup Patel <anup.patel at wdc.com>
> > Tested-by: Anup Patel <anup.patel at wdc.com>
> >
> > Applied this patch to the riscv/opensbi repo.
> >
> > @Bin Meng Can you also try RV32 U-Boot SPL ? I did not try that.
>
> It seems RV32 U-Boot SPL is broken, that it does not boot occasionally.
>
> But this has nothing to do with the LLVM changes in this series. It
> was due to upstream libfdt changes. I have sent a patch on the U-Boot
> side. Booting S-mode U-Boot directly is not affected.

Yes, it's not related to this series. In fact, it is not related to
FW_PIC at all.

I did little digging. It seems OpenSBI gets corrupted FDT from U-Boot SPL
RV32. The fw_platform_init() get's stuck very early because it is not able to
find nodeoffset of "/" path in FDT.

The OpenSBI RV32 firmwares work fine without U-Boot SPL which leads
to the conclusion that FDT is corrupted for U-Boot SPL RV32 case.

I hope the above info helps ...

Regards,
Anup

>
> Regards,
> Bin



More information about the opensbi mailing list