diff options
author | Mike Frysinger <vapier@gentoo.org> | 2015-03-16 21:12:27 +0000 |
---|---|---|
committer | Mike Frysinger <vapier@gentoo.org> | 2015-03-16 21:12:27 +0000 |
commit | bbffbe6415bc4128a9e1ab647d0d8497b5d11b45 (patch) | |
tree | 0c1ea97886353fd690972f13ca2ac609bdafb1c7 /eclass/tests | |
parent | fixing download location in 9999 ebuild so it renames safely (diff) | |
download | historical-bbffbe6415bc4128a9e1ab647d0d8497b5d11b45.tar.gz historical-bbffbe6415bc4128a9e1ab647d0d8497b5d11b45.tar.bz2 historical-bbffbe6415bc4128a9e1ab647d0d8497b5d11b45.zip |
tc-ld-is-gold/tc-ld-disable-gold: add helpers for detecting & disabling gold
Diffstat (limited to 'eclass/tests')
-rwxr-xr-x | eclass/tests/toolchain-funcs.sh | 55 |
1 files changed, 54 insertions, 1 deletions
diff --git a/eclass/tests/toolchain-funcs.sh b/eclass/tests/toolchain-funcs.sh index d8fb97e5bc73..af440325990d 100755 --- a/eclass/tests/toolchain-funcs.sh +++ b/eclass/tests/toolchain-funcs.sh @@ -51,9 +51,62 @@ do if [[ ${actual} != ${exp:-${CHOST}} ]] ; then eerror "Failure for CHOST: ${CHOST} Expected: ${exp} != Actual: ${actual}" - ((++ret)) + : $((++ret)) fi done tend ${ret} +# +# TEST: tc-ld-is-gold +# +tbegin "tc-ld-is-gold (bfd selected)" +LD=ld.bfd tc-ld-is-gold && ret=1 || ret=0 +tend ${ret} + +tbegin "tc-ld-is-gold (gold selected)" +LD=ld.gold tc-ld-is-gold +ret=$? +tend ${ret} + +tbegin "tc-ld-is-gold (bfd selected via flags)" +LD=ld.gold LDFLAGS=-fuse-ld=bfd tc-ld-is-gold +ret=$? +tend ${ret} + +tbegin "tc-ld-is-gold (gold selected via flags)" +LD=ld.bfd LDFLAGS=-fuse-ld=gold tc-ld-is-gold +ret=$? +tend ${ret} + +# +# TEST: tc-ld-disable-gold +# +tbegin "tc-ld-disable-gold (bfd selected)" +( +export LD=ld.bfd LDFLAGS= +ewarn() { :; } +tc-ld-disable-gold +[[ ${LD} == "ld.bfd" && -z ${LDFLAGS} ]] +) +tend $? + +tbegin "tc-ld-disable-gold (gold selected)" +( +export LD=ld.gold LDFLAGS= +ewarn() { :; } +tc-ld-disable-gold +[[ ${LD} == "ld.bfd" || ${LDFLAGS} == *"-fuse-ld=bfd"* ]] +) +tend $? + +tbegin "tc-ld-disable-gold (gold selected via flags)" +( +export LD= LDFLAGS="-fuse-ld=gold" +ewarn() { :; } +tc-ld-disable-gold +[[ ${LD} == *"/ld.bfd" || ${LDFLAGS} == "-fuse-ld=gold -fuse-ld=bfd" ]] +) +tend $? + + texit |