Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 423821 - cross-*/gcc: gfortran fails to build when FCFLAGS/FFLAGS are set
Summary: cross-*/gcc: gfortran fails to build when FCFLAGS/FFLAGS are set
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: x86 Linux
: Normal normal
Assignee: Gentoo Toolchain Maintainers
URL:
Whiteboard:
Keywords:
: 423853 423959 435032 435374 441738 (view as bug list)
Depends on:
Blocks:
 
Reported: 2012-06-27 12:28 UTC by Xavier Miller (RETIRED)
Modified: 2012-11-19 03:00 UTC (History)
6 users (show)

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


Attachments
build.log.gz (build.log.xz,48.66 KB, application/x-xz)
2012-06-27 12:31 UTC, Xavier Miller (RETIRED)
Details
/var/tmp/portage/cross-hppa2.0-unknown-linux-gnu/gcc-4.5.3-r2/work/build/hppa2.0-unknown-linux-gnu/libgfortran/config.log (config.log,62.76 KB, text/plain)
2012-06-27 15:25 UTC, Jeroen Roovers (RETIRED)
Details
cross-hppa2.0-unknown-linux-gnu:gcc-4.5.3-r2:20120627-131129.log.gz (20120627-131129.log.gz,47.86 KB, application/x-gzip)
2012-06-27 15:26 UTC, Jeroen Roovers (RETIRED)
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Xavier Miller (RETIRED) gentoo-dev 2012-06-27 12:28:04 UTC
Trying to build cross toolchains for ARM, I am stuck at GCC[fortran]:
checking for armv7a-hardfloat-linux-gnueabi-gfortran... /var/tmp/portage/cross-armv7a-hardfloat-linux-gnueabi/gcc-4.7.1/work/build/./gcc/gfortran -B/var/tmp/portage/cross-armv7a-hardfloat-linux-gnueabi/gcc-4.7.1/work/build/./gcc/ -B/usr/armv7a-hardfloat-linux-gnueabi/bin/ -B/usr/armv7a-hardfloat-linux-gnueabi/lib/ -isystem /usr/armv7a-hardfloat-linux-gnueabi/include -isystem /usr/armv7a-hardfloat-linux-gnueabi/sys-include
checking whether we are using the GNU Fortran compiler... no
checking whether /var/tmp/portage/cross-armv7a-hardfloat-linux-gnueabi/gcc-4.7.1/work/build/./gcc/gfortran -B/var/tmp/portage/cross-armv7a-hardfloat-linux-gnueabi/gcc-4.7.1/work/build/./gcc/ -B/usr/armv7a-hardfloat-linux-gnueabi/bin/ -B/usr/armv7a-hardfloat-linux-gnueabi/lib/ -isystem /usr/armv7a-hardfloat-linux-gnueabi/include -isystem /usr/armv7a-hardfloat-linux-gnueabi/sys-include    accepts -g... yes
checking if libtool supports shared libraries... yes
checking whether to build shared libraries... yes
checking whether to build static libraries... yes
libtool.m4: error: problem compiling FC test program
checking for /var/tmp/portage/cross-armv7a-hardfloat-linux-gnueabi/gcc-4.7.1/work/build/./gcc/gfortran -B/var/tmp/portage/cross-armv7a-hardfloat-linux-gnueabi/gcc-4.7.1/work/build/./gcc/ -B/usr/armv7a-hardfloat-linux-gnueabi/bin/ -B/usr/armv7a-hardfloat-linux-gnueabi/lib/ -isystem /usr/armv7a-hardfloat-linux-gnueabi/include -isystem /usr/armv7a-hardfloat-linux-gnueabi/sys-include    option to produce PIC...
checking if /var/tmp/portage/cross-armv7a-hardfloat-linux-gnueabi/gcc-4.7.1/work/build/./gcc/gfortran -B/var/tmp/portage/cross-armv7a-hardfloat-linux-gnueabi/gcc-4.7.1/work/build/./gcc/ -B/usr/armv7a-hardfloat-linux-gnueabi/bin/ -B/usr/armv7a-hardfloat-linux-gnueabi/lib/ -isystem /usr/armv7a-hardfloat-linux-gnueabi/include -isystem /usr/armv7a-hardfloat-linux-gnueabi/sys-include    static flag  works... no
checking if /var/tmp/portage/cross-armv7a-hardfloat-linux-gnueabi/gcc-4.7.1/work/build/./gcc/gfortran -B/var/tmp/portage/cross-armv7a-hardfloat-linux-gnueabi/gcc-4.7.1/work/build/./gcc/ -B/usr/armv7a-hardfloat-linux-gnueabi/bin/ -B/usr/armv7a-hardfloat-linux-gnueabi/lib/ -isystem /usr/armv7a-hardfloat-linux-gnueabi/include -isystem /usr/armv7a-hardfloat-linux-gnueabi/sys-include    supports -c -o file.o... no
checking if /var/tmp/portage/cross-armv7a-hardfloat-linux-gnueabi/gcc-4.7.1/work/build/./gcc/gfortran -B/var/tmp/portage/cross-armv7a-hardfloat-linux-gnueabi/gcc-4.7.1/work/build/./gcc/ -B/usr/armv7a-hardfloat-linux-gnueabi/bin/ -B/usr/armv7a-hardfloat-linux-gnueabi/lib/ -isystem /usr/armv7a-hardfloat-linux-gnueabi/include -isystem /usr/armv7a-hardfloat-linux-gnueabi/sys-include    supports -c -o file.o... (cached) no
checking whether the /var/tmp/portage/cross-armv7a-hardfloat-linux-gnueabi/gcc-4.7.1/work/build/./gcc/gfortran -B/var/tmp/portage/cross-armv7a-hardfloat-linux-gnueabi/gcc-4.7.1/work/build/./gcc/ -B/usr/armv7a-hardfloat-linux-gnueabi/bin/ -B/usr/armv7a-hardfloat-linux-gnueabi/lib/ -isystem /usr/armv7a-hardfloat-linux-gnueabi/include -isystem /usr/armv7a-hardfloat-linux-gnueabi/sys-include    linker (/var/tmp/portage/cross-armv7a-hardfloat-linux-gnueabi/gcc-4.7.1/work/build/./gcc/collect-ld) supports shared libraries... yes
checking dynamic linker characteristics... (cached) GNU/Linux ld.so
checking how to hardcode library paths into programs... immediate
checking whether the GNU Fortran compiler is working... no
configure: error: GNU Fortran is not working; please report a bug in http://gcc.gnu.org/bugzilla, attaching /var/tmp/portage/cross-armv7a-hardfloat-linux-gnueabi/gcc-4.7.1/work/build/armv7a-hardfloat-linux-gnueabi/libgfortran/config.log
make[1]: *** [configure-target-libgfortran] Erreur 1
make[1] : on quitte le répertoire « /var/tmp/portage/cross-armv7a-hardfloat-linux-gnueabi/gcc-4.7.1/work/build »
make: *** [all] Erreur 2
emake failed
 * ERROR: cross-armv7a-hardfloat-linux-gnueabi/gcc-4.7.1 failed (compile phase):
 *   emake failed with all
 *
 * Call stack:
 *     ebuild.sh, line   85:  Called src_compile
 *   environment, line 4038:  Called toolchain_src_compile
 *   environment, line 4685:  Called gcc_do_make
 *   environment, line 2351:  Called die
 * The specific snippet of code:
 *       emake LDFLAGS="${LDFLAGS}" STAGE1_CFLAGS="${STAGE1_CFLAGS}" LIBPATH="${LIBPATH}" BOOT_CFLAGS="${BOOT_CFLAGS}" ${GCC_MAKE_TARGET} || die "emake failed with ${GCC_MAKE_TARGET}";
 *
 * If you need support, post the output of `emerge --info '=cross-armv7a-hardfloat-linux-gnueabi/gcc-4.7.1'`,
 * the complete build log and the output of `emerge -pqv '=cross-armv7a-hardfloat-linux-gnueabi/gcc-4.7.1'`.
 * This ebuild is from an overlay named 'local': '/usr/local/portage/overlay/'
 *
 * Please include /var/tmp/portage/cross-armv7a-hardfloat-linux-gnueabi/gcc-4.7.1/work/build/gcc-build-logs.tar.bz2 in your bug report
 *
 * The complete build log is located at '/var/tmp/portage/cross-armv7a-hardfloat-linux-gnueabi/gcc-4.7.1/temp/build.log'.
 * The ebuild environment file is located at '/var/tmp/portage/cross-armv7a-hardfloat-linux-gnueabi/gcc-4.7.1/temp/environment'.
 * Working directory: '/var/tmp/portage/cross-armv7a-hardfloat-linux-gnueabi/gcc-4.7.1/work/build'
 * S: '/var/tmp/portage/cross-armv7a-hardfloat-linux-gnueabi/gcc-4.7.1/work/build'
_



# emerge -pv1 cross-armv7a-hardfloat-linux-gnueabi/gcc sys-devel/gcc

These are the packages that would be merged, in order:

Calculating dependencies                              ... done!
[ebuild   R   #] sys-devel/gcc-4.7.1  USE="cxx fortran mudflap nls nptl openmp (-altivec) -bootstrap -build -doc (-fixed-point) -gcj -go -graphite -gtk (-hardened) (-libssp) (-multilib) -multislot -nocxx -nopie -nossp -objc -objc++ -objc-gc -test -vanilla" 0 kB
[ebuild   R   *] cross-armv7a-hardfloat-linux-gnueabi/gcc-4.7.1::local  USE="cxx* fortran* gtk* mudflap* nls nptl openmp* (-altivec) -bootstrap -build -doc (-fixed-point) -gcj -go -graphite -hardened -libssp -multilib -multislot -nocxx* -nopie -nossp -objc -objc++ -objc-gc -test -vanilla" 0 kB


Reproducible: Always
Comment 1 Xavier Miller (RETIRED) gentoo-dev 2012-06-27 12:28:42 UTC
emerge --info
Portage 2.2.0_alpha113 (default/linux/x86/10.0, gcc-4.7.1, glibc-2.15-r2, 3.4.4-gentoo i686)
=================================================================
System uname: Linux-3.4.4-gentoo-i686-Intel-R-_Atom-TM-_CPU_N270_@_1.60GHz-with-gentoo-2.1
Timestamp of tree: Tue, 26 Jun 2012 15:00:01 +0000
distcc 3.1 i686-gentoo-linux-gnu [enabled]
app-shells/bash:          4.2_p29
dev-java/java-config:     2.1.12
dev-lang/python:          2.7.3-r2, 3.2.3-r1
dev-util/cmake:           2.8.8-r3
dev-util/pkgconfig:       0.26
sys-apps/baselayout:      2.1-r1
sys-apps/openrc:          0.10.3
sys-apps/sandbox:         2.5
sys-devel/autoconf:       2.13, 2.69
sys-devel/automake:       1.11.5, 1.12.1
sys-devel/binutils:       2.22-r1
sys-devel/gcc:            4.7.1
sys-devel/gcc-config:     1.7.3
sys-devel/libtool:        2.4.2
sys-devel/make:           3.82-r3
sys-kernel/linux-headers: 3.4 (virtual/os-headers)
sys-libs/glibc:           2.15-r2
Repositories: gentoo local pd-overlay proaudio
ACCEPT_KEYWORDS="x86 ~x86"
ACCEPT_LICENSE="@FREE freedist"
CBUILD="i686-gentoo-linux-gnu"
CFLAGS="-O2 -pipe -fomit-frame-pointer -march=prescott -mtune=generic"
CHOST="i686-gentoo-linux-gnu"
CONFIG_PROTECT="/etc /usr/share/gnupg/qualified.txt"
CONFIG_PROTECT_MASK="${EPREFIX}/etc/gconf /etc/ca-certificates.conf /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="-O2 -pipe -fomit-frame-pointer -march=prescott -mtune=generic"
DISTDIR="/var/portage/distfiles"
EMERGE_DEFAULT_OPTS="--with-bdeps y --buildpkg --quiet-build=n"
FCFLAGS="-O2 -march=i686 -pipe"
FEATURES="assume-digests binpkg-logs buildpkg candy config-protect-if-modified distcc distcc-pump distlocks ebuild-locks fixlafiles news parallel-fetch parse-eapi-ebuild-head preserve-libs protect-owned sandbox sfperms strict unknown-features-warn unmerge-logs unmerge-orphans userfetch"
FFLAGS="-O2 -march=i686 -pipe"
GENTOO_MIRRORS="ftp://ftp.belnet.be/mirror/rsync.gentoo.org/gentoo/"
LANG="fr_BE.UTF-8"
LDFLAGS="-Wl,-O1 -Wl,--sort-common -Wl,--hash-style=gnu -Wl,--as-needed"
LINGUAS="fr"
MAKEOPTS="-j7"
PKGDIR="/var/portage/packages"
PORTAGE_CONFIGROOT="/"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --stats --human-readable --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/usr/local/portage/overlay /var/lib/layman/pd-overlay /var/lib/layman/pro-audio"
SYNC="rsync://rsync.gentoo.org/gentoo-portage"
USE="X aac acl alsa amr apng branding btrfs bzip2 cairo cli consolekit cracklib crypt cups cxx dbus device-mapper dri dssi encode exif fat ffmpeg fftw flac fortran gif gpm gstreamer gtk gtk3 gudev hwdb iconv id3tag imlib jack jpeg ladspa lame libsamplerate lxde mmx modules mp3 mpeg mudflap ncurses nls nptl ntfs ogg opengl openmp osc pam pcre pdf png policykit pppd qt3support qt4 readline rubberband samba sdl session sna sqlite sse sse2 ssl ssse3 svg tcpd threads tiff truetype udev unicode usb vorbis wmf x264 x86 xcb xetex xorg xvid zlib" ALSA_CARDS="hda-intel usb-audio virmidi" ALSA_PCM_PLUGINS="adpcm alaw asym copy dmix dshare dsnoop empty extplug file hooks iec958 ioplug ladspa lfloat linear meter mmap_emul mulaw multi null plug rate route share shm softvol" APACHE2_MODULES="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" CAMERAS="ptp2" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" DVB_CARDS="usb-af9015" 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 ubx" INPUT_DEVICES="keyboard mouse evdev synaptics" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer" LINGUAS="fr" PHP_TARGETS="php5-3" PYTHON_TARGETS="python3_2 python2_7" QEMU_SOFTMMU_TARGETS="arm i386 x86_64" QEMU_USER_TARGETS="arm i386 x86_64" RUBY_TARGETS="ruby19" USERLAND="GNU" VIDEO_CARDS="intel" 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:  CPPFLAGS, CTARGET, INSTALL_MASK, LC_ALL, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS, USE_PYTHON
Comment 2 Xavier Miller (RETIRED) gentoo-dev 2012-06-27 12:31:04 UTC
Created attachment 316421 [details]
build.log.gz
Comment 3 Xavier Miller (RETIRED) gentoo-dev 2012-06-27 12:33:02 UTC
It worked on an x86_64 configuration.
Comment 4 Xavier Miller (RETIRED) gentoo-dev 2012-06-27 12:54:17 UTC
it passes whith USE="-fortran"
Comment 5 Jeroen Roovers (RETIRED) gentoo-dev 2012-06-27 14:08:04 UTC
checking whether the GNU Fortran compiler is working... no
configure: error: GNU Fortran is not working; please report a bug in http://gcc.gnu.org/bugzilla, attaching /var/tmp/portage/cross-a
rmv7a-hardfloat-linux-gnueabi/gcc-4.7.1/work/build/armv7a-hardfloat-linux-gnueabi/libgfortran/config.log
make[1]: *** [configure-target-libgfortran] Erreur 1

Could you attach that file here, please?
Comment 6 Jeroen Roovers (RETIRED) gentoo-dev 2012-06-27 15:25:03 UTC
Created attachment 316455 [details]
/var/tmp/portage/cross-hppa2.0-unknown-linux-gnu/gcc-4.5.3-r2/work/build/hppa2.0-unknown-linux-gnu/libgfortran/config.log
Comment 7 Jeroen Roovers (RETIRED) gentoo-dev 2012-06-27 15:26:57 UTC
Created attachment 316457 [details]
cross-hppa2.0-unknown-linux-gnu:gcc-4.5.3-r2:20120627-131129.log.gz
Comment 8 Jeroen Roovers (RETIRED) gentoo-dev 2012-06-27 17:46:54 UTC
*** Bug 423853 has been marked as a duplicate of this bug. ***
Comment 9 Jeroen Roovers (RETIRED) gentoo-dev 2012-06-28 13:24:50 UTC
*** Bug 423959 has been marked as a duplicate of this bug. ***
Comment 10 SpanKY gentoo-dev 2012-08-12 04:39:24 UTC
probably because you have optimized settings in your fortran flags and the gcc ebuilds don't filter those flags
Comment 11 SpanKY gentoo-dev 2012-09-14 17:42:06 UTC
*** Bug 435032 has been marked as a duplicate of this bug. ***
Comment 12 Chí-Thanh Christopher Nguyễn gentoo-dev 2012-09-14 23:41:02 UTC
The optimized settings are from arch/x86/make.defaults:

CFLAGS="-O2 -march=i686 -pipe"
CXXFLAGS="${CFLAGS}"
FFLAGS="${CFLAGS}"
FCFLAGS="${CFLAGS}"
Comment 13 SpanKY gentoo-dev 2012-09-18 20:08:18 UTC
*** Bug 435374 has been marked as a duplicate of this bug. ***
Comment 14 matt black 2012-10-21 17:56:06 UTC
Sounds like this bug...   http://gcc.gnu.org/bugzilla/show_bug.cgi?id=25672
Comment 15 SpanKY gentoo-dev 2012-11-04 19:04:07 UTC
*** Bug 441738 has been marked as a duplicate of this bug. ***
Comment 16 SpanKY gentoo-dev 2012-11-05 10:11:48 UTC
it's not failing for me for some reason.  you could try this patch:

--- toolchain.eclass    2 Nov 2012 20:18:11 -0000       1.553
+++ toolchain.eclass    5 Nov 2012 10:11:30 -0000
@@ -1398,6 +1398,8 @@ gcc_do_filter_flags() {
        if is_crosscompile ; then
                # Set this to something sane for both native and target
                CFLAGS="-O2 -pipe"
+               FFLAGS=${CFLAGS}
+               FCFLAGS=${CFLAGS}
 
                local VAR="CFLAGS_"${CTARGET//-/_}
                CXXFLAGS=${!VAR}
Comment 17 Chí-Thanh Christopher Nguyễn gentoo-dev 2012-11-05 10:40:39 UTC
(In reply to comment #16)
> it's not failing for me for some reason.  you could try this patch:
Are you on x86? The problem does not exist on amd64.
Comment 18 SpanKY gentoo-dev 2012-11-08 07:58:39 UTC
(In reply to comment #17)

i used an x86 chroot

if the problem exists for you, please try the patch and report back
Comment 19 SpanKY gentoo-dev 2012-11-19 03:00:03 UTC
well, no one responded, so i'll just assume it fixes things

http://sources.gentoo.org/eclass/toolchain.eclass?r1=1.553&r2=1.554