libtool-patches
[Top][All Lists]
Advanced

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

Re: Patches for libtool support on NAG Fortran compiler for Darwin OS


From: Peter O'Gorman
Subject: Re: Patches for libtool support on NAG Fortran compiler for Darwin OS
Date: Tue, 01 Mar 2011 09:11:56 -0600
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2.13) Gecko/20101209 Fedora/3.1.7-0.35.b3pre.fc13 Thunderbird/3.1.7

On 03/01/2011 05:24 AM, Jürgen Reuter wrote:
Dear libtool team (cc to Peter)
as discussed with Peter I send to you a diff (compared to the
2.4 official version of libtool) to support the NAG Fortran compiler
on Darwin 64bit machines.


Thanks for your work on this.

    case $cc_basename in
-     ifort*) _lt_dar_can_shared=yes ;;
+     ifort*|nagfor*) _lt_dar_can_shared=yes ;;
       *) _lt_dar_can_shared=$GCC ;;

This hunk is OK.

@@ -4245,6 +4245,19 @@
        fi
        ;;

+     darwin* | rhapsody*)
+       # PIC is the default on this platform
+       # Common symbols not allowed in MH_DYLIB files
+       case $cc_basename in
+       nagfor*)
+       # NAG Fortran compiler
+       _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,-Wl,,'
+       _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
+       _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+       ;;
+       esac
+       ;;
+

This one isn't. Either this matches and then the default case that sets lt_prog_compiler_pic to -fno-common later does not match, or vice versa. I haven't looked at where this comes in libtool.m4. Something like this would keep the default case working too:

@@ -4234,6 +4234,14 @@ m4_if([$1], [CXX], [
       # PIC is the default on this platform
       # Common symbols not allowed in MH_DYLIB files
       _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common'
+      case $cc_basename in
+      nagfor*)
+       # NAG Fortran compiler
+       _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,-Wl,,'
+       _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
+       _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+       ;;
+      esac
       ;;

     haiku*)

Though, recent Mac OS X does not require -fno-common, because -single_module is the default, it's mostly harmless to keep it there IMO.

diff -u ltmain.sh ../nag_trunk/ltmain.sh
--- ltmain.sh   2011-03-01 12:18:13.000000000 +0100
+++ ../nag_trunk/ltmain.sh      2011-03-01 11:49:34.000000000 +0100
@@ -7390,7 +7390,15 @@
           func_arith $current + 1
           minor_current=$func_arith_result
           xlcverstring="${wl}-compatibility_version ${wl}$minor_current 
${wl}-current_version ${wl}$minor_current.$revision"
-         verstring="-compatibility_version $minor_current -current_version 
$minor_current.$revision"
+         # On Darwin other compilers
+         case $CC in
+             nagfor*)
+                 verstring="${wl}-compatibility_version ${wl}$minor_current 
${wl}-current_version ${wl}$minor_current.$revision"
+                 ;;
+             *)
+                  verstring="-compatibility_version $minor_current -current_version 
$minor_current.$revision"
+                 ;;
+          esac
           ;;

I am a little confused by this because it seems strange that -compatibility_version and -current_version would need -Wl, quoting, but -dynamiclib, -bundle etc. do not. Did you happen to run the libtool test suite with this patch? Please do so and post the results.

Thanks again, sorry for asking you to do more work,
Peter



reply via email to

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