/[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.162 Revision 1.163
1# Copyright 1999-2011 Gentoo Foundation 1# Copyright 1999-2011 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.162 2011/12/28 05:48:28 dirtyepic Exp $ 3# $Header: /var/cvsroot/gentoo-x86/eclass/flag-o-matic.eclass,v 1.163 2011/12/28 06:28:55 dirtyepic 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
30 30
31 31
32# {C,CXX,F,FC}FLAGS that we allow in strip-flags 32# {C,CXX,F,FC}FLAGS that we allow in strip-flags
33# Note: shell globs and character lists are allowed 33# Note: shell globs and character lists are allowed
34setup-allowed-flags() { 34setup-allowed-flags() {
35 if [[ -z ${ALLOWED_FLAGS} ]] ; then
36 export ALLOWED_FLAGS="-pipe" 35 ALLOWED_FLAGS="-pipe"
37 export ALLOWED_FLAGS="${ALLOWED_FLAGS} -O -O1 -O2 -Os -mcpu -march -mtune" 36 ALLOWED_FLAGS+=" -O -O1 -O2 -Os -mcpu -march -mtune"
38 export ALLOWED_FLAGS="${ALLOWED_FLAGS} -fstack-protector -fstack-protector-all" 37 ALLOWED_FLAGS+=" -fstack-protector -fstack-protector-all"
39 export ALLOWED_FLAGS="${ALLOWED_FLAGS} -fbounds-checking -fno-strict-overflow" 38 ALLOWED_FLAGS+=" -fbounds-checking -fno-strict-overflow"
40 export ALLOWED_FLAGS="${ALLOWED_FLAGS} -fno-PIE -fno-pie -fno-unit-at-a-time" 39 ALLOWED_FLAGS+=" -fno-PIE -fno-pie -fno-unit-at-a-time"
41 export ALLOWED_FLAGS="${ALLOWED_FLAGS} -g -g[0-9] -ggdb -ggdb[0-9] -gstabs -gstabs+" 40 ALLOWED_FLAGS+=" -g -g[0-9] -ggdb -ggdb[0-9] -gstabs -gstabs+"
42 export ALLOWED_FLAGS="${ALLOWED_FLAGS} -fno-ident -fpermissive" 41 ALLOWED_FLAGS+=" -fno-ident -fpermissive"
43 export ALLOWED_FLAGS="${ALLOWED_FLAGS} -W* -w" 42 ALLOWED_FLAGS+=" -W* -w"
44 fi 43
45 # allow a bunch of flags that negate features / control ABI 44 # allow a bunch of flags that negate features / control ABI
46 ALLOWED_FLAGS="${ALLOWED_FLAGS} -fno-stack-protector -fno-stack-protector-all \ 45 ALLOWED_FLAGS+=" -fno-stack-protector -fno-stack-protector-all \
47 -fno-strict-aliasing -fno-bounds-checking -fstrict-overflow -fno-omit-frame-pointer" 46 -fno-strict-aliasing -fno-bounds-checking -fstrict-overflow \
47 -fno-omit-frame-pointer"
48 ALLOWED_FLAGS="${ALLOWED_FLAGS} -mregparm -mno-app-regs -mapp-regs \ 48 ALLOWED_FLAGS+=" -mregparm -mno-app-regs -mapp-regs -mno-mmx -mno-sse \
49 -mno-mmx -mno-sse -mno-sse2 -mno-sse3 -mno-ssse3 -mno-sse4 -mno-sse4.1 \ 49 -mno-sse2 -mno-sse3 -mno-ssse3 -mno-sse4 -mno-sse4.1 -mno-sse4.2 \
50 -mno-sse4.2 -mno-avx -mno-aes -mno-pclmul -mno-sse4a -mno-3dnow \ 50 -mno-avx -mno-aes -mno-pclmul -mno-sse4a -mno-3dnow -mno-popcnt \
51 -mno-popcnt -mno-abm \
52 -mips1 -mips2 -mips3 -mips4 -mips32 -mips64 -mips16 -mplt \ 51 -mno-abm -mips1 -mips2 -mips3 -mips4 -mips32 -mips64 -mips16 -mplt \
53 -msoft-float -mno-soft-float -mhard-float -mno-hard-float -mfpu \ 52 -msoft-float -mno-soft-float -mhard-float -mno-hard-float -mfpu \
54 -mieee -mieee-with-inexact -mschedule -mfloat-gprs -mspe -mno-spe \ 53 -mieee -mieee-with-inexact -mschedule -mfloat-gprs -mspe -mno-spe \
55 -mtls-direct-seg-refs -mno-tls-direct-seg-refs \ 54 -mtls-direct-seg-refs -mno-tls-direct-seg-refs -mflat -mno-flat \
56 -mflat -mno-flat -mno-faster-structs -mfaster-structs \ 55 -mno-faster-structs -mfaster-structs -m32 -m64 -mx32 -mabi \
57 -m32 -m64 -mx32 -mabi -mlittle-endian -mbig-endian -EL -EB -fPIC \ 56 -mlittle-endian -mbig-endian -EL -EB -fPIC -mlive-g0 -mcmodel \
58 -mlive-g0 -mcmodel -mstack-bias -mno-stack-bias \ 57 -mstack-bias -mno-stack-bias -msecure-plt -m*-toc -D* -U*"
59 -msecure-plt -m*-toc -D* -U*"
60 58
61 # 4.5 59 # 4.5
62 ALLOWED_FLAGS="${ALLOWED_FLAGS} -mno-fma4 -mno-movbe -mno-xop -mno-lwp" 60 ALLOWED_FLAGS+=" -mno-fma4 -mno-movbe -mno-xop -mno-lwp"
63 # 4.6 61 # 4.6
64 ALLOWED_FLAGS="${ALLOWED_FLAGS} -mno-fsgsbase -mno-rdrnd -mno-f16c \ 62 ALLOWED_FLAGS+=" -mno-fsgsbase -mno-rdrnd -mno-f16c -mno-bmi -mno-tbm"
65 -mno-bmi -mno-tbm"
66 63
64 export ALLOWED_FLAGS
67 return 0 65 return 0
68} 66}
69 67
70# inverted filters for hardened compiler. This is trying to unpick 68# inverted filters for hardened compiler. This is trying to unpick
71# the hardened compiler defaults. 69# the hardened compiler defaults.

Legend:
Removed from v.1.162  
changed lines
  Added in v.1.163

  ViewVC Help
Powered by ViewVC 1.1.20