title: Cross-Compiling gcc failure (Python)
body: <p>I'm trying to compile Python to port over to a router (ASUS RT-N16) with DD-WRT (DD-WRT v24-sp2 (SVN revision: 14896)) on it. JFFS2 (and therefore ipkg) and Optware are not options. I need to do a straight cross-compile. I'm new to cross-compiling.</p>
  
  <p>I tried following these directions:
    <a href="http://www.cnx-software.com/2011/02/04/cross-compiling-python-for-mips-and-arm-platforms/" rel="nofollow">http://www.cnx-software.com/2011/02/04/cross-compiling-python-for-mips-and-arm-platforms/</a></p>
  
  <p>I also tried these directions but got the same errors (this is what I JUST finished doing):
  <a href="http://www.embecosm.com/appnotes/ean9/ean9-howto-newlib-1.0.pdf" rel="nofollow">http://www.embecosm.com/appnotes/ean9/ean9-howto-newlib-1.0.pdf</a></p>
  
  <p>But I keep getting the following: </p>
  
  <pre><code>majik@ubuntu:~/Desktop/Python-2.7.3$ sudo CC=mipsel-linux-gcc CXX=mipsel-linux-g++ AR=mipsel-linux-ar RANLIB=mipsel-linux-ranlib ./configure -host=mipsel-linux -target=mipsel-linux -prefix=/python
  configure: WARNING: if you wanted to set the --build type, don't use --host.
      If a cross compiler is detected then cross compile mode will be used
  checking for --enable-universalsdk... no
  checking for --with-universal-archs... 32-bit
  checking MACHDEP... linux2
  checking EXTRAPLATDIR... 
  checking machine type as reported by uname -m... i686
  checking for --without-gcc... no
  checking for mipsel-linux-gcc... mipsel-linux-gcc
  checking whether the C compiler works... no
  configure: error: in `/home/majik/Desktop/Python-2.7.3':
  configure: error: C compiler cannot create executables
  See `config.log' for more details
  </code></pre>
  
  <p>My config.log contains the following:</p>
  
  <pre><code>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.67.  Invocation command line was
  
    $ ./configure -host=mipsel-linux -target=mipsel-linux -prefix=/python
  
  ## --------- ##
  ## Platform. ##
  ## --------- ##
  
  hostname = ubuntu
  uname -m = i686
  uname -r = 3.2.0-37-generic-pae
  uname -s = Linux
  uname -v = #58-Ubuntu SMP Thu Jan 24 15:51:02 UTC 2013
  
  /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: /usr/local/sbin
  PATH: /usr/local/bin
  PATH: /usr/sbin
  PATH: /usr/bin
  PATH: /sbin
  PATH: /bin
  
  
  ## ----------- ##
  ## Core tests. ##
  ## ----------- ##
  
  configure:2756: checking for --enable-universalsdk
  configure:2797: result: no
  configure:2806: checking for --with-universal-archs
  configure:2823: result: 32-bit
  configure:2980: checking MACHDEP
  configure:3129: result: linux2
  configure:3135: checking EXTRAPLATDIR
  configure:3150: result: 
  configure:3161: checking machine type as reported by uname -m
  configure:3164: result: i686
  configure:3177: checking for --without-gcc
  configure:3221: result: no
  configure:3242: checking for mipsel-linux-gcc
  configure:3269: result: mipsel-linux-gcc
  configure:3538: checking for C compiler version
  configure:3547: mipsel-linux-gcc --version &gt;&amp;5
  ./configure: line 3549: mipsel-linux-gcc: command not found
  configure:3558: $? = 127
  configure:3547: mipsel-linux-gcc -v &gt;&amp;5
  ./configure: line 3549: mipsel-linux-gcc: command not found
  configure:3558: $? = 127
  configure:3547: mipsel-linux-gcc -V &gt;&amp;5
  ./configure: line 3549: mipsel-linux-gcc: command not found
  configure:3558: $? = 127
  configure:3547: mipsel-linux-gcc -qversion &gt;&amp;5
  ./configure: line 3549: mipsel-linux-gcc: command not found
  configure:3558: $? = 127
  configure:3578: checking whether the C compiler works
  configure:3600: mipsel-linux-gcc    conftest.c  &gt;&amp;5
  ./configure: line 3602: mipsel-linux-gcc: command not found
  configure:3604: $? = 127
  configure:3642: 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:3647: error: in `/home/majik/Desktop/Python-2.7.3':
  configure:3649: 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=mipsel-linux-gcc
  ac_cv_env_CFLAGS_set=
  ac_cv_env_CFLAGS_value=
  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=
  ac_cv_env_LDFLAGS_value=
  ac_cv_env_LIBS_set=
  ac_cv_env_LIBS_value=
  ac_cv_env_build_alias_set=
  ac_cv_env_build_alias_value=
  ac_cv_env_host_alias_set=set
  ac_cv_env_host_alias_value=mipsel-linux
  ac_cv_env_target_alias_set=set
  ac_cv_env_target_alias_value=mipsel-linux
  ac_cv_prog_CC=mipsel-linux-gcc
  
  ## ----------------- ##
  ## Output variables. ##
  ## ----------------- ##
  
  AR='mipsel-linux-ar'
  ARCH_RUN_32BIT=''
  ARFLAGS=''
  BASECFLAGS=''
  BLDLIBRARY=''
  BLDSHARED=''
  BUILDEXEEXT=''
  CC='mipsel-linux-gcc'
  CCSHARED=''
  CFLAGS=''
  CFLAGSFORSHARED=''
  CONFIGURE_MACOSX_DEPLOYMENT_TARGET=''
  CONFIG_ARGS=' '\''-host=mipsel-linux'\'' '\''-target=mipsel-linux'\'' '\''-prefix=/python'\'' '\''host_alias=mipsel-linux'\'' '\''target_alias=mipsel-linux'\'' '\''CC=mipsel-linux-gcc'\'''
  CPP=''
  CPPFLAGS=''
  CXX='mipsel-linux-g++'
  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='/python'
  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=''
  LDLAST=''
  LDLIBRARY=''
  LDLIBRARYDIR=''
  LDSHARED=''
  LIBC=''
  LIBFFI_INCLUDEDIR=''
  LIBM=''
  LIBOBJS=''
  LIBRARY=''
  LIBS=''
  LIBTOOL_CRUFT=''
  LINKCC=''
  LINKFORSHARED=''
  LIPO_32BIT_FLAGS=''
  LN=''
  LTLIBOBJS=''
  MACHDEP='linux2'
  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='mipsel-linux-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=''
  datadir='${datarootdir}'
  datarootdir='${prefix}/share'
  docdir='${datarootdir}/doc/${PACKAGE_TARNAME}'
  dvidir='${docdir}'
  exec_prefix='NONE'
  host_alias='mipsel-linux'
  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='/python'
  program_transform_name='s,x,x,'
  psdir='${docdir}'
  sbindir='${exec_prefix}/sbin'
  sharedstatedir='${prefix}/com'
  sysconfdir='${prefix}/etc'
  target_alias='mipsel-linux'
  
  ## ----------- ##
  ## 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
  </code></pre>
  
  <p>Any suggestions would be greatly appreciated. I have the system that I'm trying to compile on, but I do not have access to the router unless I'm at work (won't be back there until next Tuesday). But It's the cross-compiler that's the problem. From what I understand, once it's all compiled, the folder just needs to be copied (via scp) to the router. Thanks!</p>
  
  <p>~BB</p>