binutils-testsuite: Set CC_FOR_TARGET and CXX_FOR_TARGET in site.exp
PATCH 1/1 binutils-testsuite: Set CC_FOR_TARGET and CXX_FOR_TARGET in site.exp
From: Hemanth Kumar M D <[email protected]>
The recipe calls runtest directly, bypassing upstream's Makefile which normally passes CC_FOR_TARGET/CXX_FOR_TARGET to the test harness. Without them, dejagnu falls back to find_gcc() returning the bare compiler name without --sysroot.
On ARM, ld-selective/selective.exp calls $CC_FOR_TARGET directly to query -print-libgcc-file-name. Without --sysroot, OE's poisoned cross-gcc cannot locate libgcc.a, failing selective1/2/3.
Set CC_FOR_TARGET/CXX_FOR_TARGET the same way CC/CXX already are.
Tested on qemuarm:
ld:
+--------------+--------+--------+------+ | Result | Before | After | Diff | +--------------+--------+--------+------+ | PASS | 1173 | 1879 | +706 | | FAIL | 3 | 0 | -3 | | XFAIL | 8 | 57 | +49 | | XPASS | 0 | 6 | +6 | | UNTESTED | 22 | 4 | -18 | | UNSUPPORTED | 153 | 417 | +264 | +--------------+--------+--------+------+
selective1/2/3 are ARM-specific and are fixed here. The larger test-count increase is not ARM-specific: CC_FOR_TARGET without --sysroot made check_compiler_available fail, silently skipping many sub-tests across all architectures. With the fix those tests run. Upstream bug tracking the silent skipping:
https://sourceware.org/bugzilla/show_bug.cgi?id=34580
[YOCTO #16342]
--- meta/recipes-devtools/binutils/binutils-testsuite_2.47.bb | 2 ++ 1 file changed, 2 insertions(+)
meta/recipes-devtools/binutils/binutils-testsuite_2.47.bb +2 -0
@@ -51,6 +51,8 @@ python check_prepare() { content.append(d.expand('set CXXFILT "${TARGET_PREFIX}c++filt"')) content.append(d.expand('set CC "${TARGET_PREFIX}gcc --sysroot=${STAGING_DIR_TARGET} ${TUNE_CCARGS}"')) content.append(d.expand('set CXX "${TARGET_PREFIX}g++ --sysroot=${STAGING_DIR_TARGET} ${TUNE_CCARGS}"')) + content.append(d.expand('set CC_FOR_TARGET "${TARGET_PREFIX}gcc --sysroot=${STAGING_DIR_TARGET} ${TUNE_CCARGS}"')) + content.append(d.expand('set CXX_FOR_TARGET "${TARGET_PREFIX}g++ --sysroot=${STAGING_DIR_TARGET} ${TUNE_CCARGS}"')) content.append(d.expand('set CFLAGS_FOR_TARGET "--sysroot=${STAGING_DIR_TARGET} ${TUNE_CCARGS}"')) content.append(d.expand('set LD "${TARGET_PREFIX}ld ${TUNE_LDARGS}"')) content.append(d.expand('set LDFLAGS_FOR_TARGET "${TUNE_LDARGS}"'))
Signature · 1 line
2.49.0