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 2EE1111CA52C 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 4KgnBh6Db9z3pJt 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 B2B581202D 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 23GLwKrX063570 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 23GLwKkX063569 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-approval requested: [Bug 263353] lang/python38: fix excessive ld.lld memory use with LTO in port options : [Attachment 233259] remove -g from the CFLAGS/LDFLAGS unless WITH_DEBUG is set not empty and not "no". 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=plDvX3DXWLuX4lxQlgo0l/Lg6RcMvkgEpBK5wUxXZRg=; b=kMS5DHp2mQu8Eahi0la+vdnE9lvBB6C8NAfzq+jrC8uH8VCGw+LRw69Bdz04nxG1rML9PY BtPBlE2fCbsaIoyOLPRROUf9i9LUttp9Zi2Y+utWxfCtviTL9vtPUBldypD1fpYQZ02AqC 6g8iyN+eb4dRk+9RfBZ3ahZPgHpIB280DOsxP0V4kzpkthXSxYezF0lFW6Oq5y9CPwJhBN eNZDEvkiNBGZlY/wH1CLlF7wtHeVejH9q2HHg2SrNSkPiis9/UyCtg8lPUGZMO4iqC7F3q 6WkuXcW30HsU88LUgFQgLcc2D4BVFC1KEnMpnaXpPoRzxYyaw1EGgjMlXQHWdQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1650146300; a=rsa-sha256; cv=none; b=o6nRY8Qv1xhqFh7yfb13X7USol/PdhjZ2lgI6vND848LSX0Z1Y7SS1Lrr9Bk4DZjrgQtmz 3fobgi7woxVId/lkpr6bsoSEtOMem698fCJv8iUkxFAcDgStXlCV+nm/h/tcA2qLyR8AgV mmIScUFd8ILNUvGHgsPLP2wxvOuSRWMbPk9aBfH7F85LvUoi3qqcWp2vsBmVWyAajHvBl/ C5OAjGdrP+R+BAPTLuwj0rgkjog8hNdNekvuoFdA4PsZja7CscGNa84xmZmp26A/MyQAbd weusa+UbjiGtXsg7mRAzDvAW1ETwcrx3K2SFPokHB3S1ojkvz3mvFT32l7GVbw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N Matthias Andree has asked freebsd-python (Nobody) for maintainer-approval: 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 Attachment 233259: remove -g from the CFLAGS/LDFLAGS unless WITH_DEBUG is s= et not empty and not "no". https://bugs.freebsd.org/bugzilla/attachment.cgi?id=3D233259&action=3Dedit --- 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.