# $Id$ # Main page of 'My::Project::libtool' # Copyright (C) 2003-2005 Jan Kratochvil # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; exactly version 2 of June 1991 is required # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA package project::libtool::Index; require 5.6.0; # at least 'use warnings;' but we need some 5.6.0+ modules anyway our $VERSION=do { my @r=(q$Revision$=~/\d+/g); sprintf "%d.".("%03d"x$#r),@r; }; our $CVS_ID=q$Id$; use strict; use warnings; use My::Web; Wuse 'project::Lib'; our @ListItem=( "name"=>sub { return a_href('http://www.gnu.org/software/libtool/libtool.html','GNU Libtool').' fix'; }, "platform"=>"patch", "priority"=>620, "summary"=>'Handle duplicate object file names', "download-patch"=>'http://savannah.gnu.org/cgi-bin/cvsweb/libtool/ltmain.in.diff?r1=1.320&r2=1.321', "license"=>"GPL", "maintenance"=>"accepted", "language"=>"sh patch", "description"=><<"HERE",

Patch fixes linking of convenience libraries (.a) containing two conflicting name objects.

HERE ); sub handler { project::Lib->init(); print <<"HERE";

When you include convenience library (.a) containing two conflicting name objects (same basename from two different directories) only one of those two object files will survive in ".libs/libA.lax/" arena:

	rm -fr .libs/libA.lax/libB.a
	mkdir .libs/libA.lax/libB.a
	(cd .libs/libA.lax/libB.a && ar x /abs/path/to/A/B/.libs/libB.a)

The patch implements automatic renaming of "*.*" to "*-@{[ '$' ]}seqnum.*" in such case:

	libtool: link: warning: object name conflicts; renaming object files
	libtool: link: warning: to ensure that they will not overwrite
	(cd .libs/libA.lax/libB.a && ar xN 1 /abs/path/to/A/B/.libs/libB.a 'XconflictX.o' && mv -f 'XconflictX.o' 'XconflictX-1.o')
	(cd .libs/libA.lax/libB.a && ar xN 2 /abs/path/to/A/B/.libs/libB.a 'XconflictX.o' && mv -f 'XconflictX.o' 'XconflictX-2.o')

Although renaming to a new name may be confusing IMO there is no better option. The original (conflicting) name is not left there in any instance to prevent misleading confusion of different object file found than expected.

HERE exit; } 1;