Gentoo Archives: gentoo-dev

From: "vivo75@×××××.com" <vivo75@×××××.com>
To: gentoo-dev@l.g.o
Subject: [gentoo-dev] [RFC] gcc-native-flags() proposal addition to toolchain-funcs.eclass
Date: Wed, 20 Jun 2012 15:58:05
Message-Id: 4FE1F2CA.7010204@gmail.com
1 Meeting with bug: #409471 suggested that some ebuilds could benefit from
2 expanding -march=native to the actual flags the compiler use.
3 Cannot suggest where to use it at the moment, but implementation was
4 simple enough and possibly someone on this list could have a use for it.
5
6 # @FUNCTION: gcc-native-flags
7 # @USAGE: [CC compiler]
8 # @RETURN: 1st march 2nd mtune >=3rd flags
9 gcc-native-flags()
10
11 gcc-native-flags can take an argument, the compiler to use, then return
12 something in the form:
13 -march=corei7-avx -mtune=generic -mcx16 [...] --param=l2-cache-size=8192
14
15 issues so far:
16 1) "--param l2-cache-size=8192" become "--param=l2-cache-size=8192",
17 notice the space become an "=", this work and indeed I've encountered
18 broken packages that didn't compile with -param\ ... form
19 2) what to do if $CC is not gcc / how to check cc is gcc
20 3) there are redundant flags, they are kept for simplicity
21 4) array usage is not really needed, just being a port of a python
22 version it was natural this way ;-)
23 5) better name?
24
25 #409471 "dev-python/pypy-1.8-r1 CFLAGS=-march=native fails to compile"
26 https://bugs.gentoo.org/show_bug.cgi?id=409471
27
28 the attached file could be launched as is, it fake inherit some eclass
29 and calls the function with available gcc
30
31 thanks,
32 Francesco Riosa

Attachments

File name MIME type
hw-cflags.sh application/x-shellscript

Replies