GCC编译错误:configure:error:C编译器无法创建可执行文件

时间:2018-05-17 02:31:50

标签: gcc compiler-errors

我试图通过这个shell在/ usr / bin中安装基于gcc-4.4.7的gcc-7.2.0。

# installer bash, alternate the version-code.e.g. 7.2.0 to your prefered one
tar -zxf gcc-7.2.0.tar.gz
cd gcc-7.2.0
./contrib/download_prerequisites
cd ..
mkdir gcc-build-7.2.0
cd  gcc-build-7.2.0
../gcc-7.2.0/configure --prefix=/home/gaojy/Tools/gcctool --enable- checking=release --enable-languages=c,c++ --disable-multilib
make
make install

但我收到的错误是:

checking for C compiler default output file name...
configure: error: in `/home/gaojy/Tools/gcc-build-7.2.0/x86_64-pc-linux-gnu/libgomp':
configure: error: C compiler cannot create executables
See 'config.log' for more details.

然后是config.log的详细信息。

  $ ../gcc-7.2.0/configure --prefix=/home/gaojy/Tools/gcctool --enable-checking=release --enable-languages=c,c++ --disable-multilib

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

hostname = yulab
uname -m = x86_64
uname -r = 2.6.32-696.16.1.el6.x86_64
uname -s = Linux
uname -v = #1 SMP Wed Nov 15 16:51:15 UTC 2017

/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/bin
PATH: /home/gaojy/cuda-8.0/bin
PATH: /home/gaojy/Tools/pkg-config/bin
PATH: /home/gaojy/Tools/protobuf/bin
PATH: /home/gaojy/Tools/python-2.7.14/bin
PATH: /home/gaojy/intel/bin
PATH: /home/gaojy/Tools/hdf5/bin
PATH: /home/gaojy/Tools/openjpeg-v2.3.0-linux-x86_64/bin
PATH: /usr/local/bin
PATH: /bin
PATH: /usr/bin
PATH: /usr/local/sbin
PATH: /usr/sbin
PATH: /sbin


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

configure:2304: checking build system type
configure:2318: result: x86_64-pc-linux-gnu
configure:2365: checking host system type
configure:2378: result: x86_64-pc-linux-gnu
configure:2398: checking target system type
configure:2411: result: x86_64-pc-linux-gnu
configure:2465: checking for a BSD-compatible install
configure:2533: result: /usr/bin/install -c
configure:2544: checking whether ln works
configure:2566: result: yes
configure:2570: checking whether ln -s works
configure:2574: result: yes
configure:2581: checking for a sed that does not truncate output
configure:2645: result: /bin/sed
configure:2654: checking for gawk
configure:2670: found /usr/bin/gawk
configure:2681: result: gawk
configure:3175: checking for libatomic support
configure:3185: result: yes
configure:3194: checking for libcilkrts support
configure:3204: result: yes
configure:3232: checking for libitm support
configure:3242: result: yes
configure:3251: checking for libsanitizer support
configure:3261: result: yes
configure:3270: checking for libvtv support
configure:3280: result: yes
configure:3290: checking for libmpx support
configure:3300: result: yes
configure:3309: checking for libhsail-rt support
configure:3321: result: yes
configure:4038: checking for gcc
configure:4054: found /usr/bin/gcc
configure:4065: result: gcc
configure:4294: checking for C compiler version
configure:4303: gcc --version >&5
gcc (GCC) 4.4.7 20120313 (Red Hat 4.4.7-18)
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:4314: $? = 0
configure:4303: 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-18) (GCC) 
configure:4314: $? = 0
configure:4303: gcc -V >&5
gcc: '-V' option must have argument
configure:4314: $? = 1
configure:4303: gcc -qversion >&5
gcc: unrecognized option '-qversion'
gcc: no input files
configure:4314: $? = 1
configure:4334: checking for C compiler default output file name
configure:4356: gcc    conftest.c  >&5
configure:4360: $? = 0
configure:4397: result: a.out
configure:4413: checking whether the C compiler works
configure:4422: ./a.out
configure:4426: $? = 0
configure:4441: result: yes
configure:4448: checking whether we are cross compiling
configure:4450: result: no
configure:4453: checking for suffix of executables
configure:4460: gcc -o conftest    conftest.c  >&5
configure:4464: $? = 0
configure:4486: result: 
configure:4492: checking for suffix of object files
configure:4514: gcc -c   conftest.c >&5
configure:4518: $? = 0
configure:4539: result: o
configure:4543: checking whether we are using the GNU C compiler
configure:4562: gcc -c   conftest.c >&5
configure:4562: $? = 0
configure:4571: result: yes
configure:4580: checking whether gcc accepts -g
configure:4600: gcc -c -g  conftest.c >&5
configure:4600: $? = 0
configure:4641: result: yes
configure:4658: checking for gcc option to accept ISO C89
configure:4722: gcc  -c   conftest.c >&5
configure:4722: $? = 0
configure:4735: result: none needed
configure:4813: checking for g++
configure:4829: found /usr/bin/g++
configure:4840: result: g++
configure:4867: checking for C++ compiler version
configure:4876: g++ --version >&5
g++ (GCC) 4.4.7 20120313 (Red Hat 4.4.7-18)
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:4887: $? = 0
configure:4876: g++ -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-18) (GCC) 
configure:4887: $? = 0
configure:4876: g++ -V >&5
g++: '-V' option must have argument
configure:4887: $? = 1
configure:4876: g++ -qversion >&5
g++: unrecognized option '-qversion'
g++: no input files
configure:4887: $? = 1
configure:4891: checking whether we are using the GNU C++ compiler
configure:4910: g++ -c   conftest.cpp >&5
configure:4910: $? = 0
configure:4919: result: yes
configure:4928: checking whether g++ accepts -g
configure:4948: g++ -c -g  conftest.cpp >&5
configure:4948: $? = 0
configure:4989: result: yes
configure:5038: checking whether g++ accepts -static-libstdc++ -static-libgcc
configure:5055: g++ -o conftest -g -O2   -static-libstdc++ -static-libgcc conftest.cpp  >&5
g++: unrecognized option '-static-libstdc++'
conftest.cpp:11:2: error: #error -static-libstdc++ not implemented
configure:5055: $? = 1
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.  */
| 
| #if (__GNUC__ < 4) || (__GNUC__ == 4 && __GNUC_MINOR__ < 5)
| #error -static-libstdc++ not implemented
| #endif
| int main() {}
configure:5059: result: no
configure:5120: checking for gnatbind
configure:5150: result: no
configure:5212: checking for gnatmake
configure:5242: result: no
configure:5261: checking whether compiler driver understands Ada
configure:5284: result: no
configure:5293: checking how to compare bootstrapped objects
configure:5318: result: cmp --ignore-initial=16 $$f1 $$f2
configure:5378: checking for objdir
configure:5393: result: .libs
configure:5924: WARNING: using in-tree isl, disabling version check
configure:6993: checking for default BUILD_CONFIG
configure:7025: result: bootstrap-debug
configure:7030: checking for --enable-vtable-verify
configure:7043: result: no
configure:7643: checking for bison
configure:7659: found /usr/bin/bison
configure:7670: result: bison -y
configure:7690: checking for bison
configure:7706: found /usr/bin/bison
configure:7717: result: bison
configure:7737: checking for gm4
configure:7767: result: no
configure:7737: checking for gnum4
configure:7767: result: no
configure:7737: checking for m4
configure:7753: found /usr/bin/m4
configure:7764: result: m4
configure:7784: checking for flex
configure:7814: result: no
configure:7784: checking for lex
configure:7814: result: no
configure:7832: checking for flex
configure:7862: result: no
configure:7879: checking for makeinfo
configure:7909: result: no
configure:7940: checking for expect
configure:7970: result: no
configure:7989: checking for runtest
configure:8019: result: no
configure:8134: checking for ar
configure:8150: found /usr/bin/ar
configure:8161: result: ar
configure:8275: checking for as
configure:8291: found /usr/bin/as
configure:8302: result: as
configure:8416: checking for dlltool
configure:8446: result: no
configure:8557: checking for ld
configure:8573: found /usr/bin/ld
configure:8584: result: ld
configure:8698: checking for lipo
configure:8728: result: no
configure:8839: checking for nm
configure:8855: found /usr/bin/nm
configure:8866: result: nm
configure:8980: checking for ranlib
configure:8996: found /usr/bin/ranlib
configure:9007: result: ranlib
configure:9116: checking for strip
configure:9132: found /usr/bin/strip
configure:9143: result: strip
configure:9252: checking for windres
configure:9282: result: no
configure:9393: checking for windmc
configure:9423: result: no
configure:9534: checking for objcopy
configure:9550: found /usr/bin/objcopy
configure:9561: result: objcopy
configure:9675: checking for objdump
configure:9691: found /usr/bin/objdump
configure:9702: result: objdump
configure:9816: checking for readelf
configure:9832: found /usr/bin/readelf
configure:9843: result: readelf
configure:9996: checking for cc
configure:10012: found /usr/bin/cc
configure:10023: result: cc
configure:10157: checking for c++
configure:10173: found /usr/bin/c++
configure:10184: result: c++
configure:10318: checking for gcc
configure:10334: found /usr/bin/gcc
configure:10345: result: gcc
configure:10474: checking for gfortran
configure:10504: result: no
configure:10635: checking for gccgo
configure:10665: result: no
configure:10726: checking for ar
configure:10759: result: no
configure:10876: checking for ar
configure:10892: found /usr/bin/ar
configure:10903: result: ar
configure:10956: checking for as
configure:10989: result: no
configure:11106: checking for as
configure:11122: found /usr/bin/as
configure:11133: result: as
configure:11186: checking for dlltool
configure:11219: result: no
configure:11336: checking for dlltool
configure:11366: result: no
configure:11416: checking for ld
configure:11449: result: no
configure:11566: checking for ld
configure:11582: found /usr/bin/ld
configure:11593: result: ld
configure:11646: checking for lipo
configure:11679: result: no
configure:11796: checking for lipo
configure:11826: result: no
configure:11876: checking for nm
configure:11909: result: no
configure:12026: checking for nm
configure:12042: found /usr/bin/nm
configure:12053: result: nm
configure:12106: checking for objcopy
configure:12139: result: no
configure:12256: checking for objcopy
configure:12272: found /usr/bin/objcopy
configure:12283: result: objcopy
configure:12336: checking for objdump
configure:12369: result: no
configure:12486: checking for objdump
configure:12502: found /usr/bin/objdump
configure:12513: result: objdump
configure:12566: checking for ranlib
configure:12599: result: no
configure:12716: checking for ranlib
configure:12732: found /usr/bin/ranlib
configure:12743: result: ranlib
configure:12796: checking for readelf
configure:12829: result: no
configure:12946: checking for readelf
configure:12962: found /usr/bin/readelf
configure:12973: result: readelf
configure:13026: checking for strip
configure:13059: result: no
configure:13176: checking for strip
configure:13192: found /usr/bin/strip
configure:13203: result: strip
configure:13256: checking for windres
configure:13289: result: no
configure:13406: checking for windres
configure:13436: result: no
configure:13486: checking for windmc
configure:13519: result: no
configure:13636: checking for windmc
configure:13666: result: no
configure:13694: checking where to find the target ar
configure:13727: result: host tool
configure:13736: checking where to find the target as
configure:13769: result: host tool
configure:13778: checking where to find the target cc
configure:13801: result: just compiled
configure:13820: checking where to find the target c++
configure:13846: result: just compiled
configure:13865: checking where to find the target c++ for libstdc++
configure:13891: result: just compiled
configure:13910: checking where to find the target dlltool
configure:13943: result: host tool
configure:13952: checking where to find the target gcc
configure:13975: result: just compiled
configure:13994: checking where to find the target gfortran
configure:14030: result: host tool
configure:14039: checking where to find the target gccgo
configure:14075: result: host tool
configure:14084: checking where to find the target ld
configure:14117: result: host tool
configure:14126: checking where to find the target lipo
configure:14148: result: host tool
configure:14157: checking where to find the target nm
configure:14190: result: host tool
configure:14199: checking where to find the target objcopy
configure:14232: result: host tool
configure:14241: checking where to find the target objdump
configure:14274: result: host tool
configure:14283: checking where to find the target ranlib
configure:14316: result: host tool
configure:14325: checking where to find the target readelf
configure:14358: result: host tool
configure:14367: checking where to find the target strip
configure:14400: result: host tool
configure:14409: checking where to find the target windres
configure:14442: result: host tool
configure:14451: checking where to find the target windmc
configure:14484: result: host tool
configure:14521: checking whether to enable maintainer-specific portions of Makefiles
configure:14530: result: no
configure:14788: creating ./config.status

## ---------------------- ##
## Running config.status. ##
## ---------------------- ##

This file was extended by config.status, which was
generated by GNU Autoconf 2.64.  Invocation command line was

  CONFIG_FILES    = 
  CONFIG_HEADERS  = 
  CONFIG_LINKS    = 
  CONFIG_COMMANDS = 
  $ ./config.status 

on yulab

config.status:1014: creating Makefile

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

alphaieee_frag='/dev/null'
host_makefile_frag='/dev/null'
ospace_frag='/dev/null'
serialization_dependencies='serdep.tmp'
target_makefile_frag='../gcc-7.2.0/config/mt-gnu'

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

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

configure: exit 0

这是Centos6.9。 / usr / local / gcc中有另一个gcc-4.9.1有错误。如果我尝试使用该gcc来构建我的gcc-7.2.0,它会停在带有错误的./configure命令中:

checking build system type... x86_64-pc-linux-gnu
checking host system type... x86_64-pc-linux-gnu
checking target system type... x86_64-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 libatomic support... yes
checking for libcilkrts support... yes
checking for libitm support... yes
checking for libsanitizer support... yes
checking for libvtv support... yes
checking for libmpx support... yes
checking for libhsail-rt support... yes
checking for gcc... gcc
checking for C compiler default output file name...
configure: error: in `/home/gaojy/Tools/gcc-build-7.2.0':
configure: error: C compiler cannot create executables
See `config.log' for more details.

这是gcc-4.9.1的config.log的一部分。

  $ ../gcc-7.2.0/configure --prefix=/home/gaojy/Tools/gcctool --enable-checking=release --enable-languages=c,c++ --disable-multilib

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

hostname = yulab
uname -m = x86_64
uname -r = 2.6.32-696.16.1.el6.x86_64
uname -s = Linux
uname -v = #1 SMP Wed Nov 15 16:51:15 UTC 2017

/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: /home/gaojy/cuda-8.0/bin
PATH: /home/gaojy/Tools/pkg-config/bin
PATH: /home/gaojy/Tools/protobuf/bin
PATH: /home/gaojy/Tools/python-2.7.14/bin
PATH: /home/gaojy/intel/bin
PATH: /home/gaojy/Tools/hdf5/bin
PATH: /home/gaojy/Tools/openjpeg-v2.3.0-linux-x86_64/bin
PATH: /usr/local/bin
PATH: /bin
PATH: /usr/bin
PATH: /usr/local/sbin
PATH: /usr/sbin
PATH: /sbin


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

configure:2304: checking build system type
configure:2318: result: x86_64-pc-linux-gnu
configure:2365: checking host system type
configure:2378: result: x86_64-pc-linux-gnu
configure:2398: checking target system type
configure:2411: result: x86_64-pc-linux-gnu
configure:2465: checking for a BSD-compatible install
configure:2533: result: /usr/bin/install -c
configure:2544: checking whether ln works
configure:2566: result: yes
configure:2570: checking whether ln -s works
configure:2574: result: yes
configure:2581: checking for a sed that does not truncate output
configure:2645: result: /bin/sed
configure:2654: checking for gawk
configure:2670: found /bin/gawk
configure:2681: result: gawk
configure:3175: checking for libatomic support
configure:3185: result: yes
configure:3194: checking for libcilkrts support
configure:3204: result: yes
configure:3232: checking for libitm support
configure:3242: result: yes
configure:3251: checking for libsanitizer support
configure:3261: result: yes
configure:3270: checking for libvtv support
configure:3280: result: yes
configure:3290: checking for libmpx support
configure:3300: result: yes
configure:3309: checking for libhsail-rt support
configure:3321: result: yes
configure:4038: checking for gcc
configure:4054: found /usr/local/bin/gcc
configure:4065: result: gcc
configure:4294: checking for C compiler version
configure:4303: gcc --version >&5
gcc (GCC) 4.9.1
Copyright (C) 2014 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:4314: $? = 0
configure:4303: gcc -v >&5
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/local/libexec/gcc/x86_64-unknown-linux-gnu/4.9.1/lto-wrapper
Target: x86_64-unknown-linux-gnu
Configured with: ./configure --enable-checking=release --enable-languages=c,c++ --disable-multilib
Thread model: posix
gcc version 4.9.1 (GCC) 
configure:4314: $? = 0
configure:4303: gcc -V >&5
gcc: error: unrecognized command line option '-V'
gcc: fatal error: no input files
compilation terminated.
configure:4314: $? = 1
configure:4303: gcc -qversion >&5
gcc: error: unrecognized command line option '-qversion'
gcc: fatal error: no input files
compilation terminated.
configure:4314: $? = 1
configure:4334: checking for C compiler default output file name
configure:4356: gcc    conftest.c  >&5
/usr/lib/../lib64/crt1.o: In function `_start':
(.text+0x12): undefined reference to `__libc_csu_fini'
/usr/lib/../lib64/crt1.o: In function `_start':
(.text+0x19): undefined reference to `__libc_csu_init'
collect2: error: ld returned 1 exit status
configure:4360: $? = 1
configure:4397: 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:4403: error: in `/home/gaojy/Tools/gcc-build-7.2.0':
configure:4407: error: C compiler cannot create executables
See `config.log' for more details.

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

alphaieee_frag=''
host_makefile_frag='/dev/null'
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

我希望有人可以帮我修复我的gcc-4.9.1或安装新的gcc-7.2.0。

0 个答案:

没有答案