Compile Python 3.6.2 on Debian Jessie segfaults on sharedmods

2024/10/10 10:25:01

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?

Answer

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://en.xdnf.cn/q/69903.html

Related Q&A

Escape space in filepath

Im trying to write a python tool that will read a logfile and process itOne thing it should do is use the paths listed in the logfile (its a logfile for a backup tool)/Volumes/Live_Jobs/Live_Jobs/*SCAN…

How to save web page as text file?

I would like to save a web page (all content) as a text file. (As if you did right click on webpage -> "Save Page As" -> "Save as text file" and not as html file)I have tried …

PIL Image.size returns the opposite width/height

Using PIL to determine width and height of imagesOn a specific image (luckily only this one - but it is troubling) the width/height returning from image.size is the opposite. The image: http://storage.…

Django Rest Framework: Register multiple serializers in ViewSet

Im trying to create a custom API (not using models), but its not showing the request definition in the schema (in consequence, not showing it in swagger). My current code is:views.pyclass InfoViewSet(v…

Which is most accurate way to distinguish one of 8 colors?

Imagine we how some basic colors:RED = Color ((196, 2, 51), "RED") ORANGE = Color ((255, 165, 0), "ORANGE") YELLOW = Color ((255, 205, 0), "YELLOW") GREEN = Color ((0, 128…

Lambda function behavior with and without keyword arguments

I am using lambda functions for GUI programming with tkinter. Recently I got stuck when implementing buttons that open files: self.file="" button = Button(conf_f, text="Tools opt.",…

How to get type annotation within python function scope?

For example: def test():a: intb: strprint(__annotations__) test()This function call raises a NameError: name __annotations__ is not defined error. What I want is to get the type annotation within the f…

General explanation of how epoll works?

Im doing a technical write-up on switching from a database-polling (via synchronous stored procedure call) to a message queue (via pub/sub). Id like to be able to explain how polling a database is vas…

How to return cost, grad as tuple for scipys fmin_cg function

How can I make scipys fmin_cg use one function that returns cost and gradient as a tuple? The problem with having f for cost and fprime for gradient, is that I might have to perform an operation twice…

n-gram name analysis in non-english languages (CJK, etc)

Im working on deduping a database of people. For a first pass, Im following a basic 2-step process to avoid an O(n^2) operation over the whole database, as described in the literature. First, I "b…