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