C compiler cannot create executables exit 77

20,504

The actual error line in the log is:

gcc: error trying to exec 'as': execvp: Permission denied

The problem is probably that you have a file as in your PATH that is not the "real" assembler, normally in /bin/as. Change your PATH so that /bin and /usr/bin are first in the list, before your current order of /usr/local/jdk/bin /usr/lib64/qt-3.3/bin /home/midgar77/perl5/bin and /usr/local/bin.

Share:
20,504

Related videos on Youtube

OMGitzMidgar
Author by

OMGitzMidgar

Updated on September 18, 2022

Comments

  • OMGitzMidgar
    OMGitzMidgar over 1 year

    I am using a RedHat linux environment where I do not have root permissions (I am on a paid server account).

    Every time I try to run "./configure" on a new package that I am trying to set up and install, I run into an issue because of a problem with the C compiler and/or gcc.

    My main problem has been trying to install python locally so that I can install certain Python tools like Flask and Pip. Here is the error message when I try running Python's "./configure" :

    checking for --with-universal-archs... 32-bit
    checking MACHDEP... linux2
    checking EXTRAPLATDIR...
    checking machine type as reported by uname -m... x86_64
    checking for --without-gcc... no
    checking for gcc... gcc
    checking for C compiler default output file name...
    configure: error: C compiler cannot create executables
    See `config.log' for more details.
    

    Here are the contents of 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.6, which was
        generated by GNU Autoconf 2.61.  Invocation command line was
    
          $ ./configure
    
        ## --------- ##
        ## Platform. ##
        ## --------- ##
    
        hostname = marten.arvixe.com
        uname -m = x86_64
        uname -r = 2.6.32-573.7.1.el6.x86_64
        uname -s = Linux
        uname -v = #1 SMP Tue Sep 22 22:00:00 UTC 2015
    
        /usr/bin/uname -p = unknown
        /bin/uname -X     = unknown
    
        /bin/arch              = x86_64
        /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/jdk/bin
        PATH: /usr/lib64/qt-3.3/bin
        PATH: /home/midgar77/perl5/bin
        PATH: /usr/local/bin
        PATH: /bin
        PATH: /usr/bin
        PATH: /usr/local/sbin
        PATH: /usr/sbin
        PATH: /sbin
        PATH: /usr/local/easy/bin
        PATH: /usr/local/bin
        PATH: /usr/X11R6/bin
        PATH: /home/midgar77/bin
    
    
        ## ----------- ##
        ## Core tests. ##
        ## ----------- ##
    
        configure:1904: checking for --with-universal-archs
        configure:1923: result: 32-bit
        configure:2055: checking MACHDEP
        configure:2219: result: linux2
        configure:2225: checking EXTRAPLATDIR
        configure:2240: result:
        configure:2251: checking machine type as reported by uname -m
        configure:2254: result: x86_64
        configure:2267: checking for --without-gcc
        configure:2316: result: no
        configure:2377: checking for gcc
        configure:2393: found /usr/bin/gcc
        configure:2404: result: gcc
        configure:2642: checking for C compiler version
        configure:2649: gcc --version >&5
        gcc (GCC) 4.4.7 20120313 (Red Hat 4.4.7-11)
        Copyright (C) 2010 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:2652: $? = 0
        configure:2659: gcc -v >&5
        Using built-in specs.
        Target: x86_64-redhat-linux
        Configured with: ../configure --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --with-bugurl=http://bugzilla.redhat.com/bugzilla --enable-bootstrap --enable-shared --enable-threads=posix --enable-checking=release --with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions --enable-gnu-unique-object --enable-languages=c,c++,objc,obj-c++,java,fortran,ada --enable-java-awt=gtk --disable-dssi --with-java-home=/usr/lib/jvm/java-1.5.0-gcj-1.5.0.0/jre --enable-libgcj-multifile --enable-java-maintainer-mode --with-ecj-jar=/usr/share/java/eclipse-ecj.jar --disable-libjava-multilib --with-ppl --with-cloog --with-tune=generic --with-arch_32=i686 --build=x86_64-redhat-linux
        Thread model: posix
        gcc version 4.4.7 20120313 (Red Hat 4.4.7-11) (GCC)
        configure:2662: $? = 0
        configure:2669: gcc -V >&5
        gcc: '-V' option must have argument
        configure:2672: $? = 1
        configure:2695: checking for C compiler default output file name
        configure:2722: gcc    conftest.c  >&5
        gcc: error trying to exec 'as': execvp: Permission denied
        configure:2725: $? = 1
        configure:2763: result:
        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:2770: error: C compiler cannot create executables
        See `config.log' for more details.
    
        ## ---------------- ##
        ## Cache variables. ##
        ## ---------------- ##
    
        ac_cv_env_CC_set=
        ac_cv_env_CC_value=
        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=
        ac_cv_env_host_alias_value=
        ac_cv_env_target_alias_set=
        ac_cv_env_target_alias_value=
        ac_cv_prog_ac_ct_CC=gcc
    
        ## ----------------- ##
        ## Output variables. ##
        ## ----------------- ##
    
        AR=''
        ARCH_RUN_32BIT=''
        BASECFLAGS=''
        BLDLIBRARY=''
        BLDSHARED=''
        BUILDEXEEXT=''
        CC='gcc'
        CCSHARED=''
        CFLAGS=''
        CFLAGSFORSHARED=''
        CONFIGURE_MACOSX_DEPLOYMENT_TARGET=''
        CONFIG_ARGS=''
        CPP=''
        CPPFLAGS=''
        CXX=''
        DEFS=''
        DLINCLDIR=''
        DLLLIBRARY=''
        DYNLOADFILE=''
        ECHO_C=''
        ECHO_N='-n'
        ECHO_T=''
        EGREP=''
        EXEEXT=''
        EXPORT_MACOSX_DEPLOYMENT_TARGET='#'
        EXTRAMACHDEPPATH=''
        EXTRAPLATDIR=''
        FRAMEWORKALTINSTALLFIRST=''
        FRAMEWORKALTINSTALLLAST=''
        FRAMEWORKINSTALLFIRST=''
        FRAMEWORKINSTALLLAST=''
        FRAMEWORKUNIXTOOLSPREFIX='/usr/local'
        GREP=''
        HAVE_GETHOSTBYNAME=''
        HAVE_GETHOSTBYNAME_R=''
        HAVE_GETHOSTBYNAME_R_3_ARG=''
        HAVE_GETHOSTBYNAME_R_5_ARG=''
        HAVE_GETHOSTBYNAME_R_6_ARG=''
        INSTALL_DATA=''
        INSTALL_PROGRAM=''
        INSTALL_SCRIPT=''
        INSTSONAME=''
        LDFLAGS=''
        LDLAST=''
        LDLIBRARY=''
        LDLIBRARYDIR=''
        LDSHARED=''
        LIBC=''
        LIBM=''
        LIBOBJS=''
        LIBRARY=''
        LIBS=''
        LIBTOOL_CRUFT=''
        LINKCC=''
        LINKFORSHARED=''
        LN=''
        LTLIBOBJS=''
        MACHDEP='linux2'
        MACHDEP_OBJS=''
        MAINCC=''
        OBJEXT=''
        OPT=''
        OTHER_LIBTOOL_OPT=''
        PACKAGE_BUGREPORT='http://www.python.org/python-bugs'
        PACKAGE_NAME='python'
        PACKAGE_STRING='python 2.6'
        PACKAGE_TARNAME='python'
        PACKAGE_VERSION='2.6'
        PATH_SEPARATOR=':'
        PYTHONFRAMEWORK=''
        PYTHONFRAMEWORKDIR='no-framework'
        PYTHONFRAMEWORKIDENTIFIER='org.python.python'
        PYTHONFRAMEWORKINSTALLDIR=''
        PYTHONFRAMEWORKPREFIX=''
        RANLIB=''
        RUNSHARED=''
        SGI_ABI=''
        SHELL='/bin/sh'
        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.6'
        ac_ct_CC='gcc'
        bindir='${exec_prefix}/bin'
        build_alias=''
        datadir='${datarootdir}'
        datarootdir='${prefix}/share'
        docdir='${datarootdir}/doc/${PACKAGE_TARNAME}'
        dvidir='${docdir}'
        exec_prefix='NONE'
        host_alias=''
        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='NONE'
        program_transform_name='s,x,x,'
        psdir='${docdir}'
        sbindir='${exec_prefix}/sbin'
        sharedstatedir='${prefix}/com'
        sysconfdir='${prefix}/etc'
        target_alias=''
    
        ## ----------- ##
        ## 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
    

    Does anybody know what the issue is here? Is there something wrong with my gcc setup? Am I missing a required library somewhere? I am using gcc version 4.4.7

    • Jonathan Komar
      Jonathan Komar almost 7 years
      I have the same issue on RHEL 7.
  • they
    they over 2 years
    What's a "system file", and what type of access would one need for it? Why would using sudo be required for building a piece of software? Usually, sudo would only ever be required if the software was to be installed in a location that is not writable by non-root users (and the user in this question does not get that far). Using sudo just because one gets "permission denied" is a less than ideal security policy. It would be better to understand why the error occurs, and how to solve it properly, so that building the software can be done without sudo (as is commonly the case).
  • Stephen Kitt
    Stephen Kitt over 2 years
    @switch87 but the OP was using RHEL, not Ubuntu. In any case, using sudo is wrong here, and the correct fix for the problem you’re referring to would be to fix the permissions.
  • switch87
    switch87 over 2 years
    @StephenKitt Apparently the problem is also there in RHEL and is probably a bug in the compiler package not linked to a distribution. But to solve it, in any case, you need root permissions. If this should not be is not the question here. It is what it is untill it is fixed at the root of the problem. so the answer that you need sudo permissions is right.
  • switch87
    switch87 over 2 years
    as is a compiler package, and the error clearly states that it is found but the user has no permission to use it. this answer makes no sense.
  • Admin
    Admin almost 2 years
    @switch87 Maybe the error msg does not make sense. I can confirm that the answer makes sense, since I also had error77 problem, and removing another as from PATH solved the problem for me.