GNU bug report logs - #12637
'ar cru' rejecting empty object list on darwin11

Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.

Package: libtool; Reported by: David Fang <fang@HIDDEN>; dated Sat, 13 Oct 2012 16:37:02 UTC; Maintainer for libtool is bug-libtool@HIDDEN.

Message received at submit <at> debbugs.gnu.org:


Received: (at submit) by debbugs.gnu.org; 13 Oct 2012 16:36:12 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sat Oct 13 12:36:12 2012
Received: from localhost ([127.0.0.1]:42743 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.72)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1TN4h8-0007CY-Tb
	for submit <at> debbugs.gnu.org; Sat, 13 Oct 2012 12:36:12 -0400
Received: from eggs.gnu.org ([208.118.235.92]:57393)
	by debbugs.gnu.org with esmtp (Exim 4.72)
	(envelope-from <fang@HIDDEN>) id 1TN4h3-0007C1-Et
	for submit <at> debbugs.gnu.org; Sat, 13 Oct 2012 12:36:09 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <fang@HIDDEN>) id 1TN4g1-0004RV-PK
	for submit <at> debbugs.gnu.org; Sat, 13 Oct 2012 12:35:03 -0400
X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org
X-Spam-Level: 
X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_HI
	autolearn=unavailable version=3.3.2
Received: from lists.gnu.org ([208.118.235.17]:36547)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <fang@HIDDEN>) id 1TN4g1-0004Qk-Mx
	for submit <at> debbugs.gnu.org; Sat, 13 Oct 2012 12:35:01 -0400
Received: from eggs.gnu.org ([208.118.235.92]:42681)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <fang@HIDDEN>) id 1TN4fz-0004UB-V8
	for bug-libtool@HIDDEN; Sat, 13 Oct 2012 12:35:01 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <fang@HIDDEN>) id 1TN4fx-0004Lo-Pe
	for bug-libtool@HIDDEN; Sat, 13 Oct 2012 12:34:59 -0400
Received: from csl.cornell.edu ([128.84.224.10]:3859 helo=vlsi.csl.cornell.edu)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <fang@HIDDEN>) id 1TN4fx-0004Lf-Kf
	for bug-libtool@HIDDEN; Sat, 13 Oct 2012 12:34:57 -0400
Received: from hal-00.csl.cornell.edu (hal-00.csl.cornell.edu [128.84.224.105])
	by vlsi.csl.cornell.edu (8.13.4/8.13.4) with ESMTP id q9DGYpol021833
	for <bug-libtool@HIDDEN>; Sat, 13 Oct 2012 12:34:56 -0400 (EDT)
Date: Sat, 13 Oct 2012 12:34:51 -0400 (EDT)
From: David Fang <fang@HIDDEN>
To: bug-libtool@HIDDEN
Subject: 'ar cru' rejecting empty object list on darwin11
Message-ID: <Pine.LNX.4.64.1210131219440.14048@HIDDEN>
MIME-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed
X-detected-operating-system: by eggs.gnu.org: FreeBSD 2.0-4.2
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3)
X-Received-From: 208.118.235.17
X-Spam-Score: -4.2 (----)
X-Debbugs-Envelope-To: submit
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <http://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>,
	<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <http://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <http://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>,
	<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Sender: debbugs-submit-bounces <at> debbugs.gnu.org
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
X-Spam-Score: -4.2 (----)

Hi,
 	I'm getting an error with libtool --mode=link on darwin11 (OS X 
10.7.5), using xcode command-line tools 4.5.1 (October 2012).  An 'ar cru' 
command fails because it expects a non-empty object list.

The brief:
[fangism-pro:hackt-0.1.4-devel-20121012/darwin-build/src] fang% make -j1
All header tests passed.
make  all-recursive
Making all in util/test
make  all-am
make[3]: Nothing to be done for `all-am'.
Making all in .
/bin/sh ../libtool  --tag=CXX   --mode=link clang++ -pipe -ansi 
-pedantic-errors -Wold-style-cast -Woverloaded-virtual -W -Wextra -Wall 
-Wundef -Wshadow -Wno-unused-parameter -Wpointer-arith -Wcast-qual 
-Wcast-align -Wconversion -Werror -g -O2 -Wno-error=sign-conversion 
-Wno-error=unused-function -Wno-error=conversion -Qunused-arguments 
-L/sw/lib   -L/sw/lib -o libhacktexec.la  main/force_load.lo 
main/program_registry.lo main/parse_test.lo main/flatten.lo main/haco.lo 
main/create.lo main/cflat.lo main/prsobjdemo.lo main/prsim-main.lo 
main/dump_persistent_table.lo main/objdump.lo main/shell.lo 
main/version.lo main/chpsim.lo main/hacknet.lo    libhacktprsim.la 
libhacktchpsim.la libhacknet.la
libtool: link: rm -fr  .libs/libhacktexec.a .libs/libhacktexec.la
libtool: link: ar cru .libs/libhacktexec.a main/.libs/force_load.o 
main/.libs/program_registry.o main/.libs/parse_test.o main/.libs/flatten.o 
main/.libs/haco.o main/.libs/create.o main/.libs/cflat.o 
main/.libs/prsobjdemo.o main/.libs/prsim-main.o 
main/.libs/dump_persistent_table.o main/.libs/objdump.o main/.libs/shell.o 
main/.libs/version.o main/.libs/chpsim.o main/.libs/hacknet.o
libtool: link: ranlib .libs/libhacktexec.a
libtool: link: ( cd ".libs" && rm -f "libhacktexec.la" && ln -s 
"../libhacktexec.la" "libhacktexec.la" )
/bin/sh ../libtool  --tag=CC   --mode=link clang -pipe -ansi 
-pedantic-errors -Wmissing-prototypes -Wstrict-prototypes 
-Wbad-function-cast -Wnested-externs -W -Wextra -Wall -Wundef -Wshadow 
-Wno-unused-parameter -Wpointer-arith -Wcast-qual -Wcast-align 
-Wconversion -Werror -g -O2 -Qunused-arguments -module -L/sw/lib -o 
hackt-guile.la -rpath /sw/lib/hackt  libhacktguile.la
libtool: link: warning: `/sw/lib/libgmp.la' seems to be moved
libtool: link: warning: `/sw/lib/libgmp.la' seems to be moved
libtool: link: warning: library `/sw/lib/libgmp.la' was moved.
libtool: link: rm -fr  .libs/hackt-guile.0.so .libs/hackt-guile.so
libtool: link: clang -Wl,-undefined -Wl,dynamic_lookup -o 
.libs/hackt-guile.0.so -bundle   -L/sw/lib ./.libs/libhacktguile.dylib 
/sw/src/fink.build/hackt-0.1.4-devel-20121012-1/hackt-0.1.4-devel-20121012/darwin-build/src/.libs/libhacktlib.dylib 
/sw/src/fink.build/hackt-0.1.4-devel-20121012-1/hackt-0.1.4-devel-20121012/darwin-build/src/.libs/libhacktparsers.dylib 
/sw/src/fink.build/hackt-0.1.4-devel-20121012-1/hackt-0.1.4-devel-20121012/darwin-build/src/.libs/libhacktast.dylib 
/sw/src/fink.build/hackt-0.1.4-devel-20121012-1/hackt-0.1.4-devel-20121012/darwin-build/src/.libs/libfangutil.dylib 
-lreadline -lncurses 
/sw/src/fink.build/hackt-0.1.4-devel-20121012-1/hackt-0.1.4-devel-20121012/darwin-build/src/.libs/libguileutil.dylib 
/sw/lib/libguile.dylib /sw/lib/libgmp.dylib -lm /sw/lib/libltdl.dylib  -O2 
-Wl,-dylib_file 
-Wl,/sw/lib/hackt/libhacktlib.0.dylib:/sw/src/fink.build/hackt-0.1.4-devel-20121012-1/hackt-0.1.4-devel-20121012/darwin-build/src/.libs/libhacktlib.dylib 
-Wl,-dylib_file 
-Wl,/sw/lib/hackt/libhacktparsers.0.dylib:/sw/src/fink.build/hackt-0.1.4-devel-20121012-1/hackt-0.1.4-devel-20121012/darwin-build/src/.libs/libhacktparsers.dylib 
-Wl,-dylib_file 
-Wl,/sw/lib/hackt/libhacktast.0.dylib:/sw/src/fink.build/hackt-0.1.4-devel-20121012-1/hackt-0.1.4-devel-20121012/darwin-build/src/.libs/libhacktast.dylib 
-Wl,-dylib_file 
-Wl,/sw/lib/hackt/libfangutil.0.dylib:/sw/src/fink.build/hackt-0.1.4-devel-20121012-1/hackt-0.1.4-devel-20121012/darwin-build/src/.libs/libfangutil.dylib 
-Wl,-dylib_file 
-Wl,/sw/lib/hackt/libguileutil.0.dylib:/sw/src/fink.build/hackt-0.1.4-devel-20121012-1/hackt-0.1.4-devel-20121012/darwin-build/src/.libs/libguileutil.dylib 
-Wl,-dylib_file 
-Wl,/sw/lib/hackt/libhacktparsers.0.dylib:/sw/src/fink.build/hackt-0.1.4-devel-20121012-1/hackt-0.1.4-devel-20121012/darwin-build/src/.libs/libhacktparsers.dylib 
-Wl,-dylib_file 
-Wl,/sw/lib/hackt/libhacktast.0.dylib:/sw/src/fink.build/hackt-0.1.4-devel-20121012-1/hackt-0.1.4-devel-20121012/darwin-build/src/.libs/libhacktast.dylib 
-Wl,-dylib_file 
-Wl,/sw/lib/hackt/libfangutil.0.dylib:/sw/src/fink.build/hackt-0.1.4-devel-20121012-1/hackt-0.1.4-devel-20121012/darwin-build/src/.libs/libfangutil.dylib 
-Wl,-dylib_file 
-Wl,/sw/lib/hackt/libhacktast.0.dylib:/sw/src/fink.build/hackt-0.1.4-devel-20121012-1/hackt-0.1.4-devel-20121012/darwin-build/src/.libs/libhacktast.dylib 
-Wl,-dylib_file 
-Wl,/sw/lib/hackt/libfangutil.0.dylib:/sw/src/fink.build/hackt-0.1.4-devel-20121012-1/hackt-0.1.4-devel-20121012/darwin-build/src/.libs/libfangutil.dylib 
-Wl,-dylib_file 
-Wl,/sw/lib/hackt/libfangutil.0.dylib:/sw/src/fink.build/hackt-0.1.4-devel-20121012-1/hackt-0.1.4-devel-20121012/darwin-build/src/.libs/libfangutil.dylib
libtool: link: (cd ".libs" && rm -f "hackt-guile.so" && ln -s 
"hackt-guile.0.so" "hackt-guile.so")
libtool: link: ar cru .libs/hackt-guile.a
ar: no archive members specified
usage:  ar -d [-TLsv] archive file ...
 	ar -m [-TLsv] archive file ...
 	ar -m [-abiTLsv] position archive file ...
 	ar -p [-TLsv] archive [file ...]
 	ar -q [-cTLsv] archive file ...
 	ar -r [-cuTLsv] archive file ...
 	ar -r [-abciuTLsv] position archive file ...
 	ar -t [-TLsv] archive [file ...]
 	ar -x [-ouTLsv] archive [file ...]
make[2]: *** [hackt-guile.la] Error 1
make[1]: *** [all-recursive] Error 1
make: *** [all] Error 2



With --debug added to the libtool command, the tail of the output shows:
+ func_to_tool_file .libs/hackt-guile.a func_convert_file_msys_to_w32
+ set -x
+ case ,$2, in
+ func_convert_file_noop .libs/hackt-guile.a
+ func_to_host_file_result=.libs/hackt-guile.a
+ func_to_tool_file_result=.libs/hackt-guile.a
+ tool_oldlib=.libs/hackt-guile.a
+ eval 'cmds="$AR' '$AR_FLAGS' '$oldlib$oldobjs~$RANLIB' '$tool_oldlib"'
++ cmds='ar cru .libs/hackt-guile.a ~ranlib .libs/hackt-guile.a'
+ func_len ' ar cru .libs/hackt-guile.a ~ranlib .libs/hackt-guile.a'
+ func_len_result=55
+ len=55
+ test 55 -lt 196608
+ cmds='$AR $AR_FLAGS $oldlib$oldobjs~$RANLIB $tool_oldlib'
+ func_execute_cmds '$AR $AR_FLAGS $oldlib$oldobjs~$RANLIB $tool_oldlib' 
'exit $?'
+ set -x
+ save_ifs='
'
+ IFS='~'
+ for cmd in '$1'
+ IFS='
'
+ eval 'cmd="$AR' '$AR_FLAGS' '$oldlib$oldobjs"'
++ cmd='ar cru .libs/hackt-guile.a '
+ func_show_eval 'ar cru .libs/hackt-guile.a ' 'exit $?'
+ my_cmd='ar cru .libs/hackt-guile.a '
+ my_fail_exp='exit $?'
+ false
+ func_quote_for_expand 'ar cru .libs/hackt-guile.a '
+ case $1 in
+ my_arg='ar cru .libs/hackt-guile.a '
+ case $my_arg in
+ my_arg='"ar cru .libs/hackt-guile.a "'
+ func_quote_for_expand_result='"ar cru .libs/hackt-guile.a "'
+ eval 'func_echo "ar cru .libs/hackt-guile.a "'
++ func_echo 'ar cru .libs/hackt-guile.a '
++ echo 'libtool: link: ar cru .libs/hackt-guile.a '
libtool: link: ar cru .libs/hackt-guile.a
+ false
+ eval 'ar cru .libs/hackt-guile.a '
++ ar cru .libs/hackt-guile.a
ar: no archive members specified
usage:  ar -d [-TLsv] archive file ...
 	ar -m [-TLsv] archive file ...
 	ar -m [-abiTLsv] position archive file ...
 	ar -p [-TLsv] archive [file ...]
 	ar -q [-cTLsv] archive file ...
 	ar -r [-cuTLsv] archive file ...
 	ar -r [-abciuTLsv] position archive file ...
 	ar -t [-TLsv] archive [file ...]
 	ar -x [-ouTLsv] archive [file ...]
+ my_status=1
+ test 1 -eq 0
+ eval '(exit 1); exit $?'
++ exit 1
++ exit 1

from Makefile.am (relevant lines):
pkglib_LTLIBRARIES += libhacktguile.la
pkglib_LTLIBRARIES += hackt-guile.la
hackt_guile_la_SOURCES =
hackt_guile_la_LDFLAGS = -module
hackt_guile_la_LIBADD = libhacktguile.la

libhacktguile_la_SOURCES = \
         guile/libhackt-wrap.cc \
         guile/libhackt-wrap.h \
 	...
libhacktguile_la_CPPFLAGS = $(GUILE_CPPFLAGS) -DWITH_MAIN
libhacktguile_la_CXXFLAGS = $(AM_CXXFLAGS) $(GUILE_WARN_FLAGS) \
         -Wno-old-style-cast -Werror
libhacktguile_la_LIBADD = libhacktlib.la libguileutil.la

hackt-guile.la is a loadable module with no additional sources,
just a library dependency on libhacktguile.la.

To get this far I had to apply a workaround patch to the 
configure-generated libtool script for issue 12156 (tr):
http://debbugs.gnu.org/cgi/bugreport.cgi?bug=12156


Does anything in the debug trace look wrong?
Is ar supposed to be called if the archive member list is empty?
If not, is there a suitable patch or workaround?

Fang


-- 
David Fang
http://www.csl.cornell.edu/~fang/





Acknowledgement sent to David Fang <fang@HIDDEN>:
New bug report received and forwarded. Copy sent to bug-libtool@HIDDEN. Full text available.
Report forwarded to bug-libtool@HIDDEN:
bug#12637; Package libtool. Full text available.
Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.
Last modified: Mon, 25 Nov 2019 12:00:02 UTC

GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997 nCipher Corporation Ltd, 1994-97 Ian Jackson.