From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 2155) id 68A02388210B; Thu, 31 Aug 2023 08:24:38 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 68A02388210B DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cygwin.com; s=default; t=1693470278; bh=v8PXRbTMISnBZLSWiygCbBtNqZsw3GOmtIJR4KHltI0=; h=Date:From:To:Subject:Reply-To:References:In-Reply-To:From; b=B74G2vnpdvt9DHVj9pqh7d6hYqTtTEzPHhDYWW6HnRGtS6GG6w5Qigcngyt6eMTmX u/kQYpMaE2qZXgNg/GZShugFPIE6ExnHBgCYVjmWruk0vAAiEKy2VoLbe34F/a9Qw3 fkqr4OIT+QpL7x0SUZ6zQwN87StHNRi8GMUGuV6M= Received: by calimero.vinschen.de (Postfix, from userid 500) id 7D91DA806B7; Thu, 31 Aug 2023 10:24:35 +0200 (CEST) Date: Thu, 31 Aug 2023 10:24:35 +0200 From: Corinna Vinschen To: cygwin-apps@cygwin.com Subject: Re: can't compile coreutils-9.3 any more after upgrade to cygwin-3.4.8 Message-ID: Reply-To: cygwin-apps@cygwin.com Mail-Followup-To: cygwin-apps@cygwin.com References: <603386c9-d4a0-82cd-a8e4-02f298f9047b@maxrnd.com> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="EMw7iVaRIakqRSyK" Content-Disposition: inline In-Reply-To: List-Id: --EMw7iVaRIakqRSyK Content-Type: text/plain; charset=utf-8 Content-Disposition: inline On Aug 30 20:10, Corinna Vinschen via Cygwin-apps wrote: > On Aug 30 12:04, Brian Inglis via Cygwin-apps wrote: > > On 2023-08-30 06:17, Corinna Vinschen via Cygwin-apps wrote: > > > On Aug 30 11:57, Corinna Vinschen via Cygwin-apps wrote: > > > > On Aug 30 11:34, Corinna Vinschen via Cygwin-apps wrote: > > > > > #define CPU_ZERO_S(siz, set) __cpuset_zero_s (siz, set) > > > > > -static __inline void > > > > > -__cpuset_zero_s (size_t siz, cpu_set_t *set) > > > > > -{ > > > > > - (void) memset (set, 0, siz); > > > > > -} > > > > > +void __cpuset_zero_s (size_t, cpu_set_t *); > > > > > [...] > > > > > +__cpuset_zero_s (size_t siz, cpu_set_t *set) > > > > > +{ > > > > > + (void) memset (set, 0, siz); > > > > > +} > > > > > + > > > > > } /* extern C */ > > > > > > > > Also, we can avoid an external __cpuset_zero_s function by just using a > > > > loop, kind of like this: > > > > > > I attached a matching patch. Please give it a try. > > > > Shouldn't cpuset.h #include for size_t and for pid_t? > > It shouldn't need that. sys/cpuset.h is a non-standard header which is > only included indirectly via sys/types.h. > > We may want to change from size_t to __size_t and from pid_t to __pid_t. > That should eliminate any further dependency. Try this: --EMw7iVaRIakqRSyK Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0001-Cygwin-sys-cpuset.h-use-internal-base-types.patch" >From ecc6012b90ba226c7ce92d4d0a12e6b4824ee03a Mon Sep 17 00:00:00 2001 From: Corinna Vinschen Date: Wed, 30 Aug 2023 21:11:42 +0200 Subject: [PATCH] Cygwin: sys/cpuset.h: use internal base types Use __size_t and __pid_t instead of size_t and pid_t to avoid further dependencies to external headers. Reported-by: Brian Inglis Signed-off-by: Corinna Vinschen --- winsup/cygwin/include/sys/cpuset.h | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/winsup/cygwin/include/sys/cpuset.h b/winsup/cygwin/include/sys/cpuset.h index 2ab2b95f0d65..a5a8fa81ef3d 100644 --- a/winsup/cygwin/include/sys/cpuset.h +++ b/winsup/cygwin/include/sys/cpuset.h @@ -29,15 +29,15 @@ typedef struct } cpu_set_t; #if __GNU_VISIBLE -int __sched_getaffinity_sys (pid_t, size_t, cpu_set_t *); +int __sched_getaffinity_sys (__pid_t, __size_t, cpu_set_t *); /* These macros alloc or free dynamically-sized cpu sets of size 'num' cpus. Allocations are padded such that full-word operations can be done easily. */ #define CPU_ALLOC_SIZE(num) __cpuset_alloc_size (num) -static __inline size_t +static __inline __size_t __cpuset_alloc_size (int num) { - return (size_t) (((num + __NCPUBITS - 1) / __NCPUBITS) * sizeof (__cpu_mask)); + return (__size_t) (((num + __NCPUBITS - 1) / __NCPUBITS) * sizeof (__cpu_mask)); } #define CPU_ALLOC(num) __cpuset_alloc (num) @@ -49,7 +49,7 @@ void __cpuset_free (cpu_set_t *); /* These _S macros operate on dynamically-sized cpu sets of size 'siz' bytes */ #define CPU_ZERO_S(siz, set) __cpuset_zero_s (siz, set) static __inline -__cpuset_zero_s (size_t siz, cpu_set_t *set) +__cpuset_zero_s (__size_t siz, cpu_set_t *set) { #if __GNUC_PREREQ (2, 91) __builtin_memset (set, 0, siz); @@ -62,7 +62,7 @@ __cpuset_zero_s (size_t siz, cpu_set_t *set) #define CPU_SET_S(cpu, siz, set) __cpuset_set_s (cpu, siz, set) static __inline void -__cpuset_set_s (int cpu, size_t siz, cpu_set_t *set) +__cpuset_set_s (int cpu, __size_t siz, cpu_set_t *set) { if (cpu >= 0 && cpu < 8 * siz) (set)->__bits[__CPUELT(cpu)] |= __CPUMASK(cpu); @@ -70,7 +70,7 @@ __cpuset_set_s (int cpu, size_t siz, cpu_set_t *set) #define CPU_CLR_S(cpu, siz, set) __cpuset_clr_s (cpu, siz, set) static __inline void -__cpuset_clr_s (int cpu, size_t siz, cpu_set_t *set) +__cpuset_clr_s (int cpu, __size_t siz, cpu_set_t *set) { if (cpu >= 0 && cpu < 8 * siz) (set)->__bits[__CPUELT(cpu)] &= ~(__CPUMASK(cpu)); @@ -78,7 +78,7 @@ __cpuset_clr_s (int cpu, size_t siz, cpu_set_t *set) #define CPU_ISSET_S(cpu, siz, set) __cpuset_isset_s (cpu, siz, set) static __inline int -__cpuset_isset_s (int cpu, size_t siz, cpu_set_t *set) +__cpuset_isset_s (int cpu, __size_t siz, cpu_set_t *set) { int res = 0; if (cpu >= 0 && cpu < 8 * siz) @@ -88,7 +88,7 @@ __cpuset_isset_s (int cpu, size_t siz, cpu_set_t *set) #define CPU_COUNT_S(siz, set) __cpuset_count_s (siz, set) static __inline int -__cpuset_count_s (size_t siz, cpu_set_t *set) +__cpuset_count_s (__size_t siz, cpu_set_t *set) { int i, res = 0; for (i = 0; i < siz / sizeof (__cpu_mask); i++) @@ -98,7 +98,7 @@ __cpuset_count_s (size_t siz, cpu_set_t *set) #define CPU_AND_S(siz, dst, src1, src2) __cpuset_and_s (siz, dst, src1, src2) static __inline void -__cpuset_and_s (size_t siz, cpu_set_t *dst, cpu_set_t *src1, cpu_set_t *src2) +__cpuset_and_s (__size_t siz, cpu_set_t *dst, cpu_set_t *src1, cpu_set_t *src2) { int i; for (i = 0; i < siz / sizeof (__cpu_mask); i++) @@ -107,7 +107,7 @@ __cpuset_and_s (size_t siz, cpu_set_t *dst, cpu_set_t *src1, cpu_set_t *src2) #define CPU_OR_S(siz, dst, src1, src2) __cpuset_or_s (siz, dst, src1, src2) static __inline void -__cpuset_or_s (size_t siz, cpu_set_t *dst, cpu_set_t *src1, cpu_set_t *src2) +__cpuset_or_s (__size_t siz, cpu_set_t *dst, cpu_set_t *src1, cpu_set_t *src2) { int i; for (i = 0; i < siz / sizeof (__cpu_mask); i++) @@ -116,7 +116,7 @@ __cpuset_or_s (size_t siz, cpu_set_t *dst, cpu_set_t *src1, cpu_set_t *src2) #define CPU_XOR_S(siz, dst, src1, src2) __cpuset_xor_s (siz, dst, src1, src2) static __inline void -__cpuset_xor_s (size_t siz, cpu_set_t *dst, cpu_set_t *src1, cpu_set_t *src2) +__cpuset_xor_s (__size_t siz, cpu_set_t *dst, cpu_set_t *src1, cpu_set_t *src2) { int i; for (i = 0; i < siz / sizeof (__cpu_mask); i++) @@ -125,7 +125,7 @@ __cpuset_xor_s (size_t siz, cpu_set_t *dst, cpu_set_t *src1, cpu_set_t *src2) #define CPU_EQUAL_S(siz, src1, src2) __cpuset_equal_s (siz, src1, src2) static __inline int -__cpuset_equal_s (size_t siz, cpu_set_t *src1, cpu_set_t *src2) +__cpuset_equal_s (__size_t siz, cpu_set_t *src1, cpu_set_t *src2) { int i, res = 1; for (i = 0; res && i < siz / sizeof (__cpu_mask); i++) -- 2.41.0 --EMw7iVaRIakqRSyK--