ps3dev / ps3libraries

A script to automatically build various open source libraries for use on the PS3.
86 stars 74 forks source link

libtool not seeing object file #21

Closed nevik-xx closed 11 years ago

nevik-xx commented 12 years ago

Hello,

This was done on Mac OsX 10.6.7

Checking for attribute(visibility) support... Yes. ./configure: line 719: ./ztest55120: cannot execute binary file Looking for a four-byte integer type... Not found. powerpc64-ps3-elf-gcc -O3 -DHAVE_HIDDEN -c -o adler32.o adler32.c powerpc64-ps3-elf-gcc -O3 -DHAVE_HIDDEN -c -o crc32.o crc32.c powerpc64-ps3-elf-gcc -O3 -DHAVE_HIDDEN -c -o deflate.o deflate.c powerpc64-ps3-elf-gcc -O3 -DHAVE_HIDDEN -c -o infback.o infback.c powerpc64-ps3-elf-gcc -O3 -DHAVE_HIDDEN -c -o inffast.o inffast.c powerpc64-ps3-elf-gcc -O3 -DHAVE_HIDDEN -c -o inflate.o inflate.c powerpc64-ps3-elf-gcc -O3 -DHAVE_HIDDEN -c -o inftrees.o inftrees.c powerpc64-ps3-elf-gcc -O3 -DHAVE_HIDDEN -c -o trees.o trees.c powerpc64-ps3-elf-gcc -O3 -DHAVE_HIDDEN -c -o zutil.o zutil.c powerpc64-ps3-elf-gcc -O3 -DHAVE_HIDDEN -c -o compress.o compress.c powerpc64-ps3-elf-gcc -O3 -DHAVE_HIDDEN -c -o uncompr.o uncompr.c powerpc64-ps3-elf-gcc -O3 -DHAVE_HIDDEN -c -o gzclose.o gzclose.c powerpc64-ps3-elf-gcc -O3 -DHAVE_HIDDEN -c -o gzlib.o gzlib.c powerpc64-ps3-elf-gcc -O3 -DHAVE_HIDDEN -c -o gzread.o gzread.c powerpc64-ps3-elf-gcc -O3 -DHAVE_HIDDEN -c -o gzwrite.o gzwrite.c /usr/bin/libtool -o libz.a adler32.o crc32.o deflate.o infback.o inffast.o inflate.o inftrees.o trees.o zutil.o compress.o uncompr.o gzclose.o gzlib.o gzread.o gzwrite.o /usr/bin/libtool: file: adler32.o is not an object file (not allowed in a library) /usr/bin/libtool: file: crc32.o is not an object file (not allowed in a library) /usr/bin/libtool: file: deflate.o is not an object file (not allowed in a library) /usr/bin/libtool: file: infback.o is not an object file (not allowed in a library) /usr/bin/libtool: file: inffast.o is not an object file (not allowed in a library) /usr/bin/libtool: file: inflate.o is not an object file (not allowed in a library) /usr/bin/libtool: file: inftrees.o is not an object file (not allowed in a library) /usr/bin/libtool: file: trees.o is not an object file (not allowed in a library) /usr/bin/libtool: file: zutil.o is not an object file (not allowed in a library) /usr/bin/libtool: file: compress.o is not an object file (not allowed in a library) /usr/bin/libtool: file: uncompr.o is not an object file (not allowed in a library) /usr/bin/libtool: file: gzclose.o is not an object file (not allowed in a library) /usr/bin/libtool: file: gzlib.o is not an object file (not allowed in a library) /usr/bin/libtool: file: gzread.o is not an object file (not allowed in a library) /usr/bin/libtool: file: gzwrite.o is not an object file (not allowed in a library) make: *\ [libz.a] Error 1 ../scripts/001-zlib-1.2.6.sh: Failed. ../scripts/009-ps3libraries.sh: Failed. ERROR: Could not run the toolchain script.

Thank you for any help!

zeldin commented 12 years ago

libtool is not supposed to be used in the first place. I suspect you have $AR set to /usr/bin/libtool. Please check your environment and fix it.

AndoniZubimendi commented 11 years ago

It seems the configure script overwrites the AR environment variable in MacOS.

With this patch zlib compiles fine in my macbook.

diff -urN ps3libraries.orig/patches/zlib-1.2.7-MACOS.patch ps3libraries/patches/zlib-1.2.7-MACOS.patch
--- ps3libraries.orig/patches/zlib-1.2.7-MACOS.patch    1969-12-31 21:00:00.000000000 -0300
+++ ps3libraries/patches/zlib-1.2.7-MACOS.patch 2013-01-04 11:57:56.000000000 -0300
@@ -0,0 +1,13 @@
+diff -urN zlib-1.2.7.orig/configure zlib-1.2.7/configure
+--- zlib-1.2.7.orig/configure  2013-01-04 11:48:28.000000000 -0300
++++ zlib-1.2.7/configure   2013-01-04 11:55:02.000000000 -0300
+@@ -231,8 +231,7 @@
+              SHAREDLIBV=libz.$VER$shared_ext
+              SHAREDLIBM=libz.$VER1$shared_ext
+              LDSHARED=${LDSHARED-"$cc -dynamiclib -install_name $libdir/$SHAREDLIBM -compatibility_version $VER1 -current_version $VER3"}
+-             AR="/usr/bin/libtool"
+-             ARFLAGS="-o" ;;
++      ;;
+   *)             LDSHARED=${LDSHARED-"$cc -shared"} ;;
+   esac
+ else
diff -urN ps3libraries.orig/scripts/001-zlib-1.2.6.sh ps3libraries/scripts/001-zlib-1.2.6.sh
--- ps3libraries.orig/scripts/001-zlib-1.2.6.sh 2012-07-18 09:52:14.000000000 -0300
+++ ps3libraries/scripts/001-zlib-1.2.6.sh  2013-01-04 11:52:16.000000000 -0300
@@ -9,6 +9,7 @@

 ## Patch the source code.
 cat ../../patches/zlib-1.2.6-PPU.patch | patch -p1
+cat ../../patches/zlib-1.2.7-MACOS.patch | patch -p1

 ## Configure the build.
 AR="powerpc64-ps3-elf-ar" CC="powerpc64-ps3-elf-gcc" RANLIB="powerpc64-ps3-elf-ranlib" \
zeldin commented 11 years ago

Evil!

I've integrated your patch with the existing patchset and pushed an update.

Thanks for the heads up!