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]

Re: [PATH][Ada] Fix multilib handling of gnat.dg when RUNTESTFLAGS is used


On Fri, 2009-03-27 at 14:03 +0100, Paolo Bonzini wrote:
> > If I'm not mistaken this patch still needs mingw32 maintainer ok since
> > there was an objection by Ralf on the behaviour of LN_S - but the two
> > mingw32 testers I could find reported success with LN_S so far - and
> > Arnaud ok.
> 
> Yeah, and I actually agreed with Ralf.  But given the testing results I
> think I will overrule the Windows port maintainers. :-)

I will commit the following next monday on trunk and 4.4 branch,
the patch should includes all changes suggested by Paolo.

On x86_64-linux trunk c,ada:

make -k check RUNTESTFLAGS="--target_board=unix'{-m32,-m64}'" 

Gives the following testresults:

http://gcc.gnu.org/ml/gcc-testresults/2009-04/msg00424.html

On i686-pc-mingw32 I'm not yet able to fully test trunk because
I cannot compile GMP 4.2.4 (I get "ops, mp_limb_t doesn't seem to work"
during configure, anyone with a solution?), but configure decides to use
"ln -s":

$ grep -i ln config.log
configure:1773: checking whether ln works
configure:1799: checking whether ln -s works
acx_cv_prog_LN=ln
LN='ln'
LN_S='ln -s'

I tested manually "ln -s" on directories on my mingw32 install (current
stable version from the web site) and it does a recursive copy.

Laurent

testsuite/
2009-04-06  Laurent GUERBY  <laurent@guerby.net>

        * lib/gnat.exp: Handle multilib.
        
libada/
2009-04-06  Laurent GUERBY  <laurent@guerby.net>

        * Makefile.in (ADA_RTS_DIR): Define.
        * Makefile.in (gnatlib-*): Link adainclude and adalib to it.

Index: gcc/testsuite/lib/gnat.exp
===================================================================
--- gcc/testsuite/lib/gnat.exp	(revision 145539)
+++ gcc/testsuite/lib/gnat.exp	(working copy)
@@ -83,17 +83,22 @@
     global gluefile wrap_flags
     global gnat_initialized
     global GNAT_UNDER_TEST
+    global GNAT_UNDER_TEST_ORIG
     global TOOL_EXECUTABLE
     global gnat_libgcc_s_path
+    global gnat_target_current
 
+    set gnat_target_current ""
+
     if { $gnat_initialized == 1 } { return }
 
     if ![info exists GNAT_UNDER_TEST] then {
 	if [info exists TOOL_EXECUTABLE] {
-	    set GNAT_UNDER_TEST $TOOL_EXECUTABLE
+	    set GNAT_UNDER_TEST "$TOOL_EXECUTABLE"
 	} else {
-	    set GNAT_UNDER_TEST [find_gnatmake]
+	    set GNAT_UNDER_TEST "[local_find_gnatmake]"
 	}
+        set GNAT_UNDER_TEST_ORIG "$GNAT_UNDER_TEST"
     }
 
     if ![info exists tmpdir] then {
@@ -124,14 +129,26 @@
     global gluefile wrap_flags
     global srcdir
     global GNAT_UNDER_TEST
+    global GNAT_UNDER_TEST_ORIG
     global TOOL_OPTIONS
     global ld_library_path
     global gnat_libgcc_s_path
+    global gnat_target_current
 
-    setenv ADA_INCLUDE_PATH "${rootme}/ada/rts"
+    # If we detect a change of target we need to recompute
+    # the appropriate RTS by calling get_multilibs.
+    if { $gnat_target_current!="[current_target_name]" } {
+	set gnat_target_current "[current_target_name]"
+	if [info exists TOOL_OPTIONS] {
+	    set gnat_rts_opt "--RTS=[get_multilibs ${TOOL_OPTIONS}]/libada"
+	} else {
+	    set gnat_rts_opt "--RTS=[get_multilibs]/libada"
+	}
+        set GNAT_UNDER_TEST "$GNAT_UNDER_TEST_ORIG $gnat_rts_opt"
+    }
+
     set ld_library_path ".:${gnat_libgcc_s_path}"
     lappend options "compiler=$GNAT_UNDER_TEST -q -f"
-    lappend options "incdir=${rootme}/ada/rts"
     lappend options "timeout=[timeout_value]"
 
     if { [target_info needs_status_wrapper]!="" && [info exists gluefile] } {
@@ -150,6 +167,7 @@
 
 #    set sourcename [string range $source 0 [expr [string length $source] - 5]]
 #    set dest ""
+
     return [target_compile $source $dest $type $options]
 }
 
@@ -232,29 +250,27 @@
     return $text
 }
 
-# If this is an older version of DejaGnu (without find_gnatmake), provide one.
-# This can be deleted after next DejaGnu release.
+# find_gnatmake for some version of DejaGnu will hardcode a -I...rts/ada flag
+# which prevent multilib from working, so define a new one.
 
-if { [info procs find_gnatmake] == "" } {
-    proc find_gnatmake {} {
-	global tool_root_dir
-
-	if ![is_remote host] {
-	    set file [lookfor_file $tool_root_dir gnatmake]
-	    if { $file == "" } {
-		set file [lookfor_file $tool_root_dir gcc/gnatmake]
-	    }
-	    if { $file != "" } {
-		set root [file dirname $file]
-		set CC "$file -I$root/ada/rts --GCC=$root/xgcc --GNATBIND=$root/gnatbind --GNATLINK=$root/gnatlink -cargs -B$root -largs --GCC=$root/xgcc -B$root -margs";
-	    } else {
-		set CC [transform gnatmake]
-	    }
-	} else {
-	    set CC [transform gnatmake]
-	}
-	return $CC
+proc local_find_gnatmake {} {
+    global tool_root_dir
+    
+    if ![is_remote host] {
+        set file [lookfor_file $tool_root_dir gnatmake]
+        if { $file == "" } {
+    	set file [lookfor_file $tool_root_dir gcc/gnatmake]
+        }
+        if { $file != "" } {
+    	set root [file dirname $file]
+    	set CC "$file --GCC=$root/xgcc --GNATBIND=$root/gnatbind --GNATLINK=$root/gnatlink -cargs -B$root -largs -B$root -margs -B$root";
+        } else {
+    	set CC [transform gnatmake]
+        }
+    } else {
+        set CC [transform gnatmake]
     }
+    return $CC
 }
 
 # If this is an older version of DejaGnu (without runtest_file_p),
Index: libada/Makefile.in
===================================================================
--- libada/Makefile.in	(revision 145539)
+++ libada/Makefile.in	(working copy)
@@ -65,6 +65,7 @@
 target_noncanonical:=@target_noncanonical@
 version := $(shell cat $(srcdir)/../gcc/BASE-VER)
 libsubdir := $(libdir)/gcc/$(target_noncanonical)/$(version)$(MULTISUBDIR)
+ADA_RTS_DIR=$(GCC_DIR)/ada/rts$(subst /,_,$(MULTISUBDIR))
 
 # exeext should not be used because it's the *host* exeext.  We're building
 # a *target* library, aren't we?!?  Likewise for CC.  Still, provide bogus
@@ -97,11 +98,19 @@
 	test -f stamp-libada || \
 	$(MAKE) -C $(GCC_DIR)/ada $(LIBADA_FLAGS_TO_PASS) gnatlib \
 	&& touch stamp-libada
+	-rm -rf adainclude
+	-rm -rf adalib
+	$(LN_S) $(ADA_RTS_DIR) adainclude
+	$(LN_S) $(ADA_RTS_DIR) adalib
 
 gnatlib-sjlj gnatlib-zcx gnatlib-shared: oscons $(GCC_DIR)/ada/Makefile
 	test -f stamp-libada || \
 	$(MAKE) -C $(GCC_DIR)/ada $(LIBADA_FLAGS_TO_PASS) $@ \
 	&& touch stamp-libada
+	-rm -rf adainclude
+	-rm -rf adalib
+	$(LN_S) $(ADA_RTS_DIR) adainclude
+	$(LN_S) $(ADA_RTS_DIR) adalib
 
 oscons:
 	$(MAKE) -C $(GCC_DIR) $(LIBADA_FLAGS_TO_PASS) ada/s-oscons.ads




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