/[gentoo-x86]/eclass/flag-o-matic.eclass
Gentoo

Diff of /eclass/flag-o-matic.eclass

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

Revision 1.173 Revision 1.177
1# Copyright 1999-2012 Gentoo Foundation 1# Copyright 1999-2012 Gentoo Foundation
2# Distributed under the terms of the GNU General Public License v2 2# Distributed under the terms of the GNU General Public License v2
3# $Header: /var/cvsroot/gentoo-x86/eclass/flag-o-matic.eclass,v 1.173 2012/05/31 00:29:06 vapier Exp $ 3# $Header: /var/cvsroot/gentoo-x86/eclass/flag-o-matic.eclass,v 1.177 2012/06/23 22:21:50 vapier Exp $
4 4
5# @ECLASS: flag-o-matic.eclass 5# @ECLASS: flag-o-matic.eclass
6# @MAINTAINER: 6# @MAINTAINER:
7# toolchain@gentoo.org 7# toolchain@gentoo.org
8# @BLURB: common functions to manipulate and query toolchain flags 8# @BLURB: common functions to manipulate and query toolchain flags
18# Return all the flag variables that our high level funcs operate on. 18# Return all the flag variables that our high level funcs operate on.
19all-flag-vars() { 19all-flag-vars() {
20 echo {C,CPP,CXX,CCAS,F,FC,LD}FLAGS 20 echo {C,CPP,CXX,CCAS,F,FC,LD}FLAGS
21} 21}
22 22
23# {C,CXX,F,FC}FLAGS that we allow in strip-flags 23# {C,CPP,CXX,CCAS,F,FC,LD}FLAGS that we allow in strip-flags
24# Note: shell globs and character lists are allowed 24# Note: shell globs and character lists are allowed
25setup-allowed-flags() { 25setup-allowed-flags() {
26 ALLOWED_FLAGS="-pipe" 26 ALLOWED_FLAGS="-pipe"
27 ALLOWED_FLAGS+=" -O -O1 -O2 -Os -mcpu -march -mtune" 27 ALLOWED_FLAGS+=" -O -O1 -O2 -Os -mcpu -march -mtune"
28 ALLOWED_FLAGS+=" -fstack-protector -fstack-protector-all" 28 ALLOWED_FLAGS+=" -fstack-protector -fstack-protector-all"
43 -msoft-float -mno-soft-float -mhard-float -mno-hard-float -mfpu \ 43 -msoft-float -mno-soft-float -mhard-float -mno-hard-float -mfpu \
44 -mieee -mieee-with-inexact -mschedule -mfloat-gprs -mspe -mno-spe \ 44 -mieee -mieee-with-inexact -mschedule -mfloat-gprs -mspe -mno-spe \
45 -mtls-direct-seg-refs -mno-tls-direct-seg-refs -mflat -mno-flat \ 45 -mtls-direct-seg-refs -mno-tls-direct-seg-refs -mflat -mno-flat \
46 -mno-faster-structs -mfaster-structs -m32 -m64 -mx32 -mabi \ 46 -mno-faster-structs -mfaster-structs -m32 -m64 -mx32 -mabi \
47 -mlittle-endian -mbig-endian -EL -EB -fPIC -mlive-g0 -mcmodel \ 47 -mlittle-endian -mbig-endian -EL -EB -fPIC -mlive-g0 -mcmodel \
48 -mstack-bias -mno-stack-bias -msecure-plt -m*-toc -D* -U*" 48 -mstack-bias -mno-stack-bias -msecure-plt -m*-toc -mfloat-abi=* \
49 -D* -U*"
49 50
50 # 4.5 51 # 4.5
51 ALLOWED_FLAGS+=" -mno-fma4 -mno-movbe -mno-xop -mno-lwp" 52 ALLOWED_FLAGS+=" -mno-fma4 -mno-movbe -mno-xop -mno-lwp"
52 # 4.6 53 # 4.6
53 ALLOWED_FLAGS+=" -mno-fsgsbase -mno-rdrnd -mno-f16c -mno-bmi -mno-tbm" 54 ALLOWED_FLAGS+=" -mno-fsgsbase -mno-rdrnd -mno-f16c -mno-bmi -mno-tbm"
55 # 4.7
56 ALLOWED_FLAGS+=" -mno-avx2 -mno-bmi2 -mno-fma -mno-lzcnt"
57
58 # CPPFLAGS and LDFLAGS
59 ALLOWED_FLAGS+=" -I* -L* -R* -Wl,*"
54 60
55 export ALLOWED_FLAGS 61 export ALLOWED_FLAGS
56 return 0 62 return 0
57} 63}
58 64
189append-ldflags() { 195append-ldflags() {
190 [[ $# -eq 0 ]] && return 0 196 [[ $# -eq 0 ]] && return 0
191 local flag 197 local flag
192 for flag in "$@"; do 198 for flag in "$@"; do
193 [[ ${flag} == -l* ]] && \ 199 [[ ${flag} == -l* ]] && \
194 ewarn "Appending a library link instruction (${flag}); libraries to link to should not be passed through LDFLAGS" 200 eqawarn "Appending a library link instruction (${flag}); libraries to link to should not be passed through LDFLAGS"
195 done 201 done
196 202
197 export LDFLAGS="${LDFLAGS} $*" 203 export LDFLAGS="${LDFLAGS} $*"
198 return 0 204 return 0
199} 205}
339 return 0 345 return 0
340} 346}
341 347
342# @FUNCTION: strip-flags 348# @FUNCTION: strip-flags
343# @DESCRIPTION: 349# @DESCRIPTION:
344# Strip C[XX]FLAGS of everything except known good/safe flags. 350# Strip *FLAGS of everything except known good/safe flags. This runs over all
351# flags returned by all_flag_vars().
345strip-flags() { 352strip-flags() {
346 local x y var 353 local x y var
347 354
348 setup-allowed-flags 355 setup-allowed-flags
349 356

Legend:
Removed from v.1.173  
changed lines
  Added in v.1.177

  ViewVC Help
Powered by ViewVC 1.1.20