]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
ltmain.sh: Detect and handle object name conflicts while piecewise linking a static...
authorLoren J. Rittle <ljrittle@acm.org>
Thu, 6 Jun 2002 06:12:58 +0000 (06:12 +0000)
committerH.J. Lu <hjl@gcc.gnu.org>
Thu, 6 Jun 2002 06:12:58 +0000 (23:12 -0700)
2002-06-05  Loren J. Rittle <ljrittle@acm.org>

* ltmain.sh: Detect and handle object name conflicts while
piecewise linking a static library.

From-SVN: r54303

ChangeLog
ltmain.sh

index 060bd6c87352e2ba1ff89fe4d7d8b31108a57adf..a845620448a9b482afccbdb93b1e444234748735 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2002-06-05  Loren J. Rittle <ljrittle@acm.org>
+
+       * ltmain.sh: Detect and handle object name conflicts while
+       piecewise linking a static library.
+
 2002-05-14  Release Manager
 
        * GCC 3.1 Released.
index c3547e5a5616fe295eb4520d49735679f436ec3f..92526b60b795d2e598aa37a3de6efdf45440c80f 100644 (file)
--- a/ltmain.sh
+++ b/ltmain.sh
@@ -4247,6 +4247,20 @@ fi\
           objlist=
           concat_cmds=
           save_oldobjs=$oldobjs
+         # GNU ar 2.10+ was changed to match POSIX; thus no paths are
+         # encoded into archives.  This makes 'ar r' malfunction in
+         # this piecewise linking case whenever conflicting object
+         # names appear in distinct ar calls; check, warn and compensate.
+          if (for obj in $save_oldobjs
+           do
+             $echo "X$obj" | $Xsed -e 's%^.*/%%'
+           done | sort | sort -uc >/dev/null 2>&1); then
+           :
+         else
+           $echo "$modename: warning: object name conflicts; overriding AR_FLAGS to 'cq'" 1>&2
+           $echo "$modename: warning: to ensure that POSIX-compatible ar will work" 1>&2
+           AR_FLAGS=cq
+         fi
           for obj in $save_oldobjs
           do
             oldobjs="$objlist $obj"