我正在尝试在我的 Ubuntu 14.04 LTS vServer(托管在 strato)上安装 Python 2.7.11,因为它是 letsencrypt 的要求。
我在用着本教程,基本上只是用 2.7.11 替换 2.7.9。
现在当我试图跑步时
./configure
我得到了错误
C Compiler cannot create executables
我不知道是什么原因造成的
我的config.log
文件:
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.69. Invocation command line was
$ ./configure
## --------- ##
## Platform. ##
## --------- ##
hostname = h2577734.stratoserver.net
uname -m = x86_64
uname -r = 3.13.0-042stab111.12
uname -s = Linux
uname -v = #1 SMP Thu Sep 17 11:38:20 MSK 2015
/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/games
PATH: /usr/local/games
## ----------- ##
## Core tests. ##
## ----------- ##
configure:2816: checking build system type
configure:2830: result: x86_64-unknown-linux-gnu
configure:2850: checking host system type
configure:2863: result: x86_64-unknown-linux-gnu
configure:2974: checking for --enable-universalsdk
configure:3015: result: no
configure:3025: checking for --with-universal-archs
configure:3042: result: 32-bit
configure:3199: checking MACHDEP
configure:3391: result: linux2
configure:3400: checking EXTRAPLATDIR
configure:3415: result:
configure:3436: checking for --without-gcc
configure:3480: result: no
configure:3574: checking for gcc
configure:3590: found /usr/bin/gcc
configure:3601: result: gcc
configure:3830: checking for C compiler version
configure:3839: gcc --version >&5
gcc (Ubuntu 4.8.5-2ubuntu1~14.04.1) 4.8.5
Copyright (C) 2015 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:3850: $? = 0
configure:3839: gcc -v >&5
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/4.8/lto-wrapper
Target: x86_64-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Ubuntu 4.8.5-2ubuntu1~14.04.1' --with-bugurl=file:///usr/share/doc/gcc-4.8/README.Bugs --enable-languages=c,c++,java,go,d,fortran,objc,obj-c++ --prefix=/usr --program-suffix=-4.8 --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --with-gxx-include-dir=/usr/include/c++/4.8 --libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --enable-gnu-unique-object --disable-libmudflap --enable-plugin --with-system-zlib --disable-browser-plugin --enable-java-awt=gtk --enable-gtk-cairo --with-java-home=/usr/lib/jvm/java-1.5.0-gcj-4.8-amd64/jre --enable-java-home --with-jvm-root-dir=/usr/lib/jvm/java-1.5.0-gcj-4.8-amd64 --with-jvm-jar-dir=/usr/lib/jvm-exports/java-1.5.0-gcj-4.8-amd64 --with-arch-directory=amd64 --with-ecj-jar=/usr/share/java/eclipse-ecj.jar --enable-objc-gc --enable-multiarch --disable-werror --with-arch-32=i686 --with-abi=m64 --with-multilib-list=m32,m64,mx32 --with-tune=generic --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu
Thread model: posix
gcc version 4.8.5 (Ubuntu 4.8.5-2ubuntu1~14.04.1)
configure:3850: $? = 0
configure:3839: gcc -V >&5
gcc: error: unrecognized command line option '-V'
gcc: fatal error: no input files
compilation terminated.
configure:3850: $? = 4
configure:3839: gcc -qversion >&5
gcc: error: unrecognized command line option '-qversion'
gcc: fatal error: no input files
compilation terminated.
configure:3850: $? = 4
configure:3870: checking whether the C compiler works
configure:3892: gcc conftest.c >&5
gcc: internal compiler error: Bus error (program as)
Please submit a full bug report,
with preprocessed source if appropriate.
See <file:///usr/share/doc/gcc-4.8/README.Bugs> for instructions.
configure:3896: $? = 4
configure:3934: 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:3939: error: in `/home/username/Downloads/Python-2.7.11':
configure:3941: error: C compiler cannot create executables
See `config.log' for more details
## ---------------- ##
## Cache variables. ##
## ---------------- ##
ac_cv_build=x86_64-unknown-linux-gnu
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_PKG_CONFIG_LIBDIR_set=
ac_cv_env_PKG_CONFIG_LIBDIR_value=
ac_cv_env_PKG_CONFIG_PATH_set=
ac_cv_env_PKG_CONFIG_PATH_value=
ac_cv_env_PKG_CONFIG_set=
ac_cv_env_PKG_CONFIG_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_host=x86_64-unknown-linux-gnu
ac_cv_prog_ac_ct_CC=gcc
## ----------------- ##
## Output variables. ##
## ----------------- ##
AR=''
ARCH_RUN_32BIT=''
ARFLAGS=''
BASECFLAGS=''
BASECPPFLAGS=''
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=''
ENSUREPIP=''
EXEEXT=''
EXPORT_MACOSX_DEPLOYMENT_TARGET='#'
EXTRAMACHDEPPATH=''
EXTRAPLATDIR=''
FRAMEWORKALTINSTALLFIRST=''
FRAMEWORKALTINSTALLLAST=''
FRAMEWORKINSTALLAPPSPREFIX=''
FRAMEWORKINSTALLFIRST=''
FRAMEWORKINSTALLLAST=''
FRAMEWORKUNIXTOOLSPREFIX='/usr/local'
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=''
LLVM_PROF_ERR=''
LLVM_PROF_FILE=''
LLVM_PROF_FOUND=''
LLVM_PROF_MERGER=''
LN=''
LTLIBOBJS=''
MACHDEP='linux2'
MACHDEP_OBJS=''
MAINCC=''
MKDIR_P=''
MULTIARCH=''
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=':'
PGO_PROF_GEN_FLAG=''
PGO_PROF_USE_FLAG=''
PKG_CONFIG=''
PKG_CONFIG_LIBDIR=''
PKG_CONFIG_PATH=''
PLATDIR='plat-linux2'
PYTHONFRAMEWORK=''
PYTHONFRAMEWORKDIR='no-framework'
PYTHONFRAMEWORKIDENTIFIER='org.python.python'
PYTHONFRAMEWORKINSTALLDIR=''
PYTHONFRAMEWORKPREFIX=''
PYTHON_FOR_BUILD='./$(BUILDPYTHON) -E'
RANLIB=''
RUNSHARED=''
SGI_ABI=''
SHELL='/bin/bash'
SHLIBS=''
SIGNAL_OBJS=''
SO=''
SOVERSION='1.0'
SRCDIRS=''
SVNVERSION=''
TCLTK_INCLUDES=''
TCLTK_LIBS=''
THREADHEADERS=''
THREADOBJ=''
TRUE=''
UNICODE_OBJS=''
UNIVERSALSDK=''
UNIVERSAL_ARCH_FLAGS=''
USE_SIGNAL_MODULE=''
USE_THREAD_MODULE=''
VERSION='2.7'
_PYTHON_HOST_PLATFORM=''
ac_ct_AR=''
ac_ct_CC='gcc'
ac_ct_CXX=''
bindir='${exec_prefix}/bin'
build='x86_64-unknown-linux-gnu'
build_alias=''
build_cpu='x86_64'
build_os='linux-gnu'
build_vendor='unknown'
datadir='${datarootdir}'
datarootdir='${prefix}/share'
docdir='${datarootdir}/doc/${PACKAGE_TARNAME}'
dvidir='${docdir}'
exec_prefix='NONE'
host='x86_64-unknown-linux-gnu'
host_alias=''
host_cpu='x86_64'
host_os='linux-gnu'
host_vendor='unknown'
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. ##
## ----------- ##
/* 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
gcc -V
我在和之后看到了致命错误gcc -qversion
,但我在某处读到它们是正常构建过程的一部分。
因此我编写了一个helloworld.c
文件并尝试编译它,但编译器返回:
gcc internal compiler error: Bus error (program as)
config.log
我在尝试编译 python 时也遇到了同样的错误。
当我用谷歌搜索时,我几乎找不到有关该错误的任何信息,我该如何解决这个问题?
编辑:
进一步调查(见评论):
$ which as
/usr/bin/as
$ as --version
bus error
$ gcc -print-prog-name=as
as
$ apt-cache policy binutils
binutils:
Installiert: 2.24-5ubuntu14.1
Installationskandidat: 2.24-5ubuntu14.1
Versionstabelle:
*** 2.24-5ubuntu14.1 0
500 ftp://ftp.stratoserver.net/pub/linux/ubuntu/ trusty-updates/main amd64 Packages
500 ftp://ftp.stratoserver.net/pub/linux/ubuntu/ trusty-security/main amd64 Packages
100 /var/lib/dpkg/status
2.24-5ubuntu3 0
500 ftp://ftp.stratoserver.net/pub/linux/ubuntu/ trusty/main amd64 Packages
$ file /usr/bin/as
/usr/bin/as: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.24, BuildID[sha1]=de7c02da59248e5021aefd9d4959fcc749abeec6, stripped
ldd /usr/bin/as
不返回任何内容。
答案1
正如我们从您的诊断输出中看到的,gcc
使用外部程序as
(即/usr/bin/as
) - GNU 汇编程序 - 并且正是这个程序出现了故障。
不知何故,二进制可执行文件似乎as
已在您的系统上损坏,甚至/usr/bin/as --version
导致总线错误。(尽管它显然完好无损,file
程序可以正确识别它)。由于as
由软件包提供binutils
,因此解决方案是重新安装该软件包,即
sudo apt-get install --reinstall binutils