OpenCores
no use no use 1/1 no use no use
ld: cannot find -lgcc in toolchain
by brunop on Jul 19, 2016
brunop
Posts: 2
Joined: Mar 30, 2009
Last seen: Oct 4, 2018
Hi guys,
I am sorry to come with a stupid question.
I inherited from a project based on openrisc tool-chain, and I am having hard time to get it running.

The problem I am facing is that at the link stage, I get the following :
or32-elf/bin/ld: cannot find -lgcc
collect2: ld returned 1 exit status

Most of the asnwers I have found so far are related to multilib, that look installed on my setup, and I haven't found much about other ways to investigate...

The command I run is :
or32-elf-gcc -O2 -nostartfiles -Wl,-Ttext=0xF0000000 -o bios crt0.S bios.c

Any help is very welcome.
Thanks a lot.
RE: ld: cannot find -lgcc in toolchain
by olof on Jul 19, 2016
olof
Posts: 218
Joined: Feb 10, 2010
Last seen: Dec 17, 2018
Hi,

Not sure what the problem could be, but do you need to use the old or32 toolchain, or would it be fine to update to the newer or1k toolchain? The or32 toolchain hasn't been updated since 2012 while we still try to keep the or1k toolchain up to date with the upstream toolchain

//Olof
RE: ld: cannot find -lgcc in toolchain
by brunop on Jul 19, 2016
brunop
Posts: 2
Joined: Mar 30, 2009
Last seen: Oct 4, 2018
Hi Olof,
First thanks for your reply.

As far as I understand I am supposed to stick to this toolchain, that was customized for the target.

Browsing existing information, I saw that ar32 was outdated, but I would prefer to stick to it as I would need to bring up a platform that was using it originally.

RE: ld: cannot find -lgcc in toolchain
by olof on Jul 21, 2016
olof
Posts: 218
Joined: Feb 10, 2010
Last seen: Dec 17, 2018
Hi Olof,
First thanks for your reply.

As far as I understand I am supposed to stick to this toolchain, that was customized for the target.

Browsing existing information, I saw that ar32 was outdated, but I would prefer to stick to it as I would need to bring up a platform that was using it originally.



Fair enough. The old toolchain should work just fine even though it's a bit outdated. Thinking a bit about this, I suspect that the compiler isn't able to find libgcc, which I _think_ is the library that GCC uses for all internal target functions. I'm not a toolchain guy myself, but could it be that there is some path hardcoded which requires the toolchain to be in a certain location on the filesystem? There is probably some switch to see where gcc searches for it's built-in libraries. Otherwise it could be worth trying to run "strace or32-elf-gcc" to see what it tries to access.

RE: ld: cannot find -lgcc in toolchain
by dgisselq on Jul 21, 2016
dgisselq
Posts: 247
Joined: Feb 20, 2015
Last seen: Jul 15, 2022
Olof,

I've come across this library several times while building a toolchain for the ZipCPU. For example, if the ZipCPU doesn't support a divide instruction, divides will be forwarded to an "idiv" function within libgcc. The same can be said of memcpy, long shift instructions, and so forth. I might expect that floating point instructions would be sent here too, but I'm not sure. I personally get around my need for this library (the ZipCPU toolchain isn't as mature as the or1k toolchain) by adding "-fno-builtin" to the GCC command line.

Dan

no use no use 1/1 no use no use
© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.