From nobody Sat Apr 16 21:58:20 2022 X-Original-To: python@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 21DF711CA590 for ; Sat, 16 Apr 2022 21:58:21 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4KgnBh5Rywz3pJs for ; Sat, 16 Apr 2022 21:58:20 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org (kenobi.freebsd.org [IPv6:2610:1c1:1:606c::50:1d]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9C0DF11DDB for ; Sat, 16 Apr 2022 21:58:20 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org ([127.0.1.5]) by kenobi.freebsd.org (8.15.2/8.15.2) with ESMTP id 23GLwK4f063566 for ; Sat, 16 Apr 2022 21:58:20 GMT (envelope-from bugzilla-noreply@freebsd.org) Received: (from www@localhost) by kenobi.freebsd.org (8.15.2/8.15.2/Submit) id 23GLwKP5063565 for python@FreeBSD.org; Sat, 16 Apr 2022 21:58:20 GMT (envelope-from bugzilla-noreply@freebsd.org) X-Authentication-Warning: kenobi.freebsd.org: www set sender to bugzilla-noreply@freebsd.org using -f Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="UTF-8" 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 Date: Sat, 16 Apr 2022 21:58:20 +0000 X-Bugzilla-Type: request X-Bugzilla-Product: Ports & Packages X-Bugzilla-Component: Individual Port(s) X-Bugzilla-Version: Latest X-Bugzilla-Keywords: patch, regression X-Bugzilla-Severity: Affects Only Me X-Bugzilla-Who: X-Bugzilla-Status: New X-Bugzilla-Resolution: X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: python@FreeBSD.org X-Bugzilla-Flags: maintainer-feedback? Message-ID: In-Reply-To: References: X-Bugzilla-URL: https://bugs.freebsd.org/bugzilla/ Auto-Submitted: auto-generated List-Id: FreeBSD-specific Python issues List-Archive: https://lists.freebsd.org/archives/freebsd-python List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-python@freebsd.org X-BeenThere: freebsd-python@freebsd.org MIME-Version: 1.0 ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1650146300; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=deCcvjqaa7Og3Xng3ypvug05PhilYvlqe2GAoshSrl8=; b=Cqx4fgJy7DWCvmbU6BwUliGi/QYg5bcjHdPUbOeWCHY6m7vgQN1X0Kh51RZKKupEoIf0zw DoNRvRg2IZo9fN9dLVlvvMq35G3T/sUriB2j6TdnS1bb/P88o8+xmkkVFrPioo+6sQdWgO zS67+0nHhD1eCa2zGCrJwnE6+2kuhidy+PaTzX6lEqAhfOwqYzoZa49sY4cLZ2YA+IfYMZ wf2QR5gODzk1+lWEgskYZp0j6BMFtgQcnzGm4MrryK6Ml3TzFDdzb0hte5SvBpb38vQgS0 nLjzEqYT5Qxab56u9+FjlxVh+MNV0ES104oUpVW2CMjvCz+dQRrGxboapRlmNA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1650146300; a=rsa-sha256; cv=none; b=J/GLcz4fYLU7fJh1SkDPEHmDXqFtI1bj49kQjJL/YcyTkGsuUZdeNVEz57IAk2HqMdXCdN +ZmGKuagXhVDy4NNapTgC+wqdibgMBnySKKV02GymumWAsYi6g4nlzNRMrU1rFvTjosXZl qNI72yIllmnHy/KxYNFOrKmDqlaRt3zh4uQjp5u4JxxUkJA6aPfmfjkBOU/9RIxLoRNP1m 2YSrp+94Ar+9DAl3Ka67kMbNEmWskXLTNpBBHVH7d1pgLVCY1SOP60QphS6vE/B4SxKrN+ DtFgyaCgc3B1c3jUlPYeWgUWa6LgwaD3M5ZriQndZwvlz5bsD2IssuNblPdkOg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N Bugzilla Automation has asked freebsd-python (Nobody) 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.