LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux From Scratch (https://www.linuxquestions.org/questions/linux-from-scratch-13/)
-   -   GCC-4.6.2 configure: error: C compiler cannot create executables (https://www.linuxquestions.org/questions/linux-from-scratch-13/gcc-4-6-2-configure-error-c-compiler-cannot-create-executables-936382/)

Andy45 03-25-2012 05:35 PM

GCC-4.6.2 configure: error: C compiler cannot create executables
 
Hello LQ,

I have recently begun a second LFS installation and ran into the gcc error in the title. This is the input/output code:
Code:

CC="$LFS_TGT-gcc -B/tools/lib/" \
> AR=$LFS_TGT-ar RANLIB=$LFS_TGT-ranlib \
> ../gcc-4.6.2/configure --prefix=/tools \
> --with-local-prefix=/tools --enable-clocale=gnu \
> --enable-shared --enable-threads=posix \
> --enable-__cxa_atexit --enable-languages=c,c++ \
> --disable-libstdcxx-pch --disable-multilib \
> --disable-bootstrap --disable-libgomp \
> --without-ppl --without-cloog \
> --with-mpfr-include=$(pwd)/../gcc-4.6.2/mpfr/src \
> --with-mpfr-lib=$(pwd)/mpfr/src/.libs
checking build system type... i686-pc-linux-gnu
checking host system type... i686-pc-linux-gnu
checking target system type... i686-pc-linux-gnu
checking for a BSD-compatible install... /usr/bin/install -c
checking whether ln works... yes
checking whether ln -s works... yes
checking for a sed that does not truncate output... /bin/sed
checking for gawk... gawk
checking for gcc... -gcc -B/tools/lib/
checking for C compiler default output file name...
configure: error: in `/mnt/lfs/gcc-build':
configure: error: C compiler cannot create executables
See `config.log' for more details.

The part in bold is the error. I did not run into this the first time around. Can anybody help me solve this? My host system is Mint 12.

Thanks,

Andy45

P.S. here is the config.log:

Code:

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

It was created by configure, which was
generated by GNU Autoconf 2.64.  Invocation command line was

  $ ../gcc-4.6.2/configure --prefix=/tools --with-local-prefix=/tools --enable-clocale=gnu --enable-shared --enable-threads=posix --enable-__cxa_atexit --enable-languages=c,c++ --disable-libstdcxx-pch --disable-multilib --disable-bootstrap --disable-libgomp --without-ppl --without-cloog --with-mpfr-include=/mnt/lfs/gcc-build/../gcc-4.6.2/mpfr/src --with-mpfr-lib=/mnt/lfs/gcc-build/mpfr/src/.libs

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

hostname = atieno-Satellite-U405
uname -m = i686
uname -r = 3.0.0-16-generic
uname -s = Linux
uname -v = #29-Ubuntu SMP Tue Feb 14 12:49:42 UTC 2012

/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
PATH: /usr/X11R6/bin


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

configure:2222: checking build system type
configure:2236: result: i686-pc-linux-gnu
configure:2283: checking host system type
configure:2296: result: i686-pc-linux-gnu
configure:2316: checking target system type
configure:2329: result: i686-pc-linux-gnu
configure:2383: checking for a BSD-compatible install
configure:2451: result: /usr/bin/install -c
configure:2462: checking whether ln works
configure:2484: result: yes
configure:2488: checking whether ln -s works
configure:2492: result: yes
configure:2499: checking for a sed that does not truncate output
configure:2563: result: /bin/sed
configure:2572: checking for gawk
configure:2588: found /usr/bin/gawk
configure:2599: result: gawk
configure:3923: checking for gcc
configure:3950: result: -gcc -B/tools/lib/
configure:4179: checking for C compiler version
configure:4188: -gcc -B/tools/lib/ --version >&5
../gcc-4.6.2/configure: line 4190: -gcc: command not found
configure:4199: $? = 127
configure:4188: -gcc -B/tools/lib/ -v >&5
../gcc-4.6.2/configure: line 4190: -gcc: command not found
configure:4199: $? = 127
configure:4188: -gcc -B/tools/lib/ -V >&5
../gcc-4.6.2/configure: line 4190: -gcc: command not found
configure:4199: $? = 127
configure:4188: -gcc -B/tools/lib/ -qversion >&5
../gcc-4.6.2/configure: line 4190: -gcc: command not found
configure:4199: $? = 127
configure:4219: checking for C compiler default output file name
configure:4241: -gcc -B/tools/lib/    conftest.c  >&5
../gcc-4.6.2/configure: line 4243: -gcc: command not found
configure:4245: $? = 127
configure:4282: result:
configure: failed program was:
| /* confdefs.h */
| #define PACKAGE_NAME ""
| #define PACKAGE_TARNAME ""
| #define PACKAGE_VERSION ""
| #define PACKAGE_STRING ""
| #define PACKAGE_BUGREPORT ""
| #define PACKAGE_URL ""
| /* end confdefs.h.  */
|
| int
| main ()
| {
|
|  ;
|  return 0;
| }
configure:4288: error: in `/mnt/lfs/gcc-build':
configure:4292: error: C compiler cannot create executables
See `config.log' for more details.

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

ac_cv_build=i686-pc-linux-gnu
ac_cv_env_AR_FOR_TARGET_set=
ac_cv_env_AR_FOR_TARGET_value=
ac_cv_env_AR_set=set
ac_cv_env_AR_value=-ar
ac_cv_env_AS_FOR_TARGET_set=
ac_cv_env_AS_FOR_TARGET_value=
ac_cv_env_AS_set=
ac_cv_env_AS_value=
ac_cv_env_CCC_set=
ac_cv_env_CCC_value=
ac_cv_env_CC_FOR_TARGET_set=
ac_cv_env_CC_FOR_TARGET_value=
ac_cv_env_CC_set=set
ac_cv_env_CC_value='-gcc -B/tools/lib/'
ac_cv_env_CFLAGS_set=
ac_cv_env_CFLAGS_value=
ac_cv_env_CPPFLAGS_set=
ac_cv_env_CPPFLAGS_value=
ac_cv_env_CXXFLAGS_set=
ac_cv_env_CXXFLAGS_value=
ac_cv_env_CXX_FOR_TARGET_set=
ac_cv_env_CXX_FOR_TARGET_value=
ac_cv_env_CXX_set=
ac_cv_env_CXX_value=
ac_cv_env_DLLTOOL_FOR_TARGET_set=
ac_cv_env_DLLTOOL_FOR_TARGET_value=
ac_cv_env_DLLTOOL_set=
ac_cv_env_DLLTOOL_value=
ac_cv_env_GCC_FOR_TARGET_set=
ac_cv_env_GCC_FOR_TARGET_value=
ac_cv_env_GCJ_FOR_TARGET_set=
ac_cv_env_GCJ_FOR_TARGET_value=
ac_cv_env_GFORTRAN_FOR_TARGET_set=
ac_cv_env_GFORTRAN_FOR_TARGET_value=
ac_cv_env_GOC_FOR_TARGET_set=
ac_cv_env_GOC_FOR_TARGET_value=
ac_cv_env_LDFLAGS_set=
ac_cv_env_LDFLAGS_value=
ac_cv_env_LD_FOR_TARGET_set=
ac_cv_env_LD_FOR_TARGET_value=
ac_cv_env_LD_set=
ac_cv_env_LD_value=
ac_cv_env_LIBS_set=
ac_cv_env_LIBS_value=
ac_cv_env_LIPO_FOR_TARGET_set=
ac_cv_env_LIPO_FOR_TARGET_value=
ac_cv_env_LIPO_set=
ac_cv_env_LIPO_value=
ac_cv_env_NM_FOR_TARGET_set=
ac_cv_env_NM_FOR_TARGET_value=
ac_cv_env_NM_set=
ac_cv_env_NM_value=
ac_cv_env_OBJCOPY_set=
ac_cv_env_OBJCOPY_value=
ac_cv_env_OBJDUMP_FOR_TARGET_set=
ac_cv_env_OBJDUMP_FOR_TARGET_value=
ac_cv_env_OBJDUMP_set=
ac_cv_env_OBJDUMP_value=
ac_cv_env_RANLIB_FOR_TARGET_set=
ac_cv_env_RANLIB_FOR_TARGET_value=
ac_cv_env_RANLIB_set=set
ac_cv_env_RANLIB_value=-ranlib
ac_cv_env_STRIP_FOR_TARGET_set=
ac_cv_env_STRIP_FOR_TARGET_value=
ac_cv_env_STRIP_set=
ac_cv_env_STRIP_value=
ac_cv_env_WINDMC_FOR_TARGET_set=
ac_cv_env_WINDMC_FOR_TARGET_value=
ac_cv_env_WINDMC_set=
ac_cv_env_WINDMC_value=
ac_cv_env_WINDRES_FOR_TARGET_set=
ac_cv_env_WINDRES_FOR_TARGET_value=
ac_cv_env_WINDRES_set=
ac_cv_env_WINDRES_value=
ac_cv_env_build_alias_set=
ac_cv_env_build_alias_value=
ac_cv_env_build_configargs_set=
ac_cv_env_build_configargs_value=
ac_cv_env_host_alias_set=
ac_cv_env_host_alias_value=
ac_cv_env_host_configargs_set=
ac_cv_env_host_configargs_value=
ac_cv_env_target_alias_set=
ac_cv_env_target_alias_value=
ac_cv_env_target_configargs_set=
ac_cv_env_target_configargs_value=
ac_cv_host=i686-pc-linux-gnu
ac_cv_path_SED=/bin/sed
ac_cv_path_install='/usr/bin/install -c'
ac_cv_prog_AWK=gawk
ac_cv_prog_ac_ct_CC='-gcc -B/tools/lib/'
ac_cv_target=i686-pc-linux-gnu
acx_cv_prog_LN=ln

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

AR='-ar'
AR_FOR_BUILD='$(AR)'
AR_FOR_TARGET=''
AS=''
AS_FOR_BUILD='$(AS)'
AS_FOR_TARGET=''
AWK='gawk'
BISON=''
BUILD_CONFIG=''
CC='-gcc -B/tools/lib/'
CC_FOR_BUILD='$(CC)'
CC_FOR_TARGET=''
CFLAGS=''
CFLAGS_FOR_BUILD=''
CFLAGS_FOR_TARGET=''
COMPILER_AS_FOR_TARGET=''
COMPILER_LD_FOR_TARGET=''
COMPILER_NM_FOR_TARGET=''
CONFIGURE_GDB_TK=''
CPPFLAGS=''
CXX=''
CXXFLAGS=''
CXXFLAGS_FOR_BUILD=''
CXXFLAGS_FOR_TARGET=''
CXX_FOR_BUILD='$(CXX)'
CXX_FOR_TARGET=''
DEBUG_PREFIX_CFLAGS_FOR_TARGET=''
DEFS=''
DLLTOOL=''
DLLTOOL_FOR_BUILD='$(DLLTOOL)'
DLLTOOL_FOR_TARGET=''
ECHO_C=''
ECHO_N='-n'
ECHO_T=''
EXEEXT=''
EXPECT=''
FLAGS_FOR_TARGET=''
FLEX=''
GCC_FOR_TARGET=''
GCC_SHLIB_SUBDIR=''
GCJ_FOR_BUILD='$(GCJ)'
GCJ_FOR_TARGET=''
GDB_TK=''
GFORTRAN_FOR_BUILD='$(GFORTRAN)'
GFORTRAN_FOR_TARGET=''
GNATBIND=''
GNATMAKE=''
GOC_FOR_BUILD='$(GOC)'
GOC_FOR_TARGET=''
INSTALL_DATA='${INSTALL} -m 644'
INSTALL_GDB_TK=''
INSTALL_PROGRAM='${INSTALL}'
INSTALL_SCRIPT='${INSTALL}'
LD=''
LDFLAGS=''
LDFLAGS_FOR_BUILD=''
LD_FOR_BUILD='$(LD)'
LD_FOR_TARGET=''
LEX=''
LIBOBJS=''
LIBS=''
LIPO=''
LIPO_FOR_TARGET=''
LN='ln'
LN_S='ln -s'
LTLIBOBJS=''
M4=''
MAINT=''
MAINTAINER_MODE_FALSE=''
MAINTAINER_MODE_TRUE=''
MAKEINFO=''
NM=''
NM_FOR_BUILD='$(NM)'
NM_FOR_TARGET=''
OBJCOPY=''
OBJDUMP=''
OBJDUMP_FOR_TARGET=''
OBJEXT=''
PACKAGE_BUGREPORT=''
PACKAGE_NAME=''
PACKAGE_STRING=''
PACKAGE_TARNAME=''
PACKAGE_URL=''
PACKAGE_VERSION=''
PATH_SEPARATOR=':'
RANLIB='-ranlib'
RANLIB_FOR_BUILD='$(RANLIB)'
RANLIB_FOR_TARGET=''
RAW_CXX_FOR_TARGET=''
RPATH_ENVVAR=''
RUNTEST=''
SED='/bin/sed'
SHELL='/bin/bash'
STRIP=''
STRIP_FOR_TARGET=''
SYSROOT_CFLAGS_FOR_TARGET=''
TOPLEVEL_CONFIGURE_ARGUMENTS='../gcc-4.6.2/configure --prefix=/tools --with-local-prefix=/tools --enable-clocale=gnu --enable-shared --enable-threads=posix --enable-__cxa_atexit --enable-languages=c,c++ --disable-libstdcxx-pch --disable-multilib --disable-bootstrap --disable-libgomp --without-ppl --without-cloog --with-mpfr-include=/mnt/lfs/gcc-build/../gcc-4.6.2/mpfr/src --with-mpfr-lib=/mnt/lfs/gcc-build/mpfr/src/.libs'
WINDMC=''
WINDMC_FOR_BUILD='$(WINDMC)'
WINDMC_FOR_TARGET=''
WINDRES=''
WINDRES_FOR_BUILD='$(WINDRES)'
WINDRES_FOR_TARGET=''
YACC=''
ac_ct_CC='-gcc -B/tools/lib/'
ac_ct_CXX=''
bindir='${exec_prefix}/bin'
build='i686-pc-linux-gnu'
build_alias=''
build_configargs=''
build_configdirs='build-libiberty build-texinfo build-byacc build-flex build-bison build-m4 build-fixincludes'
build_cpu='i686'
build_libsubdir='build-i686-pc-linux-gnu'
build_noncanonical='i686-pc-linux-gnu'
build_os='linux-gnu'
build_subdir='build-i686-pc-linux-gnu'
build_tooldir=''
build_vendor='pc'
clooginc=''
clooglibs=''
compare_exclusions=''
config_shell='/bin/bash'
configdirs='intl mmalloc libiberty opcodes bfd readline tcl tk itcl libgui zlib libcpp libdecnumber gmp mpfr mpc ppl cloog libelf libiconv texinfo byacc flex bison binutils gas ld fixincludes gcc cgen sid sim gdb make patch prms send-pr gprof etc expect dejagnu ash bash bzip2 m4 autoconf automake libtool diff rcs fileutils shellutils time textutils wdiff find uudecode hello tar gzip indent recode release sed utils guile perl gawk findutils gettext zip fastjar gnattools'
datadir='${datarootdir}'
datarootdir='${prefix}/share'
do_compare=''
docdir='${datarootdir}/doc/${PACKAGE}'
dvidir='${docdir}'
exec_prefix='NONE'
extra_host_libiberty_configure_flags=''
extra_mpc_gmp_configure_flags=''
extra_mpc_mpfr_configure_flags=''
extra_mpfr_configure_flags=''
gmpinc=''
gmplibs=''
host='i686-pc-linux-gnu'
host_alias=''
host_configargs=''
host_cpu='i686'
host_noncanonical='i686-pc-linux-gnu'
host_os='linux-gnu'
host_subdir='.'
host_vendor='pc'
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}'
poststage1_ldflags=''
poststage1_libs=''
pplinc=''
ppllibs=''
prefix='/tools'
program_transform_name='s,y,y,'
psdir='${docdir}'
sbindir='${exec_prefix}/sbin'
sharedstatedir='${prefix}/com'
stage1_cflags=''
stage1_checking=''
stage1_languages=''
stage1_ldflags=''
stage1_libs=''
stage2_werror_flag=''
sysconfdir='${prefix}/etc'
target='i686-pc-linux-gnu'
target_alias=''
target_configargs=''
target_configdirs='target-libgcc target-libgloss target-newlib target-libgomp target-libstdc++-v3 target-libmudflap target-libssp target-libquadmath target-libgfortran target-boehm-gc target-libffi target-zlib target-qthreads target-libjava target-libobjc target-libada target-libgo target-examples target-groff target-gperf target-rda'
target_cpu='i686'
target_noncanonical='i686-pc-linux-gnu'
target_os='linux-gnu'
target_subdir='i686-pc-linux-gnu'
target_vendor='pc'
tooldir=''

## ------------------- ##
## File substitutions. ##
## ------------------- ##

alphaieee_frag=''
host_makefile_frag='config/mh-x86omitfp'
ospace_frag=''
serialization_dependencies=''
target_makefile_frag=''

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

/* confdefs.h */
#define PACKAGE_NAME ""
#define PACKAGE_TARNAME ""
#define PACKAGE_VERSION ""
#define PACKAGE_STRING ""
#define PACKAGE_BUGREPORT ""
#define PACKAGE_URL ""

configure: exit 77


weibullguy 03-25-2012 05:56 PM

According to the config.log, it can't find your -gcc compiler. That's easy enough to see from these lines
Code:

../gcc-4.6.2/configure: line 4243: -gcc: command not found
As you are on pass 2 of gcc, I suspect the problem is you don't have LFS_TGT set in your environment. Since we can assume pass 2 of binutils completed successfully, you somehow unset this variable after installing binutils. If you haven't logged out the LFS user, just source the .bashrc file to reset the variable.

Andy45 03-25-2012 06:34 PM

Fixed!
 
Thanks for the quick and simple reply; that fixed it. I redid chapter 4.4 of the manual, and I also went here: http://www.linuxquestions.org/questi...-found-892180/.


All times are GMT -5. The time now is 06:39 AM.