Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 13907 - bug in gcc.eclass, function gcc2_flags()
Summary: bug in gcc.eclass, function gcc2_flags()
Status: RESOLVED FIXED
Alias: None
Product: Portage Development
Classification: Unclassified
Component: Unclassified (show other bugs)
Hardware: x86 All
: High normal
Assignee: Martin Schlemmer (RETIRED)
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2003-01-14 07:15 UTC by Jukka Salmi
Modified: 2011-10-30 22:20 UTC (History)
1 user (show)

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


Attachments
patch for gcc.eclass v 1.8 (gcc.eclass.patch,1.10 KB, patch)
2003-01-14 07:26 UTC, Jukka Salmi
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Jukka Salmi 2003-01-14 07:15:32 UTC
gcc2_flags() may produce non-working flags. if CFLAGS is set to "-march=pentium
-pipe" for example, it is replaced by "-march=i686-pipe", which is definitely
wrong (pentium != i686, and missing space between options). when compiling
gcc-2.95-r8 on a pentium system, this leads to "illegal instructions" and the
build fails.

here is a correct gcc2_flags():

gcc2_flags() {
        CFLAGS=${CFLAGS//pentium-mmx/i586}
        CFLAGS=${CFLAGS//pentium[234]/i686}
        CFLAGS=${CFLAGS//k6-[23]/k6}
        CFLAGS=${CFLAGS//athlon-tbird/i686}
        CFLAGS=${CFLAGS//athlon-4/i686}
        CFLAGS=${CFLAGS//athlon-[xm]p/i686}
        CFLAGS=${CFLAGS//athlon/i686}

        CXXFLAGS=${CXXFLAGS//pentium-mmx/i586}
        CXXFLAGS=${CXXFLAGS//pentium[234]/i686}
        CXXFLAGS=${CXXFLAGS//k6-[23]/k6}
        CXXFLAGS=${CXXFLAGS//athlon-tbird/i686}
        CXXFLAGS=${CXXFLAGS//athlon-4/i686}
        CXXFLAGS=${CXXFLAGS//athlon-[xm]p/i686}
        CXXFLAGS=${CXXFLAGS//athlon/i686}
        
        export CFLAGS CXXFLAGS
} 

greetings, jukka
Comment 1 Jukka Salmi 2003-01-14 07:26:18 UTC
Created attachment 7293 [details, diff]
patch for gcc.eclass v 1.8
Comment 2 Martin Holzer (RETIRED) gentoo-dev 2003-01-14 08:11:22 UTC
why remove pentiumpro and classics pentium ?
Comment 3 Jukka Salmi 2003-01-14 08:21:55 UTC
'pentium' and 'pentiumpro' are valid options vor gcc3 AND gcc2 (see gcc2 info:
Invoking GCC -> Submodel Options -> i386 Options).
Comment 4 Jukka Salmi 2003-01-18 11:41:15 UTC
here's a complete list of all i386 options of gcc2 and gcc3, so you can see what
has to be changed in gcc2_flags() (what my patch already does):

gcc2			gcc3
----			----
i386			i386
i486			i486
i586 (pentium)		i586 (pentium)
i686 (pentiumpro)	i686 (pentiumpro)
			pentium-mmx
			pentium2
			pentium3
			pentium4
k6			k6
			k6-2
			k6-3
			athlon
			athlon-tbird
			athlon-4
			athlon-xp
			athlon-mp
Comment 5 Martin Schlemmer (RETIRED) gentoo-dev 2003-01-19 17:36:09 UTC
Commited, thanks.