问题
I'm trying to compile Python 3.6.2 on a Debian Jessie box with the options
./configure --prefix="/opt/python3" \
--enable-optimizations \
--with-lto \
--enable-profiling \
--enable-unicode=ucs4 \
--with-system-expat \
--with-threads \
--with-system-ffi \
'CFLAGS=-D_FORTIFY_SOURCE=2 -g -fstack-protector-strong -Wformat -Werror=format-security ' \
'LDFLAGS=-Wl,-z,relro'
But I'm getting a segmentation fault on the build of the shared modules:
renaming build/scripts-3.6/pyvenv to build/scripts-3.6/pyvenv-3.6
Segmentation fault
Makefile:586: recipe for target 'sharedmods' failed
make[2]: *** [sharedmods] Error 139
Any ideas what's going on?
回答1:
I had the same problem and solved it by changing the compiler to clang like this:
./configure CC=clang CXX=clang++
In my case I was compiling on armv7l and I found the issue with gcc also described here:
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=848405?
来源:https://stackoverflow.com/questions/46279671/compile-python-3-6-2-on-debian-jessie-segfaults-on-sharedmods