From patchwork Sat Mar 15 02:46:23 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ramsay Jones X-Patchwork-Id: 14017691 Received: from avasout-peh-003.plus.net (avasout-peh-003.plus.net [212.159.14.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 3D5B92EB1D for ; Sat, 15 Mar 2025 02:49:26 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=212.159.14.19 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1742006967; cv=none; b=JMCwkB+dWyLWNX5ZIkxh53g9SGBVTurhEg1ElwXNrEkN4pbkYMFfGNE0BolYlhG3Uoq1VlFtIF21AVnt4mvjrwaK1P9IfK30Q/BcH8rHeL7NsQpTZQmMpHL4JYuochp/PdnSbzFLiy/cwPKmIkwgzO66N4Rf1ElGASu2MRh72q8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1742006967; c=relaxed/simple; bh=KvF01dtF3oZ/0pobUDsIDKjviipmr+w+MGGJXosAE6g=; h=Message-ID:Date:MIME-Version:To:Cc:From:Subject:Content-Type; b=qS0917zWhxVaMj/vmxfRKPFRn7Flm8iqJ+WSHJslbzjwZGNay/rQBveo/gYSJp9n23PYrnP9sxCcXVHSVNMoUC9Uyf+QRoWHSVQaY1jmBTxZgKy9ZjhtWkxUKzfQrfkrMmFRQOVgzI9TyeX+uKHZSJcFVOuNxucWlEH+pfNrKzg= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=ramsayjones.plus.com; spf=none smtp.mailfrom=ramsayjones.plus.com; dkim=pass (2048-bit key) header.d=plus.com header.i=@plus.com header.b=e3uSIylY; arc=none smtp.client-ip=212.159.14.19 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=ramsayjones.plus.com Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=ramsayjones.plus.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=plus.com header.i=@plus.com header.b="e3uSIylY" Received: from [10.0.2.15] ([80.189.83.109]) by smtp with ESMTPA id tHXbtGMnpvxWAtHXcteQBc; Sat, 15 Mar 2025 02:46:25 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=plus.com; s=042019; t=1742006785; bh=DJs/JzRwdfOkJXRGUokp2YjiiT943LHGoUp1/dyBrvc=; h=Date:To:Cc:From:Subject; b=e3uSIylY9iGVDxcoQDwj1txWC9ZYk+hqhSf9bjI5oD/tXAtlL35FlHwzDD/QfdikT cFkh5hx3x9+DEloupesdawfvJUjZIGSpznRqK+RnopMev8ZvxPpO0AioU8UsKrrlkI MI6HofbUUfHUygytp3eJuWCJvIxf9Hryb2ATkYnrXDc3VQzyHlVCcxAJJCnLwHzwqK gwCeggVgcef3vwO36lj5IrGeKaj/zS1sN0kUnGPmf2lsp+RWFI4h6TJzCl7CJ6Pwft yctIqN2RSz70/fvQPKmfgTJ4yxAXMZjbxvvRDyoE6rHj24CVJPymCZezEu4xRuxs1O zqm8EEkl85KSA== X-Clacks-Overhead: "GNU Terry Pratchett" X-CM-Score: 0.00 X-CNFS-Analysis: v=2.4 cv=QbDFvdbv c=1 sm=1 tr=0 ts=67d4ea01 a=oM5NSl/Bl4BpjFr0C8iQlQ==:117 a=oM5NSl/Bl4BpjFr0C8iQlQ==:17 a=IkcTkHD0fZMA:10 a=EBOSESyhAAAA:8 a=jTtcdIhh7rpG9tgoBZEA:9 a=QEXdDO2ut3YA:10 a=yJM6EZoI5SlJf8ks9Ge_:22 X-AUTH: ramsayjones@:2500 Message-ID: Date: Sat, 15 Mar 2025 02:46:23 +0000 Precedence: bulk X-Mailing-List: git@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Content-Language: en-US To: Junio C Hamano Cc: GIT Mailing-list , Patrick Steinhardt , Adam Dinwoodie From: Ramsay Jones Subject: [PATCH 01/12] meson.build: remove -DCURL_DISABLE_TYPECHECK X-CMAE-Envelope: MS4xfFTmjkE+vjkko/3G9Xj9EWkk/eHbScavDe01Vk+wAZBOaOHYRGHPp7yCJrX4uKtOxmSU8KsZtOZvGAeaw6kJsIyw2v2Yud0pXN7Ky5frr67SsBCpaOqg A+VmZ4BPrr92m6IDErYoAeWp4e35IfHRH2TZfeWcVP6mdignj/E4ClmQaREiMVBIyaMwXM58/+zu/aAUJWJKliwqztOsDI08nr8= Commit 9371322a60 ("sparse: suppress some \"using sizeof on a function\" warnings", 2013-10-06) used target-specific variable assignments to add -DCURL_DISABLE_TYPECHECK to SPARSE_FLAGS for each of the files affected by the "typecheck-gcc.h" warnings. (http-push.c, http.c, http-walker.c and remote-curl.c). These warnings are only issued by sparse, and not by gcc, so we do not want to disable the 'type checking' for non-sparse targets. The meson build does not provide any sparse targets, so there is no need to use the CURL_DISABLE_TYPECHECK preprocessor flag with the c compiler. In order to re-enable the curl 'type checking' in the meson build, remove the assignment of -DCURL_DISABLE_TYPECHECK to libgit_c_args. Signed-off-by: Ramsay Jones --- meson.build | 1 - 1 file changed, 1 deletion(-) diff --git a/meson.build b/meson.build index efe2871c9d..88a29fd043 100644 --- a/meson.build +++ b/meson.build @@ -966,7 +966,6 @@ if curl.found() # Most executables don't have to link against libcurl, but we still need its # include directories so that we can resolve LIBCURL_VERSION in "help.c". libgit_dependencies += curl.partial_dependency(includes: true) - libgit_c_args += '-DCURL_DISABLE_TYPECHECK' build_options_config.set('NO_CURL', '') else libgit_c_args += '-DNO_CURL' From patchwork Sat Mar 15 02:46:42 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ramsay Jones X-Patchwork-Id: 14017692 Received: from avasout-peh-003.plus.net (avasout-peh-003.plus.net [212.159.14.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 3DBA7F9E8 for ; Sat, 15 Mar 2025 02:49:45 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=212.159.14.19 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1742006987; cv=none; b=EW2XuEmqK6Z/imoDfEk7rUu4s6hq5eZ9uK9lnkru/z0TfIqJzv9nq4FKbNpZ8bk+uGAw0ff9+YAwprP1ouDV+4fkgCXoTUl++FrPO1xmMcPmk6aG7QH+7+flQNKOtMuVwSoo5NfRVvUqUWwt/PvAFJMEImkWLx21LkMITGAWlK8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1742006987; c=relaxed/simple; bh=LmrNXdXX2i6/CoclEAvT4WDlMtLJtNLLCRamPs1SYmw=; h=Message-ID:Date:MIME-Version:To:Cc:From:Subject:Content-Type; b=uI5mgdt5v4J//6RE6dWZ1nmC//Kn3dWUfNuQq36qoc+6ZOxlQa5WsjB2EoRUOK4MWKCB04RqKISg/x897Fzlwi99UmaGIfbkl77ALgDz//oA0WlgGuG0YdDJntCTdhECta2PW+ihgkWXfqZKeFO9Ra2EQsVtIlxxocYKjzOiSqU= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=ramsayjones.plus.com; spf=none smtp.mailfrom=ramsayjones.plus.com; dkim=pass (2048-bit key) header.d=plus.com header.i=@plus.com header.b=c9rWPpUV; arc=none smtp.client-ip=212.159.14.19 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=ramsayjones.plus.com Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=ramsayjones.plus.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=plus.com header.i=@plus.com header.b="c9rWPpUV" Received: from [10.0.2.15] ([80.189.83.109]) by smtp with ESMTPA id tHXvtGMpBvxWAtHXwteQBh; Sat, 15 Mar 2025 02:46:45 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=plus.com; s=042019; t=1742006805; bh=OxbwKqpgHgtPwvOTCtbz3Z4KvCrTEOuCAYfnxhCSsss=; h=Date:To:Cc:From:Subject; b=c9rWPpUVhkF1jisEMkdGFv1dUzCwdE7tfLDX4H1BFnzghRWiojXS5cGCquZre2FQg ZRnIUslrTigV3PLgQgEWZd8glxKOokcN3CVeEusixkCumHBib2zHRNhd/fomSUmY80 OerckAyqfMM7hX0Ttiq2x2o4bV7jhlu6lFl8F+rq7rS/AXSMRfsV+20fDytsHzRtYk PmA1ctNJFfq0iDfh1VebiBf7DAKc9MT31s87AGQ4RTxRT/roWB+/druYgC2x13lIfK I7pI2R90fAWIIFLoodrHzEKlrsLzqBubbAGpyEA0n6i5M009hwf96AsekW4v76bqpS KZZ3IbM3v66VQ== X-Clacks-Overhead: "GNU Terry Pratchett" X-CM-Score: 0.00 X-CNFS-Analysis: v=2.4 cv=QbDFvdbv c=1 sm=1 tr=0 ts=67d4ea15 a=oM5NSl/Bl4BpjFr0C8iQlQ==:117 a=oM5NSl/Bl4BpjFr0C8iQlQ==:17 a=IkcTkHD0fZMA:10 a=EBOSESyhAAAA:8 a=UssqkuoP40Gt3Q7oBg4A:9 a=QEXdDO2ut3YA:10 a=yJM6EZoI5SlJf8ks9Ge_:22 X-AUTH: ramsayjones@:2500 Message-ID: Date: Sat, 15 Mar 2025 02:46:42 +0000 Precedence: bulk X-Mailing-List: git@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Content-Language: en-US To: Junio C Hamano Cc: GIT Mailing-list , Patrick Steinhardt , Patrick Steinhardt From: Ramsay Jones Subject: [PATCH 02/12] Makefile: only set some BASIC_CFLAGS when RUNTIME_PREFIX is set X-CMAE-Envelope: MS4xfHh80TfnQFCexYKxpHTwKCFkoB8nKzqbHY313jBuBFWU9K/comvhJ2NkZp+Vl7NMF9+04QPFqR6L6+N7fb5rbX6FbXnXbp1LS48AJUG5ZYWDk3moaSDA MJYF6g6liYGW57nDTK5bLpw3xl4Znicf4zngmRqgDzLvn1UvgO/3Ei0lE4kLcER/bPnO5WKi725yAaTcMdc6PXaI70UhQKfwRpQ= Several build variables only have any meaning when the RUNTIME_PREFIX variable has been set. In particular, the following build variables are otherwise ignored: HAVE_BSD_KERN_PROC_SYSCTL PROCFS_EXECUTABLE_PATH HAVE_NS_GET_EXECUTABLE_PATH HAVE_ZOS_GET_EXECUTABLE_PATH HAVE_WPGMPTR Make setting BASIC_CFLAGS, for each of these variables, conditional on the RUNTIME_PREFIX being defined. Signed-off-by: Ramsay Jones --- Makefile | 38 +++++++++++++++++++++----------------- 1 file changed, 21 insertions(+), 17 deletions(-) diff --git a/Makefile b/Makefile index 7315507381..818dde32a9 100644 --- a/Makefile +++ b/Makefile @@ -2179,10 +2179,6 @@ ifdef HAVE_BSD_SYSCTL BASIC_CFLAGS += -DHAVE_BSD_SYSCTL endif -ifdef HAVE_BSD_KERN_PROC_SYSCTL - BASIC_CFLAGS += -DHAVE_BSD_KERN_PROC_SYSCTL -endif - ifdef HAVE_GETDELIM BASIC_CFLAGS += -DHAVE_GETDELIM endif @@ -2213,25 +2209,33 @@ ifneq ($(findstring openssl,$(CSPRNG_METHOD)),) EXTLIBS += -lcrypto -lssl endif -ifneq ($(PROCFS_EXECUTABLE_PATH),) - procfs_executable_path_SQ = $(subst ','\'',$(PROCFS_EXECUTABLE_PATH)) - BASIC_CFLAGS += '-DPROCFS_EXECUTABLE_PATH="$(procfs_executable_path_SQ)"' -endif - ifndef HAVE_PLATFORM_PROCINFO COMPAT_OBJS += compat/stub/procinfo.o endif -ifdef HAVE_NS_GET_EXECUTABLE_PATH - BASIC_CFLAGS += -DHAVE_NS_GET_EXECUTABLE_PATH -endif +ifdef RUNTIME_PREFIX -ifdef HAVE_ZOS_GET_EXECUTABLE_PATH - BASIC_CFLAGS += -DHAVE_ZOS_GET_EXECUTABLE_PATH -endif + ifdef HAVE_BSD_KERN_PROC_SYSCTL + BASIC_CFLAGS += -DHAVE_BSD_KERN_PROC_SYSCTL + endif + + ifneq ($(PROCFS_EXECUTABLE_PATH),) + pep_SQ = $(subst ','\'',$(PROCFS_EXECUTABLE_PATH)) + BASIC_CFLAGS += '-DPROCFS_EXECUTABLE_PATH="$(pep_SQ)"' + endif + + ifdef HAVE_NS_GET_EXECUTABLE_PATH + BASIC_CFLAGS += -DHAVE_NS_GET_EXECUTABLE_PATH + endif + + ifdef HAVE_ZOS_GET_EXECUTABLE_PATH + BASIC_CFLAGS += -DHAVE_ZOS_GET_EXECUTABLE_PATH + endif + + ifdef HAVE_WPGMPTR + BASIC_CFLAGS += -DHAVE_WPGMPTR + endif -ifdef HAVE_WPGMPTR - BASIC_CFLAGS += -DHAVE_WPGMPTR endif ifdef FILENO_IS_A_MACRO From patchwork Sat Mar 15 02:46:59 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ramsay Jones X-Patchwork-Id: 14017693 Received: from avasout-peh-003.plus.net (avasout-peh-003.plus.net [212.159.14.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 3E79D2EB1D for ; Sat, 15 Mar 2025 02:50:02 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=212.159.14.19 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1742007003; cv=none; b=ACoU1ztFJHYeF5VBr29rbfqoFY/4Us1oAEHt5k4PIW7MqISZJN9cWXUD0cO5EMCaci28JEoRpK3SRhMcFqHaKBGtNwymgno437P+7+Ayb55GSl0zn/TRyeqiwhOf03r5rO6J4qa5sAtlc4wr98jxtNI11uCVekHMbDtlBnjV9+0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1742007003; c=relaxed/simple; bh=C7N/7Ep2z135/T81IdzzPxbS9hppsV3QU1710HrzbHw=; h=Message-ID:Date:MIME-Version:To:Cc:From:Subject:Content-Type; b=q0iRmJ3YVoogXZ7QJ1lfa8kKeARzPmkwOqk8434mXmnHviCCjrHjTVakH2Cexgg/m+dYWdWAAnkOYoCplCbaPtbNrbfMheNys2j0TCFcoJmHTUAtr4B8KUfwnow3p8FjfD1BCGiEkAOeCznzevuNxmboSihA4nVyilcvcQT9QTI= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=ramsayjones.plus.com; spf=none smtp.mailfrom=ramsayjones.plus.com; dkim=pass (2048-bit key) header.d=plus.com header.i=@plus.com header.b=ig55ckMi; arc=none smtp.client-ip=212.159.14.19 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=ramsayjones.plus.com Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=ramsayjones.plus.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=plus.com header.i=@plus.com header.b="ig55ckMi" Received: from [10.0.2.15] ([80.189.83.109]) by smtp with ESMTPA id tHYBtGMqwvxWAtHYCteQBm; Sat, 15 Mar 2025 02:47:01 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=plus.com; s=042019; t=1742006821; bh=cdrXfiXioY/k3f2g4Z+1JY76gspSvv3ITSBjVjd6N2E=; h=Date:To:Cc:From:Subject; b=ig55ckMi3ibkeoBGE9Uoyea2+Os+yXwexqsh/c/BbncI+dlG4WqJ5NvpvJPyxMs1S zU9mzelAtj4mtPdRDeOm5RTj0Bvi6SfANCHkUn3xvAPhY9eskXRaU233ObxA9ragXL V8sTUh5DdUQrQifxMXzCWtMlwB5tx3JH3vADhCrq+ruez/mrjNdvTR49pmcHZWjZmH wK3Wkz8fKtqnONoAZENTpKV0/uM2Ys8+4nDlODpBsd6GHoR2vTUDsdw73iT4KcZMwK 9W7exoHklf49bpbRX7Xx4NeKqSY6kHQLylVRdA49jAKlwvYKnKMEooFT+RHWHhnpMq YUdFFQ6m1e0Sw== X-Clacks-Overhead: "GNU Terry Pratchett" X-CM-Score: 0.00 X-CNFS-Analysis: v=2.4 cv=QbDFvdbv c=1 sm=1 tr=0 ts=67d4ea25 a=oM5NSl/Bl4BpjFr0C8iQlQ==:117 a=oM5NSl/Bl4BpjFr0C8iQlQ==:17 a=IkcTkHD0fZMA:10 a=EBOSESyhAAAA:8 a=6qvqOJHbk8VEAzwtmn4A:9 a=QEXdDO2ut3YA:10 a=yJM6EZoI5SlJf8ks9Ge_:22 X-AUTH: ramsayjones@:2500 Message-ID: <5d0112ae-98b5-46f2-91ad-35ed11358c3e@ramsayjones.plus.com> Date: Sat, 15 Mar 2025 02:46:59 +0000 Precedence: bulk X-Mailing-List: git@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Content-Language: en-US To: Junio C Hamano Cc: GIT Mailing-list , Patrick Steinhardt , Adam Dinwoodie From: Ramsay Jones Subject: [PATCH 03/12] meson.build: only set build variables for non-default values X-CMAE-Envelope: MS4xfMnjGdm/KRrOik3/vBy/auKeE422hOLXaafi3zKJuyUM6cQy2+npi9L8dR+8WFMSN4xToxSAl8WcyphKreVUXizzhSCZKWQ6pkgDhI5zzku9SmGfJ/Qt FsDVgIxBh2T6UJDQIAfgK32wtuTFJ64JsDqNj0zIl3Puu+OiCkm3+nvm6TN056EYxxcaXRT7XxqjVF977l4DmP74PPqqi24Tlj0= Some preprocessor -Defines have defaults sets in the source code when they have not been provided to the C compiler. In this case, there is no need to pass them on the command-line, unless the build requires a non-standard value. The build variables for DEFAULT_EDITOR, DEFAULT_HELP_FORMAT along with DEFAULT_PAGER have appropriate defaults ('vi', 'man' and 'less') set in the code. Add the preprocessor -Defines to the 'libgit_c_args' only if the values set with the corresponding 'options' are different to these standard values. Signed-off-by: Ramsay Jones --- meson.build | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/meson.build b/meson.build index 88a29fd043..24a4c2e3c2 100644 --- a/meson.build +++ b/meson.build @@ -693,10 +693,7 @@ endif # These variables are used for building libgit.a. libgit_c_args = [ '-DBINDIR="' + get_option('bindir') + '"', - '-DDEFAULT_EDITOR="' + get_option('default_editor') + '"', '-DDEFAULT_GIT_TEMPLATE_DIR="' + get_option('datadir') / 'git-core/templates' + '"', - '-DDEFAULT_HELP_FORMAT="' + get_option('default_help_format') + '"', - '-DDEFAULT_PAGER="' + get_option('default_pager') + '"', '-DETC_GITATTRIBUTES="' + get_option('gitattributes') + '"', '-DETC_GITCONFIG="' + get_option('gitconfig') + '"', '-DFALLBACK_RUNTIME_PREFIX="' + get_option('prefix') + '"', @@ -708,6 +705,16 @@ libgit_c_args = [ '-DPAGER_ENV="' + get_option('pager_environment') + '"', '-DSHELL_PATH="' + fs.as_posix(shell.full_path()) + '"', ] +if get_option('default_editor') != 'vi' + libgit_c_args += '-DDEFAULT_EDITOR="' + get_option('default_editor') + '"' +endif +if get_option('default_pager') != 'less' + libgit_c_args += '-DDEFAULT_PAGER="' + get_option('default_pager') + '"' +endif +if get_option('default_help_format') != 'man' + libgit_c_args += '-DDEFAULT_HELP_FORMAT="' + get_option('default_help_format') + '"' +endif + libgit_include_directories = [ '.' ] libgit_dependencies = [ ] From patchwork Sat Mar 15 02:47:14 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ramsay Jones X-Patchwork-Id: 14017694 Received: from avasout-peh-003.plus.net (avasout-peh-003.plus.net [212.159.14.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 3EA35F9E8 for ; Sat, 15 Mar 2025 02:50:16 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=212.159.14.19 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1742007018; cv=none; b=INDLk2ktvGLPHFzsHhqXYY6cMFJja3O8wrVVrhRRHQlBpHsr+l3BF3irtp8oV6zEPr4rzvk7NgRqZzhqFyOcElUY7kNtwt7UIzbtB3EjHHd7nSr1+s047DVn3XEmqB/aE8xDfT0aMVFXxcMLbUZjBHTJDA2UZSE3Ve5eb+3Xl58= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1742007018; c=relaxed/simple; bh=rwk4RMpBukACJ4FMA8mh3F9GyzerP/fqoWEIWHpI8/w=; h=Message-ID:Date:MIME-Version:To:Cc:From:Subject:Content-Type; b=izmzkR3dZF17MD+VOVIhI76ZI6rHlnDrCxd2KBAWw7wS5OjpH7mxr5ZS/vuUJx3mB1VHGszkdnYXPnAcG/bmx351yEFgFrpu2Tas6sWOgsr1lpKOHcVXBmStd0ExdTp2ExAJRlbyMgLQld2Qpo0I7NDaVqS1iEJv0gWoUjafqlE= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=ramsayjones.plus.com; spf=none smtp.mailfrom=ramsayjones.plus.com; dkim=pass (2048-bit key) header.d=plus.com header.i=@plus.com header.b=AzQsF72q; arc=none smtp.client-ip=212.159.14.19 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=ramsayjones.plus.com Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=ramsayjones.plus.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=plus.com header.i=@plus.com header.b="AzQsF72q" Received: from [10.0.2.15] ([80.189.83.109]) by smtp with ESMTPA id tHYQtGMsLvxWAtHYRteQBq; Sat, 15 Mar 2025 02:47:16 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=plus.com; s=042019; t=1742006836; bh=cvvI1RTQ0Bci1xzTnR1YWCIhBbWNU3wRMrNfr2qUpvQ=; h=Date:To:Cc:From:Subject; b=AzQsF72qi/VtL++y5YWb9hS+x0LdvAGCJZkpGbnPKt1x0AG9OlekmqvNyTqrXVDcl yikoSEwcQwSGEh5O1whnRMYvzvuSHBjJ7Tu4nauyfj8Obb/7DdqJKMtVFBb9I1BQwW +i8oyUpS9zYDHAjBEjM0HWmyO1Vxq+Of9O7JF2CMhvcC1MNdyYRGFIodMsHfV/kcMc pFF8NjJSyyEe9yp//O3L4/X/jf/ZarbRVjBCaWmhHlc/8zeogjqDimSB1IPrVZG4Ud d0XqChDk3q9D58GmXePjsXDdPPJPkW7Pau05KnM9tHoI8LgAZvzBSmQzVgZ/3ePO3z py93W1nQa7BBQ== X-Clacks-Overhead: "GNU Terry Pratchett" X-CM-Score: 0.00 X-CNFS-Analysis: v=2.4 cv=QbDFvdbv c=1 sm=1 tr=0 ts=67d4ea34 a=oM5NSl/Bl4BpjFr0C8iQlQ==:117 a=oM5NSl/Bl4BpjFr0C8iQlQ==:17 a=IkcTkHD0fZMA:10 a=EBOSESyhAAAA:8 a=MwKkaEpK1oP1WH10rxgA:9 a=QEXdDO2ut3YA:10 a=yJM6EZoI5SlJf8ks9Ge_:22 X-AUTH: ramsayjones@:2500 Message-ID: Date: Sat, 15 Mar 2025 02:47:14 +0000 Precedence: bulk X-Mailing-List: git@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Content-Language: en-US To: Junio C Hamano Cc: GIT Mailing-list , Patrick Steinhardt , Adam Dinwoodie From: Ramsay Jones Subject: [PATCH 04/12] Makefile: remove NEEDS_LIBRT build variable X-CMAE-Envelope: MS4xfO+PQvxmE5aQ/k0C0hVg2d8r2CN3hxMetS8IPMXWe+Iyee9YGOQYmOH8RtTdZja4Rx/UT3Fi/i/KRxOOR1wSV5PfBxmXUSK6fUWsoI3XizG7fUEhggff wJJUhRKGxQ+ZlZJgAJfYRDAPR8OzWT1nL7znc/Vdv0mDJvW8ZIlaSiTGd/acmtfxSOpZxArFH2Ca72nAQSQAonhhgnWBWyqHDFk= Commit d19e3a5b21 ("Makefile: add NEEDS_LIBRT to optionally link with librt", 2016-07-07) introduced the NEEDS_LIBRT build variable to disassociate the HAVE_CLOCK_GETTIME variable with the unconditional linking of the librt library. At one time, the clock_gettime() function was not available as part of the libc library and (on some unix systems) required linking with librt. Commit 52fcec75ce ("config.mak.uname: define NEEDS_LIBRT under Linux, for now", 2016-07-10) set the NEEDS_LIBRT variable in the Linux section of the config.mak.uname file, since Debian 7 (wheezy) was one of the few remaining distributions, with glibc 2.13, that required linking with librt for clock_gettime(). Note that from glibc version 2.17, this is no longer necessary. Note that Debian 7.0 was released on May 4th, 2013 and benefited from long term support until May 2018 when it went end-of-life. Since that time, Linux distributions use a more up-to-date library, for example: Distribution version end of support Debian 8 2.19 30th June 2020 RHEL 8 2.28 31st May 2024 * Ubuntu 16.04 2.23 30th Apr 2021 * paid 'Maintenance support' ends 31st May 2029 Since it is no longer required, remove NEEDS_LIBRT from the Makefile and config.mak.uname. Signed-off-by: Ramsay Jones --- Makefile | 7 ------- config.mak.uname | 2 -- 2 files changed, 9 deletions(-) diff --git a/Makefile b/Makefile index 818dde32a9..8fa4d2664e 100644 --- a/Makefile +++ b/Makefile @@ -340,9 +340,6 @@ include shared.mak # # Define HAVE_SYNC_FILE_RANGE if your platform has sync_file_range. # -# Define NEEDS_LIBRT if your platform requires linking with librt (glibc version -# before 2.17) for clock_gettime and CLOCK_MONOTONIC. -# # Define HAVE_BSD_SYSCTL if your platform has a BSD-compatible sysctl function. # # Define HAVE_GETDELIM if your system has the getdelim() function. @@ -2171,10 +2168,6 @@ ifdef HAVE_SYNC_FILE_RANGE BASIC_CFLAGS += -DHAVE_SYNC_FILE_RANGE endif -ifdef NEEDS_LIBRT - EXTLIBS += -lrt -endif - ifdef HAVE_BSD_SYSCTL BASIC_CFLAGS += -DHAVE_BSD_SYSCTL endif diff --git a/config.mak.uname b/config.mak.uname index b12d4e168a..88007c4f13 100644 --- a/config.mak.uname +++ b/config.mak.uname @@ -54,8 +54,6 @@ ifeq ($(uname_S),Linux) HAVE_DEV_TTY = YesPlease HAVE_CLOCK_GETTIME = YesPlease HAVE_CLOCK_MONOTONIC = YesPlease - # -lrt is needed for clock_gettime on glibc <= 2.16 - NEEDS_LIBRT = YesPlease HAVE_SYNC_FILE_RANGE = YesPlease HAVE_GETDELIM = YesPlease FREAD_READS_DIRECTORIES = UnfortunatelyYes From patchwork Sat Mar 15 02:47:27 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ramsay Jones X-Patchwork-Id: 14017695 Received: from avasout-peh-003.plus.net (avasout-peh-003.plus.net [212.159.14.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 3BB552EB1D for ; Sat, 15 Mar 2025 02:50:30 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=212.159.14.19 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1742007032; cv=none; b=HE6U6G/cjn/gmZN/uI2Z2JjljST1d/svLu9aaSpre1OOnSV9XWBO5Noj2D3hs59Af0v4/Lh6PUk/MAxVmofCI4uRvDRH1WtdL48qaSKRiAf/5UirW4W5RRm2QDvBGkfU1BjWloN/wytiOuihNKKj7UuAQkEFLSgp19Tp8vieoXM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1742007032; c=relaxed/simple; bh=E8dCf67V3hnwc/foh1Iax6n91fE44I5imhFgZ3YQxSw=; h=Message-ID:Date:MIME-Version:To:Cc:From:Subject:Content-Type; b=eTFzNM/cjQUPnqDdwOtHsWcep9Lb+c0TqslnhmV1Nv5y3oT+HtWTW3sBp3yz+b9He+ryXr7Yw129/6zGRD+UDwVX+WUiyEZvdaIB/qKagX4D+thgIKmoBeKfdC1MPuyQ0yTW1sKHivNKtgo+2fvbyAHlKkSN1jFKNnSTBRA8hMY= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=ramsayjones.plus.com; spf=none smtp.mailfrom=ramsayjones.plus.com; dkim=pass (2048-bit key) header.d=plus.com header.i=@plus.com header.b=joRTqBMm; arc=none smtp.client-ip=212.159.14.19 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=ramsayjones.plus.com Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=ramsayjones.plus.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=plus.com header.i=@plus.com header.b="joRTqBMm" Received: from [10.0.2.15] ([80.189.83.109]) by smtp with ESMTPA id tHYdtGMtUvxWAtHYfteQBu; Sat, 15 Mar 2025 02:47:29 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=plus.com; s=042019; t=1742006849; bh=8pINdvtOrZejwqEDmdH/CJOm6n8/6gghfHbuxzfCmto=; h=Date:To:Cc:From:Subject; b=joRTqBMmJIBzTz3PuwTEFHmEKmEdpNpX5Xtzhnn0p7jqsSEteqQ8pvCcuVzshYClV qNM6c1x1YyWDxxPC52m6WnWL6hUNY1JuDnIFvfsz97EoUnNxbxaAQKQpF/N140OCJJ VDrutQzO4kt3YohV2c4yRqedHcVxekIwUQe+bISCR7jY9VD9HBv6xSwDYj3cVduTkL TWDEWaqxXJSru67AH9nYNqyU+mPy8MedcVvsx+UJu4Lhqgn978GUtmRCgUCndu3RVM VAGyvZ0KNiNogupkELm/movqZSC1fc1BbMFeV0F+akyKG6+yeoqE6VCqI4SiT3aEiN sl9gGW0J0x8Mg== X-Clacks-Overhead: "GNU Terry Pratchett" X-CM-Score: 0.00 X-CNFS-Analysis: v=2.4 cv=QbDFvdbv c=1 sm=1 tr=0 ts=67d4ea41 a=oM5NSl/Bl4BpjFr0C8iQlQ==:117 a=oM5NSl/Bl4BpjFr0C8iQlQ==:17 a=IkcTkHD0fZMA:10 a=EBOSESyhAAAA:8 a=fVsHCq2i0Zt6NT_ZDjwA:9 a=QEXdDO2ut3YA:10 a=yJM6EZoI5SlJf8ks9Ge_:22 X-AUTH: ramsayjones@:2500 Message-ID: Date: Sat, 15 Mar 2025 02:47:27 +0000 Precedence: bulk X-Mailing-List: git@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Content-Language: en-US To: Junio C Hamano Cc: GIT Mailing-list , Patrick Steinhardt , Adam Dinwoodie From: Ramsay Jones Subject: [PATCH 05/12] config.mak.uname: add a note about NO_STRLCPY for Linux X-CMAE-Envelope: MS4xfBBjrRIhqpJ1xoh+90xcIkO0opkCNhLoHeALsUqrsF3oOW7QRKyYWR2L0gMuTZQBaZ8PLA8deeHCRzx5eL/N8x0bBiilwaLCEjX3FPuudkXbWEqZcMB4 LLFaWbZg3kfbzp6SpMzpfEwWvNm/JexvFB/lxLG4B2s+j0Zxtny+nqj0xnZC5mehNTvzvLrGeGF9Y2J/lI/UmJ2MHmPKcuDDjPc= Commit 817151e61a ("Rename safe_strncpy() to strlcpy().", 2006-06-24) added the NO_STRLCPY make variable to allow the conditional use of the gitstrlcpy() compat function on those platforms which didn't provide the 'standard' strlcpy() function. Recently, in the summer of 2023, the strlcpy() and strlcat() functions were added to the glibc library (v2.38), so some of the more up-to-date Linux distributions no longer need to set NO_STRLCPY. For example, both Ubuntu 24.04 LTS and RHEL 10 beta have glibc v2.39. However, several distributions, which are still within their support window, have an earlier version and must still use the 'compat' version of strlcpy(). If the meson or autoconf build systems are used on newer platforms, then they will be configured to to use strlcpy() from glibc, whereas the make build will always choose the 'compat' function instead. Add a note to the config.mak.uname file, in the Linux section, to prompt make users to override NO_STRLCPY in the config.mak file, if appropriate. Signed-off-by: Ramsay Jones --- config.mak.uname | 1 + 1 file changed, 1 insertion(+) diff --git a/config.mak.uname b/config.mak.uname index 88007c4f13..ae6ba15586 100644 --- a/config.mak.uname +++ b/config.mak.uname @@ -48,6 +48,7 @@ ifeq ($(uname_S),OSF1) endif ifeq ($(uname_S),Linux) HAVE_ALLOCA_H = YesPlease + # override in config.mak if you have glibc >= 2.38 NO_STRLCPY = YesPlease HAVE_PATHS_H = YesPlease LIBC_CONTAINS_LIBINTL = YesPlease From patchwork Sat Mar 15 02:47:44 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ramsay Jones X-Patchwork-Id: 14017683 Received: from avasout-peh-003.plus.net (avasout-peh-003.plus.net [212.159.14.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 110892EB1D for ; Sat, 15 Mar 2025 02:47:48 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=212.159.14.19 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1742006872; cv=none; b=cgP4tcO6k/bUzinOoSiqtkJm2+DX6UC4f6bBOT7MtIwoLKdRBRGgqF98Xb3hb/vE7RYtMwxgh/EdK0cGBcgrxQs8gzLbjKhD9JDVPAxpqeJH3v+uycBeDrzdt1nc5gseZV2StK5KxsL7ilYh5el6TZQpWh69m/+MZ1zgS4yx8po= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1742006872; c=relaxed/simple; bh=n5pszrZJLmuFE6ReA219ojxPxVsq4Bi6hYP8rvl07ws=; h=Message-ID:Date:MIME-Version:To:Cc:From:Subject:Content-Type; b=O3LG+geE+SANnWTv07NpZaTFkwyC4Doda6XOnsLj7D6UvmFztJzrHhgqLjfdhz7IwmylJlwYIrNmrzp+M7+8l1dagf9S9OGVM8z4wyJCQdU6nMwa7qaWsj8bZJhiVzp3Xbvpv0xRtM4JakJ01OU+Xee+DnFXt+S0OTZc2HjUSD4= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=ramsayjones.plus.com; spf=none smtp.mailfrom=ramsayjones.plus.com; dkim=pass (2048-bit key) header.d=plus.com header.i=@plus.com header.b=nEwrJkVx; arc=none smtp.client-ip=212.159.14.19 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=ramsayjones.plus.com Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=ramsayjones.plus.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=plus.com header.i=@plus.com header.b="nEwrJkVx" Received: from [10.0.2.15] ([80.189.83.109]) by smtp with ESMTPA id tHYvtGMuevxWAtHYwteQC0; Sat, 15 Mar 2025 02:47:46 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=plus.com; s=042019; t=1742006866; bh=7Ip2jX5ojmIyIRj1sjKJXheJqs0bI/Ab4S1YGMLyXw0=; h=Date:To:Cc:From:Subject; b=nEwrJkVxNzjoxUl5d+ACwHbJnRjkNiamnyWxPnB/SXlJsnwkIO3+1WQQ6EH5FuyDy LqLBPpVvEjfw1Ex/kXaKGfK5Ke7akKX9sZURZcHUvdO+zzwMvOvW/QAnzFztfeB4cN LGd2J2bagJzzI+mprzFCipF5RI60H2jhIrV4K02zEKFqZaUUSZy2kaS7UKIPhaGR4m I9bNZ4082g4jg8X2MRcHOhg3yRLVUZwDPUi4MpGIlQ5/kXsvKMUImpOTNm7b0yG2l9 JLVyuixeKA/v/c3QKJAR2N9716GJC0wIpAc8yTHWuJl/7gRUrH6DuIXPsh6gsKxvpa sAcRJesyJd6Bg== X-Clacks-Overhead: "GNU Terry Pratchett" X-CM-Score: 0.00 X-CNFS-Analysis: v=2.4 cv=QbDFvdbv c=1 sm=1 tr=0 ts=67d4ea52 a=oM5NSl/Bl4BpjFr0C8iQlQ==:117 a=oM5NSl/Bl4BpjFr0C8iQlQ==:17 a=IkcTkHD0fZMA:10 a=EBOSESyhAAAA:8 a=-MV70WsdUszZJaylRL4A:9 a=QEXdDO2ut3YA:10 a=yJM6EZoI5SlJf8ks9Ge_:22 X-AUTH: ramsayjones@:2500 Message-ID: Date: Sat, 15 Mar 2025 02:47:44 +0000 Precedence: bulk X-Mailing-List: git@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Content-Language: en-US To: Junio C Hamano Cc: GIT Mailing-list , Patrick Steinhardt , Adam Dinwoodie From: Ramsay Jones Subject: [PATCH 06/12] config.mak.uname: only set NO_REGEX on cygwin for v1.7 X-CMAE-Envelope: MS4xfBxUBVwGjxqdGaAJjrAJfpyhlFmpfIWdZyQHvlgzo/nGqeNjMZ4EvUtO/ZBNJqG4y3bnZ5O5s+zdSQvQeEWgRbw7l8/as8/Ki94lCDfDrI2sfWVZfjTE kFLujacQ3P9ppwacy2K8Bywocdn6QQdUyFRLgV5q/Lmd/5xLMjs3lZA8V3Z9lVVBFME7fQWZpLV3VlMmvh+H1Kw6lFKXeMXKBNk= Commit 92f63d2b05 ("Cygwin 1.7 needs compat/regex", 2013-07-19) set the NO_REGEX build variable because the platform regex library failed some of the tests (t4018 and t4034), which passed just fine with the compat library. After some time (may a year or two), the platform library had been updated (with an import from FreeBSD, I believe) and now passed the full test-suite. This would be about the time of the v1.7 -> v2.0 transition in 2015. I had a patch ready to send, but just didn't get around to submitting it to the list. At some point in the interim, the official cygwin git package used the autoconf build system, which sets the NO_REGEX variable to use the platform regex library functions. The new meson build system does likewise. In order to produce the same NO_REGEX configuration from autoconf, meson and make, modify config.mak.uname to only set NO_REGEX for cygwin v1.7. Signed-off-by: Ramsay Jones --- config.mak.uname | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/config.mak.uname b/config.mak.uname index ae6ba15586..b6adce0bc4 100644 --- a/config.mak.uname +++ b/config.mak.uname @@ -245,7 +245,9 @@ ifeq ($(uname_O),Cygwin) # Try commenting this out if you suspect MMAP is more efficient NO_MMAP = YesPlease else - NO_REGEX = UnfortunatelyYes + ifeq ($(shell expr "$(uname_R)" : '1\.7\.'),4) + NO_REGEX = UnfortunatelyYes + endif endif HAVE_DEV_TTY = YesPlease HAVE_ALLOCA_H = YesPlease From patchwork Sat Mar 15 02:47:57 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ramsay Jones X-Patchwork-Id: 14017684 Received: from avasout-peh-003.plus.net (avasout-peh-003.plus.net [212.159.14.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 9DD4C2E3392 for ; Sat, 15 Mar 2025 02:47:59 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=212.159.14.19 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1742006882; cv=none; b=giSOL9t2VzHwCjT/pv6PgEPGDIKH9aEM7cb7IsrY89zZXTi+kcnUWWZK76x0Ut+a9rew5fZsXXt463wgesW+RJej/efqOHIFdGpbk/m/uKRK9GfNRtIah/E69OWI5eGWPTsYYB1mzgnK/G9zDl0RHP3X6b0zl7pqe/1AJPBW/wA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1742006882; c=relaxed/simple; bh=H6dtQQkW3gL2rwJSBnZ+4RpeXSQEwYskXYghF1PWuyg=; h=Message-ID:Date:MIME-Version:To:Cc:From:Subject:Content-Type; b=kqg9CJt4eXUmDoWtSVRF9hpGi4tUy2TMSDJRcPnRBbYuuHV7BZytWYRrCrzRrXMaxE5hNANr2SUjvhRaAjt2EquAqqaDKztVhSSrs68chfuPAiXyiFdBM5FuosGZkYz/3kIQaprREjwItdIG5Z2ThzFOxeDiwVYKfvn98EsEWmA= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=ramsayjones.plus.com; spf=none smtp.mailfrom=ramsayjones.plus.com; dkim=pass (2048-bit key) header.d=plus.com header.i=@plus.com header.b=F5vSf7Nn; arc=none smtp.client-ip=212.159.14.19 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=ramsayjones.plus.com Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=ramsayjones.plus.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=plus.com header.i=@plus.com header.b="F5vSf7Nn" Received: from [10.0.2.15] ([80.189.83.109]) by smtp with ESMTPA id tHZ7tGMvvvxWAtHZ9teQC5; Sat, 15 Mar 2025 02:47:59 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=plus.com; s=042019; t=1742006879; bh=NaDym7njn1N77KB9O4fkFJyowFgvj5EL6ZEWxKSQZYA=; h=Date:To:Cc:From:Subject; b=F5vSf7NnH0xGlW+FvBKd+uTNNTJ8ZpNr4vvlV6xhkMxq+a6WTag7vBt6arCANpkAt QqD9k/CxP+GWqGSE5SdbZceWeWxKxcI9N3/EUFUZxKDM4sn1zB/ul5Qth91AT0hm4e 603UJdcfuTjIjdL6gJW1VvSsC/09W2WGXR5mjicZq4PQUid8YX4y0/BSUlOpFsJ0OU UyAboMX0M3wO9Xn2xEjGj50+fRxYM505srH1BknPE5hdKL5tLzAww4xZgtLr/q+nUu 5N9/LC0LpZlV68Ndi05OYsLoUJ2nC8vmKLA3Zvodkyq7PrRvkzO6KbDsNGBlFOiFQD qecJ/W2XndP9g== X-Clacks-Overhead: "GNU Terry Pratchett" X-CM-Score: 0.00 X-CNFS-Analysis: v=2.4 cv=QbDFvdbv c=1 sm=1 tr=0 ts=67d4ea5f a=oM5NSl/Bl4BpjFr0C8iQlQ==:117 a=oM5NSl/Bl4BpjFr0C8iQlQ==:17 a=IkcTkHD0fZMA:10 a=EBOSESyhAAAA:8 a=5XmO7F8k-BOE0I3eWfsA:9 a=QEXdDO2ut3YA:10 a=yJM6EZoI5SlJf8ks9Ge_:22 X-AUTH: ramsayjones@:2500 Message-ID: Date: Sat, 15 Mar 2025 02:47:57 +0000 Precedence: bulk X-Mailing-List: git@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Content-Language: en-US To: Junio C Hamano Cc: GIT Mailing-list , Patrick Steinhardt , Adam Dinwoodie From: Ramsay Jones Subject: [PATCH 07/12] config.mak.uname: add HAVE_GETDELIM to the cygwin section X-CMAE-Envelope: MS4xfD95vY5QFt3JcT8HhhNGmdubeQ5W8n2YpSDHaJbOB2WAfqard9ZWoVnCoRqdQjkk8MufYh03P0OB229yw1mmV4pCbEoTTaLlJ3mQUc52GHkx/sI8lD8n pWrTTFXmi9ydm/Amt6Yb5HlwZT1suQoxXUSuotOASW2QxmBq2pherzyVsTgmmBKuM1ECbapNLv5totVNR39yW1TgIQes4nOT5UE= Cygwin has provided the getdelim() function as far back as (at least) 2011. The autoconf and meson builds enable the use of this symbol. In order to have the same configuration for autoconf, meson and make, enable the HAVE_GETDELIM build variable in the cygwin section of the config.mak.uname file. Signed-off-by: Ramsay Jones --- config.mak.uname | 1 + 1 file changed, 1 insertion(+) diff --git a/config.mak.uname b/config.mak.uname index b6adce0bc4..1b3ba8a341 100644 --- a/config.mak.uname +++ b/config.mak.uname @@ -250,6 +250,7 @@ ifeq ($(uname_O),Cygwin) endif endif HAVE_DEV_TTY = YesPlease + HAVE_GETDELIM = YesPlease HAVE_ALLOCA_H = YesPlease NEEDS_LIBICONV = YesPlease NO_FAST_WORKING_DIRECTORY = UnfortunatelyYes From patchwork Sat Mar 15 02:48:25 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ramsay Jones X-Patchwork-Id: 14017685 Received: from avasout-peh-003.plus.net (avasout-peh-003.plus.net [212.159.14.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C4EC32E3392 for ; Sat, 15 Mar 2025 02:48:27 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=212.159.14.19 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1742006910; cv=none; b=Julsz96TUOi0ODURzlCRMvUNgr6hwaZ9cvfKKyzAd8yFRauRIdO11lm1DNluUjvJ2xUTAbwvxLAa1yw3ITf60WJQ5d1Uw+wGanCQvCoTjrJzBI6T5Uq3XQ6E7baAGC6etcLMDdxaggLiREWAznzbEJRf/Ig4rPEHVTXdHfgrqKg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1742006910; c=relaxed/simple; bh=/VGWRd7GxLYcAIQ9tIKiHz0eKtdVQbWvvXovB5wBGnk=; h=Message-ID:Date:MIME-Version:To:Cc:From:Subject:Content-Type; b=NRA7YPpp2W4CQeXftJyrtfjNKQy+wLADFRSWbBUcbUn8hXYItg+ZaBDjKfIbGt+AUXi4idbdP3dBGGi8+Ibi8XH4NoCK+oAD3odGKmXdxsQKzM5YYU6k5O+xT5lfdhvi9UOHn9UXdccNfwM9fuZbFpoGU17sVak8qZLLvHZWd5U= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=ramsayjones.plus.com; spf=none smtp.mailfrom=ramsayjones.plus.com; dkim=pass (2048-bit key) header.d=plus.com header.i=@plus.com header.b=YL5FJYRZ; arc=none smtp.client-ip=212.159.14.19 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=ramsayjones.plus.com Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=ramsayjones.plus.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=plus.com header.i=@plus.com header.b="YL5FJYRZ" Received: from [10.0.2.15] ([80.189.83.109]) by smtp with ESMTPA id tHZZtGMyKvxWAtHZbteQCF; Sat, 15 Mar 2025 02:48:27 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=plus.com; s=042019; t=1742006907; bh=w+ZjwXtxmmmBBDPM76O3MtXLt9ek9EMbUNMxEWdLyww=; h=Date:To:Cc:From:Subject; b=YL5FJYRZADmV6YirwG4HbstD+FbFCinIWsQ8UUz5Do56T3vzmILaWiTE2DchYdy8Q beNDkNJckBGjuHPZkt9Ngav8Zrv5ogiTxLMY4zT9if2BdfOxBSftc10Yq4Lq3vcIDF xFveW3jc006ACWZ4F6YyplrrHnCLlKXy98QIKM3TdPmTMop77vdRHpwh58waRtd7nB 7+GPmetizI8c7TgqqaaHfcrlKHVZ2yjkUz9aEBarum80vb8+2WAemgSQUaZYt3dI6l 5mnwntgkf9kN1c5pAcKDAhO6ZhVDGaYhI6Fu+AkFHxc7ejV5DUWtOsY5wENOAqCbyC mHTYZtsMSdHkg== X-Clacks-Overhead: "GNU Terry Pratchett" X-CM-Score: 0.00 X-CNFS-Analysis: v=2.4 cv=QbDFvdbv c=1 sm=1 tr=0 ts=67d4ea7b a=oM5NSl/Bl4BpjFr0C8iQlQ==:117 a=oM5NSl/Bl4BpjFr0C8iQlQ==:17 a=IkcTkHD0fZMA:10 a=EBOSESyhAAAA:8 a=eTvDwwv87Y-7DfItWLMA:9 a=QEXdDO2ut3YA:10 a=yJM6EZoI5SlJf8ks9Ge_:22 X-AUTH: ramsayjones@:2500 Message-ID: <73a5aeaf-6636-4f52-a6b8-3fb1f2c53fcd@ramsayjones.plus.com> Date: Sat, 15 Mar 2025 02:48:25 +0000 Precedence: bulk X-Mailing-List: git@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Content-Language: en-US To: Junio C Hamano Cc: GIT Mailing-list , Patrick Steinhardt , Adam Dinwoodie From: Ramsay Jones Subject: [PATCH 08/12] config.mak.uname: add clock_gettime() to the cygwin build X-CMAE-Envelope: MS4xfLFeG2j9DsfydzqsluIK7R0XiQfKkHhNpiypIfQxpnjs+3q1m4AxYcOpAs7ULXrIT4tsskMRm5b44JFpbbb7daTzjtcBGJ8upkNc7bxRalvV71wwpbPy 1YKdhs6EL/vPfPD+kWt0zKpYijACaW7fZMD2FAa7F69Nl9gmLJ9i0gLcsbI2bNS3TK5nOt67LC2PM7m4Bgo8ap6JFTQcILvIHQc= Cygwin supports the clock_gettime() function, along with the associated CLOCK_MONOTONIC preprocessor symbol. The autoconf and meson builds both enable the use of those symbols. In order to have the same configuration for the make builds, add the HAVE_CLOCK_GETTIME and HAVE_CLOCK_MONOTONIC build variables to the cygwin section of the config.mak.uname file. Signed-off-by: Ramsay Jones --- config.mak.uname | 2 ++ 1 file changed, 2 insertions(+) diff --git a/config.mak.uname b/config.mak.uname index 1b3ba8a341..942550fb9e 100644 --- a/config.mak.uname +++ b/config.mak.uname @@ -251,6 +251,8 @@ ifeq ($(uname_O),Cygwin) endif HAVE_DEV_TTY = YesPlease HAVE_GETDELIM = YesPlease + HAVE_CLOCK_GETTIME=YesPlease + HAVE_CLOCK_MONOTONIC=YesPlease HAVE_ALLOCA_H = YesPlease NEEDS_LIBICONV = YesPlease NO_FAST_WORKING_DIRECTORY = UnfortunatelyYes From patchwork Sat Mar 15 02:48:40 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ramsay Jones X-Patchwork-Id: 14017686 Received: from avasout-peh-003.plus.net (avasout-peh-003.plus.net [212.159.14.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id A32A8A32 for ; Sat, 15 Mar 2025 02:48:42 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=212.159.14.19 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1742006925; cv=none; b=QKY+1uopaxxDPFtjwbl4Zv9EvynXLRduJsoMQ9G/s/OI8lVkliI4Gz25bhJceeMdfDAS0JDIABfZBnpXnqOCNfp5AtT24HqD/0KWR/JBze1APKa8YoCzZ1zx5urEBvEKkcA06GWSqi+9sl+aTn/8BdXbVq7faWYbeUuzh+a2Dow= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1742006925; c=relaxed/simple; bh=O8MY7Z8mLP6Q2d0lEfUB7SjCtW3JMKs6reZVUFNz0+s=; h=Message-ID:Date:MIME-Version:To:Cc:From:Subject:Content-Type; b=d05l0SiLLR6vCa1r5nTHKjmf6AwV9i6YFntvdUXRiL3H1jXMepHLBYoKdZpturC//SlVXKkuL1qaf2IQs0jEAobpcfSSdMqxM3rzA+qN1OjxJs9whACyZ7fF4mmIbG69RARhyipUcsTZjtVzBJOoQFIiOg3TYD8WdSZds6AxKKY= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=ramsayjones.plus.com; spf=none smtp.mailfrom=ramsayjones.plus.com; dkim=pass (2048-bit key) header.d=plus.com header.i=@plus.com header.b=qnfqODBN; arc=none smtp.client-ip=212.159.14.19 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=ramsayjones.plus.com Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=ramsayjones.plus.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=plus.com header.i=@plus.com header.b="qnfqODBN" Received: from [10.0.2.15] ([80.189.83.109]) by smtp with ESMTPA id tHZotGMzbvxWAtHZpteQCK; Sat, 15 Mar 2025 02:48:42 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=plus.com; s=042019; t=1742006922; bh=LVw2WLpMjAd/rb5YNA6A2TOQloWflAtZi+iQxAH72/o=; h=Date:To:Cc:From:Subject; b=qnfqODBNog6GZdUChip1xG+IlGClDpgoCCbTqUiAkkwy3jG2W5osDSh4dhNH1s4ve Ks7lk6hANpJ5yvPp8MlzPYPbOPvwOs99DLmqXlR2z5p2baMigByee1nIoRZpK58OKV rWlnjv6u+NctjAPmhkk2fmiFyWFpkWEoy5P3KpRKdi4SLOrLvBubb9T0LbWiybDfGM 3brLQ0wGHGFAmETTM4p8INUOWCoKd7D9lGzdMdusHecv5h3AS1CuC62k1KCc8m3RJu WzP0ztn1yAbDwW6b1cfFqEzNgDzmDU50B5g0cepCMjAiAVzyC0mjksH/zgvNjvkWgI MCohvNLWX5uZg== X-Clacks-Overhead: "GNU Terry Pratchett" X-CM-Score: 0.00 X-CNFS-Analysis: v=2.4 cv=QbDFvdbv c=1 sm=1 tr=0 ts=67d4ea8a a=oM5NSl/Bl4BpjFr0C8iQlQ==:117 a=oM5NSl/Bl4BpjFr0C8iQlQ==:17 a=IkcTkHD0fZMA:10 a=EBOSESyhAAAA:8 a=mCKABES6tY-doaLBvqoA:9 a=QEXdDO2ut3YA:10 a=yJM6EZoI5SlJf8ks9Ge_:22 X-AUTH: ramsayjones@:2500 Message-ID: <84b41b4b-00fb-4bc9-83ab-df1911c81a8d@ramsayjones.plus.com> Date: Sat, 15 Mar 2025 02:48:40 +0000 Precedence: bulk X-Mailing-List: git@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Content-Language: en-US To: Junio C Hamano Cc: GIT Mailing-list , Patrick Steinhardt , Adam Dinwoodie From: Ramsay Jones Subject: [PATCH 09/12] builtin/gc.c: correct RAM calculation when using sysinfo X-CMAE-Envelope: MS4xfPuo8w80RFL/YDdmEL1L9TXM3xxp91Q1MC2yPVHJ0ji321g7yd5v4TutMJAqFp/IJUFUTt9RLSyegDSG4812sgE0bR5uAU5Rq/i5E+CauS3Sh56CHO5k bHuJdqFozF/lUhQBN4naQaKAESAAf5q6y/hhGBfv7L/rez1PKVhab8Mw0NkirrvONX/MvuoS3WdrQ9Ep4gjBZyuSqYLJoyNggmc= The man page for sysinfo(2) on Linux states that (from v2.3.48) the sizes of the memory and swap fields, of the returned structure, are given as multiples of 'mem_unit' bytes. In earlier versions (prior to v2.3.23 on i386 in particular), the 'mem_unit' field was not part of the structure, and all sizes were measured in bytes. The man page does not discuss the motivation for this change, but it is possible that the change was intended for the, relatively rare, 32-bit platform with more than 4GB of memory. The total_ram() function makes the assumption that the 'totalram' field of the 'struct sysinfo' is measured in bytes, or alternatively that the 'mem_unit' field is always equal to one. Having writen a program to call the sysinfo() function and print the structure fields, it seems that, on Linux x84_64 and i686 anyway, the 'mem_unit' field is indeed set to one (note that the 32-bit system had only 2GB ram). However, cygwin also has an sysinfo() implementation, which gives the following values: $ ./sysinfo uptime: 21381 loads: 0, 0, 0 total ram: 2074637 free ram: 843237 shared ram: 0 buffer ram: 0 total swap: 327680 free swap: 306932 procs: 15 total high: 0 free high: 0 mem_unit: 4096 total ram: 8497713152 $ [This laptop has 8GB ram, so a little bit seems to be missing. ;) ] Modify the total_ram() function to allow for the possibility that the memory size is not specified in bytes (ie 'mem_unit' is greater than one). Signed-off-by: Ramsay Jones --- builtin/gc.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/builtin/gc.c b/builtin/gc.c index 99431fd467..cdcf1dc6e7 100644 --- a/builtin/gc.c +++ b/builtin/gc.c @@ -373,8 +373,13 @@ static uint64_t total_ram(void) #if defined(HAVE_SYSINFO) struct sysinfo si; - if (!sysinfo(&si)) - return si.totalram; + if (!sysinfo(&si)) { + uint64_t total = si.totalram; + + if (si.mem_unit > 1) + total *= (uint64_t)si.mem_unit; + return total; + } #elif defined(HAVE_BSD_SYSCTL) && (defined(HW_MEMSIZE) || defined(HW_PHYSMEM)) int64_t physical_memory; int mib[2]; From patchwork Sat Mar 15 02:48:54 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ramsay Jones X-Patchwork-Id: 14017687 Received: from avasout-peh-003.plus.net (avasout-peh-003.plus.net [212.159.14.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 41C63F9E8 for ; Sat, 15 Mar 2025 02:48:56 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=212.159.14.19 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1742006938; cv=none; b=PPjA4DXzi5xte+migdZ8po1kgYVxHIXJMoSoDZiNtxH5j3K/m8U30n9BM3cbM3ZDYl0WOQTi/84e/kq/51AYaAIHWDAaygYuXLQq64gvpHTSPjT5me7c1cRtaV081yrVnnH48Cl+mcl0wbdBDl1SiXByJOzmdgFvxEr/6737XTY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1742006938; c=relaxed/simple; bh=5oCpXrNwQE/F1s0fYdugcuHjjdlsUH8hlFtVY732XAw=; h=Message-ID:Date:MIME-Version:To:Cc:From:Subject:Content-Type; b=LJVBC7UKHdDvRquZULvjF7RILyEMaStlRe+SbH3WsYZbWY0uvQyOZu2q0/tePJtT7Dh8e9l7UGhxIhoTr/1EgGNr9Mu3HBryCLOv8RyF4oWe99W3kFqtaHBCHUhwJ9FWIvSYd/v05P2Tef23io0+PkTIY5/qmNEDhdLU67sM9zI= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=ramsayjones.plus.com; spf=none smtp.mailfrom=ramsayjones.plus.com; dkim=pass (2048-bit key) header.d=plus.com header.i=@plus.com header.b=SStYe9gh; arc=none smtp.client-ip=212.159.14.19 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=ramsayjones.plus.com Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=ramsayjones.plus.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=plus.com header.i=@plus.com header.b="SStYe9gh" Received: from [10.0.2.15] ([80.189.83.109]) by smtp with ESMTPA id tHa2tGN0jvxWAtHa3teQCP; Sat, 15 Mar 2025 02:48:55 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=plus.com; s=042019; t=1742006935; bh=S1WoaTkJIgo0thKCJsURAR5c8nT8Bk170pV6YSTBVEs=; h=Date:To:Cc:From:Subject; b=SStYe9ghH9YeQGEd6ZxSqi0HIAAge+H+uWyGGECtlt03Q4I/WnzjUjzFiwC3Embat 2X1FGUf+JhimJpDgX5ZssRZE7F9hlrXmfvMvSnf5M5fJw6mFtMgIZA8vmNdjSngHKR lg5Ujzv/HNf8LLoj8IwQEQLjPCmyf65P9Xoj56fCKBKB74BYp+TRKaWLQTzBSECfIz Zs8zoqSxC1B/TF3gF8+sHLd08aHGwzyL39KAvdC1+NDY27+eg4t3e/uAYnTp12s1Vk /gEfJH18rFZYLtD8J27C7XJJHgnLqEG0IlCOnIfQGCz1Lx1xeN05XvrhZk6+YV6n6V /l8GSKHdvdLuA== X-Clacks-Overhead: "GNU Terry Pratchett" X-CM-Score: 0.00 X-CNFS-Analysis: v=2.4 cv=QbDFvdbv c=1 sm=1 tr=0 ts=67d4ea97 a=oM5NSl/Bl4BpjFr0C8iQlQ==:117 a=oM5NSl/Bl4BpjFr0C8iQlQ==:17 a=IkcTkHD0fZMA:10 a=EBOSESyhAAAA:8 a=BBq10iSe0tsV5BCVkB8A:9 a=QEXdDO2ut3YA:10 a=yJM6EZoI5SlJf8ks9Ge_:22 X-AUTH: ramsayjones@:2500 Message-ID: <13072bf7-c710-47e1-9996-f886e9029f02@ramsayjones.plus.com> Date: Sat, 15 Mar 2025 02:48:54 +0000 Precedence: bulk X-Mailing-List: git@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Content-Language: en-US To: Junio C Hamano Cc: GIT Mailing-list , Patrick Steinhardt , Adam Dinwoodie From: Ramsay Jones Subject: [PATCH 10/12] config.mak.uname: add sysinfo() configuration for cygwin X-CMAE-Envelope: MS4xfOwE8vCr4tKxVlb/dnScerGmBvvvInMutPJMirDtos/DvTgqBYAAuOlBWYWenZIs4yXuqNmAGJNQ8F2iZwrVMTZdUeW/gCginUokeDKhVj6gQUeN7cKs 63DqJ2zpPR0b821eYSW08fZStX91lvq3g+ABIhxrHY5wShC24tQ2TesHdV3Afk4FgFXw3NU2yQqDQUxSt3g/pHrLWn3SBw6pOD4= Although sysinfo() is a 'Linux only' function, cygwin provides an implementation which appears to be functional. The assumption that this function is Linux only is reflected in the way the HAVE_SYSINFO build variable is handled by the Makefile and config.mak.uname. Rework the setting of HAVE_SYSINFO in the Linux section of the system specific config file, along with the corresponding setting of the BASIC_CFLAGS in the Makefile. Add the setting of HAVE_SYSINFO to the cygwin section of 'config.mak.uname'. While here, add a test for the sysinfo() function to the autoconf build system. Signed-off-by: Ramsay Jones --- Makefile | 4 ++++ config.mak.uname | 3 ++- configure.ac | 8 ++++++++ 3 files changed, 14 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 8fa4d2664e..ff89f2b81f 100644 --- a/Makefile +++ b/Makefile @@ -2168,6 +2168,10 @@ ifdef HAVE_SYNC_FILE_RANGE BASIC_CFLAGS += -DHAVE_SYNC_FILE_RANGE endif +ifdef HAVE_SYSINFO + BASIC_CFLAGS += -DHAVE_SYSINFO +endif + ifdef HAVE_BSD_SYSCTL BASIC_CFLAGS += -DHAVE_BSD_SYSCTL endif diff --git a/config.mak.uname b/config.mak.uname index 942550fb9e..0e29341056 100644 --- a/config.mak.uname +++ b/config.mak.uname @@ -58,7 +58,7 @@ ifeq ($(uname_S),Linux) HAVE_SYNC_FILE_RANGE = YesPlease HAVE_GETDELIM = YesPlease FREAD_READS_DIRECTORIES = UnfortunatelyYes - BASIC_CFLAGS += -DHAVE_SYSINFO + HAVE_SYSINFO = YesPlease PROCFS_EXECUTABLE_PATH = /proc/self/exe HAVE_PLATFORM_PROCINFO = YesPlease COMPAT_OBJS += compat/linux/procinfo.o @@ -253,6 +253,7 @@ ifeq ($(uname_O),Cygwin) HAVE_GETDELIM = YesPlease HAVE_CLOCK_GETTIME=YesPlease HAVE_CLOCK_MONOTONIC=YesPlease + HAVE_SYSINFO = YesPlease HAVE_ALLOCA_H = YesPlease NEEDS_LIBICONV = YesPlease NO_FAST_WORKING_DIRECTORY = UnfortunatelyYes diff --git a/configure.ac b/configure.ac index 5923edc44a..d7e0503f1e 100644 --- a/configure.ac +++ b/configure.ac @@ -1066,6 +1066,14 @@ AC_CHECK_LIB([iconv], [locale_charset], [AC_CHECK_LIB([charset], [locale_charset], [CHARSET_LIB=-lcharset])]) GIT_CONF_SUBST([CHARSET_LIB]) + +# +# Define HAVE_SYSINFO=YesPlease if sysinfo is available. +GIT_CHECK_FUNC(sysinfo, + [HAVE_SYSINFO=YesPlease], + [HAVE_SYSINFO=]) +GIT_CONF_SUBST([HAVE_SYSINFO]) + # # Define HAVE_CLOCK_GETTIME=YesPlease if clock_gettime is available. GIT_CHECK_FUNC(clock_gettime, From patchwork Sat Mar 15 02:49:06 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ramsay Jones X-Patchwork-Id: 14017688 Received: from avasout-peh-003.plus.net (avasout-peh-003.plus.net [212.159.14.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 62886F9E8 for ; Sat, 15 Mar 2025 02:49:08 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=212.159.14.19 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1742006950; cv=none; b=W3qEBLwcXdWvtYo0pQRSDrvLEYP9rtzEPeIBamUKpDwqErYjAkRVjvBc9e8BAv7U/J0tzUOuU2CF6/C7H2A34pF3ll+pryAwFPqbObdR8efYVEX5Mraz4tbxsfexa5e+yqyDSVApr0s9DI68jBl1t4b0/xMpvebmJErYqdUM98o= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1742006950; c=relaxed/simple; bh=Dt0aMehJojiqzWNp7wUCxyh915quNx3jcxsogSibDk4=; h=Message-ID:Date:MIME-Version:To:Cc:From:Subject:Content-Type; b=W5u9RJtuYlNOJGzy9FwJVm5Ch3Q+PSA2wwkb0rlGJWC2xm1X9SW5Fc6YqfjGUyuUlciStYMakPp0nr7JouNwJrXtI+o66t4pewHcu7U24QXa/cNI4eoRQxdb/RHod+EW5iihttdNNtsi/InYSX7k0mDnCMBM6hhKUHMfbcMPJPg= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=ramsayjones.plus.com; spf=none smtp.mailfrom=ramsayjones.plus.com; dkim=pass (2048-bit key) header.d=plus.com header.i=@plus.com header.b=dyHGEi2x; arc=none smtp.client-ip=212.159.14.19 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=ramsayjones.plus.com Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=ramsayjones.plus.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=plus.com header.i=@plus.com header.b="dyHGEi2x" Received: from [10.0.2.15] ([80.189.83.109]) by smtp with ESMTPA id tHaEtGN1ivxWAtHaFteQCW; Sat, 15 Mar 2025 02:49:08 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=plus.com; s=042019; t=1742006948; bh=K4e21Hy7d+w85pwy9NdgbFGMpmzmmimE0fw2BvpXWBI=; h=Date:To:Cc:From:Subject; b=dyHGEi2xtfOdUKB5zo3Pzo1roGX+oLYWBKRaaZAZOUSyVOZ1fsvjTiMBMFOPltTw7 9nW6lmDnDNTpJMXGQD/SllRdBv4HqtL/cLP/Do2cUy/j0x8OFGra3hV9h/8KXRWuJJ z53d+qoH8Eo7CunDPXTDoUo0nCmgm4HTfSZyCuOM+727Ygj3oE5h6PGS68G/HqddjH W4VnJFbs2mCz8xDir3v/Z7iqsp5YOsHC4dLSdfyjJQw7iEDuav0rHfoiofi+7aa1oC C8Oq7excRw6qEAW+qHIaYNRTwncjKwpkGpqkTbGEHpWJTCj9KOL+JBDjFZnrb0tUja lcEnN6YW49JJQ== X-Clacks-Overhead: "GNU Terry Pratchett" X-CM-Score: 0.00 X-CNFS-Analysis: v=2.4 cv=QbDFvdbv c=1 sm=1 tr=0 ts=67d4eaa4 a=oM5NSl/Bl4BpjFr0C8iQlQ==:117 a=oM5NSl/Bl4BpjFr0C8iQlQ==:17 a=IkcTkHD0fZMA:10 a=EBOSESyhAAAA:8 a=CyMKNFq3l4KqDfjKpYsA:9 a=QEXdDO2ut3YA:10 a=yJM6EZoI5SlJf8ks9Ge_:22 X-AUTH: ramsayjones@:2500 Message-ID: <90accf50-324a-4bec-b219-f1ca522283cf@ramsayjones.plus.com> Date: Sat, 15 Mar 2025 02:49:06 +0000 Precedence: bulk X-Mailing-List: git@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Content-Language: en-US To: Junio C Hamano Cc: GIT Mailing-list , Patrick Steinhardt , Adam Dinwoodie From: Ramsay Jones Subject: [PATCH 11/12] config.mak.uname; add arc4random to the cygwin build X-CMAE-Envelope: MS4xfPA1kumK2QhGCKsNv4xSTvlSb84LYAKdn68agqtFjKiBuzic05+EhNviv66JtTXIJqX2zvxM64NrNSgDJx92pXCupcyhEcyCbuBo6VjVRWx4MmVxzWL+ bpxkyM5PXiSPviyqgoRubjo2sD8ERS1soG+b8Pbu/3eDQxTbDsgCZSt0bzXtsiSu92evXgd8dEK/+b2V3wHO7UhLUTqFfnNT0+Y= The arc4random_buf() function has been available in cygwin since about 2016 (somewhere in the v2.x branch). Set the CSPRNG_METHOD build variable to 'arc4random', in the cygwin section, to enable the use of this cryptographically-secure pseudorandom number function. Note that the autoconf and new meson builds also enable this function. Signed-off-by: Ramsay Jones --- config.mak.uname | 1 + 1 file changed, 1 insertion(+) diff --git a/config.mak.uname b/config.mak.uname index 0e29341056..4f6770a5f4 100644 --- a/config.mak.uname +++ b/config.mak.uname @@ -254,6 +254,7 @@ ifeq ($(uname_O),Cygwin) HAVE_CLOCK_GETTIME=YesPlease HAVE_CLOCK_MONOTONIC=YesPlease HAVE_SYSINFO = YesPlease + CSPRNG_METHOD = arc4random HAVE_ALLOCA_H = YesPlease NEEDS_LIBICONV = YesPlease NO_FAST_WORKING_DIRECTORY = UnfortunatelyYes From patchwork Sat Mar 15 02:49:18 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ramsay Jones X-Patchwork-Id: 14017690 Received: from avasout-peh-003.plus.net (avasout-peh-003.plus.net [212.159.14.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 6BA86F9E8 for ; Sat, 15 Mar 2025 02:49:20 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=212.159.14.19 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1742006962; cv=none; b=nmMry5JR2Jbe2RFln2saWg+/9acv6P4jg3fJCFpGND/LWnzoTNrbY5VCzSgB2esjXTaT6GcM1Ec/nJqFtFnfSPPDo3ZcqatWHOu76WIROITjooNj1NdWFeWfJ+KM63L4B7EnprfgBnSHA5o02VxlYAUEKta9cRzw5TaTijb2n7U= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1742006962; c=relaxed/simple; bh=EZsVx2TrLOEmOvwx/TJdZgVO1C35OtndEJ19feemzek=; h=Message-ID:Date:MIME-Version:To:Cc:From:Subject:Content-Type; b=QPaSQixKqBsZmuR0ac7wuBjSxxTwe8DHOpBFzJnrVpZVAZu49qm+PhE7mSctwU12MvGzrmKdvDEYeM1Yd/QT8U2dJK1p3IgdAhxk6yBPRlvW6IAoNfUW3XQVN2RAo9kDyiZHv1TRe0uoqknBXK3Ax7zkNvNrOL9SwyFbdePSvfk= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=ramsayjones.plus.com; spf=none smtp.mailfrom=ramsayjones.plus.com; dkim=pass (2048-bit key) header.d=plus.com header.i=@plus.com header.b=Vqx4AyVf; arc=none smtp.client-ip=212.159.14.19 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=ramsayjones.plus.com Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=ramsayjones.plus.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=plus.com header.i=@plus.com header.b="Vqx4AyVf" Received: from [10.0.2.15] ([80.189.83.109]) by smtp with ESMTPA id tHaQtGN2LvxWAtHaRteQCb; Sat, 15 Mar 2025 02:49:20 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=plus.com; s=042019; t=1742006960; bh=1FrD92wT2ji08kHaIl1qvpFeLrCGSiS5kbknCXkwWts=; h=Date:To:Cc:From:Subject; b=Vqx4AyVf22CjyPl5kKnCHzJMyTfLiPgip/3lAN/mos1lmeMFsy67peseaIMWKXQxu oLFcOuUnUhbmQxsQJjubBtrZl7vwngfob44KkEHkZRqQpq/F6PoHsV31kfO4xheI8K Ri2Z1SDNAIlKw22qLmy837izKnM9TuShKri7REbjoAtyIdUnSEgcZ/hivmoNGIl0tB m6JTffAfhTPZXXMDLcvhlH0U0nfsdtZAlxZBaVbw4AYyUCPpsHG6IIjqIeKewLtYMf qKuPY2iIFMshzQiWZRglPrkG43eHf7dJdE9lz1X6Ar9Zy/ZJhQnQFuPeWUGomk2ZTX bT8ERxfQYIUWw== X-Clacks-Overhead: "GNU Terry Pratchett" X-CM-Score: 0.00 X-CNFS-Analysis: v=2.4 cv=QbDFvdbv c=1 sm=1 tr=0 ts=67d4eab0 a=oM5NSl/Bl4BpjFr0C8iQlQ==:117 a=oM5NSl/Bl4BpjFr0C8iQlQ==:17 a=IkcTkHD0fZMA:10 a=EBOSESyhAAAA:8 a=7vm066By3dVxp98ELJ0A:9 a=QEXdDO2ut3YA:10 a=yJM6EZoI5SlJf8ks9Ge_:22 X-AUTH: ramsayjones@:2500 Message-ID: <8c8e16ae-87a2-44bf-a87b-7422eb04fec2@ramsayjones.plus.com> Date: Sat, 15 Mar 2025 02:49:18 +0000 Precedence: bulk X-Mailing-List: git@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Content-Language: en-US To: Junio C Hamano Cc: GIT Mailing-list , Patrick Steinhardt , Adam Dinwoodie From: Ramsay Jones Subject: [PATCH 12/12] config.mak.uname: add a note about CSPRNG_METHOD for Linux X-CMAE-Envelope: MS4xfHRVsYg0ivunrRnwGrwu9kTPnv/tBER24XDSHVsWENNaZpZtJ2fTkA4n1RowCjtNQbInRl5wNofZoz0/FCweBepcxaUuDE8lZ/t5f5DD73WBwTQ7g+D5 GWqSjceQJCo4xlpU8bItGvI4y9+xBYM2lwCPUC3bFpX+r+f2hROe4vmam1qJQytQM1SLCxaapo9nGEeqo6h6DMe2EOEJURNa1Oc= Commit 05cd988dce ("wrapper: add a helper to generate numbers from a CSPRNG", 2022-01-17) added a csprng_bytes() function which used one of several interfaces to provide a source of cryptographically secure pseudorandom numbers. The CSPRNG_METHOD make variable was provided to determine the choice of available 'backends' for the source of random bytes. Commit 05cd988dce did not set CSPRNG_METHOD in the Linux section of the config.mak.uname file, so it defaults to using '/dev/urandom' as the source of random bytes. The 'backend' values which could be used on Linux, in order of preference, are 'arc4random', 'getrandom' or 'getentropy' ('openssl' is an option, but seems to be discouraged). The arc4random routines (ar4random_buf() is the one actually used) were added to glibc in version 2.36, while both getrandom() and getentropy() were included in 2.25. So, some of the more up-to-date distributions of Linux (eg Debian 12, Ubuntu 24.04) would be able to use the preferred 'arc4random' setting. If the meson build system is used on a newer platform, then they will be configured to use 'arc4random', whereas the make build will currently default to using '/dev/urandom'. Add a note to the config.mak.uname file, in the Linux section, to prompt make users to override CSPRNG_METHOD in the config.mak file, if appropriate. Signed-off-by: Ramsay Jones Signed-off-by: Junio C Hamano --- config.mak.uname | 2 ++ 1 file changed, 2 insertions(+) diff --git a/config.mak.uname b/config.mak.uname index 4f6770a5f4..1a897bd022 100644 --- a/config.mak.uname +++ b/config.mak.uname @@ -50,6 +50,8 @@ ifeq ($(uname_S),Linux) HAVE_ALLOCA_H = YesPlease # override in config.mak if you have glibc >= 2.38 NO_STRLCPY = YesPlease + # set to arc4random (in config.mak) if you have glibc >= 2.36 + CSPRNG_METHOD = HAVE_PATHS_H = YesPlease LIBC_CONTAINS_LIBINTL = YesPlease HAVE_DEV_TTY = YesPlease