This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC 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]

Make libstdc++_target_compile call v3_target_compile


libstdc++-v3/testsuite/config/default.exp defines a procedure
${tool}_target_compile (that is, libstdc++_target_compile) for the use
of target-supports.exp.  This uses the default DejaGnu target_compile
rather than all the configuration in v3_target_compile to select the
right compiler and options for testing libstdc++.  This has at least
two problems:

* Depending on the test environment and board files, sometimes the
  default target_compile will not find a compiler configured at all,
  or it may not be the one the testsuite is meant to be testing.

* The compilation, if it happens, will be with gcc / xgcc with minimal
  options, and so may not link with libstdc++.  (In some cases this
  causes check_cxa_atexit_available to fail, as that has a C++ test
  that may need linking with libsupc++.)

So making libstdc++_target_compile call v3_target_compile seems
better.  That shows that check_function_available (used to check for
fork and mkfifo) needs changing to support building the test as C++,
so the patch makes that change.

Tested i686-pc-linux-gnu.  OK to commit?

libstdc++-v3:
2006-10-29  Joseph Myers  <joseph@codesourcery.com>

	* testsuite/config/default.exp (${tool}_target_compile): Use
	v3_target_compile.

gcc/testsuite:
2006-10-29  Joseph Myers  <joseph@codesourcery.com>

	* lib/target-supports.exp (check_function_available): Declare
	function before calling.

Index: gcc/testsuite/lib/target-supports.exp
===================================================================
--- gcc/testsuite/lib/target-supports.exp	(revision 118100)
+++ gcc/testsuite/lib/target-supports.exp	(working copy)
@@ -943,6 +943,8 @@
 	set exe "function[pid].exe"
 
 	set f [open $src "w"]
+	puts $f "#ifdef __cplusplus\nextern \"C\"\n#endif\n"
+	puts $f "char $function ();\n"
 	puts $f "int main () { $function (); }"
 	close $f
 
Index: libstdc++-v3/testsuite/config/default.exp
===================================================================
--- libstdc++-v3/testsuite/config/default.exp	(revision 118100)
+++ libstdc++-v3/testsuite/config/default.exp	(working copy)
@@ -28,6 +28,6 @@
 
 # target-supports.exp uses this
 proc ${tool}_target_compile { srcfile destfile compile_type options } {
-    target_compile $srcfile $destfile $compile_type $options
+    v3_target_compile $srcfile $destfile $compile_type $options
 }
 

-- 
Joseph S. Myers
joseph@codesourcery.com


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