libtool-patches
[Top][All Lists]
Advanced

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

Re: last minute fixes


From: Thomas Tanner
Subject: Re: last minute fixes
Date: Tue, 24 Apr 2001 15:05:32 +0200 (CEST)

Hi Gary,

On 23-Apr-2001 Gary V. Vaughan wrote:
>>  Feel free to commit it - I don't have CVS/SSH access yet :(
> You should have.  I added your account with write access to savannah about a 
> day after Alexandre and I first told you we couldn't log in.

 I took some time before my SSH key was processed by savannah's cron job...
 but I have now access.
 
> I am worried about adding such deep changes to the tree just before our first
> full release in 2 years.  Testing seems to have been moderately successful, 
> so I'd like to release current HEAD as libtool-1.4.

 Believe me, my patch fixes absolutely apparent bugs in the ILD code I've
 written, adds some comments and does some renaming. I'm 100% sure that it
 doesn't break anything. And yes, I will port my changes to MLB very soon.
 Attached is a new patch without some unnecessary changes.
 I'll document the most important parts of my patch at the end of this mail...
  
> To minimise divergence between MLB and HEAD, we have not been committing 
> patches to either branch until we have both ports, or the patch makes no 
> sense on the other.  It has become a real PITA porting every tiny little 
> patch back and forth between HEAD libtool.m4 and MLB 
> ltconfig.in/ltcf-c.sh/ltcf-gxx.sh/ltcf-gcj.sh before committing, but it is a 
> necessary evil if we are not going to lose a whole bunch of code when we try 
> to merge the two.

 My patch doesn't touch libtool.m4

>  Just incase I didn't say it enough already:  I am *really*
> *really* looking forward to having a single development branch, so that we 
> need only port bugfixes forward.

 100% agreed.

 And now some excerpts of my patch:

       -l*)
-       if test "$arg" = "-lc"; then
-         case $host in
-         *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-beos*)
-           # These systems don't actually have c library (as such)
-           continue
-           ;;
-         *-*-rhapsody* | *-*-darwin1.[012])
-           # Rhapsody C library is in the System framework
-           deplibs="$deplibs -framework System"
-           continue
-           ;;
-         esac
-       elif test "$arg" = "-lm"; then
+       if test "X$arg" = "X-lc" || test "X$arg" = "X-lm"; then
          case $host in
          *-*-cygwin* | *-*-pw32* | *-*-beos*)
-           # These systems don't actually have math library (as such)
+           # These systems don't actually have a C or math library (as such)
            continue
            ;;
-         *-*-rhapsody* | *-*-darwin1.[012])
-           # Rhapsody math library is in the System framework
-           deplibs="$deplibs -framework System"
-           continue
+         *-*-mingw* | *-*-os2*)
+           # These systems don't actually have a C library (as such)
+           test "X$arg" = "X-lc" && continue
            ;;
          esac
        fi
 
 This merges -lc and -lm handling, fixes the "test -l*" bug and removes
 the rhapsody case, which would definitely break the ILD code.
 
-      *.$objext)
-       # A standard object.
-       objs="$objs $arg"
-       ;;
-
-      *.lo)
-       # A library object.
+      *.lo | *.$objext)
+       # A library or standard object.
        if test "$prev" = dlfiles; then
          # This file was specified with -dlopen.
          if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes;
then
@@ -1217,7 +1197,10 @@
          dlprefiles="$dlprefiles "`$echo "X$arg" | $Xsed -e "$lo2o"`
          prev=
        else
-         libobjs="$libobjs $arg"
+         case $arg in
+         *.lo) libobjs="$libobjs $arg" ;;
+         *) objs="$objs $arg" ;;
+         esac
        fi
        ;;

 supports dlopen for both .lo and .o - a very simple fix, if forgot to
 commit this part of my patches last year...
 
        *.lo | *.$objext)
-         if test $pass = conv; then
-           deplibs="$deplib $deplibs"
-         elif test $linkmode = prog; then
-           if test $pass = dlpreopen || test "$dlopen_support" != yes || test
"$build_libtool_libs" = no; then
-             # If there is no dlopen support or we're linking statically,
-             # we need to preload.
-             newdlprefiles="$newdlprefiles $deplib"
-             compile_deplibs="$deplib $compile_deplibs"
-             finalize_deplibs="$deplib $finalize_deplibs"
-           else
-             newdlfiles="$newdlfiles $deplib"
-           fi
+         if test $pass = dlpreopen || test "$dlopen_support" != yes || test
"$build_libtool_libs" = no; then
+           # If there is no dlopen support or we're linking statically,
+           # we need to preload.
+           newdlprefiles="$newdlprefiles $deplib"
+           compile_deplibs="$deplib $compile_deplibs"
+           finalize_deplibs="$deplib $finalize_deplibs"
+         else
+           newdlfiles="$newdlfiles $deplib"
          fi
          continue
          ;;
          fi

 simplification: .lo/.o files appear only in the dlopen/dlpreopen passes

          if test -z "$dlname" || test "$dlopen_support" != yes || test
"$build_libtool_libs" = no; then
            # If there is no dlname, no dlopen support or we're linking
-           # statically, we need to preload.  We also need to preload any
-           # dependent libraries so libltdl's deplib preloader doesn't
-           # bomb out in the load deplibs phase.
-           dlprefiles="$dlprefiles $lib $dependency_libs"
+           # statically, we need to preload.
+           dlprefiles="$dlprefiles $lib"
          else
            newdlfiles="$newdlfiles $lib"
          fi
          continue
-       fi
+       fi # $pass = dlopen
 
 adding dependency_libs breaks the ILD code (it contains -L/-R flags)
 and btw, you would also need to do this for the dlpreopened libs.
 This quick hack doesn't fix the bug, it even introduces some more bugs.

            echo "*** I have the capability to make that library automatically
link in when"
            echo "*** you link to this library.  But I can only do this if you
have a"
            echo "*** shared version of the library, which you do not appear to
have."
+           if test "$module" = yes; then
+             echo "*** Therefore, libtool will create a static module, that
should work "
+             echo "*** as long as the dlopening application is linked with the
-dlopen flag."
+             if test -z "$global_symbol_pipe"; then
+               echo
+               echo "*** However, this would only work if libtool was able to
extract symbol"
+               echo "*** lists from a program, using \`nm' or equivalent, but
libtool could"
+               echo "*** not find such a program.  So, this module is probably
useless."
+               echo "*** \`nm' from GNU binutils and a full rebuild may help."
+             fi
+             if test "$build_old_libs" = no; then
+               build_libtool_libs=module
+               build_old_libs=yes
+             else
+               build_libtool_libs=no
+             fi
+           fi
          else

 Ensure that modules with static dependencies are built static,
 so that libltdl can load them without trying to dlopen static dependencies.

              *) deplibs="$deplibs $path" ;;
              esac
            done
-         fi
-       fi
-      done
-      dependency_libs="$newdependency_libs"
+         fi # link_all_deplibs != no
+       fi # linkmode = lib
+      done # for deplib in $libs
       if test $pass = dlpreopen; then
        # Link the dlpreopened libraries before other libraries
        for deplib in $save_deplibs; do
@@ -2040,6 +2014,7 @@
        done
       fi
       if test $pass != dlopen; then
+       test $pass != scan && dependency_libs="$newdependency_libs"
        if test $pass != conv; then
          # Make sure lib_search_path contains only unique directories.
          lib_search_path=

 Definitely a bug in the ILD code

            for i in $deplibs; do
              name="`expr $i : '-l\(.*\)'`"
              # If $name is empty we are operating on a -L argument.
-             if test "$name" != "" -a "$name" != "0"; then
+             if test -n "$name" && test "$name" != "0"; then
                libname=`eval \\$echo \"$libname_spec\"`
                deplib_matches=`eval \\$echo \"$library_names_spec\"`
                set dummy $deplib_matches

 AFAIK non-portable test syntax

        libname=$libname_save
        name=$name_save
 
+       case $host in
+       *-*-rhapsody* | *-*-darwin1.[012])
+         # On Rhapsody replace the C library is the System framework
+         newdeplibs=`$echo "X $newdeplibs" | $Xsed -e 's/ -lc / -framework
System /'`
+         ;;
+       esac
+
        if test "$droppeddeps" = yes; then
          if test "$module" = yes; then
            echo

 Here's the right place to replace -lc with "-framework System"
 
+      case $host in
+      *-*-rhapsody* | *-*-darwin1.[012])
+       # On Rhapsody replace the C library is the System framework
+       compile_deplibs=`$echo "X $compile_deplibs" | $Xsed -e 's/ -lc /
-framework System /'`
+       finalize_deplibs=`$echo "X $finalize_deplibs" | $Xsed -e 's/ -lc /
-framework System /'`
+       ;;
+      esac
+
       compile_command="$compile_command $compile_deplibs"
       finalize_command="$finalize_command $finalize_deplibs"
 
 ditto for programs


     fi
 
     # Exit here if they wanted silent mode.
-    test "$show" = : && exit 0
+    test "$show" = ":" && exit 0
 
     echo
"----------------------------------------------------------------------"
     echo "Libraries have been installed in:"

 : has a special meaning, just to make sure...

EOF


 I hope you're now convinced that I should commit my patch?
 

 
2001-04-24  Thomas Tanner  <address@hidden>

        * TODO: describe problems with libltdl
        
        * ltmain.in (ILD): tidy up, add comments, remove dead code,
          merge duplicate code
          
        * ltmain.in (ILD): don't touch newdependency_libs after scan or
          dlopen pass
                  
        * ltmain.in (ILD): don't dlpreopen dependency_libs of a dlopened
          module (remove absolutely wrong quick hack)
          
        * ltmain.in (ILD): remove wrong comments about duplicate removal

        * ltmain.in (ILD): build a static-only module if it has
          static libraries in its dependencies (so that libltdl can
          safely load dependency_libs)

        * ltmain.in (argument parsing): prefix comparsions of -l args with X,
          replace -lc with `-framework System' _after_ the ILD passes
          
        * ltmain.in (argument parsing): support dl[pre]open
          for both .o and .lo files
        
        * ltmain.in (deplibs_check): use portable test syntax
        
        * ltmain.in (help): document -prefer-[non-]pic flags 
        
        * ltmain.in: improve readablity by adding some comments,
          rename uninst_* to notinst_* (more adequate name)
         
Thomas Tanner -------------------------
email: tanner@(ffii.org|gnu.org|gmx.de)
web:   http://home.pages.de/~tanner
UMI:   http://umi.ffii.org

Attachment: libtool2.diff
Description: libtool2.diff


reply via email to

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