Circular dependencies between libinnhist and libstorage
Julien ÉLIE
julien at trigofacile.com
Tue Mar 24 20:37:00 UTC 2015
Hi,
I recently tried to build INN 2.6.0 on an Ubuntu VM (12.04.1 LTS)
provided by the GCC C Farm, and found out that the build fails
because of the "$(LIBHIST) $(LIBSTORAGE)" order.
For instance, we currently have in expire/Makefile:
BOTH = $(LIBHIST) $(LIBSTORAGE) $(LIBINN)
farmuser at ubuntu-1204-amd64:/scratch/iulius/inn-CURRENT-20150322/expire$ ../libtool --mode=link gcc -o fastrm fastrm.o /scratch../libtool --mode=link gcc -o fastrm fastrm.o /scratch/iulius/inn-CURRENT-20150322/history/libinnhist.la /scratch/iulius/inn-CURRENT-20150322/storage/libstorage.la /scratch/iulius/inn-CURRENT-20150322/lib/libinn.la
libtool: link: gcc -o .libs/fastrm fastrm.o /scratch/iulius/inn-CURRENT-20150322/history/.libs/libinnhist.so /scratch/iulius/inn-CURRENT-20150322/storage/.libs/libstorage.so /scratch/iulius/inn-CURRENT-20150322/lib/.libs/libinn.so -Wl,-rpath -Wl,/usr/local/news/lib
/scratch/iulius/inn-CURRENT-20150322/storage/.libs/libstorage.so: undefined reference to `HISlookup'
collect2: ld returned 1 exit status
make: *** [fastrm] Error 1
Changing the line to:
BOTH = $(LIBSTORAGE) $(LIBHIST) $(LIBSTORAGE) $(LIBINN)
does not help for INN 2.6.0 because libtool removes the first libstorage.la!
../libtool --mode=link gcc -o fastrm fastrm.o /scratch/iulius/inn-CURRENT-20150322/storage/libstorage.la /scratch/iulius/inn-CURRENT-20150322/history/libinnhist.la /scratch/iulius/inn-CURRENT-20150322/storage/libstorage.la /scratch/iulius/inn-CURRENT-20150322/lib/libinn.la
libtool: link: gcc -o .libs/fastrm fastrm.o /scratch/iulius/inn-CURRENT-20150322/history/.libs/libinnhist.so /scratch/iulius/inn-CURRENT-20150322/storage/.libs/libstorage.so /scratch/iulius/inn-CURRENT-20150322/lib/.libs/libinn.so -Wl,-rpath -Wl,/usr/local/news/lib
/scratch/iulius/inn-CURRENT-20150322/storage/.libs/libstorage.so: undefined reference to `HISlookup'
collect2: ld returned 1 exit status
make: *** [fastrm] Error 1
However, the build is OK with:
BOTH = $(LIBSTORAGE) $(LIBHIST) $(LIBINN)
I hope this new order is fine.
Russ, you seem to remember cases where $(LIBSTORAGE)
should be after $(LIBHIST); does it only concern backends?
Note that we no longer have $(LIBSTORAGE) listed twice in
backends/Makefile for INN 2.6.0. Does that sound OK now that
Libtool is unconditionally used?
(I do not see errors on other servers of the GCC C Farm.)
--
Julien ÉLIE
Le 24/09/2014 04:53, INN Commit a écrit :
>
> Date: Tuesday, September 23, 2014 @ 19:53:29
> Author: eagle
> Revision: 9720
>
> Re-add second $(LIBSTORAGE) when linking backends
>
> Backend commands (such as nntpget) linked with both history
> and storage libraries list $(LIBSTORAGE) in the link line twice.
> This isn't a mistake; there are some unfortunate circular
> dependencies that require listing $(LIBSTORAGE) both before
> and after $(LIBINNHIST) in the link line or static linking will
> fail.
>
> Modified:
> branches/2.5/backends/Makefile
>
> ----------+
> Makefile | 4 +++-
> 1 file changed, 3 insertions(+), 1 deletion(-)
>
> Modified: Makefile
> ===================================================================
> --- Makefile 2014-09-22 19:19:40 UTC (rev 9719)
> +++ Makefile 2014-09-24 02:53:29 UTC (rev 9720)
> @@ -71,7 +71,9 @@
>
> ## Compilation rules.
>
> -BOTH = $(LIBSTORAGE) $(LIBHIST) $(LIBINN)
> +# $(LIBSTORAGE) must be listed twice to resolve circular dependencies
> +# when doing static linking.
> +BOTH = $(LIBSTORAGE) $(LIBHIST) $(LIBSTORAGE) $(LIBINN)
>
> LINK = $(LIBLD) $(LDFLAGS) -o $@
> INNLIBS = $(LIBINN) $(LIBS)
>
More information about the inn-workers
mailing list