summaryrefslogtreecommitdiff
path: root/ltmain.sh
diff options
context:
space:
mode:
authorljrittle <ljrittle@138bc75d-0d04-0410-961f-82ee72b054a4>2002-05-06 21:26:49 +0000
committerljrittle <ljrittle@138bc75d-0d04-0410-961f-82ee72b054a4>2002-05-06 21:26:49 +0000
commit02bff180801515dfb155759bcd38179dec8914bf (patch)
tree04e9805082b5dc717e6ad9402bbd91c4f307ca53 /ltmain.sh
parent0b64b2a5543b71b1435dd822d290db87e9c98e11 (diff)
downloadlinaro-gcc-02bff180801515dfb155759bcd38179dec8914bf.tar.gz
linaro-gcc-02bff180801515dfb155759bcd38179dec8914bf.tar.bz2
linaro-gcc-02bff180801515dfb155759bcd38179dec8914bf.zip
* ltmain.sh: Detect and handle object name conflicts
while piecewise linking a static library. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@53237 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'ltmain.sh')
-rw-r--r--ltmain.sh14
1 files changed, 14 insertions, 0 deletions
diff --git a/ltmain.sh b/ltmain.sh
index c3547e5a561..92526b60b79 100644
--- 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"