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-126-gb04fe8e


From: Ralf Wildenhues
Subject: [SCM] GNU Libtool branch, master, updated. v2.2.6-126-gb04fe8e
Date: Wed, 10 Jun 2009 17:48:01 +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  b04fe8e6da2b5bed914911bfd8567ba9e93da40b (commit)
      from  efe1cfec710dbd06987fed02ec4d70d5c6630322 (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 b04fe8e6da2b5bed914911bfd8567ba9e93da40b
Author: Ralf Wildenhues <address@hidden>
Date:   Wed Jun 10 19:47:33 2009 +0200

    Fix concurrent extraction of convenience libraries on Darwin.
    
    * libltdl/m4/libtool.m4 (_LT_CMD_OLD_ARCHIVE): New libtool
    variable `lock_old_archive_extraction', set to `yes' on darwin.
    * doc/libtool.texi (libtool script contents): Document it.
    * libltdl/config/ltmain.m4sh (func_extract_an_archive): Lock
    `ar x' invocation if `lock_old_archive_extraction' is yes.
    * tests/darwin.at (darwin concurrent library extraction): New
    test.
    * NEWS: Update.
    Report by Akim Demaille.
    
    Signed-off-by: Ralf Wildenhues <address@hidden>

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

Summary of changes:
 ChangeLog                  |   13 +++++++++++
 NEWS                       |    3 ++
 doc/libtool.texi           |    5 ++++
 libltdl/config/ltmain.m4sh |   13 ++++++++++-
 libltdl/m4/libtool.m4      |    9 +++++++
 tests/darwin.at            |   52 +++++++++++++++++++++++++++++++++++++++++++-
 6 files changed, 93 insertions(+), 2 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 596abea..0eedffd 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,16 @@
+2009-06-10  Ralf Wildenhues  <address@hidden>
+
+       Fix concurrent extraction of convenience libraries on Darwin.
+       * libltdl/m4/libtool.m4 (_LT_CMD_OLD_ARCHIVE): New libtool
+       variable `lock_old_archive_extraction', set to `yes' on darwin.
+       * doc/libtool.texi (libtool script contents): Document it.
+       * libltdl/config/ltmain.m4sh (func_extract_an_archive): Lock
+       `ar x' invocation if `lock_old_archive_extraction' is yes.
+       * tests/darwin.at (darwin concurrent library extraction): New
+       test.
+       * NEWS: Update.
+       Report by Akim Demaille.
+
 2009-06-07  Ralf Wildenhues  <address@hidden>
 
        Fix testsuite failure of lt_dlopenadvise test on FreeMiNT.
diff --git a/NEWS b/NEWS
index 3656acd..5a57891 100644
--- a/NEWS
+++ b/NEWS
@@ -38,6 +38,9 @@ New in 2.2.8 2009-??-??: git version 2.2.7a, Libtool team:
     The regression affected mainly (arguably broken) cross compiles.
   - Fix long standing bug that caused compiler checks for Fortran and
     C++ compilers to run twice.
+  - Link mode works around a parallel build failure on Darwin 9.6.0 due
+    to the `ar' `flock'ing an archive upon extraction, by protecting the
+    extraction of convenience archives with a lock.
 
 * Miscellaneous changes:
 
diff --git a/doc/libtool.texi b/doc/libtool.texi
index 5e25531..a7872c6 100644
--- a/doc/libtool.texi
+++ b/doc/libtool.texi
@@ -5670,6 +5670,11 @@ these commands, libtool will proceed to link against 
@var{$objdir/$newlib}
 instead of @var{soname}.
 @end defvar
 
address@hidden lock_old_archive_extraction
+Set to @samp{yes} if the extraction of a static library requires locking
+the library file.  This is required on Darwin.
address@hidden defvar
+
 @defvar build
 @defvarx build_alias
 @defvarx build_os
diff --git a/libltdl/config/ltmain.m4sh b/libltdl/config/ltmain.m4sh
index 72660a8..02f4d21 100644
--- a/libltdl/config/ltmain.m4sh
+++ b/libltdl/config/ltmain.m4sh
@@ -2222,7 +2222,18 @@ func_extract_an_archive ()
     $opt_debug
     f_ex_an_ar_dir="$1"; shift
     f_ex_an_ar_oldlib="$1"
-    func_show_eval "(cd \$f_ex_an_ar_dir && $AR x \"\$f_ex_an_ar_oldlib\")" 
'exit $?'
+    if test "$lock_old_archive_extraction" = yes; then
+      lockfile=$f_ex_an_ar_oldlib.lock
+      until $opt_dry_run || ln "$progpath" "$lockfile" 2>/dev/null; do
+       func_echo "Waiting for $lockfile to be removed"
+       sleep 2
+      done
+    fi
+    func_show_eval "(cd \$f_ex_an_ar_dir && $AR x \"\$f_ex_an_ar_oldlib\")" \
+                  'stat=$?; rm -f "$lockfile"; exit $stat'
+    if test "$lock_old_archive_extraction" = yes; then
+      $opt_dry_run || rm -f "$lockfile"
+    fi
     if ($AR t "$f_ex_an_ar_oldlib" | sort | sort -uc >/dev/null 2>&1); then
      :
     else
diff --git a/libltdl/m4/libtool.m4 b/libltdl/m4/libtool.m4
index 0670980..5f24fab 100644
--- a/libltdl/m4/libtool.m4
+++ b/libltdl/m4/libtool.m4
@@ -1312,10 +1312,19 @@ if test -n "$RANLIB"; then
   esac
   old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib"
 fi
+
+case $host_os in
+  darwin*)
+    lock_old_archive_extraction=yes ;;
+  *)
+    lock_old_archive_extraction=no ;;
+esac
 _LT_DECL([], [old_postinstall_cmds], [2])
 _LT_DECL([], [old_postuninstall_cmds], [2])
 _LT_TAGDECL([], [old_archive_cmds], [2],
     [Commands used to build an old-style archive])
+_LT_DECL([], [lock_old_archive_extraction], [0],
+    [Whether to use a lock for old archive extraction])
 ])# _LT_CMD_OLD_ARCHIVE
 
 
diff --git a/tests/darwin.at b/tests/darwin.at
index 6284116..8884fd2 100644
--- a/tests/darwin.at
+++ b/tests/darwin.at
@@ -1,6 +1,6 @@
 # darwin.at - tests specific to Mac OS X
 #
-#   Copyright (C) 2008 Free Software Foundation, Inc.
+#   Copyright (C) 2008, 2009 Free Software Foundation, Inc.
 #   Written by Peter O'Gorman, 2008
 #
 #   This file is part of GNU Libtool.
@@ -98,3 +98,53 @@ AT_CHECK([$LIBTOOL --mode=link --tag=CC $CC  -o main$EXEEXT 
$CPPFLAGS $CFLAGS $L
 
 PATH=$save_PATH
 AT_CLEANUP
+
+
+AT_SETUP([darwin concurrent library extraction])
+
+AT_DATA([foo.c], [[
+int foo (void) { return 0; }
+]])
+
+AT_DATA([bar.c], [[
+extern int foo1 (void);
+int bar (void) { return foo1 (); }
+]])
+cp bar.c baz.c
+
+objects=
+for obj in 1 2 3 4 5 6 7 8; do
+  sed "s/foo/foo$obj/" < foo.c > foo$obj.c
+  AT_CHECK([$LIBTOOL --mode=compile $CC $CPPFLAGS $CFLAGS -c foo$obj.c],
+          [], [ignore], [ignore])
+  objects="$objects foo$obj.lo"
+done
+AT_CHECK([$LIBTOOL --mode=compile $CC $CPPFLAGS $CFLAGS -c bar.c],
+        [], [ignore], [ignore])
+AT_CHECK([$LIBTOOL --mode=compile $CC $CPPFLAGS $CFLAGS -c baz.c],
+        [], [ignore], [ignore])
+AT_CHECK([$LIBTOOL --mode=link $CC $CFLAGS $LDFLAGS -o libfoo.la $objects],
+        [], [ignore], [ignore])
+
+# Hypothesis: concurrent convenience archive extraction works.
+for i in 1 2 3 4 5; do
+  rm -f libbar.la libbaz.la
+  AT_CHECK([($LIBTOOL --mode=link $CC $CFLAGS $LDFLAGS ]dnl
+          [  -o libbar.la bar.lo -rpath /foo libfoo.la) & ]dnl
+          [($LIBTOOL --mode=link $CC $CFLAGS $LDFLAGS ]dnl
+          [  -o libbaz.la baz.lo -rpath /foo libfoo.la) & ]dnl
+          [wait; test -f libbar.la && test -f libbaz.la],
+          [], [ignore], [ignore])
+done
+
+# Hypothesis: the lock is not used in dry run mode.
+eval "`$LIBTOOL --config | $EGREP '^(objdir)='`"
+# Next line is internal detail.
+lockfile=$objdir/libfoo.a.lock
+echo stamp > $lockfile
+AT_CHECK([$LIBTOOL --dry-run --mode=link $CC $CFLAGS $LDFLAGS ]dnl
+        [ -o libbar.la bar.lo -rpath /foo libfoo.la],
+        [], [ignore], [ignore])
+AT_CHECK([grep stamp $lockfile], [], [ignore])
+
+AT_CLEANUP


hooks/post-receive
-- 
GNU Libtool




reply via email to

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