ubuntu16.04 buildroot python2.7.14编译报错

/bin/sh: line 5: 25857 Segmentation fault      (core dumped) ./python -E -S -m sysconfig --generate-posix-vars
generate-posix-vars failed
make[2]: *** [Makefile:514: pybuilddir.txt] Error 1
make[2]: Leaving directory '/tmp/Python-2.7.14'
make[1]: *** [Makefile:444: build_all_generate_profile] Error 2
make[1]: Leaving directory '/tmp/Python-2.7.14'
make: *** [Makefile:429: profile-opt] Error 2

原因分析:

参考https://bugs.python.org/issue33374

我用的gcc版本是8.1;

解决办法:

1. gcc 降级,比如降至5.4,实测可用;

2. (对我的问题没作用)

参考 https://blog.csdn.net/qq_36062399/article/details/84592252

在 ./configure 操作前,先进行配置:

export LANGUAGE=en_US.UTF-8

export LANG=en_US.UTF-8

export LC_ALL=en_US.UTF-8

3. 替换下载2.7.15(实测可用)

参考:https://github.com/maximeh/buildroot拷贝其package/python里面的文件至自己的package/python里,重新编译即可;

你可能感兴趣的:(Linux)