https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=263353
Bug ID: 263353
Summary: lang/python38: fix excessive ld.lld memory use with
LTO in port options
Product: Ports & Packages
Version: Latest
Hardware: Any
OS: Any
Status: New
Keywords: patch, regression
Severity: Affects Only Me
Priority: ---
Component: Individual Port(s)
Assignee: [email protected]
Reporter: [email protected]
CC: [email protected]
Assignee: [email protected]
Flags: maintainer-feedback?([email protected])
Attachment #233259 maintainer-approval?([email protected])
Flags:
CC: [email protected]
Created attachment 233259
--> https://bugs.freebsd.org/bugzilla/attachment.cgi?id=233259&action=edit
remove -g from the CFLAGS/LDFLAGS unless WITH_DEBUG is set not empty and not
"no".
I can no longer build Python 3.8 on a FreeBSD 13.0-RELEASE amd64 computer with
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 "-flto
-g" to the build (through CFLAGS and LDFLAGS). This happens even without
WITH_DEBUG=yes.
This considerably increases the memory that my FreeBSD 13.0-RELEASE ld.lld
requires, and the kernel kills it with "out of swap space".
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]
caused the increase in memory consumption from the desired LTO.
Chopping out the -g from CFLAGS and LDFLAGS fixes this for me, reducing linker
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 Pythons
3.7 3.9 3.10 3.11 need an analogue patch, for lack of time. In Python 3.8 you
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.
--
You are receiving this mail because:
You are on the CC list for the bug.
You are the assignee for the bug.