All of lore.kernel.org
 help / color / mirror / Atom feed
* Link failure with Debian toolchain
@ 2022-05-26 23:26 Joel Stanley
  2022-05-27 22:38 ` Stafford Horne
  0 siblings, 1 reply; 7+ messages in thread
From: Joel Stanley @ 2022-05-26 23:26 UTC (permalink / raw)
  To: Stafford Horne; +Cc: openrisc, nicolas

Hi Stafford,

I'm not sure if you were aware, but Debian now has a or1k cross compile:

$ apt policy gcc-or1k-elf
gcc-or1k-elf:
  Installed: 12.1.0-2+1.0.2
$ apt policy binutils-or1k-elf
binutils-or1k-elf:
  Installed: 2.38-2+1.0.3

I've used it to build a mork1x litex soc so I think it works in some
situations at least.

I was trying to build your latest Linux kernel changes, applied on top
of v5.18, however the bug reproduces with plain v5.18.

$ CROSS_COMPILE=or1k-elf- ARCH=openrisc make O=or1k or1klitex_defconfig
$ CROSS_COMPILE=or1k-elf- ARCH=openrisc make O=or1k -j8

This fails at the link step:

  LD      vmlinux.o
+ or1k-elf-ld -r -o vmlinux.o --whole-archive
arch/openrisc/kernel/head.o init/built-in.a usr/built-in.a
arch/openrisc/built-in.a kernel/built-in.a certs/built-in.a
mm/built-in.a fs/built-in.a ipc/built-in.a security/built-in.a
crypto/built-in.a block/built-in.a lib/built-in.a drivers/built-in.a
sound/built-in.a net/built-in.a virt/built-in.a --no-whole-archive
--start-group lib/lib.a /usr/lib/gcc/or1k-elf/12/libgcc.a --end-group
or1k-elf-ld: /usr/lib/gcc/or1k-elf/12/libgcc.a: error adding symbols:
archive has no index; run ranlib to add one

The libgcc.a appears to have the expected files inside it.

I tried running ar -a libgcc.a, and that changed the error to look like this:

or1k-elf-ld: init/main.o: in function `do_one_initcall':
main.c:(.init.text+0x12ec): undefined reference to `__muldi3'
main.c:(.init.text+0x12ec): relocation truncated to fit:
R_OR1K_INSN_REL_26 against undefined symbol `__muldi3'

With a lot more undefined reference errors for __muldi3, __ashldi3,
and __lshrdi3.

I'm not sure if this is a toolchain error or a kernel one. The kernel
appears to be doing the right thing.

I've cc'd Nicholas who is the Debian maintainer for the package in
case he has any ideas.

Cheers,

Joel

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2022-06-02 20:01 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-05-26 23:26 Link failure with Debian toolchain Joel Stanley
2022-05-27 22:38 ` Stafford Horne
2022-05-28  9:51   ` Nicolas Boulenguez
2022-05-30  8:27     ` Joel Stanley
2022-06-02  4:52       ` Joel Stanley
2022-06-02 20:01         ` Stafford Horne
2022-05-30  7:59   ` Joel Stanley

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.