Skip to content

Failed to compile static python 3.7.3 #12248

Closed

Description

@apr916

Bug Report

Compiling python 3.7.3 statically fails with the following error:

gcc -pthread -fPIC -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -std=c99 -Wextra -Wno-unused-result -Wno-unused-parameter -Wno-missing-field-initializers -Werror=implicit-function-declaration -DPy_LIMITED_API=0x03050000 -I./Include -I. -I/usr/include/x86_64-linux-gnu -I/usr/local/include -I/home/ma-user/work/Python-3.7.3/Include -I/home/ma-user/work/Python-3.7.3 -c /home/ma-user/work/Python-3.7.3/Modules/xxlimited.c -o build/temp.linux-x86_64-3.7/home/ma-user/work/Python-3.7.3/Modules/xxlimited.o
gcc -pthread -shared -static -static -static build/temp.linux-x86_64-3.7/home/ma-user/work/Python-3.7.3/Modules/xxlimited.o -L/usr/lib/x86_64-linux-gnu -L/usr/local/lib -o build/lib.linux-x86_64-3.7/xxlimited.cpython-37m-x86_64-linux-gnu.so
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/7/crtbeginT.o: relocation R_X86_64_32 against hidden symbol `TMC_END' can not be used when making a shared object
/usr/bin/ld: final link failed: Nonrepresentable section on output
collect2: error: ld returned 1 exit status
INFO: Could not locate ffi libs and/or headers

Python build finished successfully!
The necessary bits to build these optional modules were not found:
_curses _curses_panel _dbm
_gdbm _sqlite3 _tkinter
readline
To find the necessary bits, look in setup.py in detect_modules() for the module's name.

The following modules found by detect_modules() in setup.py, have been
built by the Makefile instead, as configured by the Setup files:
_abc atexit math
pwd time

Failed to build these modules:
_asyncio _bisect _blake2
_bz2 _codecs_cn _codecs_hk
_codecs_iso2022 _codecs_jp _codecs_kr
_codecs_tw _contextvars _crypt
_csv _ctypes _ctypes_test
_datetime _decimal _elementtree
_hashlib _heapq _json
_lsprof _lzma _md5
_multibytecodec _multiprocessing _opcode
_pickle _posixsubprocess _queue
_random _sha1 _sha256
_sha3 _sha512 _socket
_ssl _struct _testbuffer
_testcapi _testimportmultiple _testmultiphase
_uuid _xxtestfuzz array
audioop binascii cmath
fcntl grp mmap
nis ossaudiodev parser
pyexpat resource select
spwd syslog termios
unicodedata xxlimited zlib

Could not build the ssl module!
(Write your steps here:)

  1. tar -zxvf Python-3.7.3.tgz && cd Python-3.7.3
  2. ./configure LDFLAGS="-static" --disable-shared --prefix=/home/python3
  3. make LDFLAGS="-static" LINKFORSHARED=" "

Reference comes from: https://wiki.python.org/moin/BuildStatically
Expected Behavior

(Write what you thought would happen.)
Compile python 3.7.3 statically successfully

Actual Behavior
build failed

(Write what happened.)

Your Environment

compiler environment: ubuntu 18.04

  1. tar -zxvf Python-3.7.3.tgz && cd Python-3.7.3
  2. ./configure LDFLAGS="-static" --disable-shared --prefix=/home/python3
  3. make LDFLAGS="-static" LINKFORSHARED=" "

Activity

  1. JelleZijlstra commented on Feb 24, 2022

    @JelleZijlstra
    Member

    I don't think you're in the right issue tracker. This is the mypy type checker, not CPython itself. Bugs against CPython should be reported at https://bugs.python.org. The devguide at https://devguide.python.org/setup/#setup also has some guidance on building from source.

  2. apr916 commented on Feb 24, 2022

    @apr916
    Author

    How to raise a question to cpython

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugmypy got something wrong

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions