mapmot / arduino-overlay

Arduino IDE overlay for gentoo linux
https://bugs.gentoo.org/525882
GNU General Public License v2.0
2 stars 2 forks source link

cross-avr/binutils - "ld" for avr cannot find linker script "avr5.x" #2

Open mapmot opened 6 years ago

mapmot commented 6 years ago

Read https://bugs.gentoo.org/147155 for more details and lots of hilarious comments towards the end. The linking workaround proposed there works.

...and https://bugs.gentoo.org/348991 for even more entertainment

From https://forums.gentoo.org/viewtopic-t-855248-start-0.html

Workaround for /usr/libexec/gcc/avr/ld: cannot open linker script file ldscripts/avr5.x: No such file or directory

CFLAGS += -L/usr/x86_64-pc-linux-gnu/avr/lib/

Workaround for /usr/libexec/gcc/avr/ld: crtm168.o: No such file: No such file or directory

CFLAGS += -B/usr/avr/lib/avr5/

sarnold commented 6 years ago

The latest binutils-config has ldscripts symlink handling. All the boards in the menu "should" work; I've testing building several but I can only upload to Uno and Mega (for avr).

mapmot commented 6 years ago

Thank you for the update. Do you happen to know the first version of binutils-config that works? Then we can make it a ${DEPEND}.

sarnold commented 6 years ago

Whatever the latest version is. binutils-config-5-r3 I think?

mapmot commented 6 years ago

The cleanest solution in my opinion is the following patch in /etc/portage/patches/cross-avr/binutils --- a/ld/Makefile.in +++ b/ld/Makefile.in @@ -386,7 +386,7 @@ -scriptdir = $(tooldir)/lib +scriptdir = $(libdir) BASEDIR = $(srcdir)/.. BFDDIR = $(BASEDIR)/bfd INCDIR = $(BASEDIR)/include

mapmot commented 6 years ago

Still doesn't work for me with sys-devel/binutils-config-5.1-r1. The patch above is still the only thing that works.