Hello,
I am experiencing problems with building the NDK R4b from source on
Mac OS X.
In the end I will need to build a version of the Crystax NDK to which
further patches have been applied, but I am running into an issue that
already comes up when trying to build a completely unmodified NDK.
I am able to reproduce this issue on my machine as follows:
- Extract NDK file for Mac OS at some location (in my case /Users/
michael/Devel/ndkbuild2/) and create two directories ../toolchain-
sources and ../build-dir.
- Call script to download the toolchain sources:
./build/tools/download-toolchain-sources.sh --verbose ../toolchain-
sources/
- Edit the script to build the cross-compiler:
Add option --disable-werror to the configure call. (Otherwise the
build process will stop whenever the first warning is encountered!)
- Start the script to build the cross-compiler:
./build/tools/build-gcc.sh --verbose -j1 --build-out=/Users/michael/
Devel/ndkbuild2/build-dir /Users/michael/Devel/ndkbuild2/toolchain-
sources /Users/michael/Devel/ndkbuild2/android-ndk-r4b arm-eabi-4.4.0
The last command starts the build process, but then at some point an
error is triggered in a configure script related to gmp-4.2.2.
Below is the relevant command line output, as well as the config.log
file from the failed configure script. I am not really an expert in
interpreting the configure; as far as I understand it, it fails at the
sizeof(long) check. I have installed all packages on my machine that I
know have to be installed.
What is the reason for this error and how can I fix it? Thanks for any
help.
Cheers,
Michael
------8<------
[......]
([ -d gmp-4.2.2 ] || \
mkdir gmp-4.2.2) && \
(cd gmp-4.2.2 ; \
/Users/michael/Devel/ndkbuild2/build-dir/temp-src/gmp-4.2.2/
configure \
'--disable-nls' '--prefix=/Users/michael/Devel/ndkbuild2/
android-ndk-r4b/build/prebuilt/darwin-x86/arm-eabi-4.4.0' '--with-
sysroot=/Users/michael/Devel/ndkbuild2/android-ndk-r4b/build/platforms/
android-3/arch-arm' '--with-binutils-version=2.19' '--with-gcc-
version=4.4.0' '--with-gdb-version=6.6' '--disable-werror' --program-
transform-name='s&^&arm-eabi-&' --prefix=/Users/michael/Devel/
ndkbuild2/build-dir/temp-install --disable-shared --host=i386-apple-
darwin10.4.0 --build=i386-apple-darwin10.4.0) && \
touch stmp-config-host-gmp
checking build system type... i386-apple-darwin10.4.0
checking host system type... i386-apple-darwin10.4.0
checking for a BSD-compatible install... /opt/local/bin/ginstall -c
checking whether build environment is sane... yes
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking whether to enable maintainer-specific portions of
Makefiles... no
checking ABI=32
checking compiler gcc ... yes
checking compiler gcc has sizeof(long)==4... no
checking compiler icc ... no
checking whether cc is gcc... yes
checking compiler cc ... yes
checking compiler cc has sizeof(long)==4... no
configure: error: could not find a working compiler, see config.log
for details
make: *** [stmp-config-host-gmp] Error 1
Error while building toolchain. See
------8<------
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
It was created by GNU MP configure 4.2.2, which was
generated by GNU Autoconf 2.59. Invocation command line was
$ /Users/michael/Devel/ndkbuild2/build-dir/temp-src/gmp-4.2.2/
configure --disable-nls --prefix=/Users/michael/Devel/ndkbuild2/
android-ndk-r4b/build/prebuilt/darwin-x86/arm-eabi-4.4.0 --with-
sysroot=/Users/michael/Devel/ndkbuild2/android-ndk-r4b/build/platforms/
android-3/arch-arm --with-binutils-version=2.19 --with-gcc-
version=4.4.0 --with-gdb-version=6.6 --disable-werror --program-
transform-name=s&^&arm-eabi-& --prefix=/Users/michael/Devel/ndkbuild2/
build-dir/temp-install --disable-shared --host=i386-apple-darwin10.4.0
--build=i386-apple-darwin10.4.0
## --------- ##
## Platform. ##
## --------- ##
hostname = localadmins-MacBook-Pro.local
uname -m = i386
uname -r = 10.4.0
uname -s = Darwin
uname -v = Darwin Kernel Version 10.4.0: Fri Apr 23 18:28:53 PDT 2010;
root:xnu-1504.7.4~1/RELEASE_I386
/usr/bin/uname -p = i386
/bin/uname -X = unknown
/bin/arch = unknown
/usr/bin/arch -k = unknown
/usr/convex/getsysinfo = unknown
hostinfo = Mach kernel version:
Darwin Kernel Version 10.4.0: Fri Apr 23 18:28:53 PDT 2010;
root:xnu-1504.7.4~1/RELEASE_I386
Kernel configured for up to 2 processors.
2 processors are physically available.
2 processors are logically available.
Processor type: i486 (Intel 80486)
Processors active: 0 1
Primary memory available: 8.00 gigabytes
Default processor set: 67 tasks, 324 threads, 2 processors
Load average: 1.49, Mach factor: 0.89
/bin/machine = unknown
/usr/bin/oslevel = unknown
/bin/universe = unknown
PATH: /Users/michael/Devel/android-sdk-mac_x86/tools/
PATH: /Users/michael/Devel/android-ndk-r4-crystax
PATH: /opt/local/bin
PATH: opt/local/sbin
PATH: /usr/bin
PATH: /bin
PATH: /usr/sbin
PATH: /sbin
PATH: /usr/local/bin
PATH: /usr/local/git/bin
PATH: /usr/X11/bin
## ----------- ##
## Core tests. ##
## ----------- ##
configure:1654: checking build system type
configure:1672: result: i386-apple-darwin10.4.0
configure:1680: checking host system type
configure:1694: result: i386-apple-darwin10.4.0
configure:1717: checking for a BSD-compatible install
configure:1772: result: /opt/local/bin/ginstall -c
configure:1783: checking whether build environment is sane
configure:1826: result: yes
configure:1883: checking for gawk
configure:1899: found /opt/local/bin/gawk
configure:1909: result: gawk
configure:1919: checking whether make sets $(MAKE)
configure:1939: result: yes
configure:2105: checking whether to enable maintainer-specific
portions of Makefiles
configure:2114: result: no
User:
ABI=32
CC=
CFLAGS=
CPPFLAGS=(unset)
MPN_PATH=
GMP:
abilist=32
cclist=gcc icc cc
configure:3794: gcc 2>&1 | grep xlc >/dev/null
configure:3797: $? = 1
configure:3851: checking compiler gcc
Test compile:
configure:3865: gcc conftest.c >&5
configure:3868: $? = 0
configure:3873: ./a.out || ./b.out || ./a.exe || ./a_out.exe || ./
conftest
configure:3876: $? = 0
Test compile: function pointer return
configure:3919: gcc conftest.c >&5
configure:3922: $? = 0
configure:3927: ./a.out || ./b.out || ./a.exe || ./a_out.exe || ./
conftest
configure:3930: $? = 0
Test compile: cmov instruction
configure:3975: gcc conftest.c >&5
configure:3978: $? = 0
configure:3983: ./a.out || ./b.out || ./a.exe || ./a_out.exe || ./
conftest
configure:3986: $? = 0
Test compile: double -> ulong conversion
configure:4032: gcc conftest.c >&5
configure:4035: $? = 0
configure:4040: ./a.out || ./b.out || ./a.exe || ./a_out.exe || ./
conftest
configure:4043: $? = 0
Test compile: double negation
configure:4087: gcc conftest.c >&5
configure:4090: $? = 0
configure:4095: ./a.out || ./b.out || ./a.exe || ./a_out.exe || ./
conftest
configure:4098: $? = 0
Test compile: double -> float conversion
configure:4143: gcc conftest.c >&5
configure:4146: $? = 0
configure:4151: ./a.out || ./b.out || ./a.exe || ./a_out.exe || ./
conftest
configure:4154: $? = 0
Test compile: gnupro alpha ev6 char spilling
configure:4227: gcc conftest.c >&5
conftest.c: In function 'param_init':
conftest.c:18: warning: incompatible implicit declaration of built-in
function 'memcpy'
configure:4230: $? = 0
configure:4235: ./a.out || ./b.out || ./a.exe || ./a_out.exe || ./
conftest
configure:4238: $? = 0
Test compile: __builtin_alloca availability
configure:4278: gcc conftest.c >&5
Undefined symbols:
"_main", referenced from:
start in crt1.10.6.o
ld: symbol(s) not found
collect2: ld returned 1 exit status
configure:4281: $? = 1
failed program was:
int k; int foo () { __builtin_alloca (k); }
Test compile: abs int -> double conversion
configure:4402: gcc conftest.c >&5
configure:4405: $? = 0
configure:4410: ./a.out || ./b.out || ./a.exe || ./a_out.exe || ./
conftest
configure:4413: $? = 0
Test compile: long long reliability test 1
configure:4466: gcc conftest.c >&5
configure:4469: $? = 0
configure:4474: ./a.out || ./b.out || ./a.exe || ./a_out.exe || ./
conftest
configure:4477: $? = 0
Test compile: long long reliability test 2
configure:4526: gcc conftest.c >&5
configure:4529: $? = 0
configure:4534: ./a.out || ./b.out || ./a.exe || ./a_out.exe || ./
conftest
configure:4537: $? = 0
Test compile: mpn_lshift_com optimization
configure:4617: gcc conftest.c >&5
configure:4620: $? = 0
configure:4625: ./a.out || ./b.out || ./a.exe || ./a_out.exe || ./
conftest
configure:4628: $? = 0
Test compile: mpn_lshift_com optimization 2
configure:4717: gcc conftest.c >&5
configure:4720: $? = 0
configure:4725: ./a.out || ./b.out || ./a.exe || ./a_out.exe || ./
conftest
configure:4728: $? = 0
configure:4874: result: yes
configure: testlist sizeof-long-4
configure:5049: checking compiler gcc has sizeof(long)==4
configure:5062: gcc -c conftest.c >&5
conftest.c: In function 'main':
conftest.c:4: error: size of array 'test_array' is negative
configure:5065: $? = 1
configure:5070: result: no
configure:3772: icc -c conftest.c >&5
/Users/michael/Devel/ndkbuild2/build-dir/temp-src/gmp-4.2.2/configure:
line 3773: icc: command not found
configure:3775: $? = 127
configure:3794: icc 2>&1 | grep xlc >/dev/null
configure:3797: $? = 1
configure:3851: checking compiler icc
Test compile:
configure:3865: icc conftest.c >&5
/Users/michael/Devel/ndkbuild2/build-dir/temp-src/gmp-4.2.2/configure:
line 3866: icc: command not found
configure:3868: $? = 127
failed program was:
int main () { return 0; }
configure:4874: result: no
configure:3772: cc -c conftest.c >&5
configure:3775: $? = 0
configure:3778: checking whether cc is gcc
configure:3780: result: yes
configure:3794: cc 2>&1 | grep xlc >/dev/null
configure:3797: $? = 1
configure:3851: checking compiler cc
Test compile:
configure:3865: cc conftest.c >&5
configure:3868: $? = 0
configure:3873: ./a.out || ./b.out || ./a.exe || ./a_out.exe || ./
conftest
configure:3876: $? = 0
Test compile: function pointer return
configure:3919: cc conftest.c >&5
configure:3922: $? = 0
configure:3927: ./a.out || ./b.out || ./a.exe || ./a_out.exe || ./
conftest
configure:3930: $? = 0
Test compile: cmov instruction
configure:3975: cc conftest.c >&5
configure:3978: $? = 0
configure:3983: ./a.out || ./b.out || ./a.exe || ./a_out.exe || ./
conftest
configure:3986: $? = 0
Test compile: double -> ulong conversion
configure:4032: cc conftest.c >&5
configure:4035: $? = 0
configure:4040: ./a.out || ./b.out || ./a.exe || ./a_out.exe || ./
conftest
configure:4043: $? = 0
Test compile: double negation
configure:4087: cc conftest.c >&5
configure:4090: $? = 0
configure:4095: ./a.out || ./b.out || ./a.exe || ./a_out.exe || ./
conftest
configure:4098: $? = 0
Test compile: double -> float conversion
configure:4143: cc conftest.c >&5
configure:4146: $? = 0
configure:4151: ./a.out || ./b.out || ./a.exe || ./a_out.exe || ./
conftest
configure:4154: $? = 0
Test compile: gnupro alpha ev6 char spilling
configure:4227: cc conftest.c >&5
conftest.c: In function 'param_init':
conftest.c:18: warning: incompatible implicit declaration of built-in
function 'memcpy'
configure:4230: $? = 0
configure:4235: ./a.out || ./b.out || ./a.exe || ./a_out.exe || ./
conftest
configure:4238: $? = 0
Test compile: __builtin_alloca availability
configure:4278: cc conftest.c >&5
Undefined symbols:
"_main", referenced from:
start in crt1.10.6.o
ld: symbol(s) not found
collect2: ld returned 1 exit status
configure:4281: $? = 1
failed program was:
int k; int foo () { __builtin_alloca (k); }
Test compile: abs int -> double conversion
configure:4402: cc conftest.c >&5
configure:4405: $? = 0
configure:4410: ./a.out || ./b.out || ./a.exe || ./a_out.exe || ./
conftest
configure:4413: $? = 0
Test compile: long long reliability test 1
configure:4466: cc conftest.c >&5
configure:4469: $? = 0
configure:4474: ./a.out || ./b.out || ./a.exe || ./a_out.exe || ./
conftest
configure:4477: $? = 0
Test compile: long long reliability test 2
configure:4526: cc conftest.c >&5
configure:4529: $? = 0
configure:4534: ./a.out || ./b.out || ./a.exe || ./a_out.exe || ./
conftest
configure:4537: $? = 0
Test compile: mpn_lshift_com optimization
configure:4617: cc conftest.c >&5
configure:4620: $? = 0
configure:4625: ./a.out || ./b.out || ./a.exe || ./a_out.exe || ./
conftest
configure:4628: $? = 0
Test compile: mpn_lshift_com optimization 2
configure:4717: cc conftest.c >&5
configure:4720: $? = 0
configure:4725: ./a.out || ./b.out || ./a.exe || ./a_out.exe || ./
conftest
configure:4728: $? = 0
configure:4874: result: yes
configure: testlist sizeof-long-4
configure:5049: checking compiler cc has sizeof(long)==4
configure:5062: cc -c conftest.c >&5
conftest.c: In function 'main':
conftest.c:4: error: size of array 'test_array' is negative
configure:5065: $? = 1
configure:5070: result: no
configure:5112: error: could not find a working compiler, see
config.log for details
## ---------------- ##
## Cache variables. ##
## ---------------- ##
ac_cv_build=i386-apple-darwin10.4.0
ac_cv_build_alias=i386-apple-darwin10.4.0
ac_cv_env_ABI_set=set
ac_cv_env_ABI_value=32
ac_cv_env_CC_FOR_BUILD_set=
ac_cv_env_CC_FOR_BUILD_value=
ac_cv_env_CC_set=
ac_cv_env_CC_value=
ac_cv_env_CFLAGS_set=set
ac_cv_env_CFLAGS_value=
ac_cv_env_CPPFLAGS_set=
ac_cv_env_CPPFLAGS_value=
ac_cv_env_CPP_FOR_BUILD_set=
ac_cv_env_CPP_FOR_BUILD_value=
ac_cv_env_CPP_set=
ac_cv_env_CPP_value=
ac_cv_env_CXXCPP_set=
ac_cv_env_CXXCPP_value=
ac_cv_env_CXXFLAGS_set=
ac_cv_env_CXXFLAGS_value=
ac_cv_env_CXX_set=
ac_cv_env_CXX_value=
ac_cv_env_LDFLAGS_set=set
ac_cv_env_LDFLAGS_value=
ac_cv_env_M4_set=
ac_cv_env_M4_value=
ac_cv_env_build_alias_set=set
ac_cv_env_build_alias_value=i386-apple-darwin10.4.0
ac_cv_env_host_alias_set=set
ac_cv_env_host_alias_value=i386-apple-darwin10.4.0
ac_cv_env_target_alias_set=
ac_cv_env_target_alias_value=
ac_cv_host=i386-apple-darwin10.4.0
ac_cv_host_alias=i386-apple-darwin10.4.0
ac_cv_path_install='/opt/local/bin/ginstall -c'
ac_cv_prog_AWK=gawk
ac_cv_prog_make_make_set=yes
## ----------------- ##
## Output variables. ##
## ----------------- ##
ABI='32'
ACLOCAL='${SHELL} /Users/michael/Devel/ndkbuild2/build-dir/temp-src/
gmp-4.2.2/missing --run aclocal-1.8'
AMTAR='${SHELL} /Users/michael/Devel/ndkbuild2/build-dir/temp-src/
gmp-4.2.2/missing --run tar'
ANSI2KNR=''
AR=''
AS=''
AUTOCONF='${SHELL} /Users/michael/Devel/ndkbuild2/build-dir/temp-src/
gmp-4.2.2/missing --run autoconf'
AUTOHEADER='${SHELL} /Users/michael/Devel/ndkbuild2/build-dir/temp-src/
gmp-4.2.2/missing --run autoheader'
AUTOMAKE='${SHELL} /Users/michael/Devel/ndkbuild2/build-dir/temp-src/
gmp-4.2.2/missing --run automake-1.8'
AWK='gawk'
BITS_PER_MP_LIMB=''
CALLING_CONVENTIONS_OBJS='x86call.lo x86check$U.lo'
CC=''
CCAS=''
CC_FOR_BUILD=''
CFLAGS=''
CPP=''
CPPFLAGS=''
CPP_FOR_BUILD=''
CXX=''
CXXCPP=''
CXXFLAGS=''
CYGPATH_W='echo'
DEFN_LONG_LONG_LIMB=''
DEFS=''
DLLTOOL=''
ECHO='echo'
ECHO_C=''
ECHO_N='-n'
ECHO_T=''
EGREP=''
ENABLE_STATIC_FALSE=''
ENABLE_STATIC_TRUE=''
EXEEXT=''
EXEEXT_FOR_BUILD=''
GMP_LDFLAGS=''
GMP_NAIL_BITS='0'
HAVE_CLOCK_01=''
HAVE_CPUTIME_01=''
HAVE_GETRUSAGE_01=''
HAVE_GETTIMEOFDAY_01=''
HAVE_HOST_CPU_FAMILY_power='0'
HAVE_HOST_CPU_FAMILY_powerpc='0'
HAVE_SIGACTION_01=''
HAVE_SIGALTSTACK_01=''
HAVE_SIGSTACK_01=''
HAVE_STACK_T_01=''
HAVE_SYS_RESOURCE_H_01=''
INSTALL_DATA='${INSTALL} -m 644'
INSTALL_PROGRAM='${INSTALL}'
INSTALL_SCRIPT='${INSTALL}'
INSTALL_STRIP_PROGRAM='${SHELL} $(install_sh) -c -s'
LDFLAGS=''
LEX=''
LEXLIB=''
LEX_OUTPUT_ROOT=''
LIBCURSES=''
LIBGMPXX_LDFLAGS=''
LIBGMP_DLL=''
LIBGMP_LDFLAGS=''
LIBM=''
LIBM_FOR_BUILD=''
LIBOBJS=''
LIBREADLINE=''
LIBS=''
LIBTOOL=''
LN_S=''
LTLIBOBJS=''
M4=''
MAINT='#'
MAINTAINER_MODE_FALSE=''
MAINTAINER_MODE_TRUE='#'
MAKEINFO='${SHELL} /Users/michael/Devel/ndkbuild2/build-dir/temp-src/
gmp-4.2.2/missing --run makeinfo'
OBJDUMP=''
OBJEXT=''
PACKAGE='gmp'
PACKAGE_BUGREPORT='
gmp-...@swox.com'
PACKAGE_NAME='GNU MP'
PACKAGE_STRING='GNU MP 4.2.2'
PACKAGE_TARNAME='gmp'
PACKAGE_VERSION='4.2.2'
PATH_SEPARATOR=':'
RANLIB=''
SED=''
SET_MAKE=''
SHELL='/bin/sh'
SPEED_CYCLECOUNTER_OBJ='pentium.lo'
STRIP=''
TAL_OBJECT=''
TUNE_SQR_OBJ=''
U=''
U_FOR_BUILD=''
VERSION='4.2.2'
WANT_CXX_FALSE=''
WANT_CXX_TRUE=''
WANT_MPBSD_FALSE=''
WANT_MPBSD_TRUE='#'
WITH_READLINE_01=''
YACC=''
ac_ct_AR=''
ac_ct_AS=''
ac_ct_CC=''
ac_ct_CXX=''
ac_ct_DLLTOOL=''
ac_ct_OBJDUMP=''
ac_ct_RANLIB=''
ac_ct_STRIP=''
am__leading_dot='.'
bindir='${exec_prefix}/bin'
build='i386-apple-darwin10.4.0'
build_alias='i386-apple-darwin10.4.0'
build_cpu='i386'
build_os='darwin10.4.0'
build_vendor='apple'
datadir='${prefix}/share'
exec_prefix='NONE'
gmp_srclinks=''
host='i386-apple-darwin10.4.0'
host_alias='i386-apple-darwin10.4.0'
host_cpu='i386'
host_os='darwin10.4.0'
host_vendor='apple'
includedir='${prefix}/include'
infodir='${prefix}/info'
install_sh='/Users/michael/Devel/ndkbuild2/build-dir/temp-src/
gmp-4.2.2/install-sh'
libdir='${exec_prefix}/lib'
libexecdir='${exec_prefix}/libexec'
localstatedir='${prefix}/var'
mandir='${prefix}/man'
mkdir_p='$(install_sh) -d'
mpn_objects=''
mpn_objs_in_libgmp=''
mpn_objs_in_libmp=''
oldincludedir='/usr/include'
prefix='/Users/michael/Devel/ndkbuild2/build-dir/temp-install'
program_transform_name='s&^&arm-eabi-&'
sbindir='${exec_prefix}/sbin'
sharedstatedir='${prefix}/com'
sysconfdir='${prefix}/etc'
target_alias=''
## ----------- ##
## confdefs.h. ##
## ----------- ##
#define HAVE_HOST_CPU_i386 1
#define PACKAGE "gmp"
#define PACKAGE_BUGREPORT "
gmp-...@swox.com"
#define PACKAGE_NAME "GNU MP"
#define PACKAGE_STRING "GNU MP 4.2.2"
#define PACKAGE_TARNAME "gmp"
#define PACKAGE_VERSION "4.2.2"
#define VERSION "4.2.2"
#define WANT_FFT 1
configure: exit 1