[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Fix linking from only convenience archives with gfortran on Darwin. (was
From: |
Ralf Wildenhues |
Subject: |
Fix linking from only convenience archives with gfortran on Darwin. (was: [libtool 2.2.10] testsuite: 28 29 102 failed) |
Date: |
Thu, 14 Oct 2010 21:27:51 +0200 |
User-agent: |
Mutt/1.5.20 (2010-08-04) |
* Ralf Wildenhues wrote on Wed, Oct 13, 2010 at 08:35:52PM CEST:
> > Thanks for the report. The failures are fairly benign, the only real
> > issue being that the GNU Fortran compiler version on your system doesn't
> > like being handed convenience archives but no plain objects on the
> > command line:
> >
> > * Paul Laight wrote on Mon, Aug 23, 2010 at 01:27:07PM CEST:
> > > ./convenience.at:151: $LIBTOOL --tag=F77 --mode=link $F77 $FFLAGS
> > > $LDFLAGS -o liba12.la liba1.la liba2.la -rpath /notexist
> > > stderr:
> > > i686-apple-darwin8-gfortran-4.2: no input files; unwilling to write
> > > output files
> > > stdout:
> > > libtool: link: gfortran -dynamiclib -Wl,-undefined -Wl,dynamic_lookup -o
> > > .libs/liba12.0.dylib -Wl,-force_load,./.libs/liba1.a
> > > -Wl,-force_load,./.libs/liba2.a -install_name
> > > /notexist/liba12.0.dylib -compatibility_version 1 -current_version 1.0
> > > -Wl,-single_module
> > > ./convenience.at:151: exit code was 1, expected 0
> > > 28. convenience.at:109: 28. F77 convenience archives
> > > (convenience.at:109): FAILED (convenience.at:151)
Looking at this again, it isn't the gfortran version that differs here
from other reports where test doesn't fail, but rather the system: it
fails on darwin because $whole_archive_flag_spec doesn't pass any
archive names without -Wl,... prefix, which in turn makes gfortran think
there is a problem. The actual issue seems to be present even in
current GCC.
The following patch should fix this. Paul, any chance you could try out
the patch on your system? OK to add your name&email to THANKS?
OK to commit? (I do have access to a darwin system, but no gfortran
installed there, so I cannot test this.)
Thanks,
Ralf
Fix linking from only convenience archives with gfortran on Darwin.
* libltdl/m4/libtool.m4 (_LT_DARWIN_LINKER_FEATURES): Update
macro comment header.
[darwin, F77, FC] <compiler_needs_object>: Set to yes if
whole_archive_flag_spec is nonempty. Fixes convenience.at test
suite failures with gfortran 4.2 on Darwin.
* THANKS: Update.
Report by Paul Laight.
diff --git a/libltdl/m4/libtool.m4 b/libltdl/m4/libtool.m4
index 5c4e29c..de417b6 100644
--- a/libltdl/m4/libtool.m4
+++ b/libltdl/m4/libtool.m4
@@ -1035,8 +1035,8 @@ _LT_EOF
])
-# _LT_DARWIN_LINKER_FEATURES
-# --------------------------
+# _LT_DARWIN_LINKER_FEATURES([TAG])
+# ---------------------------------
# Checks for linker and compiler features on darwin
m4_defun([_LT_DARWIN_LINKER_FEATURES],
[
@@ -1047,6 +1047,8 @@ m4_defun([_LT_DARWIN_LINKER_FEATURES],
_LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
if test "$lt_cv_ld_force_load" = "yes"; then
_LT_TAGVAR(whole_archive_flag_spec, $1)='`for conv in $convenience\"\"; do
test -n \"$conv\" && new_convenience=\"$new_convenience
${wl}-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`'
+ m4_case([$1], [F77], [_LT_TAGVAR(compiler_needs_object, $1)=yes],
+ [FC], [_LT_TAGVAR(compiler_needs_object, $1)=yes])
else
_LT_TAGVAR(whole_archive_flag_spec, $1)=''
fi
- Fix linking from only convenience archives with gfortran on Darwin. (was: [libtool 2.2.10] testsuite: 28 29 102 failed),
Ralf Wildenhues <=