Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 530786

Summary: cross-avr/gcc-4.8.3 - /usr/libexec/gcc/avr/ld: cannot open linker script file ldscripts/avr25.xn: No such file or directory
Product: Gentoo Linux Reporter: Attila Oláh <attilaolah>
Component: [OLD] Core systemAssignee: Gentoo Toolchain Maintainers <toolchain>
Status: RESOLVED DUPLICATE    
Severity: normal    
Priority: Normal    
Version: unspecified   
Hardware: AMD64   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---
Attachments: /var/tmp/portage/cross-avr/gcc-4.8.3/work/build/avr/libsanitizer/config.log
/var/log/portage/cross-avr-info.log
/var/log/portage/cross-avr-gcc-stage2.log.xz
/var/tmp/portage/cross-avr/gcc-4.8.3/temp/gcc-config.logs.tar.xz

Description Attila Oláh 2014-11-26 16:36:57 UTC
Created attachment 390358 [details]
/var/tmp/portage/cross-avr/gcc-4.8.3/work/build/avr/libsanitizer/config.log

I'm trying to build the AVR toolchain on AMD64, as per this guide[1] with the help of this other guide[2].

[1]: http://playground.arduino.cc/Linux/Gentoo
[2]: http://wiki.gentoo.org/wiki/Arduino

When I run the following command:

$ sudo USE="-openmp" crossdev -t avr -s4 -S --without-headers

I get this output:

-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
 * crossdev version:      20141030
 * Host Portage ARCH:     amd64
 * Target Portage ARCH:   *
 * Target System:         avr
 * Stage:                 4 (C/C++ compiler)
 * ABIs:                  default

 * binutils:              binutils-[stable]
 * gcc:                   gcc-[stable]
 * libc:                  avr-libc-[stable]

 * CROSSDEV_OVERLAY:      /usr/local/portage
 * PORT_LOGDIR:           /var/log/portage
 * PORTAGE_CONFIGROOT:    
 * Portage flags:         
  _  -  ~  -  _  -  ~  -  _  -  ~  -  _  -  ~  -  _  -  ~  -  _  -  ~  -  _  -  ~  -  _  -  ~  -  _  -  ~  -  _  -  ~  -  _  -  ~  -  _  -  ~  -  _  -  ~  -  _  -  ~  -  _  -  ~  -  _  -  ~  -  _  -  ~  -  _  -  ~  -  _  -  ~  -  _  -  ~  
 * leaving sys-devel/binutils in /usr/local/portage
 * leaving sys-devel/gcc in /usr/local/portage
 * leaving dev-embedded/avr-libc in /usr/local/portage
 * leaving sys-devel/gdb in /usr/local/portage
 * leaving metadata/layout.conf alone in /usr/local/portage
  _  -  ~  -  _  -  ~  -  _  -  ~  -  _  -  ~  -  _  -  ~  -  _  -  ~  -  _  -  ~  -  _  -  ~  -  _  -  ~  -  _  -  ~  -  _  -  ~  -  _  -  ~  -  _  -  ~  -  _  -  ~  -  _  -  ~  -  _  -  ~  -  _  -  ~  -  _  -  ~  -  _  -  ~  -  _  -  ~  
 * Log: /var/log/portage/cross-avr-binutils.log
 * Emerging cross-binutils ...                                                                                                                                                                                                           [ ok ]
 * Log: /var/log/portage/cross-avr-gcc-stage1.log
 * Emerging cross-gcc-stage1 ...                                                                                                                                                                                                         [ ok ]
 * Log: /var/log/portage/cross-avr-avr-libc.log
 * Emerging cross-avr-libc ...                                                                                                                                                                                                           [ ok ]
 * Log: /var/log/portage/cross-avr-gcc-stage2.log
 * Emerging cross-gcc-stage2 ...

 * gcc failed :(
 * If you file a bug, please attach the following logfiles:
 * /var/log/portage/cross-avr-info.log
 * /var/log/portage/cross-avr-gcc-stage2.log.xz
 * /var/tmp/portage/cross-avr/gcc*/temp/gcc-config.logs.tar.xz

When I look at cross-avr-gcc-stage2.log, it seems that `cross-avr/gcc` is built successfully, and then it fails with this error:

checking for C compiler default output file name... 
configure: error: in `/var/tmp/portage/cross-avr/gcc-4.8.3/work/build/avr/avr25/libsanitizer':
configure: error: C compiler cannot create executables
See `config.log' for more details.
Makefile:9339: recipe for target 'configure-target-libsanitizer' failed

The following line confirms that it was libsanitizer that failed:

$ sudo tail -1 /var/tmp/portage/cross-avr/gcc-4.8.3/work/build/avr/libsanitizer/config.log
configure: exit 1

I'm also attaching the relevant config.log, in case that helps.
Comment 1 Attila Oláh 2014-11-26 16:37:40 UTC
Created attachment 390360 [details]
/var/log/portage/cross-avr-info.log
Comment 2 Attila Oláh 2014-11-26 16:38:04 UTC
Created attachment 390362 [details]
/var/log/portage/cross-avr-gcc-stage2.log.xz
Comment 3 Attila Oláh 2014-11-26 16:39:12 UTC
Created attachment 390364 [details]
/var/tmp/portage/cross-avr/gcc-4.8.3/temp/gcc-config.logs.tar.xz
Comment 4 Jeroen Roovers (RETIRED) gentoo-dev 2014-11-26 17:01:22 UTC

*** This bug has been marked as a duplicate of bug 525910 ***
Comment 5 Attila Oláh 2014-11-26 17:12:27 UTC
(In reply to Jeroen Roovers from comment #4)
> 
> *** This bug has been marked as a duplicate of bug 525910 ***

Thanks, I had no idea USE=sanitize was causing this.
Comment 6 Attila Oláh 2014-11-26 18:04:02 UTC

*** This bug has been marked as a duplicate of bug 525910 ***
Comment 7 Attila Oláh 2014-11-26 19:22:27 UTC
I managed to build my toolchain using this command:

$ sudo USE="-sanitize" crossdev -t avr -s4 -S --without-headers

However, now I'm hitting the issue that is the description of this bug report:

/usr/libexec/gcc/avr/ld: cannot open linker script file ldscripts/avr5.xn: No such file or directory
collect2: error: ld returned 1 exit status

The duplicate bug, https://bugs.gentoo.org/show_bug.cgi?id=525910, is in turn a duplicate of https://bugs.gentoo.org/show_bug.cgi?id=370063, which is still UNCONFIRMED.

So the question remains:

1. Why do I have to use `USE="-sanitize"` when building for avr?
2. Just where the hell is ldscripts/avr5.xn? It seems that the "sanitize" steps were failing for the exact same reason.
Comment 8 Attila Oláh 2014-11-26 19:26:40 UTC
It seems though that I have the file.

$ sudo find / -name avr5.xn                                                                                                                                                                                                      /usr/lib64/binutils/avr/2.24/ldscripts/avr5.xn
Comment 9 Attila Oláh 2014-11-26 20:43:46 UTC
Apparently this solves the issue:

$ sudo ln -s /usr/lib64/binutils/avr/2.24/ldscripts/ /usr/x86_64-pc-linux-gnu/avr/binutils-bin/2.24/


See http://forums.gentoo.org/viewtopic-p-7567730.html#7567730.
Comment 10 SpanKY gentoo-dev 2015-05-26 00:05:27 UTC

*** This bug has been marked as a duplicate of bug 147155 ***