On 2025/02/12 20:32, Kurt Mosiejczuk wrote:
> On Tue, Feb 11, 2025 at 05:07:52AM -0700, Stuart Henderson wrote:
> > CVSROOT:    /cvs
> > Module name:        ports
> > Changes by: [email protected]   2025/02/11 05:07:52
> 
> > Modified files:
> >     security/rhash : Makefile distinfo 
> >     security/rhash/patches: patch-configure patch-librhash_Makefile 
> >     security/rhash/pkg: PLIST 
> > Removed files:
> >     security/rhash/patches: patch-Makefile 
> 
> > Log message:
> > update to rhash-1.4.5
> 
> This breaks on sparc64.
> 
> cc -c -DNDEBUG -pipe -ffunction-sections -fdata-sections -fomit-frame-pointer 
> -Wall -W -Wstrict-prototypes -Wnested-externs -Winline -Wpointer-arith 
> -Wbad-function-cast -Wmissing-prototypes -Wmissing-declarations 
> -Wdeclaration-after-statement -O2 -pipe calc_sums.c -o calc_sums.o
> In file included from calc_sums.h:5,
>                  from calc_sums.c:3:
> common_func.h:147:41: error: missing binary operator before token "("
>      (defined(__clang__) && __has_builtin(__builtin_ctz))
>                                          ^
> *** Error 1 in /usr/obj/ports/rhash-1.4.5/RHash-1.4.5 (Makefile:160 
> 'calc_sums.o')
> 
> Since cmake uses this, that takes out some 2000 packages.

Hopefully fixed with this, which I've just committed:

Index: patches/patch-common_func_h
===================================================================
RCS file: /cvs/ports/security/rhash/patches/patch-common_func_h,v
diff -u -p -r1.4 patch-common_func_h
--- patches/patch-common_func_h 8 Mar 2022 08:53:52 -0000       1.4
+++ patches/patch-common_func_h 13 Feb 2025 09:40:16 -0000
@@ -1,3 +1,12 @@
+hunk #2: "(defined(__clang__) && __has_builtin(__builtin_ctz))" doesn't work
+as expected on base-gcc archs:
+
+common_func.h:147:41: error: missing binary operator before token "("
+     (defined(__clang__) && __has_builtin(__builtin_ctz))
+                                         ^
+
+clang has "#define __GNUC__ 4" so that branch is not taken anyway.
+
 Index: common_func.h
 --- common_func.h.orig
 +++ common_func.h
@@ -10,3 +19,15 @@ Index: common_func.h
  # endif /* LOCALEDIR */
  #else
  # define _(str) (str)
+@@ -143,9 +143,8 @@ wchar_t* rhash_wcsdup(const wchar_t* str, const char* 
+ #endif
+ 
+ /* get_ctz - count traling zero bits */
+-#if (defined(__GNUC__) && (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ 
>= 4))) || \
+-    (defined(__clang__) && __has_builtin(__builtin_ctz))
+-/* macro if GCC >= 3.4 or has clang __builtin_ctz() */
++#if (defined(__GNUC__) && (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ 
>= 4)))
++/* macro if GCC >= 3.4 (includes clang) */
+ # define get_ctz(x) __builtin_ctz(x)
+ #else
+ unsigned get_ctz(unsigned); /* define as function */

Reply via email to