Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 56707 - libstdc++-v3 will not compile with -mtune in CFLAGS
Summary: libstdc++-v3 will not compile with -mtune in CFLAGS
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] GCC Porting (show other bugs)
Hardware: All All
: High normal (vote)
Assignee: Gentoo Toolchain Maintainers
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-07-11 10:49 UTC by Mark Loeser (RETIRED)
Modified: 2004-07-13 19:35 UTC (History)
2 users (show)

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Mark Loeser (RETIRED) gentoo-dev 2004-07-11 10:49:49 UTC
-mtune is a new flag for GCC 3.4, so when compiling libstdc++-v3, it will be alright until it starts to use xgcc, which doesn't recognize the flag since its 3.3.3.  At that point, during the configure before it starts to use xgcc, it will say that the compiler can not create executables.
Either -mtune could be replaced with -mcpu in the ebuild, which will give warnings that the flag is deprecated during the first half of the compile, or replaced with -march.
Comment 1 Robert Moss (RETIRED) gentoo-dev 2004-07-11 11:52:55 UTC
Lv, you're a plonker :-P

inherit flag-o-matic
filter-flags -mtune

Something like that required? Also, has the flag-o-matic eclass been updated to handle -mtune (which takes options) properly yet in the same way that it supports -mcpu?
Comment 2 Travis Tilley (RETIRED) gentoo-dev 2004-07-11 12:51:22 UTC
-mcpu also causes bugs if using gcc 3.4, so i'm simply going to filter -mtune here. thanks for reporting this bug :)

robmoss - :P :P :P
Comment 3 Mark Loeser (RETIRED) gentoo-dev 2004-07-11 17:53:23 UTC
# gcc 3.3 doesnt support -mtune on numerous archs, so xgcc will fail
mtsetting="`get-flag mcpu`"
[ ! -z "${mtsetting}" ] && filter-flags -mtune="${setting}"

You seemed to have made a couple of typos here.  I believe it should look like this:

# gcc 3.3 doesnt support -mtune on numerous archs, so xgcc will fail
mtsetting="`get-flag mtune`"
[ ! -z "${mtsetting}" ] && filter-flags -mtune="${mtsetting}"

The get-flag should be mtune, not mcpu, and ${mtsetting}, not ${setting}, in the filter-flags.

Works for me after these changes.
Comment 4 Travis Tilley (RETIRED) gentoo-dev 2004-07-11 21:19:41 UTC
...oops
Comment 5 Kathy Wills 2004-07-13 02:48:22 UTC
This didn't work for me.

checking how to run the C preprocessor...  /var/tmp/portage/libstdc++-v3-3.3.3-r1/work/build/gcc/xgcc -B/var/tmp/portage/libstdc++-v3-3.3.3-r1/work/build/gcc/ -B/usr/i686-pc-linux-gnu/bin/ -B/usr/i686-pc-linux-gnu/lib/ -isystem /usr/i686-pc-linux-gnu/include -E
checking for sys/file.h... yes
checking for sys/param.h... yes
checking for limits.h... yes
checking for stdlib.h... yes
checking for malloc.h... yes
checking for string.h... yes
checking for unistd.h... yes
checking for strings.h... yes
checking for sys/time.h... yes
checking for time.h... yes
checking for sys/resource.h... yes
checking for sys/stat.h... yes
checking for sys/mman.h... yes
checking for fcntl.h... yes
checking for alloca.h... yes
checking for sys/pstat.h... no
checking for sys/sysmp.h... no
checking for sys/sysinfo.h... yes
checking for machine/hal_sysinfo.h... no
checking for sys/table.h... no
checking for sys/sysctl.h... yes
checking for sys/systemcfg.h... no
checking for sys/wait.h that is POSIX.1 compatible... no
checking whether time.h and sys/time.h may both be included... no
checking whether errno must be declared... yes
checking for ANSI C header files... no
checking for uintptr_t... no
checking for pid_t... yes
checking whether the C compiler ( /var/tmp/portage/libstdc++-v3-3.3.3-r1/work/build/gcc/xgcc -B/var/tmp/portage/libstdc++-v3-3.3.3-r1/work/build/gcc/ -B/usr/i686-pc-linux-gnu/bin/ -B/usr/i686-pc-linux-gnu/lib/ -isystem /usr/i686-pc-linux-gnu/include -O2 -march=pentium3 -O2 -pipe -fno-unit-at-a-time ) works... no
configure: error: installation or configuration problem: C compiler cannot create executables.
make: *** [configure-target-libiberty] Error 1

!!! ERROR: sys-libs/libstdc++-v3-3.3.3-r1 failed.
!!! Function src_compile, Line 172, Exitcode 2
!!! (no error message)

Here's my emerge info:

Portage 2.0.50-r9 (default-x86-1.4, gcc-3.4.1, glibc-2.3.4.20040619-r0, 2.6.7-rc3-love2)
=================================================================
System uname: 2.6.7-rc3-love2 i686 Pentium III (Coppermine)
Gentoo Base System version 1.5.1
Autoconf: sys-devel/autoconf-2.59-r4
Automake: sys-devel/automake-1.8.5-r1
ACCEPT_KEYWORDS="x86 ~x86"
AUTOCLEAN="yes"
CFLAGS="-march=pentium3 -mtune=i686 -O2 -funroll-loops -pipe -fno-unit-at-a-time"
CHOST="i686-pc-linux-gnu"
COMPILER="gcc3"
CONFIG_PROTECT="/etc /usr/X11R6/lib/X11/xkb /usr/kde/2/share/config /usr/kde/3/share/config /usr/kde/cvs/share/config /usr/lib/mozilla/defaults/pref /usr/share/config /usr/share/texmf/dvipdfm/config/ /usr/share/texmf/dvips/config/ /usr/share/texmf/tex/generic/config/ /usr/share/texmf/tex/platex/config/ /usr/share/texmf/xdvi/ /var/bind /var/qmail/control"
CONFIG_PROTECT_MASK="/etc/gconf /etc/terminfo /etc/env.d"
CXXFLAGS="-march=pentium3 -mtune=i686 -O2 -funroll-loops -pipe -fno-unit-at-a-time"
DISTDIR="/usr/portage/distfiles"
FEATURES="autoaddcvs ccache sandbox"
GENTOO_MIRRORS="ftp://ftp.ucsb.edu/pub/mirrors/linux/gentoo/ http://mirror.clarkson.edu/pub/distributions/gentoo/"
MAKEOPTS="-j2"
PKGDIR="/usr/portage/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/usr/local/portage /usr/local/bmg-main /usr/local/bmg-gnome-current"
SYNC="rsync://rsync.us.gentoo.org/gentoo-portage"
USE="X alsa apm arts avi berkdb cdr crypt cups doc encode esd foomaticdb gdbm gif gimp gimp-print gphoto2 gtk gtk2 imlib java jpeg kde libg++libwww mad mikmod motif mozilla mpeg ncurses nls nptl oggvorbis opengloss pam pdflib perl png python qt quicktime readline samba sdl slang spell ssl svga tcltk tcpd tetex truetype x86 xml2 xmms xv zlib"
Comment 6 Travis Tilley (RETIRED) gentoo-dev 2004-07-13 06:58:55 UTC
take -fno-unit-at-a-time out of cflags... looks like i'll have to mask this one too
Comment 7 Kathy Wills 2004-07-13 18:58:32 UTC
The cflag -fno-unit-at-a-time is needed for some of my other things to compile.
Comment 8 Mark Loeser (RETIRED) gentoo-dev 2004-07-13 19:05:45 UTC
He meant to remove it while compiling this package, since its not a 3.3.3 flag.  If you resync, the ebuild should filter the flag itself now.
Comment 9 Kathy Wills 2004-07-13 19:35:27 UTC
OK. Thanks. I'll sync and try again asap.