Joined: 17 Apr 2004
Location: Dark side of the mood
|Posted: Fri Sep 08, 2017 8:05 pm Post subject: cross-avr: ld fails with '-pie is not supported' [SOLVED]
I don't know if it's because I ran eselect gcc or not but since then I can no longer compile anything for the AVR platform. For the record I installed avr-gcc using crossdev and it worked like a charm until I decided to peek into higher versions of the compiler, which latest version is 6.4.0 as of now. Note that I had to manually install the symbolic link /usr/avr/lib/ldscripts -> /usr/x86_64-pc-linux-gnu/avr/lib/ldscripts to make the original toollchain work.
After I've installed cross-avr/gcc-6.4.0 all I get wierdly enough is this:
|avr-gcc -g -Wall -mcall-prologues -fshort-enums -Os -ffreestanding -Wl,-gc-sections -Wl,-relax -mmcu=atmega64m1 dac.c -o dac: |
|dac.c:1:0: warning: -fPIC is not supported [-fPIC]
dac.c:1:0: warning: -fPIE is not supported [-fPIE]
/usr/libexec/gcc/avr/ld: -pie not supported
collect2: error: ld returned 1 exit status
I'm not even invoking -pie! Where the heck does that come from?
I've tried to completely remove cross-*/* and reinstall only one version of each tool (all stable but GCC). No way, I'm still getting the error.
|equery l cross-*/*: |
|[I-O] [ -] cross-avr/avr-libc-2.0.0:0
[I-O] [ -] cross-avr/binutils-2.28.1:2.28.1
[I-O] [ -] cross-avr/gcc-6.4.0:6.4.0
|ll /usr/libexec/gcc/avr/ld: |
|lrwxrwxrwx 1 root root 51 8 sep 15:42 /usr/libexec/gcc/avr/ld -> /usr/x86_64-pc-linux-gnu/avr/binutils-bin/2.28.1/ld |
EDIT: I don't know what muse inspired me to check USE flags for avr-gcc-6.4.0 but the latter was indeed compiled with... pie. I added -pie to my global USE flags for crossdev, reinstalled avr-gcc and now the issue has gone.
Case closed. *pfew*
Gentoo addict: tomorrow I quit, I promise!... Just one more emerge...