/[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.135 Revision 1.137
1# Copyright 1999-2015 Gentoo Foundation 1# Copyright 1999-2015 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.135 2015/03/16 21:12:27 vapier Exp $ 3# $Header: /var/cvsroot/gentoo-x86/eclass/toolchain-funcs.eclass,v 1.137 2015/04/13 05:38:17 vapier 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
221# @USAGE: [compiler variables] 221# @USAGE: [compiler variables]
222# @DESCRIPTION: 222# @DESCRIPTION:
223# Export common build related compiler settings. 223# Export common build related compiler settings.
224tc-export_build_env() { 224tc-export_build_env() {
225 tc-export "$@" 225 tc-export "$@"
226 # Some build envs will initialize vars like:
227 # : ${BUILD_LDFLAGS:-${LDFLAGS}}
228 # So make sure all variables are non-empty. #526734
226 : ${BUILD_CFLAGS:=-O1 -pipe} 229 : ${BUILD_CFLAGS:=-O1 -pipe}
227 : ${BUILD_CXXFLAGS:=-O1 -pipe} 230 : ${BUILD_CXXFLAGS:=-O1 -pipe}
228 : ${BUILD_CPPFLAGS:=} 231 : ${BUILD_CPPFLAGS:= }
229 : ${BUILD_LDFLAGS:=} 232 : ${BUILD_LDFLAGS:= }
230 export BUILD_{C,CXX,CPP,LD}FLAGS 233 export BUILD_{C,CXX,CPP,LD}FLAGS
231 234
232 # Some packages use XXX_FOR_BUILD. 235 # Some packages use XXX_FOR_BUILD.
233 local v 236 local v
234 for v in BUILD_{C,CXX,CPP,LD}FLAGS ; do 237 for v in BUILD_{C,CXX,CPP,LD}FLAGS ; do
347 fi 350 fi
348 351
349 ewarn "Forcing usage of the BFD linker instead of GOLD" 352 ewarn "Forcing usage of the BFD linker instead of GOLD"
350 353
351 # Set up LD to point directly to bfd if it's available. 354 # Set up LD to point directly to bfd if it's available.
355 # We need to extract the first word in case there are flags appended
356 # to its value (like multilib). #545218
352 local bfd_ld="$(tc-getLD "$@").bfd" 357 local ld=$(tc-getLD "$@")
358 local bfd_ld="${ld%% *}.bfd"
353 local path_ld=$(which "${bfd_ld}" 2>/dev/null) 359 local path_ld=$(which "${bfd_ld}" 2>/dev/null)
354 [[ -e ${path_ld} ]] && export LD=${bfd_ld} 360 [[ -e ${path_ld} ]] && export LD=${bfd_ld}
355 361
356 # Set up LDFLAGS to select gold based on the gcc version. 362 # Set up LDFLAGS to select gold based on the gcc version.
357 local major=$(gcc-major-version "$@") 363 local major=$(gcc-major-version "$@")

Legend:
Removed from v.1.135  
changed lines
  Added in v.1.137

  ViewVC Help
Powered by ViewVC 1.1.20