summaryrefslogtreecommitdiffstats
path: root/meta/recipes-devtools/binutils/binutils-testsuite_2.42.bb
diff options
context:
space:
mode:
Diffstat (limited to 'meta/recipes-devtools/binutils/binutils-testsuite_2.42.bb')
-rw-r--r--meta/recipes-devtools/binutils/binutils-testsuite_2.42.bb86
1 files changed, 86 insertions, 0 deletions
diff --git a/meta/recipes-devtools/binutils/binutils-testsuite_2.42.bb b/meta/recipes-devtools/binutils/binutils-testsuite_2.42.bb
new file mode 100644
index 0000000000..f2facd52c3
--- /dev/null
+++ b/meta/recipes-devtools/binutils/binutils-testsuite_2.42.bb
@@ -0,0 +1,86 @@
1# NOTE: This recipe cannot have -cross- in the file name because it triggers
2# the cross build detection in sstate which causes it to use the wrong
3# architecture
4require binutils.inc
5require binutils-${PV}.inc
6
7BPN = "binutils"
8
9DEPENDS += "dejagnu-native expect-native"
10DEPENDS += "binutils-native"
11
12deltask do_compile
13deltask do_install
14
15inherit nopackages
16
17do_configure[dirs] += "${B}/ld ${B}/bfd"
18do_configure() {
19 # create config.h, oe enables initfini-array by default
20 echo "#define HAVE_INITFINI_ARRAY" > ${B}/ld/config.h
21}
22
23# target depends
24DEPENDS += "virtual/${TARGET_PREFIX}binutils"
25DEPENDS += "virtual/${TARGET_PREFIX}gcc"
26DEPENDS += "virtual/${MLPREFIX}${TARGET_PREFIX}compilerlibs"
27DEPENDS += "virtual/${MLPREFIX}libc"
28
29python check_prepare() {
30 def suffix_sys(sys):
31 if sys.endswith("-linux"):
32 return sys + "-gnu"
33 return sys
34
35 def generate_site_exp(d, suite):
36 content = []
37 content.append('set srcdir "{0}/{1}"'.format(d.getVar("S"), suite))
38 content.append('set objdir "{0}/{1}"'.format(d.getVar("B"), suite))
39 content.append('set build_alias "{0}"'.format(d.getVar("BUILD_SYS")))
40 content.append('set build_triplet {0}'.format(d.getVar("BUILD_SYS")))
41 # use BUILD here since HOST=TARGET
42 content.append('set host_alias "{0}"'.format(d.getVar("BUILD_SYS")))
43 content.append('set host_triplet {0}'.format(d.getVar("BUILD_SYS")))
44 content.append('set target_alias "{0}"'.format(d.getVar("TARGET_SYS")))
45 content.append('set target_triplet {0}'.format(suffix_sys(d.getVar("TARGET_SYS"))))
46 content.append("set development true")
47 content.append("set experimental false")
48
49 content.append(d.expand('set CXXFILT "${TARGET_PREFIX}c++filt"'))
50 content.append(d.expand('set CC "${TARGET_PREFIX}gcc --sysroot=${STAGING_DIR_TARGET} ${TUNE_CCARGS}"'))
51 content.append(d.expand('set CXX "${TARGET_PREFIX}g++ --sysroot=${STAGING_DIR_TARGET} ${TUNE_CCARGS}"'))
52 content.append(d.expand('set CFLAGS_FOR_TARGET "--sysroot=${STAGING_DIR_TARGET} ${TUNE_CCARGS}"'))
53 content.append(d.expand('set LD "${TARGET_PREFIX}ld ${TUNE_LDARGS}"'))
54 content.append(d.expand('set LDFLAGS_FOR_TARGET "${TUNE_LDARGS}"'))
55
56 if suite == "ld" and d.getVar("TUNE_ARCH") == "mips64":
57 # oe patches binutils to have the default mips64 abi as 64bit, but
58 # skips gas causing issues with the ld test suite (which uses gas)
59 content.append('set ASFLAGS "-64"')
60
61 return "\n".join(content)
62
63 for i in ["binutils", "gas", "ld"]:
64 builddir = os.path.join(d.getVar("B"), i)
65 if not os.path.isdir(builddir):
66 os.makedirs(builddir)
67 with open(os.path.join(builddir, "site.exp"), "w") as f:
68 f.write(generate_site_exp(d, i))
69}
70
71CHECK_TARGETS ??= "binutils gas ld"
72
73do_check[dirs] = "${B} ${B}/binutils ${B}/gas ${B}/ld"
74do_check[prefuncs] += "check_prepare"
75do_check[nostamp] = "1"
76do_check() {
77 export LC_ALL=C
78 for i in ${CHECK_TARGETS}; do
79 (cd ${B}/$i; runtest \
80 --tool $i \
81 --srcdir ${S}/$i/testsuite \
82 --ignore 'plugin.exp' \
83 || true)
84 done
85}
86addtask check after do_configure