i've used sys-devel/crossdev-20150716 by typing "crossdev avr" cross-avr/binutils-2.25.1-r1 emerged fine, but gcc failed in stage1 with : checking for avr-gcc... /home/notmpfs/portage/cross-avr/gcc-4.9.3/work/build/./gcc/xgcc -B/home/notmpfs/portage/cross-avr/gcc-4.9.3/work/build/./gcc/ -B/usr/avr/bin/ -B/usr/avr/lib/ -isystem /usr/avr/include -isystem /usr/avr/sys-include checking for suffix of object files... configure: error: in `/home/notmpfs/portage/cross-avr/gcc-4.9.3/work/build/avr/libgcc': configure: error: cannot compute suffix of object files: cannot compile Reproducible: Always
Created attachment 415618 [details] general info
Created attachment 415620 [details] compilation log
crossdev ends with ... * 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 ... * 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-stage1.log.xz * /var/tmp/portage/cross-avr/gcc*/temp/gcc-config.logs.tar.xz But I can't find the last the last one. I've looked for anything related, and found nothing.
following https://gcc.gnu.org/wiki/FAQ#Configuration_fails_with_.27.27configure:_error:_cannot_compute_suffix_of_object_files:_cannot_compile.27.27._What_is_the_problem.3F I've checked ./work/build/avr/libgcc/config.log and it contains : .... configure:2671: checking for avr-lipo configure:2698: result: avr-lipo configure:2763: checking for avr-nm configure:2790: result: /home/notmpfs/portage/cross-avr/gcc-4.9.3/work/build/./gcc/nm configure:2855: checking for avr-ranlib configure:2882: result: /usr/libexec/gcc/avr/ranlib configure:2947: checking for avr-strip configure:2974: result: /usr/libexec/gcc/avr/strip configure:3036: checking whether ln -s works configure:3040: result: yes configure:3057: checking for avr-gcc configure:3084: result: /home/notmpfs/portage/cross-avr/gcc-4.9.3/work/build/./gcc/xgcc -B/home/notmpfs/portage/cross-avr/gcc-4.9.3/work/build/./gcc/ -B/usr/avr/bin/ -B/usr/avr/lib/ -isystem /usr/avr/include -isystem /usr/avr/sys-include configure:3353: checking for C compiler version configure:3362: /home/notmpfs/portage/cross-avr/gcc-4.9.3/work/build/./gcc/xgcc -B/home/notmpfs/portage/cross-avr/gcc-4.9.3/work/build/./gcc/ -B/usr/avr/bin/ -B/usr/avr/lib/ -isystem /usr/avr/include -isystem /usr/avr/sys-include --version >&5 xgcc (Gentoo 4.9.3 p1.3, pie-0.6.3) 4.9.3 Copyright (C) 2015 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. configure:3373: $? = 0 configure:3362: /home/notmpfs/portage/cross-avr/gcc-4.9.3/work/build/./gcc/xgcc -B/home/notmpfs/portage/cross-avr/gcc-4.9.3/work/build/./gcc/ -B/usr/avr/bin/ -B/usr/avr/lib/ -isystem /usr/avr/include -isystem /usr/avr/sys-include -v >&5 Reading specs from /home/notmpfs/portage/cross-avr/gcc-4.9.3/work/build/./gcc/specs COLLECT_GCC=/home/notmpfs/portage/cross-avr/gcc-4.9.3/work/build/./gcc/xgcc COLLECT_LTO_WRAPPER=/home/notmpfs/portage/cross-avr/gcc-4.9.3/work/build/./gcc/lto-wrapper Target: avr Configured with: /home/notmpfs/portage/cross-avr/gcc-4.9.3/work/gcc-4.9.3/configure --host=x86_64-pc-linux-gnu --target=avr --build=x86_64-pc-linux-gnu --prefix=/usr --bindir=/usr/x86_64-pc-linux-gnu/avr/gcc-bin/4.9.3 --includedir=/usr/lib/gcc/avr/4.9.3/include --datadir=/usr/share/gcc-data/avr/4.9.3 --mandir=/usr/share/gcc-data/avr/4.9.3/man --infodir=/usr/share/gcc-data/avr/4.9.3/info --with-gxx-include-dir=/usr/lib/gcc/avr/4.9.3/include/g++-v4 --with-python-dir=/share/gcc-data/avr/4.9.3/python --enable-languages=c --enable-obsolete --enable-secureplt --disable-werror --with-system-zlib --enable-nls --without-included-gettext --enable-checking=release --with-bugurl=https://bugs.gentoo.org/ --with-pkgversion='Gentoo 4.9.3 p1.3, pie-0.6.3' --enable-poison-system-directories --enable-shared --disable-threads --disable-bootstrap --enable-multilib --disable-altivec --disable-fixed-point --disable-libgcj --disable-libgomp --disable-libmudflap --disable-libssp --disable-libcilkrts --disable-libquadmath --enable-lto --with-cloog --disable-isl-version-check --disable-libsanitizer Thread model: single gcc version 4.9.3 (Gentoo 4.9.3 p1.3, pie-0.6.3) configure:3373: $? = 0 configure:3362: /home/notmpfs/portage/cross-avr/gcc-4.9.3/work/build/./gcc/xgcc -B/home/notmpfs/portage/cross-avr/gcc-4.9.3/work/build/./gcc/ -B/usr/avr/bin/ -B/usr/avr/lib/ -isystem /usr/avr/include -isystem /usr/avr/sys-include -V >&5 xgcc: error: unrecognized command line option '-V' xgcc: fatal error: no input files compilation terminated. configure:3373: $? = 1 configure:3362: /home/notmpfs/portage/cross-avr/gcc-4.9.3/work/build/./gcc/xgcc -B/home/notmpfs/portage/cross-avr/gcc-4.9.3/work/build/./gcc/ -B/usr/avr/bin/ -B/usr/avr/lib/ -isystem /usr/avr/include -isystem /usr/avr/sys-include -qversion >&5 xgcc: error: unrecognized command line option '-qversion' xgcc: fatal error: no input files compilation terminated. configure:3373: $? = 1 configure:3389: /home/notmpfs/portage/cross-avr/gcc-4.9.3/work/build/./gcc/xgcc -B/home/notmpfs/portage/cross-avr/gcc-4.9.3/work/build/./gcc/ -B/usr/avr/bin/ -B/usr/avr/lib/ -isystem /usr/avr/include -isystem /usr/avr/sys-include -o conftest -g -O2 -pipe conftest.c >&5 Assembler messages: Fatal error: selected target format 'elf32-avr' unknown configure:3392: $? = 2 configure:3580: checking for suffix of object files configure:3602: /home/notmpfs/portage/cross-avr/gcc-4.9.3/work/build/./gcc/xgcc -B/home/notmpfs/portage/cross-avr/gcc-4.9.3/work/build/./gcc/ -B/usr/avr/bin/ -B/usr/avr/lib/ -isystem /usr/avr/include -isystem /usr/avr/sys-include -c -g -O2 -pipe conftest.c >&5 Assembler messages: Fatal error: selected target format 'elf32-avr' unknown configure:3606: $? = 2 configure: failed program was: | /* confdefs.h */ | #define PACKAGE_NAME "GNU C Runtime Library" | #define PACKAGE_TARNAME "libgcc" | #define PACKAGE_VERSION "1.0" | #define PACKAGE_STRING "GNU C Runtime Library 1.0" | #define PACKAGE_BUGREPORT "" | #define PACKAGE_URL "http://www.gnu.org/software/libgcc/" | /* end confdefs.h. */ | | int | main () | { | | ; | return 0; | } configure:3620: error: in `/home/notmpfs/portage/cross-avr/gcc-4.9.3/work/build/avr/libgcc': configure:3623: error: cannot compute suffix of object files: cannot compile See `config.log' for more details.
I tried another gcc version, using --g 4.8.5, but the result is the same
If you have binutils-config-5, then try downgrading to binutils-config-4, or try my patch from bug #562460
I indeed do have binutils-config-5 installed. I tried masking it, but i have other packages requiring it: >=sys-devel/binutils-config-5 required by (sys-libs/binutils-libs-2.25.1-r1:0/2.25.1::gentoo, installed) So I tried patching my /usr/bin/binutils-config with + if [[ ${TARGET} != ${HOST} ]] ; then + for x in lib* ; do + atomic_ln "${LIBPATH}/${x}" "${dstlib}" "${x}" + done + fi then uninstalled cross-avr/binutils and restarted 'crossdev avr'. I'm not sure about the result. I think it worked slightly more than previously, but it still fails in some configure, though differently.
Created attachment 415768 [details] failure after patching binutils-select, comment #7
Please attach /home/notmpfs/portage/cross-avr/gcc-4.9.3/work/build/avr/avr25/libsanitizer/config.log
On my system the actual error is: configure:3026: checking for C compiler default output file name configure:3048: /var/tmp/portage/cross-avr/gcc-4.9.3/work/build/./gcc/xgcc -B/var/tmp/portage/cross-avr/gcc-4.9.3/work/build/./gcc/ -B/usr/avr/bin/ -B/usr/av r/lib/ -isystem /usr/avr/include -isystem /usr/avr/sys-include -mmcu=avr25 -g -O2 -pipe conftest.c >&5 /usr/libexec/gcc/avr/ld: cannot open linker script file ldscripts/avr25.xn: No such file or directory collect2: error: ld returned 1 exit status configure:3052: $? = 1 configure:3089: result: configure: failed program was: | /* confdefs.h */ | #define PACKAGE_NAME "package-unused" | #define PACKAGE_TARNAME "package-unused" | #define PACKAGE_VERSION "version-unused" | #define PACKAGE_STRING "package-unused version-unused" | #define PACKAGE_BUGREPORT "libsanitizer" | #define PACKAGE_URL "" | /* end confdefs.h. */ | | int | main () | { | | ; | return 0; | } configure:3095: error: in `/var/tmp/portage/cross-avr/gcc-4.9.3/work/build/avr/avr25/libsanitizer': configure:3099: error: C compiler cannot create executables See `config.log' for more details. $ qlist cross-avr/binutils-2.25.1-r1 | grep avr25.xn /usr/lib64/binutils/avr/2.25.1/ldscripts/avr25.xn This looks very similar to the old bug #147155 =/
Created attachment 415772 [details] /home/notmpfs/portage/cross-avr/gcc-4.9.3/work/build/avr/avr25/libsanitizer/config.log
(seems like i have the same error as Alexander Tsoy)
Alexander : but #147155 doesn't prevent emerging, it's "only" that the emerged stuff doesn't work. And even if this bug has been there for years, there are workarounds.
(In reply to Thomas Capricelli from comment #13) Yes. Although ldscripts symlink fixed this error, I got another linker error later at configure phase. Here is the workaround that works for me: # echo 'cross-avr/gcc sanitize' > /etc/portage/profile/package.use.mask/cross-avr-nosanitize IIUC address sanitizer is not supported on avr. So this issue should be fixed either in crossdev (GUSE="-sanitize") or even in toolchain.eclass (do not add "sanitize" to IUSE for unsupported CTARGETs).
So this is a dupe of bug #525910 (just found it :/ )
(In reply to Alexander Tsoy from comment #14) That did it! Thanks for the hint. I know have an avr-4.9.3 (again, i had an old old that i removed because i thought it would be easy for crossdev to build a more recent one ..)
*** This bug has been marked as a duplicate of bug 525910 ***