This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH] reduce disk space requirements of testsuites


With the 64k-sections ELF test enabled for all targets I noticed a
significant growth in the testsuites' disk usage. Per target disk
space used for a full build and check was about 150 Mb (64-bit target)
or 100 Mb (32-bit target). For bulk tests of many targets, this easily
adds up to 15/10 Gb. For this reason I went through the tests and
identified the most significant space consumers, and the below patch
arranges for them to be deleted. This shrinks the space requirements
to about 100/65 Mb per 64-/32-bit target, saving several Gb for bulk
testing.
Additionally I occasionally wondered why the binutils testsuite during
repeated build/check runs wouldn't catch obvious flaws in assembler
changes being tested, which led me to find that the assembler and
linker binaries were copied during the first testsuite run and then
never updated again. Thus this patch not only saves the disk space
needed for the copies (when linking is instead possible), but also
improves the chances of quickly finding issues with assembler or
linker with incremental builds.

Built and tested on i686-pc-linux-gnu, x86_64-unknown-linux-gnu,
ia64-unknown-linux-gnu, and for a large number of cross targets.

Jan

binutils/testsuite/
2005-11-11  Jan Beulich  <jbeulich@novell.com>

	* config/default.exp (link_or_copy): New. Use it for setting
	up assembler and linker for the compiler to use.

ld/testsuite/
2005-11-11  Jan Beulich  <jbeulich@novell.com>

	* ld-bootstrap/bootstrap.exp: Delete ld-partial.o and ld[123]*
	after test.
	* ld-elf/elf.exp: Delete preinit, init, and fini after test.
	* ld-elf/sec64k.exp: Use macro and repeat in generated source
	files. Delete object files after test.

---
/home/jbeulich/src/binutils/mainline/2005-11-09/binutils/testsuite/config/default.exp	2005-05-09
08:31:35.000000000 +0200
+++ 2005-11-09/binutils/testsuite/config/default.exp	2005-11-10
14:01:28.029169472 +0100
@@ -74,21 +74,26 @@ if ![file isdirectory tmpdir] {catch "ex
 # Make a copy from tmpdir/gas/as and tmpdir/gas/ld to the assembler
 # and linker in the build tree, so that we can use a -B option to gcc
 # to force it to use the newly built assembler/linker.
-if {![file isdirectory tmpdir/gas]} then {
-    catch "exec mkdir tmpdir/gas" status
-    if {[file isfile ../gas/as-new[exe_ext]]} then {
-	catch "exec cp ../gas/as-new[exe_ext] tmpdir/gas/as[exe_ext]"
status
-    } else {
-	# For non-Windows hosts there may be an executable
-	# without a .exe suffix, so try copying that instead.
-	catch "exec cp ../gas/as-new tmpdir/gas/as[exe_ext]" status
-    }
-    # This may not be needed any more...
-    if {[file isfile ../ld/ld-new[exe_ext]]} then {
-	catch "exec cp ../ld/ld-new[exe_ext] tmpdir/gas/ld[exe_ext]"
status
-    } else {
-	catch "exec cp ../ld/ld-new tmpdir/gas/ld[exe_ext]" status
-    }
+if {![file isdirectory tmpdir/gas]} {catch "exec mkdir tmpdir/gas"
status}
+
+proc link_or_copy { src dst } {
+    if ![catch "exec ln -sf ../../../$src tmpdir/gas/$dst" status]
then {return 0}
+    if ![catch "exec ln -f ../$src tmpdir/gas/$dst" status] then
{return 0}
+    catch "exec cp -fpu ../$src tmpdir/gas/$dst" status
+}
+
+if {[file isfile gas/as-new[exe_ext]]} then {
+    link_or_copy gas/as-new[exe_ext] as[exe_ext]
+} else {
+    # For non-Windows hosts there may be an executable
+    # without a .exe suffix, so try copying that instead.
+    link_or_copy gas/as-new as[exe_ext]
+}
+# This may not be needed any more...
+if {[file isfile ld/ld-new[exe_ext]]} then {
+    link_or_copy ld/ld-new[exe_ext] ld[exe_ext]
+} else {
+    link_or_copy ld/ld-new ld[exe_ext]
 }
 set gcc_gas_flag "-B[pwd]/tmpdir/gas/"
 set dlltool_gas_flag "-S [pwd]/tmpdir/gas/as[exe_ext]"
---
/home/jbeulich/src/binutils/mainline/2005-11-09/ld/testsuite/ld-bootstrap/bootstrap.exp	2005-05-13
12:17:13.000000000 +0200
+++ 2005-11-09/ld/testsuite/ld-bootstrap/bootstrap.exp	2005-11-10
15:40:44.067713984 +0100
@@ -169,3 +169,6 @@ foreach flags {"" "strip" "--static" "--
 	fail $testname
     }
 }
+
+catch "exec rm -f tmpdir/ld-partial.o tmpdir/ld1 tmpdir/ld2
tmpdir/ld3" status
+catch "exec rm -f tmpdir/ld1tail tmpdir/ld2tail tmpdir/ld3tail"
status
---
/home/jbeulich/src/binutils/mainline/2005-11-09/ld/testsuite/ld-elf/elf.exp	2005-08-18
08:51:59.000000000 +0200
+++ 2005-11-09/ld/testsuite/ld-elf/elf.exp	2005-11-10
14:44:51.040451608 +0100
@@ -45,3 +45,5 @@ set array_tests {
 
 # NetBSD ELF systems do not currently support the .*_array sections.
 run_ld_link_exec_tests [list "*-*-netbsdelf*"] $array_tests
+
+catch "exec rm -f tmpdir/preinit tmpdir/init tmpdir/fini" status
---
/home/jbeulich/src/binutils/mainline/2005-11-09/ld/testsuite/ld-elf/sec64k.exp	2005-10-11
14:31:20.000000000 +0200
+++ 2005-11-09/ld/testsuite/ld-elf/sec64k.exp	2005-11-10
15:42:59.139180000 +0100
@@ -39,7 +39,6 @@ if { ![runtest_file_p $runtests $test1] 
 set sfiles {}
 set max_sec 66000
 set secs_per_file 1000
-set secn 0
 for { set i 0 } { $i < $max_sec / $secs_per_file } { incr i } {
     set sfile "$objdir/tmpdir/sec64-$i.s"
     lappend sfiles $sfile
@@ -50,7 +49,7 @@ for { set i 0 } { $i < $max_sec / $secs_
 	return
     }
 
-    if { $secn == 0 } {
+    if { $i == 0 } {
 	puts $ofd " .global _start"
 	puts $ofd "_start:"
 	puts $ofd " .global foo_0"
@@ -59,15 +58,20 @@ for { set i 0 } { $i < $max_sec / $secs_
 
     # Make sure the used section is not covered by common linker
scripts.
     # They should get separate section entries even without -r.
-    for { set j 0 } { $j < $secs_per_file } { incr j } {
-	incr secn
-	puts $ofd " .section .foo.$secn,\"ax\""
-	puts $ofd " .global foo_$secn"
-	puts $ofd "foo_$secn:"
-	puts $ofd " .long foo_[expr $secn - 1]"
-	puts $ofd "bar_$secn:"
-	puts $ofd " .long bar_$secn"
-    }
+    puts $ofd " .altmacro"
+    puts $ofd " .macro sec secn, secp"
+    puts $ofd "  .section .foo.\\secn,\"ax\"" 
+    puts $ofd "  .global foo_\\secn"
+    puts $ofd "foo_\\secn:"
+    puts $ofd "  .long foo_\\secp"
+    puts $ofd "bar_\\secn:"
+    puts $ofd "  .long bar_\\secn"
+    puts $ofd " .endm"
+    puts $ofd " secn = [expr $i * $secs_per_file]"
+    puts $ofd " .rept $secs_per_file"
+    puts $ofd "  secn = secn + 1"
+    puts $ofd "  sec %(secn), %(secn-1)"
+    puts $ofd " .endr"
 
     close $ofd
 }
@@ -141,3 +145,7 @@ puts $ofd ".* (\[0-9\] foo_1|66... foo_6
 puts $ofd "#pass"
 close $ofd
 run_dump_test "tmpdir/$test2"
+
+for { set i 1 } { $i < $max_sec / $secs_per_file } { incr i } {
+    catch "exec rm -f tmpdir/dump$i.o" status
+}

Attachment: binutils-mainline-diskusage.patch
Description: Text document


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]