public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* PATCH: Fix Java libgcj.a libtool link on Windows
@ 2005-03-30 21:14 Aaron W. LaFramboise
  2005-03-30 23:03 ` Alexandre Oliva
  0 siblings, 1 reply; 2+ messages in thread
From: Aaron W. LaFramboise @ 2005-03-30 21:14 UTC (permalink / raw)
  To: Gcc Patch List; +Cc: Danny Smith, aoliva

[-- Attachment #1: Type: text/plain, Size: 626 bytes --]

Earlier this month, Alexandre Oliva fixed ltmain.sh so that libtool
would not discard duplicate basenames in archives
(http://gcc.gnu.org/ml/gcc-patches/2005-03/msg00057.html).  The attached
patch alters this slightly by making the basename comparison
case-insensitive.  With this change, libjava is able to successfully
bootstrap on Windows.

The case-insensitive comparison is used for all targets, as non-Windows
targets may well be using a case-insensitive filesystem as well, and
selectively enabling case-insensitivity seems more complicated than its
worth.

This fixes PR libgcj/20654.

Tested on i686-pc-mingw32.

OK?

[-- Attachment #2: gcc-mainline-20050330-case.patch --]
[-- Type: text/plain, Size: 2234 bytes --]

2005-03-30  Aaron W. LaFramboise  <aaronavay62@aaronwl.com>

	PR libgcj/20654
	ltmain.sh: Make basename comparison case-insensitive.

Index: ltmain.sh
===================================================================
RCS file: /cvs/gcc/gcc/ltmain.sh,v
retrieving revision 1.25
diff -c -3 -p -r1.25 ltmain.sh
*** ltmain.sh	1 Mar 2005 22:27:43 -0000	1.25
--- ltmain.sh	30 Mar 2005 03:05:12 -0000
*************** fi\
*** 4316,4322 ****
          if (for obj in $oldobjs
  	    do
  	      $echo "X$obj" | $Xsed -e 's%^.*/%%'
! 	    done | sort | sort -uc >/dev/null 2>&1); then
  	  :
  	else
  	  $echo "copying selected object files to avoid basename conflicts..."
--- 4316,4322 ----
          if (for obj in $oldobjs
  	    do
  	      $echo "X$obj" | $Xsed -e 's%^.*/%%'
! 	    done | sort -f | sort -ucf >/dev/null 2>&1); then
  	  :
  	else
  	  $echo "copying selected object files to avoid basename conflicts..."
*************** fi\
*** 4341,4356 ****
  	  for obj in $save_oldobjs
  	  do
  	    objbase=`$echo "X$obj" | $Xsed -e 's%^.*/%%'`
! 	    case " $oldobjs " in
  	    " ") oldobjs=$obj ;;
! 	    *[\ /]"$objbase "*)
  	      while :; do
  		# Make sure we don't pick an alternate name that also
  		# overlaps.
  	        newobj=lt$counter-$objbase
  	        counter=`expr $counter + 1`
! 		case " $oldobjs " in
! 		*[\ /]"$newobj "*) ;;
  		*) if test ! -f "$gentop/$newobj"; then break; fi ;;
  		esac
  	      done
--- 4341,4360 ----
  	  for obj in $save_oldobjs
  	  do
  	    objbase=`$echo "X$obj" | $Xsed -e 's%^.*/%%'`
! 	    case " `echo $oldobjs | tr abcdefghijklmnopqrstuvwxyz \
! 	      ABCDEFGHIJKLMNOPQRSTUVWXYZ` " in
  	    " ") oldobjs=$obj ;;
! 	    *[\ /]"`echo $objbase | tr abcdefghijklmnopqrstuvwxyz \
! 	      ABCDEFGHIJKLMNOPQRSTUVWXYZ` "*)
  	      while :; do
  		# Make sure we don't pick an alternate name that also
  		# overlaps.
  	        newobj=lt$counter-$objbase
  	        counter=`expr $counter + 1`
! 		case " `echo $oldobjs | tr abcdefghijklmnopqrstuvwxyz \
! 		  ABCDEFGHIJKLMNOPQRSTUVWXYZ` " in
! 		*[\ /]"`echo $newobj | tr abcdefghijklmnopqrstuvwxyz \
! 		  ABCDEFGHIJKLMNOPQRSTUVWXYZ` "*) ;;
  		*) if test ! -f "$gentop/$newobj"; then break; fi ;;
  		esac
  	      done

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: PATCH: Fix Java libgcj.a libtool link on Windows
  2005-03-30 21:14 PATCH: Fix Java libgcj.a libtool link on Windows Aaron W. LaFramboise
@ 2005-03-30 23:03 ` Alexandre Oliva
  0 siblings, 0 replies; 2+ messages in thread
From: Alexandre Oliva @ 2005-03-30 23:03 UTC (permalink / raw)
  To: Aaron W. LaFramboise; +Cc: Gcc Patch List, Danny Smith

On Mar 30, 2005, "Aaron W. LaFramboise" <aaronavay62@aaronwl.com> wrote:

> 	PR libgcj/20654
> 	ltmain.sh: Make basename comparison case-insensitive.

The idea is good, but we need some further work.

First, this has to be in upstream libtool before we accept it in GCC.

Second, it would be very nice to hoist the calls of tr such that you
don't run them over the entire string all the time.  What I have in
mind is something like this:

+         oldobjslower=
    	  for obj in $save_oldobjs
    	  do
-   	    objbase=`$echo "X$obj" | $Xsed -e 's%^.*/%%'`
- 	    case " $oldobjs " in
-  	    "  ") oldobjs=$obj ;;
+           objlower=`echo "X$obj" | $Xsed | tr ABC...Z abc...z.`
+   	    objbase=`$echo "X$objlower" | $Xsed -e 's%^.*/%%'`
+ 	    case " $oldobjslower " in
+           "  ") oldobjs=$obj oldobjslower=$objlower ;;
 	    *[\ /]"$objbase "*)
    	      while :; do
    		# Make sure we don't pick an alternate name that also
    		# overlaps.
    	        newobj=lt$counter-$objbase
    	        counter=`expr $counter + 1`
- 		case " $oldobjs " in
+ 		case " $oldobjslower " in
  		*[\ /]"$newobj "*) ;;
    		*) if test ! -f "$gentop/$newobj"; then break; fi ;;
    		esac
    	      done
+             oldobjlower="$oldobjlower $gentop/$newobj"


See how this would make it much faster?

Please give this a try and post a revised patch.

Upstream libtool will probably take a somewhat different approach,
since the pathname duplicate handling is somewhat different there.

Thanks for looking into this.

-- 
Alexandre Oliva             http://www.ic.unicamp.br/~oliva/
Red Hat Compiler Engineer   aoliva@{redhat.com, gcc.gnu.org}
Free Software Evangelist  oliva@{lsd.ic.unicamp.br, gnu.org}

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2005-03-30 22:59 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-03-30 21:14 PATCH: Fix Java libgcj.a libtool link on Windows Aaron W. LaFramboise
2005-03-30 23:03 ` Alexandre Oliva

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).