FS#37515 - avr-gcc unable to find libm

Attached to Project: Community Packages
Opened by Bas Dalenoord (bdalenoord) - Sunday, 27 October 2013, 11:27 GMT
Last edited by Jelle van der Waa (jelly) - Sunday, 27 October 2013, 19:48 GMT
Task Type Bug Report
Category Packages: Extra
Status Closed
Assigned To No-one
Architecture All
Severity Low
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No

Details

Description:
I installed the 'arduino' package from the AUR, which depends on 'avr-libc', which in turn depends on 'avr-gcc'... However, when I try to compile some Arduino source-code, I get the following error:

/usr/share/arduino/hardware/tools/avr/bin/../lib/gcc/avr/4.3.2/../../../avr/bin/ld: cannot find -lm

This seems to be a problem in the 'avr-gcc' package which was not compiled correctly, 'libm.a' (which I think is the missing library) can be found by issueing the 'locate' command, which gives me the following output:

$ locate libm.a
/usr/avr/lib/libm.a
/usr/avr/lib/avr25/libm.a
/usr/avr/lib/avr3/libm.a
/usr/avr/lib/avr31/libm.a
/usr/avr/lib/avr35/libm.a
/usr/avr/lib/avr4/libm.a
/usr/avr/lib/avr5/libm.a
/usr/avr/lib/avr51/libm.a
/usr/avr/lib/avr6/libm.a
/usr/avr/lib/avrxmega2/libm.a
/usr/avr/lib/avrxmega4/libm.a
/usr/avr/lib/avrxmega5/libm.a
/usr/avr/lib/avrxmega6/libm.a
/usr/avr/lib/avrxmega7/libm.a
/usr/lib/libm.a
/usr/lib32/libm.a

This suggests a packaging error, so can anyone look into this?

Additional info:
arduino 1.0.5 (from AUR)
avr-gcc (GCC) 4.8.2

Steps to reproduce:
(Not sure on this one as it involves an AUR-package to reproduce)
Create a new empty sketch using the Arduino software and try to verify it by issuing the [CTRL]+[R] shortcut
This task depends upon

Closed by  Jelle van der Waa (jelly)
Sunday, 27 October 2013, 19:48 GMT
Reason for closing:  Not a bug
Additional comments about closing:  not a bug, upstream arduino studio issue.
Comment by Bas Dalenoord (bdalenoord) - Sunday, 27 October 2013, 11:36 GMT
I forgot to mention the forum topic on this one:
https://bbs.archlinux.org/viewtopic.php?pid=1342098
Comment by Jelle van der Waa (jelly) - Sunday, 27 October 2013, 19:15 GMT
libm.a is owned by avr-libc. So I don't know how avr-gcc is to blame.

Anyway please post
pacman -Q avr-libc
pacman -Q avr-gcc
pacman -Q avr-binutils

Can you also post code + args of avr-libc. Since I can't reproduce it with an atmega 2560.

It seems like arduino is to blame since it looks for avr 4.3.2 and we have 4.8.2 /usr/share/arduino/hardware/tools/avr/bin/../lib/gcc/avr/4.3.2/.
Comment by Bas Dalenoord (bdalenoord) - Sunday, 27 October 2013, 19:27 GMT
avr-gcc was just a guess after I read the following thread:
http://comments.gmane.org/gmane.comp.hardware.avr.gcc/7477

It issues avr-ld which is part of avr-binutils. I'm using it with an Arduino UNO, if that's of any importance (atmega 328-PU)

> Anyway please post
pacman -Q avr-libc
avr-libc 1.8.0-5

pacman -Q avr-gcc
avr-gcc 4.8.2-1

pacman -Q avr-gcc
avr-gcc 4.8.2-1

> Can you also post code + args of avr-libc. Since I can't reproduce it with an atmega 2560

I'm not sure what you mean with this... the verbose output of Arduino IDE can be found here:
http://pastebin.com/faNYKNhL
Comment by Jelle van der Waa (jelly) - Sunday, 27 October 2013, 19:31 GMT
This isn't an arch issue. It's arduino studio using their own avr linker,lib and gcc. So the arduino packages seems to be broken, arduino-git works for me with a arduino mega 2560
Comment by Bas Dalenoord (bdalenoord) - Sunday, 27 October 2013, 19:38 GMT
Thanks for the info... I've installed arduino-git but this is no solution as the error remains... I'll be bothering the folks upstream then...

Loading...