/[gentoo-x86]/eclass/toolchain-funcs.eclass
Gentoo

Diff of /eclass/toolchain-funcs.eclass

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

Revision 1.126 Revision 1.129
1# Copyright 1999-2014 Gentoo Foundation 1n Copyright 1999-2014 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/toolchain-funcs.eclass,v 1.126 2014/01/17 03:46:31 vapier Exp $ 3# $Header: /var/cvsroot/gentoo-x86/eclass/toolchain-funcs.eclass,v 1.129 2014/10/15 22:30:56 blueness Exp $
4 4
5# @ECLASS: toolchain-funcs.eclass 5# @ECLASS: toolchain-funcs.eclass
6# @MAINTAINER: 6# @MAINTAINER:
7# Toolchain Ninjas <toolchain@gentoo.org> 7# Toolchain Ninjas <toolchain@gentoo.org>
8# @BLURB: functions to query common info about the toolchain 8# @BLURB: functions to query common info about the toolchain
11# for gleaning useful information about the toolchain and to simplify 11# for gleaning useful information about the toolchain and to simplify
12# ugly things like cross-compiling and multilib. All of this is done 12# ugly things like cross-compiling and multilib. All of this is done
13# in such a way that you can rely on the function always returning 13# in such a way that you can rely on the function always returning
14# something sane. 14# something sane.
15 15
16if [[ ${___ECLASS_ONCE_TOOLCHAIN_FUNCS} != "recur -_+^+_- spank" ]] ; then 16if [[ -z ${_TOOLCHAIN_FUNCS_ECLASS} ]]; then
17___ECLASS_ONCE_TOOLCHAIN_FUNCS="recur -_+^+_- spank" 17_TOOLCHAIN_FUNCS_ECLASS=1
18 18
19inherit multilib 19inherit multilib
20 20
21# tc-getPROG <VAR [search vars]> <default> [tuple] 21# tc-getPROG <VAR [search vars]> <default> [tuple]
22_tc-getPROG() { 22_tc-getPROG() {
167} 167}
168 168
169# @FUNCTION: tc-is-cross-compiler 169# @FUNCTION: tc-is-cross-compiler
170# @RETURN: Shell true if we are using a cross-compiler, shell false otherwise 170# @RETURN: Shell true if we are using a cross-compiler, shell false otherwise
171tc-is-cross-compiler() { 171tc-is-cross-compiler() {
172 return $([[ ${CBUILD:-${CHOST}} != ${CHOST} ]]) 172 [[ ${CBUILD:-${CHOST}} != ${CHOST} ]]
173} 173}
174 174
175# @FUNCTION: tc-is-softfloat 175# @FUNCTION: tc-is-softfloat
176# @DESCRIPTION: 176# @DESCRIPTION:
177# See if this toolchain is a softfloat based one. 177# See if this toolchain is a softfloat based one.
208# otherwise. 208# otherwise.
209tc-is-static-only() { 209tc-is-static-only() {
210 local host=${CTARGET:-${CHOST}} 210 local host=${CTARGET:-${CHOST}}
211 211
212 # *MiNT doesn't have shared libraries, only platform so far 212 # *MiNT doesn't have shared libraries, only platform so far
213 return $([[ ${host} == *-mint* ]]) 213 [[ ${host} == *-mint* ]]
214} 214}
215 215
216# @FUNCTION: tc-export_build_env 216# @FUNCTION: tc-export_build_env
217# @USAGE: [compiler variables] 217# @USAGE: [compiler variables]
218# @DESCRIPTION: 218# @DESCRIPTION:
576 576
577# Returns true if gcc sets relro 577# Returns true if gcc sets relro
578gcc-specs-relro() { 578gcc-specs-relro() {
579 local directive 579 local directive
580 directive=$(gcc-specs-directive link_command) 580 directive=$(gcc-specs-directive link_command)
581 return $([[ "${directive/\{!norelro:}" != "${directive}" ]]) 581 [[ "${directive/\{!norelro:}" != "${directive}" ]]
582} 582}
583# Returns true if gcc sets now 583# Returns true if gcc sets now
584gcc-specs-now() { 584gcc-specs-now() {
585 local directive 585 local directive
586 directive=$(gcc-specs-directive link_command) 586 directive=$(gcc-specs-directive link_command)
587 return $([[ "${directive/\{!nonow:}" != "${directive}" ]]) 587 [[ "${directive/\{!nonow:}" != "${directive}" ]]
588} 588}
589# Returns true if gcc builds PIEs 589# Returns true if gcc builds PIEs
590gcc-specs-pie() { 590gcc-specs-pie() {
591 local directive 591 local directive
592 directive=$(gcc-specs-directive cc1) 592 directive=$(gcc-specs-directive cc1)
593 return $([[ "${directive/\{!nopie:}" != "${directive}" ]]) 593 [[ "${directive/\{!nopie:}" != "${directive}" ]]
594} 594}
595# Returns true if gcc builds with the stack protector 595# Returns true if gcc builds with the stack protector
596gcc-specs-ssp() { 596gcc-specs-ssp() {
597 local directive 597 local directive
598 directive=$(gcc-specs-directive cc1) 598 directive=$(gcc-specs-directive cc1)
599 return $([[ "${directive/\{!fno-stack-protector:}" != "${directive}" ]]) 599 [[ "${directive/\{!fno-stack-protector:}" != "${directive}" ]]
600} 600}
601# Returns true if gcc upgrades fstack-protector to fstack-protector-all 601# Returns true if gcc upgrades fstack-protector to fstack-protector-all
602gcc-specs-ssp-to-all() { 602gcc-specs-ssp-to-all() {
603 local directive 603 local directive
604 directive=$(gcc-specs-directive cc1) 604 directive=$(gcc-specs-directive cc1)
605 return $([[ "${directive/\{!fno-stack-protector-all:}" != "${directive}" ]]) 605 [[ "${directive/\{!fno-stack-protector-all:}" != "${directive}" ]]
606} 606}
607# Returns true if gcc builds with fno-strict-overflow 607# Returns true if gcc builds with fno-strict-overflow
608gcc-specs-nostrict() { 608gcc-specs-nostrict() {
609 local directive 609 local directive
610 directive=$(gcc-specs-directive cc1) 610 directive=$(gcc-specs-directive cc1)
611 return $([[ "${directive/\{!fstrict-overflow:}" != "${directive}" ]]) 611 [[ "${directive/\{!fstrict-overflow:}" != "${directive}" ]]
612}
613# Returns true if gcc builds with fstack-check
614gcc-specs-stack-check() {
615 local directive
616 directive=$(gcc-specs-directive cc1)
617 [[ "${directive/\{!fno-stack-check:}" != "${directive}" ]]
612} 618}
613 619
614 620
615# @FUNCTION: gen_usr_ldscript 621# @FUNCTION: gen_usr_ldscript
616# @USAGE: [-a] <list of libs to create linker scripts for> 622# @USAGE: [-a] <list of libs to create linker scripts for>

Legend:
Removed from v.1.126  
changed lines
  Added in v.1.129

  ViewVC Help
Powered by ViewVC 1.1.20