diff options
author | Alexandre Oliva <aoliva@redhat.com> | 2005-03-01 22:33:54 +0000 |
---|---|---|
committer | Alexandre Oliva <aoliva@redhat.com> | 2005-03-01 22:33:54 +0000 |
commit | 33a3fb7b23777eb4dc2b36349ad7f921c590ae8c (patch) | |
tree | bfe3ec13117fe9fcd1e867e362c2c757da6ad885 | |
parent | a76903bf5d933f4737bafcb179b6d7a5d0e9ccc9 (diff) | |
download | gdb-33a3fb7b23777eb4dc2b36349ad7f921c590ae8c.zip gdb-33a3fb7b23777eb4dc2b36349ad7f921c590ae8c.tar.gz gdb-33a3fb7b23777eb4dc2b36349ad7f921c590ae8c.tar.bz2 |
PR libgcj/20160
* ltmain.sh: Avoid creating archives with components that have
duplicate basenames.
-rw-r--r-- | ChangeLog | 6 | ||||
-rw-r--r-- | ltmain.sh | 58 |
2 files changed, 64 insertions, 0 deletions
@@ -1,3 +1,9 @@ +2005-03-01 Alexandre Oliva <aoliva@redhat.com> + + PR libgcj/20160 + * ltmain.sh: Avoid creating archives with components that have + duplicate basenames. + 2005-02-28 Andrew Pinski <pinskia@physics.uc.edu> PR bootstrap/20250 @@ -4234,6 +4234,63 @@ fi\ # fi # done + # POSIX demands no paths to be encoded in archives. We have + # to avoid creating archives with duplicate basenames if we + # might have to extract them afterwards, e.g., when creating a + # static archive out of a convenience library, or when linking + # the entirety of a libtool archive into another (currently + # not supported by libtool). + 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..." + + if test -z "$gentop"; then + gentop="$output_objdir/${outputname}x" + + $show "${rm}r $gentop" + $run ${rm}r "$gentop" + $show "$mkdir $gentop" + $run $mkdir "$gentop" + status=$? + if test $status -ne 0 && test ! -d "$gentop"; then + exit $status + fi + generated="$generated $gentop" + fi + + save_oldobjs=$oldobjs + oldobjs= + counter=1 + 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 + $show "ln $obj $gentop/$newobj || cp $obj $gentop/$newobj" + $run ln "$obj" "$gentop/$newobj" || + $run cp "$obj" "$gentop/$newobj" + oldobjs="$oldobjs $gentop/$newobj" + ;; + *) oldobjs="$oldobjs $obj" ;; + esac + done + fi + eval cmds=\"$old_archive_cmds\" if len=`expr "X$cmds" : ".*"` && @@ -4247,6 +4304,7 @@ fi\ objlist= concat_cmds= save_oldobjs=$oldobjs + for obj in $save_oldobjs do oldobjs="$objlist $obj" |