------- Comment #2 from ro at techfak dot uni-bielefeld dot de 2008-10-31 01:24 ------- Subject: Ada testsuites lack multilib support
While testing the fix for PR ada/37681, I tried to test both multilibs (default and amd64) on i386-pc-solaris2.10, and found that I had to make the following changes: * For ada/acats, the necessary changes are restricted to the run_acats script: --- run_acats.save Wed May 30 17:59:57 2007 +++ run_acats Thu Oct 9 17:55:35 2008 @@ -13,7 +13,7 @@ BASE=`cd $ROOT/../../..; ${PWDCMD-pwd}` PATH=$BASE:$ROOT:$PATH -ADA_INCLUDE_PATH=$BASE/ada/rts +ADA_INCLUDE_PATH=$BASE/ada/rts_sparcv9 LD_LIBRARY_PATH=$ADA_INCLUDE_PATH:$BASE:$LD_LIBRARY_PATH ADA_OBJECTS_PATH=$ADA_INCLUDE_PATH @@ -33,7 +33,7 @@ fi GCC_DRIVER="$BASE/xgcc" -GCC="$BASE/xgcc -B$BASE/" +GCC="$BASE/xgcc -B$BASE/ -m64" export PATH ADA_INCLUDE_PATH ADA_OBJECTS_PATH GCC_DRIVER GCC LD_LIBRARY_PATH echo '#!/bin/sh' > host_gnatchop To properly handle this, the script needs to iterate over the available multilibs and append _<multilib dir> to $ADA_INCLUDE_PATH and the multilib flag to $GCC. One problem here is that unlike the dejagnu based testsuite, where the user can influence the multilibs to test via the RUNTESTFLAGS environment variable, it seems to be unnecessarily complex to parse that dejagnu-specific variable (which might look like --target_board "unix{,-m64}" in the present case), so instead the default should be to iterate over all available multilibs. * For gnat, the situation is similar with one twist: --- gnat.exp.save Mon Sep 3 18:05:02 2007 +++ gnat.exp Thu Oct 9 17:54:58 2008 @@ -127,10 +127,10 @@ global ld_library_path global gnat_libgcc_s_path - setenv ADA_INCLUDE_PATH "${rootme}/ada/rts" + setenv ADA_INCLUDE_PATH "${rootme}/ada/rts_amd64" set ld_library_path ".:${gnat_libgcc_s_path}" lappend options "compiler=$GNAT_UNDER_TEST -q -f" - lappend options "incdir=${rootme}/ada/rts" + lappend options "incdir=${rootme}/ada/rts_amd64" if { [target_info needs_status_wrapper]!="" && [info exists gluefile] } { lappend options "libs=${gluefile}" @@ -244,7 +244,7 @@ } 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"; + set CC "$file -I$root/ada/rts_amd64 --GCC=$root/xgcc --GNATBIND=$root/gnatbind --GNATLINK=$root/gnatlink -cargs -B$root -largs --GCC=$root/xgcc -B$root -m64 -margs"; } else { set CC [transform gnatmake] } Again, one needs to add _<multilib dir> to ADA_INCLUDE_PATH and friends. The multilib flag is already appended to $CC by the dejagnu framework, but one issue remains: unlike gnatmake, gnatlink doesn't pass unknown flags (like -m64 in this case) to gcc, but ignores them. If invoking gnatlink via the shell, it is possible to use -largs --GCC="$root/xgcc -B$root -m64" and pass -B and -m64 through gnatlink. With the dejagnu/tcl framework, I've found no way to achieve the same effect, i.e. to pass a single argument which includes whitespace. Maybe some testsuite expert can help here? If this were not done, compilations performed by gnatlink `behind the scenes' would produce objects for the default multilib, leading to link failures in the final link step. As a workaround, I've replaced xgcc by a script that always passes -m64: #!/bin/sh exec $0.bin -m64 "$@" With those changes, I could at least manually test both multilibs on sparc-sun-solaris2.11 and i386-pc-solaris2.10. Rainer -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=37703