Skip to content

Make sure we're cross-compiling zlib

samuela requested to merge samuela/cookbook:samuela-master-patch-85258 into master

This MR fixes the zlib build on macOS. See https://stackoverflow.com/questions/21396988/zlib-build-not-configuring-properly-with-cross-compiler-ignores-ar.

The current error looks like:

$ make all
...
repo - preparing zlib
cook - zlib prepare
repo - building zlib
cook - zlib build
Building static library libz.a version 1.2.11 with x86_64-unknown-redox-gcc.
Checking for size_t... Yes.
Checking for off64_t... No.
Checking for fseeko... Yes.
Checking for strerror... Yes.
Checking for unistd.h... Yes.
Checking for stdarg.h... Yes.
Checking whether to use vs[n]printf() or s[n]printf()... using vs[n]printf().
Checking for vsnprintf() in stdio.h... Yes.
Checking for return value of vsnprintf()... Yes.
Checking for attribute(visibility) support... Yes.
x86_64-unknown-redox-gcc -O3 -DHAVE_HIDDEN -I. -c -o example.o test/example.c
x86_64-unknown-redox-gcc -O3 -DHAVE_HIDDEN  -c -o adler32.o adler32.c
x86_64-unknown-redox-gcc -O3 -DHAVE_HIDDEN  -c -o crc32.o crc32.c
x86_64-unknown-redox-gcc -O3 -DHAVE_HIDDEN  -c -o deflate.o deflate.c
x86_64-unknown-redox-gcc -O3 -DHAVE_HIDDEN  -c -o infback.o infback.c
x86_64-unknown-redox-gcc -O3 -DHAVE_HIDDEN  -c -o inffast.o inffast.c
x86_64-unknown-redox-gcc -O3 -DHAVE_HIDDEN  -c -o inflate.o inflate.c
x86_64-unknown-redox-gcc -O3 -DHAVE_HIDDEN  -c -o inftrees.o inftrees.c
x86_64-unknown-redox-gcc -O3 -DHAVE_HIDDEN  -c -o trees.o trees.c
x86_64-unknown-redox-gcc -O3 -DHAVE_HIDDEN  -c -o zutil.o zutil.c
x86_64-unknown-redox-gcc -O3 -DHAVE_HIDDEN  -c -o compress.o compress.c
x86_64-unknown-redox-gcc -O3 -DHAVE_HIDDEN  -c -o uncompr.o uncompr.c
x86_64-unknown-redox-gcc -O3 -DHAVE_HIDDEN  -c -o gzclose.o gzclose.c
x86_64-unknown-redox-gcc -O3 -DHAVE_HIDDEN  -c -o gzlib.o gzlib.c
x86_64-unknown-redox-gcc -O3 -DHAVE_HIDDEN  -c -o gzread.o gzread.c
x86_64-unknown-redox-gcc -O3 -DHAVE_HIDDEN  -c -o gzwrite.o gzwrite.c
x86_64-unknown-redox-gcc -O3 -DHAVE_HIDDEN -I. -c -o minigzip.o test/minigzip.c
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 
error: /Library/Developer/CommandLineTools/usr/bin/libtool: file: adler32.o is not an object file (not allowed in a library)
error: /Library/Developer/CommandLineTools/usr/bin/libtool: file: crc32.o is not an object file (not allowed in a library)
error: /Library/Developer/CommandLineTools/usr/bin/libtool: file: deflate.o is not an object file (not allowed in a library)
error: /Library/Developer/CommandLineTools/usr/bin/libtool: file: infback.o is not an object file (not allowed in a library)
error: /Library/Developer/CommandLineTools/usr/bin/libtool: file: inffast.o is not an object file (not allowed in a library)
error: /Library/Developer/CommandLineTools/usr/bin/libtool: file: inflate.o is not an object file (not allowed in a library)
error: /Library/Developer/CommandLineTools/usr/bin/libtool: file: inftrees.o is not an object file (not allowed in a library)
error: /Library/Developer/CommandLineTools/usr/bin/libtool: file: trees.o is not an object file (not allowed in a library)
error: /Library/Developer/CommandLineTools/usr/bin/libtool: file: zutil.o is not an object file (not allowed in a library)
error: /Library/Developer/CommandLineTools/usr/bin/libtool: file: compress.o is not an object file (not allowed in a library)
error: /Library/Developer/CommandLineTools/usr/bin/libtool: file: uncompr.o is not an object file (not allowed in a library)
error: /Library/Developer/CommandLineTools/usr/bin/libtool: file: gzclose.o is not an object file (not allowed in a library)
error: /Library/Developer/CommandLineTools/usr/bin/libtool: file: gzlib.o is not an object file (not allowed in a library)
error: /Library/Developer/CommandLineTools/usr/bin/libtool: file: gzread.o is not an object file (not allowed in a library)
error: /Library/Developer/CommandLineTools/usr/bin/libtool: file: gzwrite.o is not an object file (not allowed in a library)
make[1]: *** [libz.a] Error 1
./repo.sh failed.make: *** [build/filesystem.bin] Error 1

Merge request reports