diff mbox

[libgomp] libgomp.fortran/fortran.exp - add -fintrinsic-modules-path ${blddir}

Message ID 87mwcqvj6k.fsf@schwinge.name
State New
Headers show

Commit Message

Thomas Schwinge July 3, 2014, 10:19 a.m. UTC
Hi!

On Wed, 2 Jul 2014 21:14:11 +0200, Tobias Burnus <burnus@net-b.de> wrote:
> Thomas Schwinge wrote:
> > Reopening this oldie:
> >
> >> index 5fa42f4..68440d18 100644
> >> --- a/libgomp/testsuite/libgomp.fortran/fortran.exp
> >> +++ b/libgomp/testsuite/libgomp.fortran/fortran.exp
> >> @@ -14,6 +14,7 @@ set quadmath_library_path "../libquadmath/.libs"
> >>   dg-init
> >>   
> >>   if { $blddir != "" } {
> >> +    lappend ALWAYS_CFLAGS "additional_flags=-fintrinsic-modules-path ${blddir}"
> 
> How about the following (only lightly tested). I wonder why I didn't use 
> it before – but it looks obvious.

> --- a/libgomp/testsuite/libgomp.fortran/fortran.exp
> +++ b/libgomp/testsuite/libgomp.fortran/fortran.exp
> @@ -48,5 +48,5 @@ if { $lang_test_file_found } {
>               || [file exists "${blddir}/${quadmath_library_path}/libquadmath.${shlib_ext}"] } {
> -           lappend ALWAYS_CFLAGS "ldflags=-L${blddir}/${quadmath_library_path}/"
> +           lappend ALWAYS_FFLAGS "ldflags=-L${blddir}/${quadmath_library_path}/"
>              # Allow for spec subsitution.
> -           lappend ALWAYS_CFLAGS "additional_flags=-B${blddir}/${quadmath_library_path}/"
> +           lappend ALWAYS_FFLAGS "additional_flags=-B${blddir}/${quadmath_library_path}/"
>              set ld_library_path "$always_ld_library_path:${blddir}/${lang_library_path}:${blddir}/${quadmath_library_path}"

I don't understand -- there is no ALWAYS_FFLAGS, and, it's not -L and -B
options that are the problem here, but rather -fintrinsic-modules-path
passed to xgcc running in non-Fortran mode when doing
check_effective-target_* checks and the like.  My understanding is that
these checks will always be using ${tool}_target_compile, so the
"problem" is ALWAYS_CFLAGS usage in
libgomp/testsuite/lib/libgomp.exp:libgomp_target_compile: this will be
set up for Fortran testing in
libgomp/testsuite/libgomp.fortran/fortran.exp (including the
-fintrinsic-modules-path option), but then used by
check_effective-target_* with C language test cases, hence the compiler
warning.

I found the following to work (but so far only did libgomp testing), but
that is a little bit more intrusive, but may actually be the right thing
to do.  (Possibly also in additional places where ${tool}_target_compile
is used?  CCing testsuite maintainers.)  Comments?

Patch to relax checking for compiler warnings when determining features
supported by the target:



Grüße,
 Thomas
diff mbox

Patch

--- gcc/testsuite/lib/target-supports.exp
+++ gcc/testsuite/lib/target-supports.exp
@@ -78,6 +78,9 @@  proc check_compile {basename type contents args} {
     set lines [${tool}_target_compile $src $output $compile_type "$options"]
     file delete $src
 
+    # Mask out messages from gcc that aren't useful for our purposes here.
+    set lines [string trim [prune_gcc_output $lines]]
+
     set scan_output $output
     # Don't try folding this into the switch above; calling "glob" before the
     # file is created won't work.

Patch to mask out »valid for Fortran but not for C« warnings.

--- gcc/testsuite/lib/prune.exp
+++ gcc/testsuite/lib/prune.exp
@@ -46,6 +46,10 @@  proc prune_gcc_output { text } {
     regsub -all "(^|\n)\[^\n\]*: Additional NOP may be necessary to workaround Itanium processor A/B step errata" $text "" text
     regsub -all "(^|\n)\[^\n*\]*: Assembler messages:\[^\n\]*" $text "" text
 
+    # Ignore warning for gfortran options passed to xgcc not running in Fortran
+    # mode.
+    regsub -all "(^|\n)\[^\n\]*: warning: command line option .-f\[^\n\]*. is valid for Fortran but not for C\[^\n\]*" $text "" text
+
     # Ignore harmless VTA note.
     regsub -all "(^|\n)\[^\n\]*: note: variable tracking size limit exceeded with -fvar-tracking-assignments, retrying without\[^\n\]*" $text "" text