Re: [gentoo-dev] [RFC] gcc-native-flags() proposal addition to toolchain-funcs.eclass

2012-06-23 Thread Mike Frysinger
On Wednesday 20 June 2012 11:56:58 viv...@gmail.com wrote:
> Meeting with bug: #409471 suggested that some ebuilds could benefit from
> expanding -march=native to the actual flags the compiler use.

i can't really see how.  if packages can't handle certain flags, then fix 
those.  
so NAK on adding anything like this to a common eclass.
-mike


signature.asc
Description: This is a digitally signed message part.


Re: [gentoo-dev] [RFC] gcc-native-flags() proposal addition to toolchain-funcs.eclass

2012-06-22 Thread Marien Zwart
On wo, 2012-06-20 at 17:56 +0200, viv...@gmail.com wrote:
> #409471  "dev-python/pypy-1.8-r1 CFLAGS=-march=native fails to
> compile"
> https://bugs.gentoo.org/show_bug.cgi?id=409471

Thanks, but currently I do not think we quite need this: I do not think
we should use a whitelist of known-working flags for pypy, and rather
than blacklisting known-broken flags I am optimistic about just getting
them fixed upstream reasonably quickly. And I hope we're done with these
for the time being, until another cpu or gcc version comes along. If
more bugs like this surface and we can't get support added by upstream
reasonably quickly I'll see about using this to fail early, though.

-- 
Marien Zwart




[gentoo-dev] [RFC] gcc-native-flags() proposal addition to toolchain-funcs.eclass

2012-06-20 Thread viv...@gmail.com
Meeting with bug: #409471 suggested that some ebuilds could benefit from 
expanding -march=native to the actual flags the compiler use.
Cannot suggest where to use it at the moment, but implementation was 
simple enough and possibly someone on this list could have a use for it.


# @FUNCTION: gcc-native-flags
# @USAGE: [CC compiler]
# @RETURN: 1st march 2nd mtune >=3rd flags
gcc-native-flags()

gcc-native-flags can take an argument, the compiler to use, then return 
something in the form:

-march=corei7-avx -mtune=generic -mcx16 [...] --param=l2-cache-size=8192

issues so far:
1) "--param l2-cache-size=8192" become "--param=l2-cache-size=8192", 
notice the space become an "=", this work and indeed I've encountered 
broken packages that didn't compile with -param\ ... form

2) what to do if $CC is not gcc / how to check cc is gcc
3) there are redundant flags, they are kept for simplicity
4) array usage is not really needed, just being a port of a python 
version it was natural this way ;-)

5) better name?

#409471  "dev-python/pypy-1.8-r1 CFLAGS=-march=native fails to compile"
https://bugs.gentoo.org/show_bug.cgi?id=409471

the attached file could be launched as is, it fake inherit some eclass 
and calls the function with available gcc


thanks,
Francesco Riosa



hw-cflags.sh
Description: application/shellscript