Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Failed compilation on ubuntu with python 2.7 configure: error: C compiler cannot create executables #535

Closed
VineethRaghavan opened this issue Jul 22, 2017 · 3 comments

Comments

@VineethRaghavan
Copy link

Hi,

I tried compiling a basic hello world app. But I got the following error

checking for --with-universal-archs... 32-bit
checking MACHDEP... linux4
checking EXTRAPLATDIR... 
checking machine type as reported by uname -m... x86_64
checking for --without-gcc... no
checking for arm-eabi-gcc... /usr/bin/ccache arm-linux-androideabi-gcc -DANDROID -mandroid -fomit-frame-pointer --sysroot /home/kivy/.buildozer/android/platform/android-ndk-r9c/platforms/android-19/arch-arm
checking whether the C compiler works... no
configure: error: in `/home/kivy/Desktop/.buildozer/android/platform/build/build/other_builds/python2/armeabi-v7a/python2':
configure: error: C compiler cannot create executables
See `config.log' for more details

Here is the config.log file:

This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.

It was created by python configure 2.7, which was
generated by GNU Autoconf 2.68.  Invocation command line was

  $ ./configure --host=arm-eabi --build=x86_64-linux-gnu --prefix=/home/kivy/Desktop/.buildozer/android/platform/build/build/other_builds/python2/armeabi-v7a/python2/python-install --enable-shared --disable-toolbox-glue --disable-framework

## --------- ##
## Platform. ##
## --------- ##

hostname = kivyvm
uname -m = x86_64
uname -r = 4.10.0-20-generic
uname -s = Linux
uname -v = #22-Ubuntu SMP Thu Apr 20 09:22:42 UTC 2017

/usr/bin/uname -p = unknown
/bin/uname -X     = unknown

/bin/arch              = unknown
/usr/bin/arch -k       = unknown
/usr/convex/getsysinfo = unknown
/usr/bin/hostinfo      = unknown
/bin/machine           = unknown
/usr/bin/oslevel       = unknown
/bin/universe          = unknown

PATH: /home/kivy/.buildozer/android/platform/android-ndk-r9c/toolchains/arm-linux-androideabi-4.8/prebuilt/linux-x86/bin/
PATH: /home/kivy/.buildozer/android/platform/android-ndk-r9c/toolchains/arm-linux-androideabi-4.8/prebuilt/linux-x86_64/bin/
PATH: /home/kivy/.buildozer/android/platform/android-ndk-r9c
PATH: /home/kivy/.buildozer/android/platform/android-sdk-20/tools
PATH: /home/kivy/.buildozer/android/platform/apache-ant-1.9.4/bin
PATH: /usr/local/sbin
PATH: /usr/local/bin
PATH: /usr/sbin
PATH: /usr/bin
PATH: /sbin
PATH: /bin
PATH: /usr/games
PATH: /usr/local/games
PATH: /snap/bin


## ----------- ##
## Core tests. ##
## ----------- ##

configure:2764: checking for --enable-universalsdk
configure:2805: result: no
configure:2814: checking for --with-universal-archs
configure:2831: result: 32-bit
configure:2988: checking MACHDEP
configure:3136: result: linux4
configure:3142: checking EXTRAPLATDIR
configure:3157: result: 
configure:3168: checking machine type as reported by uname -m
configure:3171: result: x86_64
configure:3184: checking for --without-gcc
configure:3228: result: no
configure:3249: checking for arm-eabi-gcc
configure:3276: result: /usr/bin/ccache arm-linux-androideabi-gcc -DANDROID -mandroid -fomit-frame-pointer --sysroot /home/kivy/.buildozer/android/platform/android-ndk-r9c/platforms/android-19/arch-arm
configure:3545: checking for C compiler version
configure:3554: /usr/bin/ccache arm-linux-androideabi-gcc -DANDROID -mandroid -fomit-frame-pointer --sysroot /home/kivy/.buildozer/android/platform/android-ndk-r9c/platforms/android-19/arch-arm --version >&5
arm-linux-androideabi-gcc (GCC) 4.8
Copyright (C) 2013 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

configure:3565: $? = 0
configure:3554: /usr/bin/ccache arm-linux-androideabi-gcc -DANDROID -mandroid -fomit-frame-pointer --sysroot /home/kivy/.buildozer/android/platform/android-ndk-r9c/platforms/android-19/arch-arm -v >&5
Using built-in specs.
COLLECT_GCC=/home/kivy/.buildozer/android/platform/android-ndk-r9c/toolchains/arm-linux-androideabi-4.8/prebuilt/linux-x86_64/bin//arm-linux-androideabi-gcc
COLLECT_LTO_WRAPPER=/home/kivy/.buildozer/android/platform/android-ndk-r9c/toolchains/arm-linux-androideabi-4.8/prebuilt/linux-x86_64/bin/../libexec/gcc/arm-linux-androideabi/4.8/lto-wrapper
Target: arm-linux-androideabi
Configured with: /s/ndk-toolchain/src/build/../gcc/gcc-4.8/configure --prefix=/tmp/ndk-andrewhsieh/build/toolchain/prefix --target=arm-linux-androideabi --host=x86_64-linux-gnu --build=x86_64-linux-gnu --with-gnu-as --with-gnu-ld --enable-languages=c,c++ --with-gmp=/tmp/ndk-andrewhsieh/build/toolchain/temp-install --with-mpfr=/tmp/ndk-andrewhsieh/build/toolchain/temp-install --with-mpc=/tmp/ndk-andrewhsieh/build/toolchain/temp-install --with-cloog=/tmp/ndk-andrewhsieh/build/toolchain/temp-install --with-isl=/tmp/ndk-andrewhsieh/build/toolchain/temp-install --with-ppl=/tmp/ndk-andrewhsieh/build/toolchain/temp-install --disable-ppl-version-check --disable-cloog-version-check --disable-isl-version-check --enable-cloog-backend=isl --with-host-libstdcxx='-static-libgcc -Wl,-Bstatic,-lstdc++,-Bdynamic -lm' --disable-libssp --enable-threads --disable-nls --disable-libmudflap --disable-libgomp --disable-libstdc__-v3 --disable-sjlj-exceptions --disable-shared --disable-tls --disable-libitm --with-float=soft --with-fpu=vfp --with-arch=armv5te --enable-target-optspace --enable-initfini-array --disable-nls --prefix=/tmp/ndk-andrewhsieh/build/toolchain/prefix --with-sysroot=/tmp/ndk-andrewhsieh/build/toolchain/prefix/sysroot --with-binutils-version=2.23 --with-mpfr-version=3.1.1 --with-mpc-version=1.0.1 --with-gmp-version=5.0.5 --with-gcc-version=4.8 --with-gdb-version=7.3.x --with-python=/usr/local/google/home/andrewhsieh/mydroid/ndk/prebuilt/linux-x86_64/bin/python-config.sh --with-gxx-include-dir=/tmp/ndk-andrewhsieh/build/toolchain/prefix/include/c++/4.8 --with-bugurl=http://source.android.com/source/report-bugs.html --disable-bootstrap --disable-libquadmath --enable-plugins --enable-libgomp --disable-libsanitizer --enable-gold --enable-graphite=yes --with-cloog-version=0.18.0 --with-isl-version=0.11.1 --enable-eh-frame-hdr-for-static --with-arch=armv5te --program-transform-name='s&^&arm-linux-androideabi-&' --enable-gold=default
Thread model: posix
gcc version 4.8 (GCC) 
configure:3565: $? = 0
configure:3554: /usr/bin/ccache arm-linux-androideabi-gcc -DANDROID -mandroid -fomit-frame-pointer --sysroot /home/kivy/.buildozer/android/platform/android-ndk-r9c/platforms/android-19/arch-arm -V >&5
arm-linux-androideabi-gcc: error: unrecognized command line option '-V'
arm-linux-androideabi-gcc: fatal error: no input files
compilation terminated.
configure:3565: $? = 1
configure:3554: /usr/bin/ccache arm-linux-androideabi-gcc -DANDROID -mandroid -fomit-frame-pointer --sysroot /home/kivy/.buildozer/android/platform/android-ndk-r9c/platforms/android-19/arch-arm -qversion >&5
arm-linux-androideabi-gcc: error: unrecognized command line option '-qversion'
arm-linux-androideabi-gcc: fatal error: no input files
compilation terminated.
configure:3565: $? = 1
configure:3585: checking whether the C compiler works
configure:3607: /usr/bin/ccache arm-linux-androideabi-gcc -DANDROID -mandroid -fomit-frame-pointer --sysroot /home/kivy/.buildozer/android/platform/android-ndk-r9c/platforms/android-19/arch-arm -DANDROID -mandroid -fomit-frame-pointer --sysroot /home/kivy/.buildozer/android/platform/android-ndk-r9c/platforms/android-19/arch-arm -march=armv7-a -mfloat-abi=softfp -mfpu=vfp -mthumb -DNO_MALLINFO  -lm -L/home/kivy/Desktop/.buildozer/android/platform/build/build/libs_collections/myapp/armeabi-v7a conftest.c  >&5
Assembler messages:
Fatal error: invalid -march= option: `armv7-a'
configure:3611: $? = 1
configure:3649: result: no
configure: failed program was:
| /* confdefs.h */
| #define _GNU_SOURCE 1
| #define _NETBSD_SOURCE 1
| #define __BSD_VISIBLE 1
| #define _BSD_TYPES 1
| #define _DARWIN_C_SOURCE 1
| #define _XOPEN_SOURCE 600
| #define _XOPEN_SOURCE_EXTENDED 1
| #define _POSIX_C_SOURCE 200112L
| /* end confdefs.h.  */
| 
| int
| main ()
| {
| 
|   ;
|   return 0;
| }
configure:3654: error: in `/home/kivy/Desktop/.buildozer/android/platform/build/build/other_builds/python2/armeabi-v7a/python2':
configure:3656: error: C compiler cannot create executables
See `config.log' for more details

## ---------------- ##
## Cache variables. ##
## ---------------- ##

ac_cv_env_CC_set=set
ac_cv_env_CC_value='/usr/bin/ccache arm-linux-androideabi-gcc -DANDROID -mandroid -fomit-frame-pointer --sysroot /home/kivy/.buildozer/android/platform/android-ndk-r9c/platforms/android-19/arch-arm'
ac_cv_env_CFLAGS_set=set
ac_cv_env_CFLAGS_value='-DANDROID -mandroid -fomit-frame-pointer --sysroot /home/kivy/.buildozer/android/platform/android-ndk-r9c/platforms/android-19/arch-arm -march=armv7-a -mfloat-abi=softfp -mfpu=vfp -mthumb -DNO_MALLINFO'
ac_cv_env_CPPFLAGS_set=
ac_cv_env_CPPFLAGS_value=
ac_cv_env_CPP_set=
ac_cv_env_CPP_value=
ac_cv_env_LDFLAGS_set=set
ac_cv_env_LDFLAGS_value='-lm -L/home/kivy/Desktop/.buildozer/android/platform/build/build/libs_collections/myapp/armeabi-v7a'
ac_cv_env_LIBS_set=
ac_cv_env_LIBS_value=
ac_cv_env_build_alias_set=set
ac_cv_env_build_alias_value=x86_64-linux-gnu
ac_cv_env_host_alias_set=set
ac_cv_env_host_alias_value=arm-eabi
ac_cv_env_target_alias_set=
ac_cv_env_target_alias_value=
ac_cv_prog_CC='/usr/bin/ccache arm-linux-androideabi-gcc -DANDROID -mandroid -fomit-frame-pointer --sysroot /home/kivy/.buildozer/android/platform/android-ndk-r9c/platforms/android-19/arch-arm'

## ----------------- ##
## Output variables. ##
## ----------------- ##

AR='arm-linux-androideabi-ar'
ARCH_RUN_32BIT=''
ARFLAGS=''
BASECFLAGS=''
BLDLIBRARY=''
BLDSHARED=''
BUILDEXEEXT=''
CC='/usr/bin/ccache arm-linux-androideabi-gcc -DANDROID -mandroid -fomit-frame-pointer --sysroot /home/kivy/.buildozer/android/platform/android-ndk-r9c/platforms/android-19/arch-arm'
CCSHARED=''
CFLAGS='-DANDROID -mandroid -fomit-frame-pointer --sysroot /home/kivy/.buildozer/android/platform/android-ndk-r9c/platforms/android-19/arch-arm -march=armv7-a -mfloat-abi=softfp -mfpu=vfp -mthumb -DNO_MALLINFO'
CFLAGSFORSHARED=''
CONFIGURE_MACOSX_DEPLOYMENT_TARGET=''
CONFIG_ARGS=' '\''--host=arm-eabi'\'' '\''--build=x86_64-linux-gnu'\'' '\''--prefix=/home/kivy/Desktop/.buildozer/android/platform/build/build/other_builds/python2/armeabi-v7a/python2/python-install'\'' '\''--enable-shared'\'' '\''--disable-toolbox-glue'\'' '\''--disable-framework'\'' '\''build_alias=x86_64-linux-gnu'\'' '\''host_alias=arm-eabi'\'' '\''CC=/usr/bin/ccache arm-linux-androideabi-gcc -DANDROID -mandroid -fomit-frame-pointer --sysroot /home/kivy/.buildozer/android/platform/android-ndk-r9c/platforms/android-19/arch-arm'\'' '\''CFLAGS=-DANDROID -mandroid -fomit-frame-pointer --sysroot /home/kivy/.buildozer/android/platform/android-ndk-r9c/platforms/android-19/arch-arm -march=armv7-a -mfloat-abi=softfp -mfpu=vfp -mthumb -DNO_MALLINFO'\'' '\''LDFLAGS=-lm -L/home/kivy/Desktop/.buildozer/android/platform/build/build/libs_collections/myapp/armeabi-v7a'\'''
CPP=''
CPPFLAGS=''
CXX='/usr/bin/ccache arm-linux-androideabi-g++ -DANDROID -mandroid -fomit-frame-pointer --sysroot /home/kivy/.buildozer/android/platform/android-ndk-r9c/platforms/android-19/arch-arm'
DEFS=''
DLINCLDIR=''
DLLLIBRARY=''
DYNLOADFILE=''
ECHO_C=''
ECHO_N='-n'
ECHO_T=''
EGREP=''
EXEEXT=''
EXPORT_MACOSX_DEPLOYMENT_TARGET='#'
EXTRAMACHDEPPATH=''
EXTRAPLATDIR=''
FRAMEWORKALTINSTALLFIRST=''
FRAMEWORKALTINSTALLLAST=''
FRAMEWORKINSTALLAPPSPREFIX=''
FRAMEWORKINSTALLFIRST=''
FRAMEWORKINSTALLLAST=''
FRAMEWORKUNIXTOOLSPREFIX='/home/kivy/Desktop/.buildozer/android/platform/build/build/other_builds/python2/armeabi-v7a/python2/python-install'
GNULD=''
GREP=''
HAS_HG=''
HAVE_GETHOSTBYNAME=''
HAVE_GETHOSTBYNAME_R=''
HAVE_GETHOSTBYNAME_R_3_ARG=''
HAVE_GETHOSTBYNAME_R_5_ARG=''
HAVE_GETHOSTBYNAME_R_6_ARG=''
HGBRANCH=''
HGTAG=''
HGVERSION=''
INSTALL_DATA=''
INSTALL_PROGRAM=''
INSTALL_SCRIPT=''
INSTSONAME=''
LDCXXSHARED=''
LDFLAGS='-lm -L/home/kivy/Desktop/.buildozer/android/platform/build/build/libs_collections/myapp/armeabi-v7a'
LDLAST=''
LDLIBRARY=''
LDLIBRARYDIR=''
LDSHARED=''
LIBC=''
LIBFFI_INCLUDEDIR=''
LIBM=''
LIBOBJS=''
LIBRARY=''
LIBS=''
LIBTOOL_CRUFT=''
LINKCC=''
LINKFORSHARED=''
LIPO_32BIT_FLAGS=''
LN=''
LTLIBOBJS=''
MACHDEP='linux4'
MACHDEP_OBJS=''
MAINCC=''
OBJEXT=''
OPT=''
OTHER_LIBTOOL_OPT=''
PACKAGE_BUGREPORT='http://bugs.python.org/'
PACKAGE_NAME='python'
PACKAGE_STRING='python 2.7'
PACKAGE_TARNAME='python'
PACKAGE_URL=''
PACKAGE_VERSION='2.7'
PATH_SEPARATOR=':'
PKG_CONFIG=''
PYTHONFRAMEWORK=''
PYTHONFRAMEWORKDIR='no-framework'
PYTHONFRAMEWORKIDENTIFIER='org.python.python'
PYTHONFRAMEWORKINSTALLDIR=''
PYTHONFRAMEWORKPREFIX=''
RANLIB='arm-linux-androideabi-ranlib'
RUNSHARED=''
SGI_ABI=''
SHELL='/bin/bash'
SHLIBS=''
SIGNAL_OBJS=''
SO=''
SOVERSION='1.0'
SRCDIRS=''
SVNVERSION=''
THREADHEADERS=''
THREADOBJ=''
TRUE=''
UNICODE_OBJS=''
UNIVERSALSDK=''
UNIVERSAL_ARCH_FLAGS=''
USE_SIGNAL_MODULE=''
USE_THREAD_MODULE=''
VERSION='2.7'
ac_ct_CC=''
bindir='${exec_prefix}/bin'
build_alias='x86_64-linux-gnu'
datadir='${datarootdir}'
datarootdir='${prefix}/share'
docdir='${datarootdir}/doc/${PACKAGE_TARNAME}'
dvidir='${docdir}'
exec_prefix='NONE'
host_alias='arm-eabi'
htmldir='${docdir}'
includedir='${prefix}/include'
infodir='${datarootdir}/info'
libdir='${exec_prefix}/lib'
libexecdir='${exec_prefix}/libexec'
localedir='${datarootdir}/locale'
localstatedir='${prefix}/var'
mandir='${datarootdir}/man'
oldincludedir='/usr/include'
pdfdir='${docdir}'
prefix='/home/kivy/Desktop/.buildozer/android/platform/build/build/other_builds/python2/armeabi-v7a/python2/python-install'
program_transform_name='s,x,x,'
psdir='${docdir}'
sbindir='${exec_prefix}/sbin'
sharedstatedir='${prefix}/com'
sysconfdir='${prefix}/etc'
target_alias=''

## ----------- ##
## confdefs.h. ##
## ----------- ##

/* confdefs.h */
#define _GNU_SOURCE 1
#define _NETBSD_SOURCE 1
#define __BSD_VISIBLE 1
#define _BSD_TYPES 1
#define _DARWIN_C_SOURCE 1
#define _XOPEN_SOURCE 600
#define _XOPEN_SOURCE_EXTENDED 1
#define _POSIX_C_SOURCE 200112L

configure: exit 77

I tried googling and found solutions which suggested upgrading cython or gcc. I tried them all, but none of them worked.

I'd appreciate any help that you may offer.
Thanks!

@Akash3194
Copy link

@VineethRaghavan first of all install a c compiler like gcc in your os and then run "sudo rm -r .buildozer" and then compile again(it worked for me)

@VineethRaghavan
Copy link
Author

Thanks! it worked for me too!

@yangle9567
Copy link

没看明白到底怎么样解决
root@cdh2:/opt/Python-2.7# ./configure
checking for --enable-universalsdk... no
checking for --with-universal-archs... 32-bit
checking MACHDEP... linux4
checking EXTRAPLATDIR...
checking machine type as reported by uname -m... x86_64
checking for --without-gcc... no
checking for gcc... gcc
checking whether the C compiler works... no
configure: error: in /opt/Python-2.7': configure: error: C compiler cannot create executables See config.log' for more details.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants