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 | 0690b00f733a6588a8e25e2bb74cd9b133e80529 (patch) | |
tree | 409944169800cb6eeb37d021f35bab9d0d4d04aa /eclass/tests | |
parent | fixing download location in 9999 ebuild so it renames safely (diff) | |
download | gentoo-2-0690b00f733a6588a8e25e2bb74cd9b133e80529.tar.gz gentoo-2-0690b00f733a6588a8e25e2bb74cd9b133e80529.tar.bz2 gentoo-2-0690b00f733a6588a8e25e2bb74cd9b133e80529.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 |