This is the mail archive of the libstdc++@gcc.gnu.org mailing list for the libstdc++ 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: Fix libstdc++ testsuite on systems without ranlib


I've noticed that the libstdc++ testsuite failed on mips-sgi-irix5.3
like this:

ar -rc ./libtestc++.a testsuite_abi.o testsuite_allocator.o testsuite_character.o testsuite_hooks.o verified_cmd_line_input.o prog_bar.o elapsed_timer.o 
Executing on host: ar -rc ./libtestc++.a testsuite_abi.o testsuite_allocator.o testsuite_character.o testsuite_hooks.o verified_cmd_line_input.o prog_bar.o elapsed_timer.o    (timeout = 300)
ranlib ./libtestc++.a
Executing on host: ranlib ./libtestc++.a   (timeout = 300)
ERROR: tcl error sourcing /vol/gcc/src/hg/trunk/irix/libstdc++-v3/testsuite/libstdc++-abi/abi.exp.
ERROR: could not link libtestc++.a
    while executing
"error "could not link libtestc++.a""

By adding some logging to libstdc++-v3/testsuite/lib/libstdc++.exp
(v3-build_support), I found that this happens because RANLIB isn't set
in the environment (the Makefile has .NOEXPORT:).  But even if I export
the make variable in the correct target, this doesn't work: IRIX 5.3 has
no ranlib at all, and the toplevel configure.ac defaults to : in this
case.  While this works in a Makefile where the command is executed by a
shell, it won't in a expect script which does the execution itself, and
: just doesn't exist in the filesystem.  To fix this, I've instead
changed the default to true, which works just as well.

So far, I've only manually modified the generated
libstdc++-v3/testsuite/Makefile, but the following changes should have
the same effect.

I've exported AR at the same time, since libstdc++.exp tries to use it
as well.

At first, I was astonished that the change in the third arg of
ACX_CHECK_INSTALLED_TARGET_TOOL(RANLIB_FOR_TARGET) in the toplevel
configure.ac didn't have any effect on the generated configure, until I
noticed that the macro only takes two args (cf. config/acx.m4), so I've
simply removed it.

A full bootstrap and test on the target will take more than a week.  Ok
for mainline if it passes?

	Rainer

-- 
-----------------------------------------------------------------------------
Rainer Orth, Center for Biotechnology, Bielefeld University


2010-02-03  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>

	libstdc++-v3:
	* testsuite/Makefile.am (check-DEJAGNU
	$(check_DEJAGNU_normal_targets)): Export AR, RANLIB.
	* testsuite/Makefile.in: Regenerate.

	toplevel:
	* configure.ac (RANLIB): Default to true.
	(RANLIB_FOR_TARGET): Remove unused third arg.
	* configure: Regenerate.

diff -r 639f1353c2b9 configure.ac
--- a/configure.ac	Mon Jan 25 10:22:04 2010 +0000
+++ b/configure.ac	Wed Feb 03 19:26:03 2010 +0100
@@ -3183,7 +3183,7 @@
 NCN_STRICT_CHECK_TOOLS(LD, ld)
 NCN_STRICT_CHECK_TOOLS(LIPO, lipo)
 NCN_STRICT_CHECK_TOOLS(NM, nm)
-NCN_STRICT_CHECK_TOOLS(RANLIB, ranlib, :)
+NCN_STRICT_CHECK_TOOLS(RANLIB, ranlib, true)
 NCN_STRICT_CHECK_TOOLS(STRIP, strip, :)
 NCN_STRICT_CHECK_TOOLS(WINDRES, windres)
 NCN_STRICT_CHECK_TOOLS(WINDMC, windmc)
@@ -3220,7 +3220,7 @@
 ACX_CHECK_INSTALLED_TARGET_TOOL(LIPO_FOR_TARGET, lipo)
 ACX_CHECK_INSTALLED_TARGET_TOOL(NM_FOR_TARGET, nm)
 ACX_CHECK_INSTALLED_TARGET_TOOL(OBJDUMP_FOR_TARGET, objdump)
-ACX_CHECK_INSTALLED_TARGET_TOOL(RANLIB_FOR_TARGET, ranlib, :)
+ACX_CHECK_INSTALLED_TARGET_TOOL(RANLIB_FOR_TARGET, ranlib)
 ACX_CHECK_INSTALLED_TARGET_TOOL(STRIP_FOR_TARGET, strip)
 ACX_CHECK_INSTALLED_TARGET_TOOL(WINDRES_FOR_TARGET, windres)
 ACX_CHECK_INSTALLED_TARGET_TOOL(WINDMC_FOR_TARGET, windmc)
diff -r 639f1353c2b9 libstdc++-v3/testsuite/Makefile.am
--- a/libstdc++-v3/testsuite/Makefile.am	Mon Jan 25 10:22:04 2010 +0000
+++ b/libstdc++-v3/testsuite/Makefile.am	Wed Feb 03 19:26:03 2010 +0100
@@ -103,6 +103,8 @@
 
 # Run the testsuite in normal mode.
 check-DEJAGNU $(check_DEJAGNU_normal_targets): check-DEJAGNU%: site.exp
+	AR=$(AR); export AR; \
+	RANLIB=$(RANLIB); export RANLIB; \
 	if [ -z "$*$(filter-out --target_board=%, $(RUNTESTFLAGS))" ] \
 	    && [ "$(filter -j, $(MFLAGS))" = "-j" ]; then \
 	  $(MAKE) $(AM_MAKEFLAGS) check-DEJAGNUnormal0 check-DEJAGNUnormal1 \


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