On Fri, May 14, 2021 at 7:56 AM Simon Glass <[email protected]> wrote: > > Hi Heinrich, > > On Thu, 13 May 2021 at 08:46, Heinrich Schuchardt <[email protected]> wrote: > > > > The sandbox does not build on RISC-V when _init is not defined. Errors like > > the following were observed. Which function was referred to depended on the > > configuration. > > > > /usr/bin/ld: common/built-in.o: in function `parse_stream_outer': > > /common/cli_hush.c:3175: undefined reference to `_init' > > collect2: error: ld returned 1 exit status > > make: *** [Makefile:1726: u-boot] Error 1 > > > > /usr/bin/ld: common/built-in.o: in function `bootdelay_process': > > common/autoboot.c:335: undefined reference to `_init' > > collect2: error: ld returned 1 exit status > > make: *** [Makefile:1726: u-boot] Error 1 > > > > Signed-off-by: Heinrich Schuchardt <[email protected]> > > --- > > arch/sandbox/cpu/u-boot.lds | 2 ++ > > 1 file changed, 2 insertions(+) > > Is this a toolchain bug?
+Jim who might know. > > Reviewed-by: Simon Glass <[email protected]> > > > > > > diff --git a/arch/sandbox/cpu/u-boot.lds b/arch/sandbox/cpu/u-boot.lds > > index a1f509c9ab..d9e7ffcea3 100644 > > --- a/arch/sandbox/cpu/u-boot.lds > > +++ b/arch/sandbox/cpu/u-boot.lds > > @@ -9,6 +9,8 @@ SECTIONS > > { > > > > . = ALIGN(4); > > + /* RISC-V GCC wants this dummy symbol */ > > + _init = .; > > .u_boot_list : { > > KEEP(*(SORT(.u_boot_list*))); > > } Regards, Bin

