Title: Python 3.7.4 does not build on Raspbian Buster
Type: compile error Stage:
Components: Build Versions: Python 3.7
Status: open Resolution:
Dependencies: Superseder:
Assigned To: Nosy List: DNSGeek, benjamin.peterson, kal.sze
Priority: normal Keywords:

Created on 2019-07-15 01:46 by kal.sze, last changed 2019-08-01 08:09 by kal.sze.

File name Uploaded Description Edit
python-build.20190711104717.24526.log kal.sze, 2019-07-15 01:46 Build log
Messages (6)
msg347948 - (view) Author: Kal Sze (kal.sze) Date: 2019-07-15 01:46
Like the title says.

Tried building with these `configure` options:

    --enable-optimizations \
    --with-lto \
    --enable-shared \
    --enable-loadable-sqlite-extensions \
    --enable-ipv6 \
    --with-system-expat \
    --with-system-ffi \
    --with-system-libmpdec \
    --with-doc-strings \
    --with-pymalloc \
    --with-c-locale-coercion \

And `CFLAGS="-O3 -march=native"`

But got this error message:

/usr/bin/ld: ./ undefined reference to `__gcov_pow2_profiler_atomic'
/usr/bin/ld: ./ undefined reference to `__gcov_average_profiler_atomic'
collect2: error: ld returned 1 exit status
make[3]: *** [Makefile:733: Programs/_testembed] Error 1
make[3]: Leaving directory '/tmp/python-build.20190712163526.2762/Python-3.7.4'
make[2]: *** [Makefile:521: build_all_generate_profile] Error 2
make[2]: Leaving directory '/tmp/python-build.20190712163526.2762/Python-3.7.4'
make[1]: *** [Makefile:497: profile-gen-stamp] Error 2
make[1]: Leaving directory '/tmp/python-build.20190712163526.2762/Python-3.7.4'
make: *** [Makefile:509: profile-run-stamp] Error 2
msg348402 - (view) Author: Thomas Knox (DNSGeek) Date: 2019-07-24 19:06
Any update on this? This is biting me too.

I've tested on a Raspberry Pi 3B+, a 4B and a Zero W all running buster. All of them exhibit this same behavior.

Also, this same error is preventing Python 2.7.16 from compiling on the same hardware.
msg348834 - (view) Author: Kal Sze (kal.sze) Date: 2019-08-01 03:13
I looked at my build log again.

The very first line that jumps out as abnormal is this:

    /usr/bin/ld: /usr/bin/ld: DWARF error: invalid abstract instance DIE ref

A quick DuckDuckGoing suggests that this *may* be related to a broken version of binutils:

The current, most up-to-date version of binutils in Raspbian Stretch is this:

    $ dpkg -l binutils
    | Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
    |/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
    ||/ Name           Version        Architecture Description
    ii  binutils       2.31.1-16+rpi1 armhf        GNU assembler, linker and binary utilities

A quick grep of the output of `apt changelog binutils` doesn't mention the bug number (23425).

I don't know what conclusion to draw.
msg348835 - (view) Author: Kal Sze (kal.sze) Date: 2019-08-01 03:14
Sorry, I meant most up-to-date version of binutils in Raspbian *Buster* in my previous message.
msg348836 - (view) Author: Benjamin Peterson (benjamin.peterson) * (Python committer) Date: 2019-08-01 03:45
Presumably dropping --enable-optimizations will fix this problem.
msg348843 - (view) Author: Kal Sze (kal.sze) Date: 2019-08-01 08:09
Yes, removing --enable-optimizations and keeping all other configure options allows me to build.

However, I think most people *do* want optimizations, especially because the Raspberry Pi itself already isn't very fast.
Date User Action Args
2019-08-01 08:09:28kal.szesetmessages: + msg348843
2019-08-01 03:45:48benjamin.petersonsetnosy: + benjamin.peterson
messages: + msg348836
2019-08-01 03:14:15kal.szesetmessages: + msg348835
2019-08-01 03:13:21kal.szesetmessages: + msg348834
2019-07-24 19:06:01DNSGeeksetnosy: + DNSGeek
messages: + msg348402
2019-07-15 01:46:39kal.szecreate