Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 16 Apr 2022 21:58:20 +0000
From:      bugzilla-noreply@freebsd.org
To:        python@FreeBSD.org
Subject:   maintainer-feedback requested: [Bug 263353] lang/python38: fix excessive ld.lld memory use with LTO in port options
Message-ID:  <bug-263353-21822-UWhdnuhtUc@https.bugs.freebsd.org/bugzilla/>
In-Reply-To: <bug-263353-21822@https.bugs.freebsd.org/bugzilla/>
References:  <bug-263353-21822@https.bugs.freebsd.org/bugzilla/>

next in thread | previous in thread | raw e-mail | index | archive | help
Bugzilla Automation <bugzilla@FreeBSD.org> has asked freebsd-python (Nobody)
<python@FreeBSD.org> for maintainer-feedback:
Bug 263353: lang/python38: fix excessive ld.lld memory use with LTO in port
options
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D263353



--- Description ---
I can no longer build Python 3.8 on a FreeBSD 13.0-RELEASE amd64 computer w=
ith
1.6 GB available memory (1 GB physical, 1 GB encrypted swap file on UFS).

The upstream configure.ac file in Python 3.8.13 as of 0058eede0ebf adds "-f=
lto
-g" to the build (through CFLAGS and LDFLAGS). This happens even without
WITH_DEBUG=3Dyes.

This considerably increases the memory that my FreeBSD 13.0-RELEASE ld.lld
requires, and the kernel kills it with "out of swap space".=20

I used to be able to build Python 3.8 on that machine earlier, and reviewing
port history, I surmise that * 9a31e1b6d3bf 2022-03-09 | lang/python3*: add=
 LTO
option and enable by default everywhere except powerpc64 and riscv64 [Piotr
Kubaj]=20
caused the increase in memory consumption from the desired LTO.

Chopping out the -g from CFLAGS and LDFLAGS fixes this for me, reducing lin=
ker
memory consumption to below 400 MB VMEM, and lets my low-on-RAM computer
complete the build. (It is a single Xeon core I rented out for a virtual
server.)

I am proposing the attached patch. I have not investigated yet whether Pyth=
ons
3.7 3.9 3.10 3.11 need an analogue patch, for lack of time. In Python 3.8 y=
ou
will see "-flto -g" in the ${WRKSRC}/Makefile that results from a "make
configure" with LTO option enabled, because the upstream configure.ac is
written that way.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-263353-21822-UWhdnuhtUc>