From nobody Mon Dec 11 17:42:39 2023 X-Original-To: dev-commits-ports-all@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 4Sppwv3bnzz53t2h; Mon, 11 Dec 2023 17:42:39 +0000 (UTC) (envelope-from git@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 4Sppwv2z8fz4SVf; Mon, 11 Dec 2023 17:42:39 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1702316559; 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; bh=djQTiYPFpz5otJ41UVWYHm2AI9IDyGEVnUQVMACUsaA=; b=oeJgTi8e0xlfeVL4Y3adu2FbFasB2UCdLHDfUHWuJzFUqwC1NI7itqViBpoVWjvm9Dyrgu gEJi4OaJnmksNckHxa856FTFz1B0X29KscQRWeZSW8Blr28PFzATVQsgwuYFDqpNQEoDJg lVn0qo7ISaCDONyQmV/0JUK4JS1cPVvfWT5rIPL+CCuKB+X9M97g/W5a8qBuuz6TCI0fB+ X7BXxQwPPFKJAC/Ka8ExwXHTLOgaOy637FVM0emyEJRRWFEVA5k2Z1MRUT3Km3YJfjeF+a 4Nz2D2844PCOtNbqqK+9MFmgPdUC2pwuJf013cLty/Y6TbHTPpUeMlBxhE7WFg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1702316559; a=rsa-sha256; cv=none; b=j3x0ysDTe1R4G1EgFqfzWJFQtb79Xpxx7/hiCj8cqMUaXfkjYKsGFqWf/c7Gbwx8d1cWMG remJV79qDXP0GbzaTj7vzrGED43H5kOl7ciTKjeH5H3SpcmSsmRLthtTw5Y4uw9RUMtr4a Nu8VPADB4WiiitV/VbfhXkG8l++H2UVxDtT/K4sr26gsJDj+rGzE0u9qiTBy8I2LhN72ht OheF/BsKL48/M6VpaFZZW01fksh01FxYH5sInpT4U4haQjNTi68lK13S/zczv4hJMUZ1zG 9z/nDKuM8VIUypG78JcNzyfHRYuzZGnY43iGWbQMTg1+feb9SKp+2fxy44aeJg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1702316559; 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; bh=djQTiYPFpz5otJ41UVWYHm2AI9IDyGEVnUQVMACUsaA=; b=CYp9On3NGDuR6f/Ox6h2xUTwliw9hSfbLPcbHkj4gDBCo2LIhOjgvCQjYybMDuCHIg24wH w9Qvd5Wobq6dDneQffBC5j23CSv3VjKPvIRqFoil1p/X0AWGFmVFnpCYe4xIPWolJAcrkr 7nPvG4xvSwQA2/cXTnZ0lHK+616tJWZGfPsqctyS9aXAGjuAqtXsAsb1dwFiH58EYL8sY5 RMgK3Lz394K76GF59WbUkwjCvl5ZyXomFJaiDUfQev65aXPOhJxMtiYnviYw1VFFGZ+NZl hlN7KvtHNbrj4JY7L/Qo2NEEJihxYateNw5uxd1Oa4135t3T5KqipVTj3MEEEQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 4Sppwv24qkzghg; Mon, 11 Dec 2023 17:42:39 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 3BBHgdR5022391; Mon, 11 Dec 2023 17:42:39 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 3BBHgddp022388; Mon, 11 Dec 2023 17:42:39 GMT (envelope-from git) Date: Mon, 11 Dec 2023 17:42:39 GMT Message-Id: <202312111742.3BBHgddp022388@gitrepo.freebsd.org> To: ports-committers@FreeBSD.org, dev-commits-ports-all@FreeBSD.org, dev-commits-ports-main@FreeBSD.org From: Brooks Davis Subject: git: f2348b342e63 - main - lang/smalltalk: use modern memory management List-Id: Commit messages for all branches of the ports repository List-Archive: https://lists.freebsd.org/archives/dev-commits-ports-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-ports-all@freebsd.org X-BeenThere: dev-commits-ports-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: brooks X-Git-Repository: ports X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: f2348b342e632aa2974ec09ff067b3bcbd0a2f50 Auto-Submitted: auto-generated The branch main has been updated by brooks: URL: https://cgit.FreeBSD.org/ports/commit/?id=f2348b342e632aa2974ec09ff067b3bcbd0a2f50 commit f2348b342e632aa2974ec09ff067b3bcbd0a2f50 Author: Brooks Davis AuthorDate: 2023-12-11 17:40:40 +0000 Commit: Brooks Davis CommitDate: 2023-12-11 17:42:26 +0000 lang/smalltalk: use modern memory management The memory allocator defaults to some horrifying complex code to manage mmap'd allocations. On system where MAP_NORESERVE is defined (Linux) it uses a much simpler approach relying on memory overcommit. Enable this code on FreeBSD by defining MAP_NORESERVE to 0 (all allocations are MAP_NORESERVE on FreeBSD unless a sysctl is set). Entierly disable the other code path as it (somewhat gratutiously) uses sbrk. Approved by: danfe (maintainer) Sponsord by: DARPA Differential Revision: https://reviews.freebsd.org/D42974 --- lang/smalltalk/Makefile | 5 +- .../files/patch-libgst_sysdep_posix_mem.c | 59 ++++++++++++++++++++++ 2 files changed, 60 insertions(+), 4 deletions(-) diff --git a/lang/smalltalk/Makefile b/lang/smalltalk/Makefile index 591a27d6302b..64a6dfd1f13d 100644 --- a/lang/smalltalk/Makefile +++ b/lang/smalltalk/Makefile @@ -1,6 +1,6 @@ PORTNAME= smalltalk PORTVERSION= 3.2.5 -PORTREVISION= 17 +PORTREVISION= 18 CATEGORIES= lang MASTER_SITES= GNU @@ -10,10 +10,7 @@ WWW= https://smalltalk.gnu.org/ LICENSE= GPLv2+ -BROKEN_aarch64= Fails to link: undefined reference to sbrk BROKEN_powerpc64= Fails to build: gst-package: did not understand #~ -BROKEN_riscv64= Fails to link: undefined reference to sbrk -BROKEN_sparc64= Fails to install BUILD_DEPENDS= zip:archivers/zip \ gawk:lang/gawk diff --git a/lang/smalltalk/files/patch-libgst_sysdep_posix_mem.c b/lang/smalltalk/files/patch-libgst_sysdep_posix_mem.c new file mode 100644 index 000000000000..a9514dea3ca0 --- /dev/null +++ b/lang/smalltalk/files/patch-libgst_sysdep_posix_mem.c @@ -0,0 +1,59 @@ +--- libgst/sysdep/posix/mem.c.orig ++++ libgst/sysdep/posix/mem.c +@@ -92,20 +92,27 @@ + #if defined MAP_AUTORESRV && !defined MAP_NORESERVE + # define MAP_NORESERVE MAP_AUTORESRV + #endif ++#if !defined(MAP_NORESERVE) && defined(__FreeBSD__) ++#define MAP_NORESERVE 0 /* always true */ ++#endif + #ifdef MAP_NORESERVE + static PTR noreserve_reserve (PTR, size_t); + static void noreserve_decommit (PTR, size_t); + #endif ++#ifndef __FreeBSD__ + static mst_Boolean anon_mmap_check (void); + static PTR anon_mmap_reserve (PTR, size_t); + static void anon_mmap_release (PTR, size_t); ++#endif + static PTR anon_mmap_commit (PTR, size_t); + + struct heap_implementation heap_impl_tab[] = { + #ifdef MAP_NORESERVE + { NULL, noreserve_reserve, _gst_osmem_free, anon_mmap_commit, noreserve_decommit }, + #endif ++#ifndef __FreeBSD__ + { anon_mmap_check, anon_mmap_reserve, anon_mmap_release, anon_mmap_commit, _gst_osmem_free }, ++#endif + { NULL, NULL, NULL, NULL, NULL } + }; + +@@ -195,6 +202,7 @@ + + static char *baseaddr; + ++#ifndef __FreeBSD__ + PTR + anon_mmap_reserve (PTR address, size_t size) + { +@@ -220,6 +228,7 @@ + if ((char *) baseaddr == (char *) base + size) + baseaddr = base; + } ++#endif + + PTR + anon_mmap_commit (PTR base, size_t size) +@@ -231,6 +240,7 @@ + return UNCOMMON (result == MAP_FAILED) ? NULL : result; + } + ++#ifndef __FreeBSD__ + /* This is hairy and a hack. We have to find a place for our heaps... */ + + /* This signal handler is used if it is the only means to decide if +@@ -360,3 +370,4 @@ + return (true); + } + } ++#endif