libtool-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Intel compilers update


From: Ralf Wildenhues
Subject: Intel compilers update
Date: Wed, 26 Jan 2005 18:42:16 +0100
User-agent: Mutt/1.4.1i

As discussed quite some time ago[1], here's a set of patches to make the
libtool testsuite happier with icc/icpc/ifort (tested on 8.1 versions,
ia32, x86_64 and ia64).  I don't have access to older ifc's, but I think
my changes should be fine for them.

There are still a few failures:

Some of the compiler drivers call the GNU linker with a -version-script.
ld then fails in mdemo because we supply another version script with
anonymous symbols.  I really would not like going back to
-retain-symbols here.  We should eventually think about non-anonymous
versions or something else sensible (like merging the version-script
patch).

depdemo-relink fails on ia64.

Furthermore, there are inconsistencies in Intel's supplied libraries --
the C++ examples fail when linked against the Fortran libs (happens when
you source ifortvars.sh after iccvars.sh -- both of these set
LD_LIBRARY_PATH, unfortunately).   

Other than that, the Intel compilers are a fast-moving target, and users
are encouraged to use recent versions (plus, we might have to update
again some time).

OK to apply (inline patch against HEAD and branch-2-0, attachment
against branch-1-5)?

Regards,
Ralf

[1] thread starting at
http://lists.gnu.org/archive/html/libtool-patches/2004-10/msg00196.html

        * m4/libtool.m4 (_LT_LINKER_SHLIBS, _LT_LANG_CXX_CONFIG) [linux]
        Update for Intel Compiler icc/icpc/ifort: add -i_dynamic and
        -nofor_main, if necessary.  Simplify logic somewhat.

Index: m4/libtool.m4
===================================================================
RCS file: /cvsroot/libtool/libtool/m4/libtool.m4,v
retrieving revision 1.158
diff -u -r1.158 libtool.m4
--- m4/libtool.m4       26 Jan 2005 11:30:51 -0000      1.158
+++ m4/libtool.m4       26 Jan 2005 13:25:38 -0000
@@ -3655,12 +3654,19 @@
       if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \
         && test "$tmp_diet" = no
       then
-       tmp_archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags 
${wl}-soname $wl$soname -o $lib'
-       # Portland Group f77 and f90 compilers require an additonal -fpic
-       if test "$CC" = "pgf77" -o "$CC" = "pgf90"; then
-          tmp_archive_cmds="$tmp_archive_cmds -fpic"
-        fi
-       _LT_TAGVAR(archive_cmds, $1)="$tmp_archive_cmds"
+       tmp_addflag=
+       case $CC,$host_cpu in
+       pgf77* | pgf90* )               # Portland Group f77 and f90 compilers
+         tmp_addflag=' -fpic' ;;
+       ecc*,ia64* | icc*,ia64*)        # Intel C compiler on ia64
+         tmp_addflag=' -i_dynamic' ;;
+       efc*,ia64* | ifort*,ia64*)      # Intel Fortran compiler on ia64
+         tmp_addflag=' -i_dynamic -nofor_main' ;;
+       ifc* | ifort*)                  # Intel Fortran compiler
+         tmp_addflag=' -nofor_main' ;;
+       esac
+
+       _LT_TAGVAR(archive_cmds, $1)='$CC -shared'"$tmp_addflag"' $libobjs 
$deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
         case `$LD -v 2>&1` in
           *\ [01].* | *\ 2.[[0-9]].* | *\ 2.10.*) ;; # catch versions < 2.11
           *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ...
@@ -3669,7 +3675,7 @@
           *) supports_anon_versioning=yes ;;
         esac
         if test "x$supports_anon_versioning" = xyes; then
-          _LT_TAGVAR(archive_expsym_cmds, $1)='$ECHO "{ global:" > 
$output_objdir/$libname.ver~cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> 
$output_objdir/$libname.ver~$ECHO "local: *; };" >> 
$output_objdir/$libname.ver~$CC -shared $libobjs $deplibs $compiler_flags 
${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver 
-o $lib'
+          _LT_TAGVAR(archive_expsym_cmds, $1)='$ECHO "{ global:" > 
$output_objdir/$libname.ver~cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> 
$output_objdir/$libname.ver~$ECHO "local: *; };" >> 
$output_objdir/$libname.ver~$CC -shared'"$tmp_addflag"' $libobjs $deplibs 
$compiler_flags ${wl}-soname $wl$soname ${wl}-version-script 
${wl}$output_objdir/$libname.ver -o $lib'
         else
           _LT_TAGVAR(archive_expsym_cmds, $1)=$_LT_TAGVAR(archive_cmds, $1)
         fi
@@ -5158,8 +5164,12 @@
                _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared 
$predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname 
$wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
                ;;
              *)  # Version 8.0 or newer
-               _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs 
$compiler_flags ${wl}-soname $wl$soname -o $lib'
-               _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs 
$deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file 
$wl$export_symbols -o $lib'
+               tmp_idyn=
+               case $host_cpu in
+                 ia64*) tmp_idyn=' -i_dynamic';;
+               esac
+               _LT_TAGVAR(archive_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs 
$deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+               _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared'"$tmp_idyn"' 
$libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname 
${wl}-retain-symbols-file $wl$export_symbols -o $lib'
                ;;
            esac
            _LT_TAGVAR(archive_cmds_need_lc, $1)=no

Attachment: intel
Description: Text document


reply via email to

[Prev in Thread] Current Thread [Next in Thread]