openrisc.lists.librecores.org archive mirror
 help / color / mirror / Atom feed
From: Joel Stanley <joel@jms.id.au>
To: Stafford Horne <shorne@gmail.com>
Cc: openrisc@lists.librecores.org, nicolas@debian.org
Subject: Link failure with Debian toolchain
Date: Thu, 26 May 2022 23:26:45 +0000	[thread overview]
Message-ID: <CACPK8XcBRtd+RFhXaR-B3wbeM1gsmCW3hgRp_uwS0-g-oCWniw@mail.gmail.com> (raw)

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

             reply	other threads:[~2022-05-26 23:27 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-05-26 23:26 Joel Stanley [this message]
2022-05-27 22:38 ` Link failure with Debian toolchain 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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CACPK8XcBRtd+RFhXaR-B3wbeM1gsmCW3hgRp_uwS0-g-oCWniw@mail.gmail.com \
    --to=joel@jms.id.au \
    --cc=nicolas@debian.org \
    --cc=openrisc@lists.librecores.org \
    --cc=shorne@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).