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.
Ubuntu
$ 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
Some environment variables
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
Error
The make
command leads to
+++ 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
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.
Update
Going to try upgrade g++
to a more recent version. Following this thread
@$(CC) -MMD -MP -MF $(@:.o=.d) -c -I$(ODIR) $(CFLAGS) $(CFLAGS_$*) -o $@ $<
when compiling the boost_json.o target. – Sarcenetg++ (Ubuntu 4.8.4-2ubuntu1~14.04.3) 4.8.4
. – Vaticideg++
to its latest version. I think your suggestion may resolve my issue, please feel free to add it as answer. – Vaticide