Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 564314 - cross-avr/gcc/gcc-4.9.3 fails to compile
Summary: cross-avr/gcc/gcc-4.9.3 fails to compile
Status: RESOLVED DUPLICATE of bug 525910
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Embedded Gentoo Team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-10-28 12:19 UTC by Thomas Capricelli
Modified: 2015-11-10 15:16 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
general info (cross-avr-info.log,18.98 KB, text/x-log)
2015-10-28 12:20 UTC, Thomas Capricelli
Details
compilation log (cross-avr-gcc-stage1.log.xz,37.85 KB, application/x-xz)
2015-10-28 12:20 UTC, Thomas Capricelli
Details
failure after patching binutils-select, comment #7 (cross-avr-gcc-stage2.log.xz,120.38 KB, application/x-xz)
2015-10-30 13:38 UTC, Thomas Capricelli
Details
/home/notmpfs/portage/cross-avr/gcc-4.9.3/work/build/avr/avr25/libsanitizer/config.log (config.log,15.26 KB, text/x-log)
2015-10-30 23:14 UTC, Thomas Capricelli
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Thomas Capricelli 2015-10-28 12:19:11 UTC
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
Comment 1 Thomas Capricelli 2015-10-28 12:20:04 UTC
Created attachment 415618 [details]
general info
Comment 2 Thomas Capricelli 2015-10-28 12:20:28 UTC
Created attachment 415620 [details]
compilation log
Comment 3 Thomas Capricelli 2015-10-28 12:22:12 UTC
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.
Comment 4 Thomas Capricelli 2015-10-28 12:40:00 UTC
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.
Comment 5 Thomas Capricelli 2015-10-28 13:34:23 UTC
I tried another gcc version, using --g 4.8.5, but the result is the same
Comment 6 Alexander Tsoy 2015-10-29 23:16:29 UTC
If you have binutils-config-5, then try downgrading to binutils-config-4, or try my patch from bug #562460
Comment 7 Thomas Capricelli 2015-10-30 13:37:35 UTC
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.
Comment 8 Thomas Capricelli 2015-10-30 13:38:29 UTC
Created attachment 415768 [details]
failure after patching binutils-select, comment #7
Comment 9 Alexander Tsoy 2015-10-30 15:02:35 UTC
Please attach /home/notmpfs/portage/cross-avr/gcc-4.9.3/work/build/avr/avr25/libsanitizer/config.log
Comment 10 Alexander Tsoy 2015-10-30 15:17:10 UTC
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 =/
Comment 11 Thomas Capricelli 2015-10-30 23:14:45 UTC
Created attachment 415772 [details]
/home/notmpfs/portage/cross-avr/gcc-4.9.3/work/build/avr/avr25/libsanitizer/config.log
Comment 12 Thomas Capricelli 2015-10-30 23:15:39 UTC
(seems like i have the same error as Alexander Tsoy)
Comment 13 Thomas Capricelli 2015-10-30 23:16:46 UTC
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.
Comment 14 Alexander Tsoy 2015-10-31 02:26:03 UTC
(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).
Comment 15 Alexander Tsoy 2015-10-31 11:37:20 UTC
So this is a dupe of bug #525910 (just found it :/ )
Comment 16 Thomas Capricelli 2015-11-01 03:06:33 UTC
(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 ..)
Comment 17 Michael Palimaka (kensington) gentoo-dev 2015-11-10 15:16:55 UTC

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