[PATCH, testsuite] Enable automatic overlays for compat tests on SPU

Ulrich Weigand uweigand@de.ibm.com
Sun Jun 15 15:58:00 GMT 2008


Hello,

on the SPU, most compat.exp test cases (both C and C++) fail
because the resulting executables exceed 256KB code size and
do not fit into local store.

With recent binutils, we support "automatic overlays" that will
partition large executables into code overlay segments that are
loaded on demand.  This feature allows the compat.exp test cases
to work.

To enable it, we need to pass -ffunction-sections to the compiler
and --auto-overlay to the linker.  The following patch changes
the compat.exp library helper to add those flags for the SPU.

(Note that this will still cause failures if your binutils are
too old to support --auto-overlay.  However, as the tests would
then fail anyway, I don't think we need any configure checks
for this ...)

Tested on spu-elf with no regressions, fixes all FAILs in all
compat.exp test cases.

OK for mainline and the 4.3 branch?

Bye,
Ulrich


ChangeLog:

	* lib/compat.exp (compat-execute): Add -ffunction-sections
	and -Wl,--auto-overlay when building for the SPU.


Index: gcc/testsuite/lib/compat.exp
===================================================================
*** gcc/testsuite/lib/compat.exp	(revision 136680)
--- gcc/testsuite/lib/compat.exp	(working copy)
*************** proc compat-execute { src1 sid use_alt }
*** 275,280 ****
--- 275,289 ----
      set extra_flags_3 [compat-get-options $src3]
      set compile_xfail_3 $compiler_conditional_xfail_data
  
+     # On the SPU, most of the compat test cases exceed local store size.
+     # Use automatic overlay support to make them fit.
+     if { [istarget spu-*-*] } {
+ 	set extra_flags_1 "$extra_flags_1 -Wl,--auto-overlay"
+ 	set extra_flags_1 "$extra_flags_1 -ffunction-sections"
+ 	set extra_flags_2 "$extra_flags_2 -ffunction-sections"
+ 	set extra_flags_3 "$extra_flags_3 -ffunction-sections"
+     }
+ 
      # Define the names of the object files.
      regsub "sid" "sid_main_tst.o" $sid obj1
      regsub "sid" "sid_x_tst.o" $sid obj2_tst
-- 
  Dr. Ulrich Weigand
  GNU Toolchain for Linux on System z and Cell BE
  Ulrich.Weigand@de.ibm.com



More information about the Gcc-patches mailing list