gcc:内部编译器错误:分段错误

gcc:内部编译器错误:分段错误

我正在尝试使用以下版本安装 ruby萊本

安装 ruby​​ 2.7.6 的命令生成此错误:

$ rbenv install 2.7.6
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
        LANGUAGE = (unset),
        LC_ALL = (unset),
        LANG = "C.UTF-8"
    are supported and installed on your system.
perl: warning: Falling back to the standard locale ("C").
To follow progress, use 'tail -f /tmp/ruby-build.20221213114742.26922.log' or pass --verbose
Downloading ruby-2.7.6.tar.bz2...
-> https://cache.ruby-lang.org/pub/ruby/2.7/ruby-2.7.6.tar.bz2
Installing ruby-2.7.6...

WARNING: ruby-2.7.6 is nearing its end of life.
It only receives critical security updates, no bug fixes.

ruby-build: using readline from homebrew
ruby-build: using gmp from homebrew

BUILD FAILED (Ubuntu 20.04 using ruby-build 20221206)

Inspect or clean up the working tree at /tmp/ruby-build.20221213114742.26922.ohEg9k
Results logged to /tmp/ruby-build.20221213114742.26922.log

Last 10 log lines:
tool/config.guess already exists
tool/config.sub already exists
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 gcc... gcc
checking whether the C compiler works... no
configure: error: in `/tmp/ruby-build.20221213114742.26922.ohEg9k/ruby-2.7.6':
configure: error: C compiler cannot create executables
See `config.log' for more details

此次尝试构建的文件config.log如下所示:

$ cat /tmp/ruby-build.20221213114742.26922.ohEg9k/ruby-2.7.6/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 configure, which was
generated by GNU Autoconf 2.69.  Invocation command line was

  $ ./configure --prefix=/home/zifnab/.rbenv/versions/2.7.6 --enable-shared --with-readline-dir=/home/linuxbrew/.linuxbrew/opt/readline --with-gmp-dir=/home/linuxbrew/.linuxbrew/opt/gmp --with-openssl-dir=/home/linuxbrew/.linuxbrew/opt/[email protected]

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

hostname = ZIFNAB-DESKTOP
uname -m = x86_64
uname -r = 4.19.128-microsoft-standard
uname -s = Linux
uname -v = #1 SMP Tue Jun 23 12:58:10 UTC 2020

/usr/bin/uname -p = x86_64
/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/linuxbrew/.linuxbrew/Cellar/rbenv/1.2.0/libexec
PATH: /home/linuxbrew/.linuxbrew/opt/postgresql@13/bin
PATH: /home/zifnab/bin
PATH: /home/zifnab/.nvm/versions/node/v12.18.3/bin
PATH: /home/zifnab/.rbenv/shims
PATH: /home/linuxbrew/.linuxbrew/bin
PATH: /home/linuxbrew/.linuxbrew/sbin
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
PATH: /usr/lib/wsl/lib
PATH: /mnt/c/Program Files/WindowsApps/CanonicalGroupLimited.Ubuntu20.04onWindows_2004.2022.8.0_x64__79rhkp1fndgsc
PATH: /mnt/c/Program Files/Common Files/Oracle/Java/javapath
PATH: /mnt/c/WINDOWS/system32
PATH: /mnt/c/WINDOWS
PATH: /mnt/c/WINDOWS/System32/Wbem
PATH: /mnt/c/WINDOWS/System32/WindowsPowerShell/v1.0/
PATH: /mnt/c/Program Files (x86)/NVIDIA Corporation/PhysX/Common
PATH: /mnt/f/Programs/Hashicorp/bin
PATH: /mnt/c/WINDOWS/System32/OpenSSH/
PATH: /mnt/c/Program Files/NVIDIA Corporation/NVIDIA NvDLISR
PATH: /mnt/c/WINDOWS/system32
PATH: /mnt/c/WINDOWS
PATH: /mnt/c/WINDOWS/System32/Wbem
PATH: /mnt/c/WINDOWS/System32/WindowsPowerShell/v1.0/
PATH: /mnt/c/WINDOWS/System32/OpenSSH/
PATH: /mnt/c/Users/Nathan/AppData/Local/Programs/Python/Python310/Scripts/
PATH: /mnt/c/Users/Nathan/AppData/Local/Programs/Python/Python310/
PATH: /mnt/c/Users/Nathan/AppData/Local/Microsoft/WindowsApps
PATH: /mnt/c/Users/Nathan/AppData/Local/atom/bin
PATH: /mnt/c/Users/Nathan/AppData/Local/Microsoft/WindowsApps
PATH: /mnt/c/Users/Nathan/AppData/Local/Programs/Microsoft VS Code/bin
PATH: /mnt/c/Users/Nathan/bin
PATH: /snap/bin
PATH: /home/zifnab/projects/lawgical/scripts/bin


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

configure:3013: checking for ruby
configure:3031: found /home/zifnab/.rbenv/shims/ruby
configure:3044: result: /home/zifnab/.rbenv/shims/ruby
configure:3117: checking build system type
configure:3131: result: x86_64-pc-linux-gnu
configure:3217: checking host system type
configure:3230: result: x86_64-pc-linux-gnu
configure:3250: checking target system type
configure:3263: result: x86_64-pc-linux-gnu
configure:3420: checking for gcc
configure:3436: found /usr/bin/gcc
configure:3447: result: gcc
configure:3676: checking for C compiler version
configure:3685: gcc --version >&5
gcc (Ubuntu 9.3.0-17ubuntu1~20.04) 9.3.0
Copyright (C) 2019 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:3696: $? = 0
configure:3685: gcc -v >&5
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/9/lto-wrapper
OFFLOAD_TARGET_NAMES=nvptx-none:hsa
OFFLOAD_TARGET_DEFAULT=1
Target: x86_64-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Ubuntu 9.3.0-17ubuntu1~20.04' --with-bugurl=file:///usr/share/doc/gcc-9/README.Bugs --enable-languages=c,ada,c++,go,brig,d,fortran,objc,obj-c++,gm2 --prefix=/usr --with-gcc-major-version-only --program-suffix=-9 --program-prefix=x86_64-linux-gnu- --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --libdir=/usr/lib --enable-nls --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --with-default-libstdcxx-abi=new --enable-gnu-unique-object --disable-vtable-verify --enable-plugin --enable-default-pie --with-system-zlib --with-target-system-zlib=auto --enable-objc-gc=auto --enable-multiarch --disable-werror --with-arch-32=i686 --with-abi=m64 --with-multilib-list=m32,m64,mx32 --enable-multilib --with-tune=generic --enable-offload-targets=nvptx-none=/build/gcc-9-HskZEa/gcc-9-9.3.0/debian/tmp-nvptx/usr,hsa --without-cuda-driver --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu
Thread model: posix
gcc version 9.3.0 (Ubuntu 9.3.0-17ubuntu1~20.04)
configure:3696: $? = 0
configure:3685: gcc -V >&5
gcc: error: unrecognized command line option '-V'
gcc: fatal error: no input files
compilation terminated.
configure:3696: $? = 1
configure:3685: gcc -qversion >&5
gcc: error: unrecognized command line option '-qversion'; did you mean '--version'?
gcc: fatal error: no input files
compilation terminated.
configure:3696: $? = 1
configure:3716: checking whether the C compiler works
configure:3738: gcc  -I/home/zifnab/.rbenv/versions/2.7.6/include  -L/home/zifnab/.rbenv/versions/2.7.6/lib  conftest.c  >&5
gcc: internal compiler error: Segmentation fault signal terminated program as
Please submit a full bug report,
with preprocessed source if appropriate.
See <file:///usr/share/doc/gcc-9/README.Bugs> for instructions.
configure:3742: $? = 4
configure:3780: result: no
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:3785: error: in `/tmp/ruby-build.20221213114742.26922.ohEg9k/ruby-2.7.6':
configure:3787: error: C compiler cannot create executables
See `config.log' for more details

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

ac_cv_build=x86_64-pc-linux-gnu
ac_cv_env_CCC_set=
ac_cv_env_CCC_value=
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=set
ac_cv_env_CPPFLAGS_value='-I/home/zifnab/.rbenv/versions/2.7.6/include '
ac_cv_env_CPP_set=
ac_cv_env_CPP_value=
ac_cv_env_CXXFLAGS_set=
ac_cv_env_CXXFLAGS_value=
ac_cv_env_CXX_set=
ac_cv_env_CXX_value=
ac_cv_env_LDFLAGS_set=set
ac_cv_env_LDFLAGS_value='-L/home/zifnab/.rbenv/versions/2.7.6/lib '
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_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_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-pc-linux-gnu
ac_cv_path_BASERUBY=/home/zifnab/.rbenv/shims/ruby
ac_cv_prog_ac_ct_CC=gcc
ac_cv_target=x86_64-pc-linux-gnu

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

ALLOCA=''
AR=''
ARCHFILE=''
ARCH_FLAG=''
ARFLAGS=''
AS=''
ASFLAGS=''
ASMEXT=''
BASERUBY='/home/zifnab/.rbenv/shims/ruby --disable=gems'
BOOTSTRAPRUBY=''
BTESTRUBY=''
BUILTIN_ENCOBJS=''
BUILTIN_TRANSOBJS=''
BUILTIN_TRANSSRCS=''
CAPITARGET=''
CC='gcc'
CCDLFLAGS=''
CC_VERSION=''
CC_VERSION_MESSAGE=''
CC_WRAPPER=''
CFLAGS=''
CHDIR=''
COMMON_HEADERS=''
COMMON_LIBS=''
COMMON_MACROS=''
CONFIGURE=''
COUTFLAG=''
CP=''
CPP=''
CPPFLAGS='-I/home/zifnab/.rbenv/versions/2.7.6/include '
CPPOUTFILE=''
CROSS_COMPILING=''
CSRCFLAG=''
CXX=''
CXXFLAGS=''
DEFS=''
DESTDIR=''
DLDFLAGS=''
DLDLIBS=''
DLDSHARED=''
DLEXT2=''
DLEXT=''
DLLWRAP=''
DLNOBJ=''
DOT=''
DOXYGEN=''
DTRACE=''
DTRACE_EXT=''
DTRACE_OBJ=''
DTRACE_OPT=''
DTRACE_REBUILD=''
ECHO_C=''
ECHO_N='-n'
ECHO_T=''
EGREP=''
ENABLE_DEBUG_ENV=''
ENABLE_SHARED=''
ENCOBJS=''
ENCSTATIC=''
EXECUTABLE_EXTS=''
EXEEXT=''
EXPORT_PREFIX=''
EXTDLDFLAGS=''
EXTLDFLAGS=''
EXTOBJS=''
EXTOUT=''
EXTSTATIC=''
GCC=''
GIT='git'
GNU_LD=''
GREP=''
HAVE_BASERUBY='yes'
HAVE_GIT='yes'
INSTALLDOC=''
INSTALL_DATA=''
INSTALL_PROGRAM=''
INSTALL_SCRIPT=''
INSTALL_STATIC_LIBRARY=''
LD=''
LDFLAGS='-L/home/zifnab/.rbenv/versions/2.7.6/lib '
LDSHARED=''
LDSHAREDXX=''
LIBEXT=''
LIBOBJS=''
LIBPATHENV=''
LIBPATHFLAG=''
LIBRUBY=''
LIBRUBYARG=''
LIBRUBYARG_SHARED=''
LIBRUBYARG_STATIC=''
LIBRUBY_A=''
LIBRUBY_ALIASES=''
LIBRUBY_A_OBJS=''
LIBRUBY_DLDFLAGS=''
LIBRUBY_LDSHARED=''
LIBRUBY_RELATIVE=''
LIBRUBY_SO=''
LIBRUBY_SONAME=''
LIBS=''
LINK_SO=''
LN_S=''
LTLIBOBJS=''
MAINLIBS=''
MAJOR='2'
MAKEDIRS=''
MAKEFILES=''
MANTYPE=''
MATHN=''
MINIOBJS=''
MINIRUBY=''
MINOR='7'
MJIT_CC=''
MJIT_CFLAGS=''
MJIT_DEBUGFLAGS=''
MJIT_HEADER_FLAGS=''
MJIT_HEADER_INSTALL_DIR=''
MJIT_LDSHARED=''
MJIT_OPTFLAGS=''
MJIT_SUPPORT=''
MKDIR_P=''
NM=''
NULLCMD=''
OBJCOPY=''
OBJDUMP=''
OBJEXT=''
OUTFLAG=''
PACKAGE=''
PACKAGE_BUGREPORT=''
PACKAGE_NAME=''
PACKAGE_STRING=''
PACKAGE_TARNAME=''
PACKAGE_URL=''
PACKAGE_VERSION=''
PATH_SEPARATOR=':'
PKG_CONFIG=''
PLATFORM_DIR=''
POSTLINK=''
PRELOADENV=''
PREP=''
RANLIB=''
RDOCTARGET=''
RI_BASE_NAME=''
RM=''
RMALL=''
RMDIR=''
RMDIRS=''
RPATHFLAG=''
RUBYW_BASE_NAME='rubyw'
RUBYW_INSTALL_NAME=''
RUBY_API_VERSION='$(MAJOR).$(MINOR)'
RUBY_BASE_NAME='ruby'
RUBY_EXEC_PREFIX=''
RUBY_INSTALL_NAME=''
RUBY_LIB_VERSION=''
RUBY_LIB_VERSION_STYLE=''
RUBY_PROGRAM_VERSION='$(MAJOR).$(MINOR).$(TEENY)'
RUBY_SEARCH_PATH=''
RUBY_SO_NAME=''
RUBY_VERSION_NAME='${RUBY_BASE_NAME}-${ruby_version}'
RUNRUBY=''
RUNRUBY_COMMAND=''
SET_MAKE=''
SHELL='/bin/bash'
SOEXT=''
SOLIBS=''
STATIC=''
STRIP=''
SYMBOL_PREFIX=''
TEENY='6'
TEST_RUNNABLE=''
THREAD_MODEL=''
TRY_LINK=''
UNIVERSAL_ARCHNAMES=''
UNIVERSAL_INTS=''
USE_RUBYGEMS=''
WERRORFLAG=''
WINDRES=''
XCC_WRAPPER=''
XCFLAGS=''
XLDFLAGS=''
XRUBY=''
XRUBY_LIBDIR=''
XRUBY_RUBYHDRDIR=''
XRUBY_RUBYLIBDIR=''
X_COROUTINE_H=''
X_COROUTINE_SRC=''
ac_ct_AR=''
ac_ct_CC='gcc'
ac_ct_CXX=''
ac_ct_NM=''
ac_ct_OBJCOPY=''
ac_ct_OBJDUMP=''
ac_ct_RANLIB=''
arch=''
archincludedir=''
archlibdir=''
bindir='${exec_prefix}/bin'
build='x86_64-pc-linux-gnu'
build_alias=''
build_cpu='x86_64'
build_os='linux-gnu'
build_vendor='pc'
cflags=''
codesign=''
configure_args=''
cppflags=''
cxxflags=''
datadir='${datarootdir}'
datarootdir='${prefix}/share'
debugflags=''
docdir='${datarootdir}/doc/${PACKAGE}'
dsymutil=''
dvidir='${docdir}'
exec=''
exec_prefix='NONE'
host='x86_64-pc-linux-gnu'
host_alias=''
host_cpu='x86_64'
host_os='linux-gnu'
host_vendor='pc'
htmldir='${docdir}'
includedir='${prefix}/include'
infodir='${datarootdir}/info'
libdir='${exec_prefix}/lib'
libdirname=''
libexecdir='${exec_prefix}/libexec'
localedir='${datarootdir}/locale'
localstatedir='${prefix}/var'
mandir='${datarootdir}/man'
oldincludedir='/usr/include'
optflags=''
pdfdir='${docdir}'
prefix='/home/zifnab/.rbenv/versions/2.7.6'
program_transform_name='s&^&&'
psdir='${docdir}'
ridir=''
ruby_pc=''
ruby_version=''
rubyarchdir=''
rubyarchhdrdir=''
rubyarchprefix=''
rubyhdrdir=''
rubylibdir=''
rubylibprefix=''
rubysitearchprefix=''
rubyw_install_name=''
runstatedir='${localstatedir}/run'
sbindir='${exec_prefix}/sbin'
setup=''
sharedstatedir='${prefix}/com'
sitearch=''
sitearchdir=''
sitearchhdrdir=''
sitearchincludedir=''
sitearchlibdir=''
sitedir=''
sitehdrdir=''
sitelibdir=''
strict_warnflags=''
sysconfdir='${prefix}/etc'
target='x86_64-pc-linux-gnu'
target_alias=''
target_cpu='x86_64'
target_os='linux'
target_vendor='pc'
try_header=''
vendorarchdir=''
vendorarchhdrdir=''
vendordir=''
vendorhdrdir=''
vendorlibdir=''
warnflags=''

## ----------- ##
## 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: internal compiler error: Segmentation fault signal terminated program as就是这个问题,但我不知道问题出在哪里。上周它运行良好,但后来我去升级 ghostscript,现在我的整个 ruby​​ 环境不知怎么就被搞坏了。我甚至不知道如何开始调试它。

以下是有关我当前环境的一些详细信息:

$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 20.04.1 LTS
Release:        20.04
Codename:       focal
$ gcc --version
gcc (Ubuntu 9.3.0-17ubuntu1~20.04) 9.3.0
Copyright (C) 2019 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.
$ ruby-build --version
ruby-build 20221206
$ rbenv --version
rbenv 1.2.0

相关内容