Re: [PATCH] tests: feed -no-undefined when linking libtool libraries

2012-09-21 Thread Gary V. Vaughan
Hi Peter,

On 19 Sep 2012, at 21:50, Peter Rosin  wrote:

> On 2012-09-19 16:20, Gary V. Vaughan wrote:
>> Hi Peter,
>> 
>> My bad, I'm embarrassed to say. I started to write a script to make the
>> appropriate changes, but ended up doing it manually rather than adding
>> more and more corner cases to the throwaway script... a poor choice in
>> hindsight :-(
> 
> It's easy to be wise after the fact... If you do redo it, may I suggest
> breaking up the patch in smaller pieces for bisectability?

I've pushed a temporary branch called gary/redo-test-operand-order to
savannah with seven changesets that reverts the manual version of the
buggy original and redoes it with a painstaking awk script (also checked
in, for the morbidly curious).

I'm on the fence about committing in smaller pieces... the policy for
libtool has always been to make sure the testsuite passes (at least
on the committer's machine) for every changeset, so that bisecting
using one of the test cases doesn't fail unexpectedly on another
commit that was intentionally pushed with know failures.  On the other
hand, the original was a monster, so I can see the benefits of splitting
it up a bit too.


>> I think it will be safer to revert the broken patch, and then
>> write a script to reapply those changes automatically as I
>> should have done originally, and only then to merge the result
>> back to head. If you hold off for a few days, I'll do that as
>> penance for my sins when I get back to my computer.
> 
> I'm not sure a revert of such a big patch is possible after
> 50-odd more patches? But I was thinking revert too after
> reading it for a while... Who knows what else hides in
> there?

Well, I wrote and applied the script, diffed the results, and
the testsuite has no regressions for me.  I get a weird failure
in distcheck which tries to run distclean in _build/tests/cdemo
aftec removing _build/tests/cdemo/Makefile, that I haven't had
time to check against current master to see if it is a new regression
caused by my patch.

>> But please hold on to your test case to verify that I've made
>> a better job of things on the do over.
> 
> That's easy, on Cygwin:
>   make check-local TESTSUITEFLAGS="-k Runpath"
> is supposed to PASS (not FAIL) and
>   make check-local TESTSUITEFLAGS="-k relpaths"
> is supposed to XFAIL (not XPASS)
> 
> (mentioning it here so that I don't forget myself)

Cool.  When you have time, please let me know whether the temporary
branch I made works properly for you.  I'll do some more regression
testing, and if all goes well, I'll transplant the branch onto
master.

> Commit v2.4.2-120-g962aa91
> syntax-check: fix violations and implement sc_prohibit_test_const_follows_var
> inadvertenty stomped some comparisons.
> 
> * build-aux/ltmain.m4sh (func_mode_compile): Reverse test when checking
> if non-PIC is attempted in shared libraries.
> (func_mode_link): Check for dlprefiles, not dlfiles.
> (func_mode_link): Reverse test so that dependencies are checked when
> pass_all is not in effect.
> ---
> build-aux/ltmain.m4sh |6 +++---
> 1 files changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/build-aux/ltmain.m4sh b/build-aux/ltmain.m4sh
> index 14f3c37..0b8defa 100644
> --- a/build-aux/ltmain.m4sh
> +++ b/build-aux/ltmain.m4sh
> @@ -1350,7 +1350,7 @@ func_mode_compile ()
>   pic_mode=default
>   ;;
> esac
> -if test yes = "$pic_mode" && test pass_all != "$deplibs_check_method"; 
> then
> +if test no = "$pic_mode" && test pass_all != "$deplibs_check_method"; 
> then
>   # non-PIC code in shared libraries is not supported
>   pic_mode=default
> fi
> @@ -5151,7 +5151,7 @@ func_mode_link ()
>fi
> 
># CHECK ME:  I think I busted this.  -Ossama
> -   if test dlfiles = "$prev"; then
> +   if test dlprefiles = "$prev"; then
>  # Preload the old-style object.
>  func_append dlprefiles " $pic_object"
>  prev=
> @@ -6191,7 +6191,7 @@ func_mode_link ()
>  fi
>elif test yes = "$build_libtool_libs"; then
>  # Not a shared library
> - if test pass_all = "$deplibs_check_method"; then
> + if test pass_all != "$deplibs_check_method"; then
># We're trying link a shared library against a static one
># but the system doesn't support it.


My awk script also matches your changes in these hunks, so I'm
moderately confident that it will have caught any other lurkers too.

If not, I will branch before 962aa91, run the script, and then apply
the rest of master to that branch one patch at a time until I arrive
at a diff that I can apply to master itself, rather than using revert
as I did on the current temporary branch.

Cheers,
-- 
Gary V. Vaughan (gary AT gnu DOT org)




Fwd: Fix PIC flags with MPI wrappers using Portland C++ on GNU/Linux

2012-09-21 Thread Christian Rössel

Wrong list in the first place, sorry.

Christian

 Original Message 
Subject: Fix PIC flags with MPI wrappers using Portland C++ on GNU/Linux
Date: Tue, 18 Sep 2012 18:38:20 -0700
From: Christian Rössel 
To: libtool 
CC: t...@subnetz.org

Dear all,

please find attached a patch that fixes the erroneous detection of PIC
flags in case when CXX is a MPI wrapper that uses pgCC or pgcpp on
GNU/Linux as well as the wrong rpath option.

The testsuite.log output was created by configuring with CC=pgcc
CXX=pgCC F77=pgf77 FC=pgf90 and running make check. Is this the supposed
way to do it? Compiler version is 10.1-0.

There were two unexpected failures, in the patched as well as in the
unpatched version:
110: C++ exception handling  FAILED
(exceptions.at:385)
121: Run tests with low max_cmd_len  FAILED
(cmdline_wrap.at:43)

BTW, is there a recommendation whether or not to use tabs for
indentation in libtool.m4?

Thanks,
Christian
--
Dipl-Phys.
Christian Rössel
Forschungszentrum Jülich GmbH
Jülich Supercomputing Centre
Telefon: +1 541 346 2484
E-Mail: c.roes...@fz-juelich.de
Internet: http://www.fz-juelich.de/jsc








Forschungszentrum Juelich GmbH
52425 Juelich
Sitz der Gesellschaft: Juelich
Eingetragen im Handelsregister des Amtsgerichts Dueren Nr. HR B 3498
Vorsitzender des Aufsichtsrats: MinDir Dr. Karl Eugen Huthmacher
Geschaeftsfuehrung: Prof. Dr. Achim Bachem (Vorsitzender),
Karsten Beneke (stellv. Vorsitzender), Prof. Dr.-Ing. Harald Bolt,
Prof. Dr. Sebastian M. Schmidt



Kennen Sie schon unsere app? http://www.fz-juelich.de/app
diff --git a/gnulib b/gnulib
index c3d1ccf..0cd711b 16
--- a/gnulib
+++ b/gnulib
@@ -1 +1 @@
-Subproject commit c3d1ccfdb375b4cb1b912116c084a61422ef47e3
+Subproject commit 0cd711b27ba11019c96314a42e197bc288f415d7-dirty
diff --git a/m4/libtool.m4 b/m4/libtool.m4
index 4413a6d..ee63dda 100644
--- a/m4/libtool.m4
+++ b/m4/libtool.m4
@@ -4055,13 +4055,19 @@ m4_if([$1], [CXX], [
 	_LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink'
 	;;
 	  *)
-	case `$CC -V 2>&1 | sed 5q` in
+	case `$CC -V 2>&1` in
 	*Sun\ C*)
 	  # Sun C++ 5.9
 	  _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
 	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
 	  _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
 	  ;;
+*Portland\ Group*)
+  # Portland Group C++ compiler
+  _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+  _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic'
+  _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+  ;;
 	esac
 	;;
 	esac
@@ -4375,7 +4381,7 @@ m4_if([$1], [CXX], [
 	_LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink'
 	;;
   *)
-	case `$CC -V 2>&1 | sed 5q` in
+	case `$CC -V 2>&1` in
 	*Sun\ Ceres\ Fortran* | *Sun*Fortran*\ [[1-7]].* | *Sun*Fortran*\ 8.[[0-3]]*)
 	  # Sun Fortran 8.3 passes all unrecognized flags to the linker
 	  _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
@@ -4797,6 +4803,10 @@ _LT_EOF
 	  _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive'
 	  tmp_addflag=' $pic_flag'
 	  ;;
+	pgCC* | pgcpp*) # Portland Group C++ compiler
+	  _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive'
+	  tmp_addflag=' $pic_flag'
+	  ;;
 	pgf77* | pgf90* | pgf95* | pgfortran*)
 	# Portland Group f77 and f90 compilers
 	  _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive'
@@ -6450,7 +6460,7 @@ if test yes != "$_lt_caught_CXX_error"; then
 	  ;;
 	esac
 
-	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl--rpath $wl$libdir'
+	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
 	_LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-dynamic'
 	_LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive'
 ;;
@@ -6486,7 +6496,7 @@ if test yes != "$_lt_caught_CXX_error"; then
 	fi
 	;;
 	  *)
-