From nobody Fri Sep 01 16:54:56 2023 X-Original-To: dev-commits-src-main@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 4RckfT0kVvz4rlnt; Fri, 1 Sep 2023 16:54:57 +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 4RckfS6cljz3V8K; Fri, 1 Sep 2023 16:54:56 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1693587296; 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=6WaGoicPsIvN2ZCAEBW0dSTQLCU5mlLCVGcuunZdY3E=; b=xbpfkpTRr8lONikqq/zZGzF0Qd/u7l2getwZX0QDpOxnDs2s1dUnzGPyBMzFIKM4PJ9yuj t7UqFRJA5/z+0DtlGHpQJ55wGSXUFDHKls4SjbF5VmBwyskyz2CCdr48pIcoaMTe3Hyw4b 79Dq2jWWnnchUfwMssBUzYt9xpHMNS1gmSGqD1yc0AXwJEQJz8OPP9ZTNgSwi9bj6y1Fan d7ZcntDgOZ6x/86+u6T7QVibwROnYxuh5Nfa+GistDB0MAKUsc9EQGV7mzAxNH49lkEV4l Wel6O3A0Udgi0Zrrm67yxF/psvF4VXL/AVdaSL+ThG4lBPY6C8G0yzMUX+O7NA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1693587296; a=rsa-sha256; cv=none; b=OU5zWckAxHNoF/rbjhqUXbjueNeUEdhnqTK5qNwfREb8KLHLHVlpq8tbMIEHR0XC6GidTH 5SOhBeqgRgZrkk7smIdASUZaWOzM4PkGP90xkoSR8joH+0Hw2VQqMCEhdo4fJMiLDOt41p GmBzIHVsHJwJznmk/fPutHRqI9D919o+qsZIkkhlDLrimJjVTqazRHbpnW8+GlUGJhIbQM fmf6CtLsM8x/cxx5KGGSZiA/3oVqGAvvJDCGiyw2/ighLXcZxmIjV+6IOArHYP4sd/K5xt sgnOljrStdMQ3a4pxdugSMnCMXOvmUKCTNWjjHxwQa8KfwDPVUusNwywoyQebQ== 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=1693587296; 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=6WaGoicPsIvN2ZCAEBW0dSTQLCU5mlLCVGcuunZdY3E=; b=iRru1PlLgLmi5dWs43QsfrdRZ+KRAFcywCFsuQUyanoKiXnCirDMzMrDJXLpdwIAIdYYxG NaU5I//tPQ2RMoR/lYEfXnXC4ve5+mH0XZaX/EEFiKBxh/S5uA7udA0nOPwPPhKxIBYFzB EyO/N3KFzbt8XRNnpOZkl8VQjnClE2oJpp9EtR9Xs4pIF/PkHDyYaYIgeEJZhhuzX0bkMc qD7E4K+lncuO/nMIhb2dhD2AfsQzxH+jz52v75dvtuAPMj/9WKH5aDOrFNrKSJkUqY1mjZ SH8mSxCMj9VsRcqHOhZ5oDb8DOY5RJVlPwFc7+I2k1RwP07UmQE/my3v9acHag== 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 4RckfS5k9qz17p0; Fri, 1 Sep 2023 16:54:56 +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 381Gsuaw070726; Fri, 1 Sep 2023 16:54:56 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 381Gsuaf070723; Fri, 1 Sep 2023 16:54:56 GMT (envelope-from git) Date: Fri, 1 Sep 2023 16:54:56 GMT Message-Id: <202309011654.381Gsuaf070723@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Brooks Davis Subject: git: 09e32b2fddf5 - main - libc: add LIBC_MALLOC option List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: brooks X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 09e32b2fddf5f673f76e2fffa415a73d99a6f309 Auto-Submitted: auto-generated The branch main has been updated by brooks: URL: https://cgit.FreeBSD.org/src/commit/?id=09e32b2fddf5f673f76e2fffa415a73d99a6f309 commit 09e32b2fddf5f673f76e2fffa415a73d99a6f309 Author: Brooks Davis AuthorDate: 2023-09-01 16:42:39 +0000 Commit: Brooks Davis CommitDate: 2023-09-01 16:54:23 +0000 libc: add LIBC_MALLOC option This will enable alternative mallocs to be included in the tree and selected by setting LIBC_MALLOC. As there is only one today (jemalloc) this option does nothing, but we expect to add other implementations in the future. This will also reduce diffs to CheriBSD. Reviewed by: emaste Differential Revision: https://reviews.freebsd.org/D41660 --- lib/libc/stdlib/malloc/Makefile.inc | 2 +- share/mk/src.opts.mk | 6 ++++++ tools/build/options/LIBC_MALLOC | 13 +++++++++++++ 3 files changed, 20 insertions(+), 1 deletion(-) diff --git a/lib/libc/stdlib/malloc/Makefile.inc b/lib/libc/stdlib/malloc/Makefile.inc index bce4353fe80a..3bae4ff1505b 100644 --- a/lib/libc/stdlib/malloc/Makefile.inc +++ b/lib/libc/stdlib/malloc/Makefile.inc @@ -1,3 +1,3 @@ SYM_MAPS+=${LIBC_SRCTOP}/stdlib/malloc/Symbol.map -.include "${LIBC_SRCTOP}/stdlib/malloc/jemalloc/Makefile.inc" +.include "${LIBC_SRCTOP}/stdlib/malloc/${OPT_LIBC_MALLOC}/Makefile.inc" diff --git a/share/mk/src.opts.mk b/share/mk/src.opts.mk index 1183a8202168..d7112cf57178 100644 --- a/share/mk/src.opts.mk +++ b/share/mk/src.opts.mk @@ -228,6 +228,12 @@ __DEFAULT_DEPENDENT_OPTIONS= \ LOADER_VERIEXEC_VECTX/LOADER_VERIEXEC \ VERIEXEC/BEARSSL \ +__SINGLE_OPTIONS = \ + LIBC_MALLOC + +__LIBC_MALLOC_OPTIONS= jemalloc +__LIBC_MALLOC_DEFAULT= jemalloc + # MK_*_SUPPORT options which default to "yes" unless their corresponding # MK_* variable is set to "no". # diff --git a/tools/build/options/LIBC_MALLOC b/tools/build/options/LIBC_MALLOC new file mode 100644 index 000000000000..ee1883f3ee54 --- /dev/null +++ b/tools/build/options/LIBC_MALLOC @@ -0,0 +1,13 @@ +Specify the +.Xr malloc 3 +implementaiton used by libc. +The default value is +.Li jemalloc . +Valid values are: +.Bl -tag -width indent +.It Li jemalloc +.El +.Pp +Other implementations are expected in the future in both +.Fx +and downstream consumers.