Open shenki opened 6 years ago
Did you every fix this? I have the same.
Try removing completely the build/
, yotta_modules/
and yotta_targets/
directories and then rebuilding.
This warning (I trimmed the paths to make it easier to read) is due to the way the Ubuntu cross compiler is configured:
arm-none-eabi/bin/ld: error: arm-none-eabi/lib/crt0.o: Conflicting CPU architectures 12/1
arm-none-eabi/bin/ld: failed to merge target specific data of file arm-none-eabi/lib/crt0.o
$ objdump -f /usr/lib/arm-none-eabi/newlib/crt0.o | sed -n '3p'
architecture: armv4, flags 0x00000011:
The crt0 it's trying to link in is built for ARM(v4), but a m0 machine only supports thumb.
When building for -mcpu=cortex-m0
, the compiler looks in thumb/v6-m
for libraries:
$ arm-none-eabi-gcc -print-multi-directory -mcpu=cortex-m0
thumb/v6-m
However, we don't have a crt0.o
in /usr/lib/arm-none-eabi/newlib/thumb/v6-m
. There is one in thumb/
, however gcc doesn't seem to fall back to that, and instead falls back to /usr/lib/arm-none-eabi/newlib/crt0.o.
I did some experiments to work out what was going on, before realising that Ubuntu appears to have fixed the issue since I reported it. I'm running libnewlib-arm-none-eabi 2.4.0.20160527-4. Ubuntu bionic has 2.4.0.20160527-3, which I think was the broken version.
You could try to install the version of libnewlib-arm-* from Ubuntu cosmic?
this could be a Ubuntu 18.04 bug https://bugs.launchpad.net/ubuntu/+source/gcc-arm-none-eabi/+bug/1767223 please pile on :)
You could try to install the version of libnewlib-arm-* from Ubuntu cosmic?
Yes, I can confirm fixing the issue by installing the newer packages.
Just get the libnewlib-dev (2.4.0.20160527-4) and libnewlib-arm-none-eabi (2.4.0.20160527-4) *.deb files, then install them:
sudo dpkg -i libnewlib-dev_2.4.0.20160527-4_all.deb libnewlib-arm-none-eabi_2.4.0.20160527-4_all.deb
As of today, @temporaryaccount's instructions worked for Ubuntu 18.04.1 (but the versions provided at the links have been updated).
$ sudo dpkg -i libnewlib-arm-none-eabi_3.0.0.20180802-2_all.deb libnewlib-dev_3.0.0.20180802-2_all.deb
I see this on my Ubuntu system.