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

Bug 120220

Summary: genflags outputs inadvisable CFLAGS for amd64?
Product: Portage Development Reporter: Jonathan Coome (RETIRED) <maedhros>
Component: ToolsAssignee: Robin Johnson <robbat2>
Status: RESOLVED WONTFIX    
Severity: normal CC: treecleaner
Priority: High    
Version: unspecified   
Hardware: All   
OS: Linux   
URL: https://forums.gentoo.org/viewtopic-p-3056816.html#3056816
Whiteboard:
Package list:
Runtime testing required: ---

Description Jonathan Coome (RETIRED) gentoo-dev 2006-01-24 14:06:34 UTC
I'd never heard of genflags before until today, but it seems that it is generating potentially inadvisable CFLAGS, and some users may be following them (see the attached link). This is the output I get when running host2flags:

CHOST="x86_64-pc-linux-gnu"
CFLAGS="-m64 -O3 -pipe -fPIC"
CXXFLAGS="-m64 -O3 -pipe -fPIC"

According to the amd64 technotes [1] the -m64 flag is irrelevant in normal usage, and could break anything that compiles things with -m32 internally, and people shouldn't use -fPIC globally.

Perhaps a warning should be issued if this is the case, or the output corrected?

[1] http://www.gentoo.org/proj/en/base/amd64/technotes/index.xml?part=1&chap=3#doc_chap9
Comment 1 Robin Johnson archtester Gentoo Infrastructure gentoo-dev Security 2006-01-24 16:15:37 UTC
yup, genflags is badly out of date.
When I wrote it all arches gave input on what the correct flags were for their systems.

It does badly need updating (a full rewrite actually), but I don't have time for it presently.

My longterm objective is to see what languages are provided in the latest releases again, and re-write all of genflags in it, also providing support for the many newer chips that have come out since genflags was first written.

If you could provide info on all of the newer /proc/cpuinfo for AMD64 machines, and the relevant CFLAGS to use, I'd appreciate it.
Comment 2 Jeremy Olexa (darkside) (RETIRED) archtester gentoo-dev Security 2009-04-17 04:10:34 UTC
Mask message said:

# Robin H. Johnson <robbat2@gentoo.org> (20 Oct 2008)
# Masked for removal in 30 days (see bugs #120220, #137998, #170782)
# genflags should never have been born.  Output needs to be specific per GCC
# version, and that's a big change.
app-portage/genflags

so treecleaners removed it.