Date: Sat, 16 Apr 2022 21:58:20 +0000 From: bugzilla-noreply@freebsd.org To: ports-bugs@FreeBSD.org Subject: [Bug 263353] lang/python38: fix excessive ld.lld memory use with LTO in port options Message-ID: <bug-263353-7788@https.bugs.freebsd.org/bugzilla/>
next in thread | raw e-mail | index | archive | help
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D263353 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: python@FreeBSD.org Reporter: mandree@FreeBSD.org CC: python@FreeBSD.org Assignee: python@FreeBSD.org Flags: maintainer-feedback?(python@FreeBSD.org) Attachment #233259 maintainer-approval?(python@FreeBSD.org) Flags: CC: python@FreeBSD.org Created attachment 233259 --> https://bugs.freebsd.org/bugzilla/attachment.cgi?id=3D233259&action= =3Dedit 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 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. --=20 You are receiving this mail because: You are the assignee for the bug.=
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-263353-7788>