bug-automake
[Top][All Lists]
Advanced

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

Re: getdate.lo is linked twice to libgnu.la


From: Ralf Wildenhues
Subject: Re: getdate.lo is linked twice to libgnu.la
Date: Wed, 13 Sep 2006 15:46:10 +0200
User-agent: Mutt/1.5.13 (2006-09-01)

[ quoting generously for bug-automake ]

Hello Simon.

* Simon Josefsson wrote on Wed, Sep 13, 2006 at 02:19:04PM CEST:
> When building Shishi using latest gnulib, I got this:
> 
> ../gl/.libs/libgnu.a(lt1-getdate.o): In function `yyparse':
> /home/jas/src/shishi/gl/getdate.c:1398: multiple definition of `yyparse'
> ../gl/.libs/libgnu.a(getdate.o):/home/jas/src/shishi/gl/getdate.c:1398: first 
> defined here

> The cause appears to be that getdate.lo is added twice to the libtool
> command:
*snip*

> This can be reproduced without libtool using:
> 
> rm -rf /tmp/testdir;./gnulib-tool --create-testdir --dir=/tmp/testdir getdate
> cd /tmp/testdir && autoreconf -fvi && ./configure && make
> ...
> ar cru libgnu.a allocsa.o getdate.o xalloc-die.o mktime.o exitfail.o 
> getdate.o gettime.o xmalloc.o
> 
> The getdate Makefile.am snippet is:
> 
> libgnu_a_SOURCES += getdate.y
> BUILT_SOURCES += getdate.c
> MAINTAINERCLEANFILES += getdate.c
> EXTRA_DIST += getdate.c getdate.h
> 
> The getdate.m4 contains:
> 
>   AC_LIBOBJ([getdate])
> 
> I'm not exactly sure what happens, but it seems AC_LIBOBJ adds one
> copy of getdate.lo, and automake adds another (due to BUILT_SOURCE?).

I think the fix is to drop the AC_LIBOBJ line from getdate.m4.  But
Automake also could warn against this (it warns in a slightly simpler
setting not involving built sources).  For this however, gnulib-tool
should use $(LIBOBJS) instead of @LIBOBJS@ in the Makefile.am snippet
that it outputs (so that automake has a chance to detect this).  Why
doesn't gnulib-tool do that, by the way?

Hmm.  There is probably also a Libtool bug involved: it should not
rename objects listed on the command line.  But first this is a bit
tricky to solve (renaming objects that stem from convenience archives
may simply be necessary), won't save you from every possible failure
case (getdate.o passed on the command line and also in a convenience
archive), and won't help you at all in the non-Libtool case.

Cheers,
Ralf




reply via email to

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