This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: Cannot compile on RPi with optimizations
Type: compile error Stage: resolved
Components: Build Versions: Python 3.8, Python 3.7
process
Status: closed Resolution: duplicate
Dependencies: Superseder: Python 3.7.4 does not build on Raspbian Buster with optimizations
View: 37595
Assigned To: Nosy List: DNSGeek, ammar2
Priority: normal Keywords:

Created on 2019-09-17 22:05 by DNSGeek, last changed 2022-04-11 14:59 by admin. This issue is now closed.

Messages (6)
msg352668 - (view) Author: Thomas Knox (DNSGeek) Date: 2019-09-17 22:05
Trying to compile 3.8.0b4 on an raspberry pi 3B+ and 4 running:

pi@pi4b:~/Downloads/Python-3.8.0b4 $ uname -a
Linux pi4b 4.19.66-v7l+ #1253 SMP Thu Aug 15 12:02:08 BST 2019 armv7l GNU/Linux

Using arguments:

./configure --disable-shared --enable-optimizations --enable-loadable-sqlite-extensions --enable-ipv6 --enable-big-digits --with-lto --with-doc-strings --with-ensurepip --with-openssl=/usr

fails compilation at the linking stage with the errors:

/usr/bin/ld: /usr/bin/ld: DWARF error: offset (7602768) greater than or equal to .debug_str size (517480)
/usr/bin/ld: DWARF error: offset (2013417729) greater than or equal to .debug_str size (517480)
/usr/bin/ld: DWARF error: offset (1375799296) greater than or equal to .debug_str size (517480)
/usr/bin/ld: DWARF error: offset (3959620946) greater than or equal to .debug_str size (517480)
/usr/bin/ld: DWARF error: offset (150994953) greater than or equal to .debug_str size (517480)
/usr/bin/ld: DWARF error: offset (622700) greater than or equal to .debug_str size (517480)
/usr/bin/ld: DWARF error: offset (990813185) greater than or equal to .debug_str size (517480)
/usr/bin/ld: DWARF error: could not find abbrev number 9630
/tmp/ccX29Gpf.lto.o: in function `copy_base':
<artificial>:(.text+0x8374): undefined reference to `__gcov_one_value_profiler_atomic'
/usr/bin/ld: <artificial>:(.text+0x8388): undefined reference to `__gcov_average_profiler_atomic'
/usr/bin/ld: <artificial>:(.text+0x8398): undefined reference to `__gcov_ior_profiler_atomic'
/usr/bin/ld: <artificial>:(.text+0x840c): undefined reference to `__gcov_one_value_profiler_atomic'
/usr/bin/ld: <artificial>:(.text+0x8420): undefined reference to `__gcov_average_profiler_atomic'
/usr/bin/ld: <artificial>:(.text+0x8430): undefined reference to `__gcov_ior_profiler_atomic'
/usr/bin/ld: <artificial>:(.text+0x84c8): undefined reference to `__gcov_one_value_profiler_atomic'
/usr/bin/ld: <artificial>:(.text+0x84dc): undefined reference to `__gcov_average_profiler_atomic'
/usr/bin/ld: <artificial>:(.text+0x84ec): undefined reference to `__gcov_ior_profiler_atomic'
/usr/bin/ld: <artificial>:(.text+0x856c): undefined reference to `__gcov_one_value_profiler_atomic'
/usr/bin/ld: <artificial>:(.text+0x8580): undefined reference to `__gcov_average_profiler_atomic'
/usr/bin/ld: <artificial>:(.text+0x8590): undefined reference to `__gcov_ior_profiler_atomic'
/usr/bin/ld: <artificial>:(.text+0x866c): undefined reference to `__gcov_one_value_profiler_atomic'
/usr/bin/ld: <artificial>:(.text+0x867c): undefined reference to `__gcov_average_profiler_atomic'
/usr/bin/ld: <artificial>:(.text+0x868c): undefined reference to `__gcov_ior_profiler_atomic'
/usr/bin/ld: <artificial>:(.text+0x8718): undefined reference to `__gcov_one_value_profiler_atomic'
/usr/bin/ld: <artificial>:(.text+0x8728): undefined reference to `__gcov_average_profiler_atomic'
/usr/bin/ld: <artificial>:(.text+0x8738): undefined reference to `__gcov_ior_profiler_atomic'
/usr/bin/ld: <artificial>:(.text+0x87b0): undefined reference to `__gcov_one_value_profiler_atomic'
/usr/bin/ld: <artificial>:(.text+0x87c8): undefined reference to `__gcov_average_profiler_atomic'
/usr/bin/ld: <artificial>:(.text+0x87d8): undefined reference to `__gcov_ior_profiler_atomic'
...
For hundreds of lines.

Removing the --enable-optimizations flag allows it compile and link.
msg352671 - (view) Author: Ammar Askar (ammar2) * (Python committer) Date: 2019-09-17 23:01
Could you provide the output of 

  gcc --version

and

  ld --version
msg352733 - (view) Author: Thomas Knox (DNSGeek) Date: 2019-09-18 15:49
pi@pi4b:~ $ gcc --version
gcc (Raspbian 8.3.0-6+rpi1) 8.3.0

pi@pi4b:~ $ ld --version
GNU ld (GNU Binutils for Raspbian) 2.31.1
msg352734 - (view) Author: Thomas Knox (DNSGeek) Date: 2019-09-18 15:51
I'll be more than happy to buy you an RPi to do testing on.
msg352737 - (view) Author: Ammar Askar (ammar2) * (Python committer) Date: 2019-09-18 16:00
Hmm, I think this might be the following gcc/binutils bug: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84847
https://sourceware.org/bugzilla/show_bug.cgi?id=20882

This might be a bit of a pain but could you try updating binutils and see if the problem persists.
msg352742 - (view) Author: Thomas Knox (DNSGeek) Date: 2019-09-18 16:36
I updated binutils:

pi@pi4b:~/Downloads/Python-3.8.0b4 $ ld --version
GNU ld (GNU Binutils) 2.32

Same problem.
History
Date User Action Args
2022-04-11 14:59:20adminsetgithub: 82385
2022-01-12 23:04:07iritkatrielsetstatus: open -> closed
superseder: Python 3.7.4 does not build on Raspbian Buster with optimizations
resolution: duplicate
stage: resolved
2019-09-18 16:36:33DNSGeeksetmessages: + msg352742
2019-09-18 16:00:20ammar2setmessages: + msg352737
2019-09-18 15:51:47DNSGeeksetmessages: + msg352734
2019-09-18 15:49:42DNSGeeksetmessages: + msg352733
2019-09-17 23:01:48ammar2setnosy: + ammar2
messages: + msg352671
2019-09-17 22:05:08DNSGeekcreate