libtool-commit
[Top][All Lists]
Advanced

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

[SCM] GNU Libtool branch, master, updated. v2.2.6-10-g3531d11


From: Ralf Wildenhues
Subject: [SCM] GNU Libtool branch, master, updated. v2.2.6-10-g3531d11
Date: Sun, 05 Oct 2008 10:43:58 +0000

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU Libtool".

The branch, master has been updated
       via  3531d11d42fe0ff7331d5857cba41a35c916d751 (commit)
      from  d185ad66e6469919022f83eb845b1fc9ab19abec (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 3531d11d42fe0ff7331d5857cba41a35c916d751
Author: Ralf Wildenhues <address@hidden>
Date:   Sun Oct 5 12:35:27 2008 +0200

    Atomic shared library install permissions on HP-UX.
    
    The HP-UX 11 runtime linker fails to mmap shared libraries
    without execute permissions.  Fixing them with postinstall_cmds
    may be too late, as ln, sed, and chmod may link against the
    library being installed.
    
    * libltdl/m4/libtool.m4 (install_override_mode): New LT_DECL.
    (_LT_SYS_DYNAMIC_LINKER) [hpux9*, hpux10*, hpux11*]: Set it.
    * libltdl/config/ltmain.m4sh (func_mode_install): Build a second
    command line, $install_shared_prog, for the installation of the
    shared library.  Override resp. set the permission mode if
    install_override_mode is nonempty.
    * doc/libtool.texi (libtool script contents): Document it.
    * tests/install.at (Install tests): New test.
    * Makefile.am (TESTSUITE_AT): Adjust.
    (TESTS_ENVIRONMENT): Pass INSTALL.
    Report by Bruno Haible.
    
    Signed-off-by: Ralf Wildenhues <address@hidden>

-----------------------------------------------------------------------

Summary of changes:
 ChangeLog                         |   20 +++++++++++++++++++
 Makefile.am                       |    3 +-
 doc/libtool.texi                  |    9 ++++++++
 libltdl/config/ltmain.m4sh        |   18 ++++++++++++++++-
 libltdl/m4/libtool.m4             |    6 ++++-
 tests/{ltdl-api.at => install.at} |   38 ++++++++++++++++++++++++------------
 6 files changed, 78 insertions(+), 16 deletions(-)
 copy tests/{ltdl-api.at => install.at} (50%)

diff --git a/ChangeLog b/ChangeLog
index bdec7e6..cabc93d 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,23 @@
+2008-10-05  Ralf Wildenhues  <address@hidden>
+
+       Atomic shared library install permissions on HP-UX.
+       The HP-UX 11 runtime linker fails to mmap shared libraries
+       without execute permissions.  Fixing them with postinstall_cmds
+       may be too late, as ln, sed, and chmod may link against the
+       library being installed.
+
+       * libltdl/m4/libtool.m4 (install_override_mode): New LT_DECL.
+       (_LT_SYS_DYNAMIC_LINKER) [hpux9*, hpux10*, hpux11*]: Set it.
+       * libltdl/config/ltmain.m4sh (func_mode_install): Build a second
+       command line, $install_shared_prog, for the installation of the
+       shared library.  Override resp. set the permission mode if
+       install_override_mode is nonempty.
+       * doc/libtool.texi (libtool script contents): Document it.
+       * tests/install.at (Install tests): New test.
+       * Makefile.am (TESTSUITE_AT): Adjust.
+       (TESTS_ENVIRONMENT): Pass INSTALL.
+       Report by Bruno Haible.
+
 2008-09-26  Eric Blake  <address@hidden>
 
        Avoid gcc warning.
diff --git a/Makefile.am b/Makefile.am
index 8570db4..8b19ea5 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -460,6 +460,7 @@ TESTSUITE_AT        = tests/testsuite.at \
                  tests/archive-in-archive.at \
                  tests/execute-mode.at \
                  tests/localization.at \
+                 tests/install.at \
                  tests/destdir.at \
                  tests/old-m4-iface.at \
                  tests/am-subdir.at \
@@ -486,7 +487,7 @@ EXTRA_DIST     += $(srcdir)/$(TESTSUITE) $(TESTSUITE_AT) 
$(srcdir)/tests/package
 TESTS_ENVIRONMENT = MAKE="$(MAKE)" CC="$(CC)" CFLAGS="$(CFLAGS)" \
        CPP="$(CPP)" CPPFLAGS="$(CPPFLAGS)" LD="$(LD)" LDFLAGS="$(LDFLAGS)" \
        LIBS="$(LIBS)" LN_S="$(LN_S)" NM="$(NM)" RANLIB="$(RANLIB)" \
-       STRIP="$(STRIP)" \
+       STRIP="$(STRIP)" INSTALL="$(INSTALL)" \
        OBJEXT="$(OBJEXT)" EXEEXT="$(EXEEXT)" \
        SHELL="$(SHELL)" CONFIG_SHELL="$(SHELL)" \
        CXX="$(CXX)" CXXFLAGS="$(CXXFLAGS)" CXXCPP="$(CXXCPP)" \
diff --git a/doc/libtool.texi b/doc/libtool.texi
index 59f3872..1ee12aa 100644
--- a/doc/libtool.texi
+++ b/doc/libtool.texi
@@ -5819,6 +5819,15 @@ runtime path list, requiring libtool to relink the 
output when installing.
 Set to @samp{yes} or @samp{no}.  Default is @samp{no}.
 @end defvar
 
address@hidden install_override_mode
+Permission mode override for installation of shared libraries.  If the
+runtime linker fails to load libraries with wrong permissions, then it
+may fail to execute programs that are needed during installation,
+because these need the library that has just been installed.  In this
+case, it is necessary to pass the mode to @command{install} with
address@hidden @var{install_override_mode}}.
address@hidden defvar
+
 @defvar libext
 The standard old archive suffix (normally @samp{a}).
 @end defvar
diff --git a/libltdl/config/ltmain.m4sh b/libltdl/config/ltmain.m4sh
index ec7de23..696b6ab 100644
--- a/libltdl/config/ltmain.m4sh
+++ b/libltdl/config/ltmain.m4sh
@@ -1458,6 +1458,7 @@ func_mode_install ()
     # Aesthetically quote it.
     func_quote_for_eval "$arg"
     install_prog="$install_prog$func_quote_for_eval_result"
+    install_shared_prog=$install_prog
 
     # We need to accept at least all the BSD install flags.
     dest=
@@ -1467,8 +1468,10 @@ func_mode_install ()
     install_type=
     isdir=no
     stripme=
+    no_mode=:
     for arg
     do
+      arg2=
       if test -n "$dest"; then
        files="$files $dest"
        dest=$arg
@@ -1495,6 +1498,10 @@ func_mode_install ()
       *)
        # If the previous option needed an argument, then skip it.
        if test -n "$prev"; then
+         if test "x$prev" = x-m && test -n "$install_override_mode"; then
+           arg2=$install_override_mode
+           no_mode=false
+         fi
          prev=
        else
          dest=$arg
@@ -1506,6 +1513,10 @@ func_mode_install ()
       # Aesthetically quote the argument.
       func_quote_for_eval "$arg"
       install_prog="$install_prog $func_quote_for_eval_result"
+      if test -n "$arg2"; then
+       func_quote_for_eval "$arg2"
+      fi
+      install_shared_prog="$install_shared_prog $func_quote_for_eval_result"
     done
 
     test -z "$install_prog" && \
@@ -1514,6 +1525,11 @@ func_mode_install ()
     test -n "$prev" && \
       func_fatal_help "the \`$prev' option requires an argument"
 
+    if test -n "$install_override_mode" && $no_mode; then
+      func_quote_for_eval "$install_override_mode"
+      install_shared_prog="$install_shared_prog -m $func_quote_for_eval_result"
+    fi
+
     if test -z "$files"; then
       if test -z "$dest"; then
        func_fatal_help "no file or destination specified"
@@ -1634,7 +1650,7 @@ func_mode_install ()
          test -n "$relink_command" && srcname="$realname"T
 
          # Install the shared library and build the symlinks.
-         func_show_eval "$install_prog $dir/$srcname $destdir/$realname" \
+         func_show_eval "$install_shared_prog $dir/$srcname 
$destdir/$realname" \
              'exit $?'
          tstripme="$stripme"
          case $host_os in
diff --git a/libltdl/m4/libtool.m4 b/libltdl/m4/libtool.m4
index 39ba996..caf88b1 100644
--- a/libltdl/m4/libtool.m4
+++ b/libltdl/m4/libtool.m4
@@ -2386,8 +2386,10 @@ hpux9* | hpux10* | hpux11*)
     soname_spec='${libname}${release}${shared_ext}$major'
     ;;
   esac
-  # HP-UX runs *really* slowly unless shared libraries are mode 555.
+  # HP-UX runs *really* slowly unless shared libraries are mode 555, ...
   postinstall_cmds='chmod 555 $lib'
+  # or fails outright, so override atomically:
+  install_override_mode=555
   ;;
 
 interix[[3-9]]*)
@@ -2705,6 +2707,8 @@ _LT_DECL([], [library_names_spec], [1],
     The last name is the one that the linker finds with -lNAME]])
 _LT_DECL([], [soname_spec], [1],
     [[The coded name of the library, if different from the real name]])
+_LT_DECL([], [install_override_mode], [1],
+    [Permission mode override for installation of shared libraries])
 _LT_DECL([], [postinstall_cmds], [2],
     [Command to use after installation of a shared archive])
 _LT_DECL([], [postuninstall_cmds], [2],
diff --git a/tests/ltdl-api.at b/tests/install.at
similarity index 50%
copy from tests/ltdl-api.at
copy to tests/install.at
index 465a513..e0a075c 100644
--- a/tests/ltdl-api.at
+++ b/tests/install.at
@@ -1,7 +1,7 @@
-# ltdl-api.at -- test libltdl API                -*- Autotest -*-
+# install.at -- install mode tests             -*- Autotest -*-
 #
 #   Copyright (C) 2008 Free Software Foundation, Inc.
-#   Written by Ralf Wildenhues, 2008.
+#   Written by Ralf Wildenhues, 2008
 #
 #   This file is part of GNU Libtool.
 #
@@ -22,18 +22,30 @@
 # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
 ####
 
-AT_SETUP([ltdl API])
-AT_KEYWORDS([libltdl])
+AT_SETUP([Install tests])
+AT_KEYWORDS([libtool])
 
-# Ensure that no symbols from argz are unrenamed.
-eval `$LIBTOOL --config | $EGREP '^(NM|global_symbol_pipe|objext)='`
-argz_o=$abs_top_builddir/libltdl/argz.$objext
-AT_CHECK([test -f "$argz_o" || exit 77])
-AT_CHECK([eval "$NM \"\$argz_o\" | $global_symbol_pipe"],
+# Ensure that install_override_mode overrides the mode of the shared
+# library (and only the shared library).
+
+AT_CHECK([$LIBTOOL --features | grep 'enable shared libraries' || exit 77],
+        [], [ignore])
+sed 's,^\(install_override_mode=\).*,&755,' < $LIBTOOL > ./libtool
+LIBTOOL=./libtool
+chmod a+rx $LIBTOOL
+
+inst=`pwd`/inst
+mkdir inst
+
+echo 'int a () { return 0; }' > a.c
+$LIBTOOL --mode=compile $CC $CPPFLAGS $CFLAGS -c a.c
+$LIBTOOL --mode=link $CC $CFLAGS $LDFLAGS -o liba.la a.lo -rpath $inst
+AT_CHECK([$LIBTOOL --mode=install $INSTALL liba.la $inst],
+        [], [stdout], [ignore])
+AT_CHECK([grep ' -m 755' stdout], [], [ignore])
+AT_CHECK([$LIBTOOL --mode=install $INSTALL -m 644 liba.la $inst],
         [], [stdout], [ignore])
-# Check for global symbols beginning with "argz_"
-AT_CHECK([grep "^T argz_" stdout], [1])
-# and also for the _ prefixed version "_argz_"
-AT_CHECK([grep "^T _argz_" stdout], [1])
+AT_CHECK([grep ' -m 755' stdout], [], [ignore])
+AT_CHECK([grep ' -m 644.*liba.la' stdout], [], [ignore])
 
 AT_CLEANUP


hooks/post-receive
--
GNU Libtool




reply via email to

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