[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[FYI-1.5] func_extract_archives was broken for fat darwin :(
From: |
Peter O'Gorman |
Subject: |
[FYI-1.5] func_extract_archives was broken for fat darwin :( |
Date: |
Sat, 05 Feb 2005 22:58:57 +0900 |
User-agent: |
Mozilla Thunderbird 1.0 (Macintosh/20041206) |
Hi,
Made a for real fat archive yesterday and discovered that libtool couldn't
extract it. Applied this to branch-1-5, will forward port later.
Peter
--
Peter O'Gorman - http://www.pogma.com
Index: ChangeLog
* ltmain.in (func_extract_archives) [darwin]: This didn't actually
work on a real fat archive, should do now.
* tests/func_extract_archives.test: remove darwin fat tests which
did not actually work.
from Ralf Wildenhues <address@hidden>
Index: ltmain.in
===================================================================
RCS file: /cvsroot/libtool/libtool/Attic/ltmain.in,v
retrieving revision 1.334.2.59
diff -u -3 -p -u -r1.334.2.59 ltmain.in
--- ltmain.in 4 Feb 2005 16:11:33 -0000 1.334.2.59
+++ ltmain.in 5 Feb 2005 13:55:10 -0000
@@ -339,21 +339,20 @@ func_extract_archives ()
for darwin_arch in $darwin_arches ; do
mkdir -p "unfat-$$/${darwin_base_archive}-${darwin_arch}"
lipo -thin $darwin_arch -output
"unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}"
"${darwin_archive}"
- # Remove the table of contents from the thin files.
- $AR -d
"unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}"
__.SYMDEF 2>/dev/null || true
- $AR -d
"unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}"
__.SYMDEF\ SORTED 2>/dev/null || true
- func_extract_an_archive
"unfat-$$/${darwin_base_archive}-${darwin_arch}" "${darwin_base_archive}"
+ cd "unfat-$$/${darwin_base_archive}-${darwin_arch}"
+ func_extract_an_archive "`pwd`" "${darwin_base_archive}"
+ cd "$darwin_curdir"
$rm
"unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}"
done # $darwin_arches
## Okay now we have a bunch of thin objects, gotta fatten them up :)
- darwin_filelist=`find unfat-$$ -type f | xargs basename | sort -u |
$NL2SP`
+ darwin_filelist=`find unfat-$$ -type f -name \*.o -print -o -name
\*.lo -print| xargs basename | sort -u | $NL2SP`
darwin_file=
darwin_files=
for darwin_file in $darwin_filelist; do
darwin_files=`find unfat-$$ -name $darwin_file -print | $NL2SP`
lipo -create -output "$darwin_file" $darwin_files
done # $darwin_filelist
- ${rm}f unfat-$$
+ ${rm}r unfat-$$
cd "$darwin_orig_dir"
else
cd "$darwin_orig_dir"
Index: tests/func_extract_archives.test
===================================================================
RCS file: /cvsroot/libtool/libtool/tests/Attic/func_extract_archives.test,v
retrieving revision 1.1.2.2
diff -u -3 -p -u -r1.1.2.2 func_extract_archives.test
--- tests/func_extract_archives.test 1 Feb 2005 14:39:14 -0000 1.1.2.2
+++ tests/func_extract_archives.test 5 Feb 2005 13:55:11 -0000
@@ -8,56 +8,20 @@ if test -z "$srcdir"; then
test "${VERBOSE+set}" != "set" && VERBOSE=yes
fi
. $srcdir/defs || exit 1
-case $host in
-*darwin*)
- makefatdarwin=yes
- ;;
- *)
- makefatdarwin=
- ;;
-esac
rm -f foo.o bar.o libfoo.a
SED=${SED-sed}
Xsed="$SED -e s/^X//"
for afile in baz foobar foobaz
do
- if test -n "$makefatdarwin"; then
- echo "ppc $afile" > $afile.ppc.o
- echo "m68k $afile" > $afile.m68k.o
- echo "i386 $afile" > $afile.i386.o
- lipo -create -output $afile.o -arch ppc $afile.ppc.o -arch m68k \
- $afile.m68k.o -arch i386 $afile.i386.o
- rm -f $afile.*.o
- ar -q libfoo.a $afile.o
- rm -f $afile.o
- else
echo "$afile" > $afile.o
ar -q libfoo.a $afile.o
rm -f $afile.o
- fi
done
for anum in 1 2 3 4 5 6 7 8 9 10 11 12
do
- if test -n "$makefatdarwin"; then
- echo "ppc foo $anum" > foo.ppc.o
- echo "m68k foo $anum" > foo.m68k.o
- echo "i386 foo $anum" > foo.i386.o
- lipo -create -output foo.o -arch ppc foo.ppc.o -arch m68k foo.m68k.o \
- -arch i386 foo.i386.o
- ar -q libfoo.a foo.o
- rm -f foo.o foo.*.o
- echo "ppc bar $anum" > bar.ppc.o
- echo "m68k bar $anum" > bar.m68k.o
- echo "i386 bar $anum" > bar.i386.o
- lipo -create -output bar.o -arch ppc bar.ppc.o -arch m68k bar.m68k.o \
- -arch i386 bar.i386.o
- ar -q libfoo.a bar.o
- rm -f bar.o bar.*.o
- else
echo "foo $anum" > foo.o
echo "bar $anum" > bar.o
ar -q libfoo.a foo.o bar.o
- fi
done
test -d .libs || mkdir .libs
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [FYI-1.5] func_extract_archives was broken for fat darwin :(,
Peter O'Gorman <=