g ++:内部编译器错误:分段错误(程序cc1plus)-我从哪里开始? [英] g++: internal compiler error: Segmentation fault (program cc1plus) - where do I start?
问题描述
我要将在 Ubuntu 14.04 上编译的代码移植到 16.04 .我已经克隆了git repo,安装了依赖项并尝试了通常的 make
命令,很快我遇到了 g ++:内部编译器错误:分段错误(程序cc1plus)
...但是我不确定从哪里开始诊断和解决此问题.
I am porting code that compiled on Ubuntu 14.04 to 16.04. I have cloned my git repo, installed dependencies and tried the usual make
command, soon I hit a g++: internal compiler error: Segmentation fault (program cc1plus)
... yet I am not sure where to start to diagnose and resolve this issue.
我会尽我所能分享,看看是否有人可以指导我解决问题.
I will share as much as I can, see if someone can guide me through a resolution.
$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 16.04.2 LTS
Release: 16.04
Codename: xenial
g ++
$ g++ --version
g++ (Ubuntu 5.4.0-6ubuntu1~16.04.4) 5.4.0 20160609
python
$ python --version
Python 2.7.12
一些环境变量
PYTHON /usr/bin/python2.7
ARCH x86_64
OS Linux
VERSION 4.4.071generic
PLATFORM linux2
HOSTNAME deploy
USER myUser
WUSS_BUILD NO
CCVER gcc
PYLIBDIR build.x86_64-linux2
LIBDIR build.x86_64-linux2
BINDIR build.x86_64-linux2
ODIR build.x86_64-linux2-gcc
STATICLIBDIR build-static.x86_64-linux2
错误
make
命令导致
+++ Compile mycore/boost_json.cc to build.x86_64-linux2-gcc
g++: internal compiler error: Segmentation fault (program cc1plus) <===
Please submit a full bug report,
with preprocessed source if appropriate.
See <file:///usr/share/doc/gcc-5/README.Bugs> for instructions.
mk/makelib2.inc:48: recipe for target 'build.x86_64-linux2-gcc/mycore/boost_json.o' failed
make[1]: *** [build.x86_64-linux2-gcc/mycore/boost_json.o] Error 4
Makefile:152: recipe for target 'make.stage1c' failed
make: *** [make.stage1c] Error 2
错误消息似乎指向 g ++
编译器错误(?)
The error message seems to be pointing at a g++
compiler error (?)
makelib2.inc:48
$(ODIR)/%.o : %.c
@mkdir -p $(dir $@)
@echo "+++ Compile $< to $(ODIR)"
@$(CC) -MMD -MP -MF $(@:.o=.d) -c -I$(ODIR) $(CFLAGS) $(CFLAGS_$*) -o $@ $<
我意识到,要提出适当的问题以寻求适当的帮助将非常困难.因此,请多多包涵,并随时建议添加可能有帮助的任何内容.不幸的是,我无法共享代码.
I realize that this is going to be very difficult to craft a proper question that would lead to getting proper help. So please bear with me and feel free to suggest adding anything that may help. Unfortunately, I can't share the code.
要尝试将 g ++
升级到最新版本.跟随此线程
Going to try upgrade g++
to a more recent version. Following this thread
HERE how to install g++ 7 on Ubuntu
推荐答案
我如何解决 g ++
细分错误问题
受到此线程
我在 Ubuntu 16.04
sudo apt-get install build-essential software-properties-common -y
sudo add-apt-repository ppa:ubuntu-toolchain-r/test -y
sudo apt-get update
sudo apt-get install gcc-snapshot -y
将什么 g ++
从 5.4.0
递增到 5.4.1
之后,即可解决分段错误问题
After what g++
was incremented from 5.4.0
to 5.4.1
which resolve the segmentation fault issue
$ g++ --version
g++ (Ubuntu 5.4.1-2ubuntu1~16.04) 5.4.1 20160904
这篇关于g ++:内部编译器错误:分段错误(程序cc1plus)-我从哪里开始?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!