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

Bug 589672

Summary: cross-arm-none-eabi/gcc-5.4.0: stage2 libstdc++ fails: error: Link tests are not allowed after GCC_NO_EXECUTABLES
Product: Gentoo Linux Reporter: scheer
Component: Current packagesAssignee: Gentoo Crossdev team <crossdev>
Status: RESOLVED FIXED    
Severity: normal CC: crazycasta, kripton, masanori.ogino, mlen, philipp.psurek+gentoo, qsx, wtt6, x0r+gentoo
Priority: Normal    
Version: unspecified   
Hardware: AMD64   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---
Bug Depends on:    
Bug Blocks: 627914    
Attachments: required logfiles (error message) + emerge --info
gcc-build-logs.tar.bz2
arm-none-eabi/libstdc++-v3/config.log
cross-arm-none-eabi-info.log
cross-arm-none-eabi-gcc-stage2.log.xz

Description scheer 2016-07-25 13:03:10 UTC
Created attachment 441518 [details]
required logfiles (error message) + emerge --info

Running

# crossdev -t arm-none-eabi -s4

results in:


-----------------------------------------------------------------------------------------------
 * crossdev version:      20151026
 * Host Portage ARCH:     amd64
 * Target Portage ARCH:   arm
 * Target System:         arm-none-eabi
 * Stage:                 4 (C/C++ compiler)
 * ABIs:                  default

 * binutils:              binutils-[latest]
 * gcc:                   gcc-[latest]
 * libc:                  newlib-[latest]

 * CROSSDEV_OVERLAY:      /usr/local/portage
 * PORT_LOGDIR:           /var/log/portage
 * PORTAGE_CONFIGROOT:    
 * Portage flags:         
  _  -  ~  -  _  -  ~  -  _  -  ~  -  _  -  ~  -  _  -  ~  -  _  -  ~  -  _  -  ~  -  _  -  ~  
 * leaving metadata/layout.conf alone in /usr/local/portage
  _  -  ~  -  _  -  ~  -  _  -  ~  -  _  -  ~  -  _  -  ~  -  _  -  ~  -  _  -  ~  -  _  -  ~  
!!! WARNING - Cannot auto-configure CHOST arm-none-eabi;
!!! You should edit /usr/arm-none-eabi/etc/portage/make.conf
!!! by hand to complete your configuration.
!!!  No LIBC is known for this target.
 * Log: /var/log/portage/cross-arm-none-eabi-binutils.log
 * Emerging cross-binutils ...                                                           [ ok ]
 * Log: /var/log/portage/cross-arm-none-eabi-gcc-stage1.log
 * Emerging cross-gcc-stage1 ...                                                         [ ok ]
 * Log: /var/log/portage/cross-arm-none-eabi-newlib.log
 * Emerging cross-newlib ...                                                             [ ok ]
 * Log: /var/log/portage/cross-arm-none-eabi-gcc-stage2.log
 * Emerging cross-gcc-stage2 ...

 * gcc failed :(
 * 
 * If you file a bug, please attach the following logfiles:
 * /var/log/portage/cross-arm-none-eabi-info.log
 * /var/log/portage/cross-arm-none-eabi-gcc-stage2.log.xz
 * /tmp/portage/cross-arm-none-eabi/gcc*/temp/gcc-config.logs.tar.xz
Comment 1 Mateusz Lenik 2017-01-10 13:43:05 UTC
I am also affected by this bug (with identical error message), but only on one of my machines, on the other one it compiles just fine.

From the broken machine:
$ emerge --info cross-arm-none-eabi/gcc
Portage 2.3.3 (python 3.4.5-final-0, default/linux/amd64/13.0, gcc-5.4.0, glibc-2.23-r3, 4.9.2-gentoo x86_64)
=================================================================
                         System Settings
=================================================================
System uname: Linux-4.9.2-gentoo-x86_64-Intel-R-_Xeon-R-_CPU_E5-2630_v4_@_2.20GHz-with-gentoo-2.3
KiB Mem:    32805808 total,  24998276 free
KiB Swap:   33554428 total,  33554428 free
Timestamp of repository gentoo: Tue, 10 Jan 2017 08:30:01 +0000
sh bash 4.4_p5-r1
ld GNU ld (Gentoo 2.27 p1.0) 2.27
distcc 3.2rc1 x86_64-pc-linux-gnu [disabled]
app-shells/bash:          4.4_p5-r1::gentoo
dev-java/java-config:     2.2.0-r3::gentoo
dev-lang/perl:            5.24.1_rc4::gentoo
dev-lang/python:          2.7.12::gentoo, 3.4.5::gentoo
dev-util/cmake:           3.7.1::gentoo
dev-util/pkgconfig:       0.29.1::gentoo
sys-apps/baselayout:      2.3::gentoo
sys-apps/openrc:          0.23.1::gentoo
sys-apps/sandbox:         2.10-r3::gentoo
sys-devel/autoconf:       2.13::gentoo, 2.69-r2::gentoo
sys-devel/automake:       1.12.6-r1::gentoo, 1.13.4-r1::gentoo, 1.14.1-r1::gentoo, 1.15-r2::gentoo
sys-devel/binutils:       2.27::gentoo
sys-devel/gcc:            5.4.0-r2::gentoo
sys-devel/gcc-config:     1.8-r1::gentoo
sys-devel/libtool:        2.4.6-r2::gentoo
sys-devel/make:           4.2.1::gentoo
sys-kernel/linux-headers: 4.9::gentoo (virtual/os-headers)
sys-libs/glibc:           2.23-r3::gentoo
Repositories:

gentoo
    location: /usr/portage
    sync-type: rsync
    sync-uri: rsync://rsync.gentoo.org/gentoo-portage
    priority: -1000

mlen
    location: /var/lib/mlen-overlay
    sync-type: git
    sync-uri: https://github.com/mlen/gentoo-overlay.git
    masters: gentoo

crossdev
    location: /usr/local/portage-crossdev
    masters: gentoo
    priority: 10

ACCEPT_KEYWORDS="amd64 ~amd64"
ACCEPT_LICENSE="* -@EULA"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-march=broadwell -O2 -pipe"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/lib64/libreoffice/program/sofficerc /usr/share/gnupg/qualified.txt"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/dconf /etc/env.d /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo /etc/texmf/language.dat.d /etc/texmf/language.def.d /etc/texmf/updmap.d /etc/texmf/web2c"
CXXFLAGS="-march=broadwell -O2 -pipe"
DISTDIR="/usr/portage/distfiles"
FCFLAGS="-O2 -pipe"
FEATURES="assume-digests binpkg-logs cgroup config-protect-if-modified distlocks ebuild-locks fail-clean fixlafiles merge-sync news parallel-fetch preserve-libs protect-owned sandbox sfperms strict unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync xattr"
FFLAGS="-O2 -pipe"
GENTOO_MIRRORS="http://distfiles.gentoo.org"
LANG="en_US.UTF-8"
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
MAKEOPTS="-j42 -l42"
PKGDIR="/usr/portage/packages"
PORTAGE_CONFIGROOT="/"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --omit-dir-times --compress --force --whole-file --delete --stats --human-readable --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages --exclude=/.git"
PORTAGE_TMPDIR="/var/tmp"
USE="X aac aacplus acl alsa amd64 audit berkdb bluray bzip2 caps cli consolekit cracklib crypt cryptsetup cups cxx dbus dri dri3 dvd faac flac fortran gdbm geoclue geoloc geolocation gif glamor gnome-keyring gtk gtk3 gtkstyle hidpi hotwording iconv icu idn infinality introspection iproute2 ipv6 jpeg kerberos libedit libnotify llvm lvm mmx mmxext modules mp3 mpeg multilib ncurses nls nptl numa offensive ogg opengl openmp opus oss pam pch pcre pm-utils png policykit pulseaudio python qt5 readline samba seccomp session sound sse sse2 ssl startup-notification tcpd theora tiff truetype udev udisks unicode unwind v4l vdpau vim vim-syntax virt-network vorbis vpx vulkan webp widgets x264 xattr xft xinerama zlib zsh-completion" ABI_X86="64" ALSA_CARDS="ali5451 als4000 atiixp atiixp-modem bt87x ca0106 cmipci emu10k1x ens1370 ens1371 es1938 es1968 fm801 hda-intel intel8x0 intel8x0m maestro3 trident usb-audio via82xx via82xx-modem ymfpci" APACHE2_MODULES="authn_core authz_core socache_shmcb unixd actions alias auth_basic authn_alias authn_anon authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache cgi cgid dav dav_fs dav_lock deflate dir disk_cache env expires ext_filter file_cache filter headers include info log_config logio mem_cache mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias" CALLIGRA_FEATURES="kexi words flow plan sheets stage tables krita karbon braindump author" CAMERAS="ptp2" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" CPU_FLAGS_X86="aes avx avx2 fma3 mmx mmxext popcnt sse sse2 sse3 sse4_1 sse4_2 ssse3" ELIBC="glibc" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock itrax mtk3301 nmea ntrip navcom oceanserver oldstyle oncore rtcm104v2 rtcm104v3 sirf superstar2 timing tsip tripmate tnt ublox ubx" INPUT_DEVICES="evdev" KERNEL="linux" L10N="en" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer" LINGUAS="en" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php5-6" PYTHON_SINGLE_TARGET="python2_7" PYTHON_TARGETS="python2_7 python3_4" QEMU_SOFTMMU_TARGETS="x86_64 i386 arm" QEMU_USER_TARGETS="x86_64 i386 arm" RUBY_TARGETS="ruby21 ruby23 ruby24" USERLAND="GNU" VIDEO_CARDS="amdgpu radeonsi" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipset ipp2p iface geoip fuzzy condition tee tarpit sysrq steal rawnat logmark ipmark dhcpmac delude chaos account"
Unset:  CC, CPPFLAGS, CTARGET, CXX, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LC_ALL, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS, USE_PYTHON

=================================================================
                        Package Settings
=================================================================

cross-arm-none-eabi/gcc-5.4.0-r2::crossdev was built with the following:
USE="multilib nls nptl (-altivec) -awt -cilk -cxx -debug -doc (-fixed-point) -fortran -gcj -go -graphite -hardened -jit -libssp -mpx -nopie -nossp -objc -objc++ -objc-gc -openmp -regression-test -sanitize -vanilla -vtv" ABI_X86="64"
CFLAGS="-O2 -pipe"
CXXFLAGS=""

Diff between broken and working machines:

diff --git a/broken b/working
index e7484c5..d0e02ea 100644
--- a/broken
+++ b/working
@@ -1,11 +1,11 @@
Portage 2.3.3 (python 3.4.5-final-0, default/linux/amd64/13.0, gcc-5.4.0, glibc-2.23-r3, [-4.9.2-gentoo-]{+4.9.1-gentoo+} x86_64)
=================================================================
                         System Settings
=================================================================
System uname: [-Linux-4.9.2-gentoo-x86_64-Intel-R-_Xeon-R-_CPU_E5-2630_v4_@_2.20GHz-with-gentoo-2.3-]{+Linux-4.9.1-gentoo-x86_64-Intel-R-_Core-TM-_i7-6600U_CPU_@_2.60GHz-with-gentoo-2.3+}
KiB Mem:    [-32805808-]{+16339768+} total,   [-24998276-]{+9736972+} free
KiB Swap:   33554428 total,  33554428 free
Timestamp of repository gentoo: [-Tue, 10-]{+Sun, 08+} Jan 2017 [-08:30:01-]{+12:30:01+} +0000
sh bash 4.4_p5-r1
ld GNU ld (Gentoo 2.27 p1.0) 2.27
distcc 3.2rc1 x86_64-pc-linux-gnu [disabled]
@@ -61,12 +61,12 @@ FFLAGS="-O2 -pipe"
GENTOO_MIRRORS="http://distfiles.gentoo.org"
LANG="en_US.UTF-8"
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
[-MAKEOPTS="-j42 -l42"-]{+MAKEOPTS="-j5 -l5"+}
PKGDIR="/usr/portage/packages"
PORTAGE_CONFIGROOT="/"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --omit-dir-times --compress --force --whole-file --delete --stats --human-readable --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages --exclude=/.git"
PORTAGE_TMPDIR="/var/tmp"
USE="X aac aacplus acl alsa amd64 audit berkdb[-bluray-] bzip2 caps cli consolekit cracklib crypt cryptsetup cups cxx dbus dri dri3 dvd faac flac fortran gdbm geoclue geoloc geolocation gif[-glamor-] gnome-keyring gtk gtk3 gtkstyle hidpi hotwording iconv icu idn infinality introspection iproute2 ipv6 jpeg kerberos libedit libnotify llvm lvm {+mbim+} mmx mmxext {+modemmanager+} modules mp3 mpeg multilib ncurses {+networkmanager+} nls nptl[-numa-] offensive ogg opengl openmp opus oss pam pch pcre pm-utils png policykit pulseaudio python qt5 readline samba seccomp session sound sse sse2 ssl startup-notification tcpd theora tiff truetype udev udisks unicode unwind v4l [-vdpau-]{+vaapi+} vim vim-syntax virt-network vorbis vpx[-vulkan-] webp widgets x264 xattr xft xinerama zlib zsh-completion" ABI_X86="64" ALSA_CARDS="ali5451 als4000 atiixp atiixp-modem bt87x ca0106 cmipci emu10k1x ens1370 ens1371 es1938 es1968 fm801 hda-intel intel8x0 intel8x0m maestro3 trident usb-audio via82xx via82xx-modem ymfpci" APACHE2_MODULES="authn_core authz_core socache_shmcb unixd actions alias auth_basic authn_alias authn_anon authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache cgi cgid dav dav_fs dav_lock deflate dir disk_cache env expires ext_filter file_cache filter headers include info log_config logio mem_cache mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias" CALLIGRA_FEATURES="kexi words flow plan sheets stage tables krita karbon braindump author" CAMERAS="ptp2" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" CPU_FLAGS_X86="aes avx avx2 fma3 mmx mmxext popcnt sse sse2 sse3 sse4_1 sse4_2 ssse3" ELIBC="glibc" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock itrax mtk3301 nmea ntrip navcom oceanserver oldstyle oncore rtcm104v2 rtcm104v3 sirf superstar2 timing tsip tripmate tnt ublox ubx" [-INPUT_DEVICES="evdev"-]{+INPUT_DEVICES="synaptics evdev"+} KERNEL="linux" L10N="en" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer" LINGUAS="en" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php5-6" PYTHON_SINGLE_TARGET="python2_7" PYTHON_TARGETS="python2_7 python3_4" QEMU_SOFTMMU_TARGETS="x86_64 i386 arm" QEMU_USER_TARGETS="x86_64 i386 arm" RUBY_TARGETS="ruby21 ruby23 ruby24" USERLAND="GNU" [-VIDEO_CARDS="amdgpu radeonsi"-]{+VIDEO_CARDS="intel i965"+} XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipset ipp2p iface geoip fuzzy condition tee tarpit sysrq steal rawnat logmark ipmark dhcpmac delude chaos account"
Unset:  CC, CPPFLAGS, CTARGET, CXX, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LC_ALL, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS, USE_PYTHON

=================================================================
@@ -74,7 +74,7 @@ Unset:  CC, CPPFLAGS, CTARGET, CXX, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LC_ALL, P
=================================================================

cross-arm-none-eabi/gcc-5.4.0-r2::crossdev was built with the following:
[-USE="multilib-]{+USE="cxx fortran multilib+} nls nptl {+vtv+} (-altivec) -awt -cilk[--cxx-] -debug -doc (-fixed-point)[--fortran-] -gcj -go -graphite -hardened -jit -libssp -mpx -nopie -nossp -objc -objc++ -objc-gc -openmp -regression-test -sanitize [--vanilla -vtv"-]{+-vanilla"+} ABI_X86="64"
CFLAGS="-O2 -pipe"
CXXFLAGS=""
Comment 2 Mateusz Lenik 2017-02-03 18:41:04 UTC
Same failure for cross-arm-none-eabi/gcc-5.4.0-r3, this time it fails on both machines.
Comment 3 SpanKY gentoo-dev 2017-02-15 08:47:32 UTC
what version of newlib do you have ?  i suspect it's related to this error:
configure:3970: /tmp/portage/cross-arm-none-eabi/gcc-5.4.0/work/build/./gcc/xgcc -B/tmp/portage/cross-arm-none-eabi/gcc-5.4.0/work/build/./gcc/ -B/usr/arm-none-eabi/bin/ -B/usr/arm-none-eabi/lib/ -isystem /usr/arm-none-eabi/include -isystem /usr/arm-none-eabi/sys-include    -o conftest -g -O2   conftest.c  >&5
/usr/arm-none-eabi/lib/libg.a(lib_a-exit.o): In function `exit':
/tmp/portage/cross-arm-none-eabi/newlib-2.4.0/work/newlib-2.4.0/newlib/libc/stdlib/exit.c:70: undefined reference to `_exit'
collect2: error: ld returned 1 exit status
Comment 4 Mateusz Lenik 2017-02-15 13:15:48 UTC
I'm using newlib-2.5.0 on both machines
Comment 5 Ralf Ramsauer 2017-06-30 13:47:16 UTC
Similar error here for cross-armv7a-hardfloat-linux-gnueabi/gcc-5.4.0-r3

Any suggestions?
Comment 6 Philipp Psurek 2017-07-06 10:49:11 UTC
Created attachment 481128 [details]
gcc-build-logs.tar.bz2

I'm also dealing with this bug. Unfortunately I didn't save my old compile logs from uncounted attempts.

# crossdev -s4 --b 2.28-r2 --g 7.1.0-r1 --l 2.5.0 -t arm-none-eabi
-------------------------------------------------------------------------------
 * crossdev version:      20151026
 * Host Portage ARCH:     amd64
 * Target Portage ARCH:   arm
 * Target System:         arm-none-eabi
 * Stage:                 4 (C/C++ compiler)
 * ABIs:                  default

 * binutils:              binutils-2.28-r2
 * gcc:                   gcc-7.1.0-r1
 * libc:                  newlib-2.5.0

 * CROSSDEV_OVERLAY:      /usr/local/portage-crossdev
 * PORT_LOGDIR:           /var/log/portage
 * PORTAGE_CONFIGROOT:    
 * Portage flags:
  _  -  ~  -  _  -  ~  -  _  -  ~  -  _  -  ~  -  _  -  ~  -  _

Now for the fun and to identify which USE is responsible for the fail to compile stage 4 I did this:

# USE="cxx -fortran -sanitize -multilib -nls -nptl -pch -pie -ssp -vtv" \
    emerge -1av cross-arm-none-eabi/gcc

and again:
 […]
checking for library containing clock_gettime... configure: error: Link tests are not allowed after GCC_NO_EXECUTABLES.
make[1]: *** [Makefile:10306: configure-target-libstdc++-v3] Error 1
make[1]: Leaving directory '/mnt/bdt/data/gentoo/portage/cross-arm-none-eabi/gcc-7.1.0-r1/work/build'
make: *** [Makefile:889: all] Error 2
 * ERROR: cross-arm-none-eabi/gcc-7.1.0-r1::crossdev failed (compile phase):
 *   emake failed
 […]

btw. crossdev tries to compile stage 4 with this changes:
USE="cxx* fortran* multilib nls nptl pch pie sanitize* ssp vtv (-altivec) -awt -cilk -debug -doc (-fixed-point) -gcj -go -graphite -hardened -jit -libssp -mpx -objc -objc++ -objc-gc -openmp -regression-test -vanilla"

I can't remember if the same bug occurred with 6.3.0, 5.4.0{-r*} and 4.9.4 but there was also the fail of compile stage 4 for arm-none-eabi.

References I found:
https://gcc.gnu.org/ml/gcc-help/2008-02/msg00007.html
https://gcc.gnu.org/ml/gcc-help/2012-07/msg00018.html
https://stackoverflow.com/questions/12880394/link-tests-are-not-allowed-after-gcc-no-executables-crosscompiling-toolchain
Comment 7 Philipp Psurek 2017-07-06 10:53:35 UTC
Bugs #515648 #560668 might be related to this bug
Comment 8 DawidPi 2017-07-25 07:11:35 UTC
Bugs: #515648 #560668 indeed seems to be the same issue.

My question is if there is any workaround/fix known/planned for this issue?

I do not know how exactly does crossdev work, but in my undestading gcc.ebuild configure section should be different, when building it for embedded versions. I am no ebuild developer, but I think, that configure section is done by toolchain eclass. Unfortunatelly I do not know where to get sources for this eclass and how to make configurations different for different embedded platforms.

I am willing to help in solving the issue, as it's urgent for me to have arm-none-eabi compiler working.
Comment 9 Philipp Psurek 2017-07-25 08:53:14 UTC
here there are, the related bugs linked properly: bug 515648 bug 560668

as far as I can see crossdev generates a wrong GCC in stage 1. The correct compiler should have this multilibs:

$ arm-none-eabi-gcc -print-multi-lib
.;
thumb;@mthumb
fpu;@mfloat-abi=hard
armv6-m;@mthumb@march=armv6s-m
armv7-m;@mthumb@march=armv7-m
armv7e-m;@mthumb@march=armv7e-m
armv7-ar/thumb;@mthumb@march=armv7
armv8-m.base;@mthumb@march=armv8-m.base
armv8-m.main;@mthumb@march=armv8-m.main
armv7e-m/softfp/fpv5-sp-d16;@mthumb@march=armv7e-m@mfloat-abi=softfp@mfpu=fpv5-sp-d16
armv7e-m/softfp/fpv5-d16;@mthumb@march=armv7e-m@mfloat-abi=softfp@mfpu=fpv5-d16
armv7e-m/softfp;@mthumb@march=armv7e-m@mfloat-abi=softfp@mfpu=fpv4-sp-d16
armv7e-m/fpu/fpv5-sp-d16;@mthumb@march=armv7e-m@mfloat-abi=hard@mfpu=fpv5-sp-d16
armv7e-m/fpu/fpv5-d16;@mthumb@march=armv7e-m@mfloat-abi=hard@mfpu=fpv5-d16
armv7e-m/fpu;@mthumb@march=armv7e-m@mfloat-abi=hard@mfpu=fpv4-sp-d16
armv7-ar/thumb/softfp;@mthumb@march=armv7@mfloat-abi=softfp@mfpu=vfpv3-d16
armv7-ar/thumb/fpu;@mthumb@march=armv7@mfloat-abi=hard@mfpu=vfpv3-d16
armv8-m.main/softfp/fpv5-sp-d16;@mthumb@march=armv8-m.main@mfloat-abi=softfp@mfpu=fpv5-sp-d16
armv8-m.main/softfp/fpv5-d16;@mthumb@march=armv8-m.main@mfloat-abi=softfp@mfpu=fpv5-d16
armv8-m.main/fpu/fpv5-sp-d16;@mthumb@march=armv8-m.main@mfloat-abi=hard@mfpu=fpv5-sp-d16
armv8-m.main/fpu/fpv5-d16;@mthumb@march=armv8-m.main@mfloat-abi=hard@mfpu=fpv5-d16

but the GCC generated by crossdev have only:

$ arm-none-eabi-gcc -print-multi-lib
.;
thumb;@mthumb

one should build the toolchain like [1] or [2]

Copy the Eclass to your overlay [3] and change it [4]

[1] http://www.freddiechopin.info/en/articles/35-arm/87-bleeding-edge-toolchain-o-co-chodzi
[2] https://istarc.wordpress.com/2014/07/21/stm32f4-build-your-toolchain-from-scratch/
[3] https://devmanual.gentoo.org/general-concepts/overlay/index.html#overlay-and-eclasses
[4] https://devmanual.gentoo.org/eclass-writing/index.html
Comment 10 Dominik Diesch 2018-02-28 17:23:24 UTC
I could solve the problem in a very simple way: add the following line
to your /etc/portage/env/cross-arm-none-eabi/gcc.conf:

EXTRA_ECONF=--disable-libstdcxx-time

This will override the hardcoded opposite setting in the eclass and prevent the ebuild/configure script to fail by skipping unsuccessful tests whether to add time functions when building the stdc++ library. 

Since these time functions require kernel support they can't be built in an arm-none-eabi environment anyway.

I have tested this patch with cross-arm-none-eabi/gcc-7.2.0 and gcc-7.3.0. Both will compile fine.
Comment 11 Sergei Trofimovich (RETIRED) gentoo-dev 2018-03-01 23:01:54 UTC
(In reply to Dominik Diesch from comment #10)
> EXTRA_ECONF=--disable-libstdcxx-time

Looks about right. Currently libstdcxx-time enabled unconditionally for all targets:
    https://gitweb.gentoo.org/repo/gentoo.git/tree/eclass/toolchain.eclass#n935

Where should we disable libstdcxx-time?
For all newlib targets? (*-eabi)
Or only arm? (arm*-eabi)
Comment 12 Sergei Trofimovich (RETIRED) gentoo-dev 2018-03-02 07:41:34 UTC
With new crossdev-20180120 the following command is enough to build stage4 without any modifications:
   # USE=-fortran crossdev -t arm-none-eabi -S -s4

Does anyone still experience build failures?
Comment 13 Larry the Git Cow gentoo-dev 2018-03-02 22:32:55 UTC
The bug has been referenced in the following commit(s):

https://gitweb.gentoo.org/proj/crossdev.git/commit/?id=d7c82ccdd26f7212116a9ccc57b16d23d9cb2288

commit d7c82ccdd26f7212116a9ccc57b16d23d9cb2288
Author:     Sergei Trofimovich <slyfox@gentoo.org>
AuthorDate: 2018-03-02 22:32:06 +0000
Commit:     Sergei Trofimovich <slyfox@gentoo.org>
CommitDate: 2018-03-02 22:32:06 +0000

    crossdev: disable fortran in gcc-stage2 no bare-metal targets, bug #589672
    
    Bug: https://bugs.gentoo.org/589672
    Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>

 crossdev | 1 +
 1 file changed, 1 insertion(+)}
Comment 14 Larry the Git Cow gentoo-dev 2018-03-02 22:34:46 UTC
The bug has been referenced in the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=4eaa82558651cbe073c5d522c1415d1238952c45

commit 4eaa82558651cbe073c5d522c1415d1238952c45
Author:     Sergei Trofimovich <slyfox@gentoo.org>
AuthorDate: 2018-03-02 22:34:31 +0000
Commit:     Sergei Trofimovich <slyfox@gentoo.org>
CommitDate: 2018-03-02 22:34:40 +0000

    sys-devel/crossdev: bump up to 20180302, bug #589672
    
    Bug: https://bugs.gentoo.org/589672
    Package-Manager: Portage-2.3.24, Repoman-2.3.6

 sys-devel/crossdev/Manifest                 |  1 +
 sys-devel/crossdev/crossdev-20180302.ebuild | 35 +++++++++++++++++++++++++++++
 2 files changed, 36 insertions(+)}
Comment 15 Sergei Trofimovich (RETIRED) gentoo-dev 2018-04-07 17:25:58 UTC
*** Bug 515648 has been marked as a duplicate of this bug. ***
Comment 16 Sergei Trofimovich (RETIRED) gentoo-dev 2018-04-07 17:27:38 UTC
*** Bug 592396 has been marked as a duplicate of this bug. ***
Comment 17 Thomas Schneider 2018-04-27 12:56:59 UTC
I have the same problem: checking for library containing clock_gettime... configure: error: Link tests are not allowed after GCC_NO_EXECUTABLES.

cross-arm-none-eabi/gcc-7.3.0-r1::crossdev was built with the following:
USE="hardened (multilib) nls nptl pch pie ssp (-altivec) -awt -cilk -cxx -debug -doc (-fixed-point) -fortran -gcj -go -graphite -jit -libssp -mpx -objc -objc++ -objc-gc -openmp -pgo -regression-test -sanitize -van
illa -vtv" ABI_X86="(64)"
CFLAGS="-O2 -pipe"                               
CXXFLAGS="-O2 -pipe"

The difference when building the s4 gcc is USE="+cxx +fortran +openmp +sanitize +vtv" (arguably some come from my main system gcc and could be stripped).

I’ll now try with EXTRA_ECONF=--disable-libstdcxx-time.
Comment 18 Thomas Schneider 2018-04-27 13:06:24 UTC
> I’ll now try with EXTRA_ECONF=--disable-libstdcxx-time.

… which fails with configure: error: in `/tmp/portage/cross-arm-none-eabi/gcc-7.3.0-r1/work/build/arm-none-eabi/libgomp':
configure: error: C compiler cannot create executables
See `config.log' for more details.

Relevant (imho) parts from said config.log:
configure:3745: /tmp/portage/cross-arm-none-eabi/gcc-7.3.0-r1/work/build/./gcc/xgcc -B/tmp/portage/cross-arm-none-eabi/gcc-7.3.0-r1/work/build/./gcc/ -B/usr/arm-none-eabi/bin/ -B/usr/arm-none-eabi/lib/ -isystem /usr/arm-none-eabi/include -isystem /usr/arm-none-eabi/sys-include    -g -O2   conftest.c  >&5
/usr/arm-none-eabi/lib/libg.a(lib_a-exit.o): In function `exit':
exit.c:(.text.exit+0x40): undefined reference to `_exit'
/usr/libexec/gcc/arm-none-eabi/ld: warning: creating a DT_TEXTREL in a shared object.
collect2: error: ld returned 1 exit status
configure:3749: $? = 1
configure:3786: result: 
configure: failed program was:
| /* confdefs.h */
| #define PACKAGE_NAME "GNU Offloading and Multi Processing Runtime Library"
| #define PACKAGE_TARNAME "libgomp"
| #define PACKAGE_VERSION "1.0"
| #define PACKAGE_STRING "GNU Offloading and Multi Processing Runtime Library 1.0"
| #define PACKAGE_BUGREPORT ""
| #define PACKAGE_URL "http://www.gnu.org/software/libgomp/"
| #define PACKAGE "libgomp"
| #define VERSION "1.0"
| /* end confdefs.h.  */
| 
| int
| main ()
| {
| 
|   ;
|   return 0;
| }
configure:3792: error: in `/tmp/portage/cross-arm-none-eabi/gcc-7.3.0-r1/work/build/arm-none-eabi/libgomp':
configure:3796: error: C compiler cannot create executables
---

All this creates many and large log files, so I’m a bit unsure what info to provide.
Comment 19 Sergei Trofimovich (RETIRED) gentoo-dev 2018-04-27 21:19:09 UTC
(In reply to Thomas Schneider from comment #18)
> All this creates many and large log files, so I’m a bit unsure what info to
> provide.

Best would be to share exact crossdev command run and logs that crossdev usually asks you to grab.
Comment 20 Thomas Schneider 2018-04-28 15:05:51 UTC
Created attachment 528722 [details]
arm-none-eabi/libstdc++-v3/config.log

This is the libstdc++’s config.log from /var/log/portage/cross-arm-none-eabi-gcc-stage2.log.xz, containing the error: configure:20741: error: Link tests are not allowed after GCC_NO_EXECUTABLES.
Comment 21 Thomas Schneider 2018-04-28 15:06:46 UTC
Created attachment 528724 [details]
cross-arm-none-eabi-info.log
Comment 22 Sergei Trofimovich (RETIRED) gentoo-dev 2018-04-28 17:03:31 UTC
(In reply to Thomas Schneider from comment #20)
> Created attachment 528722 [details]
> arm-none-eabi/libstdc++-v3/config.log
> 
> This is the libstdc++’s config.log from
> /var/log/portage/cross-arm-none-eabi-gcc-stage2.log.xz, containing the
> error: configure:20741: error: Link tests are not allowed after
> GCC_NO_EXECUTABLES.

Can you attach full cross-arm-none-eabi-gcc-stage2.log.xz file?
Comment 23 Thomas Schneider 2018-04-28 19:29:55 UTC
Created attachment 528728 [details]
cross-arm-none-eabi-gcc-stage2.log.xz
Comment 24 Larry the Git Cow gentoo-dev 2018-04-29 15:31:38 UTC
The bug has been referenced in the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=e4da4705a51d46236f3e9a0d2c850455b7d9772c

commit e4da4705a51d46236f3e9a0d2c850455b7d9772c
Author:     Sergei Trofimovich <slyfox@gentoo.org>
AuthorDate: 2018-04-29 15:26:25 +0000
Commit:     Sergei Trofimovich <slyfox@gentoo.org>
CommitDate: 2018-04-29 15:31:31 +0000

    eclass/toolchain.eclass: disable libstdcxx-time for bare metal
    
    Historically Gentoo unconditionally sets --enable-libstdcxx-time=yes
    to avoid --enable-libstdcxx-time=rt on linux targets, bug #411681
    
    Unfortunately this conflicts with arm-none-eabi and other
    bare-metal targets that don't provide enough plumbing
    to support for POSIX timers.
    
    This change ogerrides our default to --disable-libstdcxx-time
    on *-elf and *-eabi targets.
    
    Tested as:
      $ crossdev --stage4 arm-none-eabi
    
    Reported-by: scheer@wsoptics.de
    Reported-by: Thomas Schneider
    Bug: https://bugs.gentoo.org/411681
    Bug: https://bugs.gentoo.org/589672
    Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>

 eclass/toolchain.eclass | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)}
Comment 25 Sergei Trofimovich (RETIRED) gentoo-dev 2018-04-29 15:39:54 UTC
libstdc++ should avoid clock_gettime() and friends with #comment24 commit.

crossdev disables openmp explicitly for a long while in:
   https://bugs.gentoo.org/489798
Comment 26 Sergei Trofimovich (RETIRED) gentoo-dev 2018-04-29 16:05:19 UTC
*** Bug 549512 has been marked as a duplicate of this bug. ***