NetBSD Problem Report #57047

From www@netbsd.org  Thu Oct  6 09:31:04 2022
Return-Path: <www@netbsd.org>
Received: from mail.netbsd.org (mail.netbsd.org [199.233.217.200])
	(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits))
	(Client CN "mail.NetBSD.org", Issuer "mail.NetBSD.org CA" (not verified))
	by mollari.NetBSD.org (Postfix) with ESMTPS id 737B21A923C
	for <gnats-bugs@gnats.NetBSD.org>; Thu,  6 Oct 2022 09:31:04 +0000 (UTC)
Message-Id: <20221006093103.70F0B1A923D@mollari.NetBSD.org>
Date: Thu,  6 Oct 2022 09:31:03 +0000 (UTC)
From: adr@sdf.org
Reply-To: adr@sdf.org
To: gnats-bugs@NetBSD.org
Subject: Xine-ui can't be built without "inline-all-stringops" __attribute (aarch64)
X-Send-Pr-Version: www-1.0

>Number:         57047
>Category:       pkg
>Synopsis:       Xine-ui can't be built without "inline-all-stringops" __attribute (aarch64)
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    pkg-manager
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Thu Oct 06 09:35:01 +0000 2022
>Last-Modified:  Sat Oct 08 11:35:01 +0000 2022
>Originator:     adr
>Release:        pkgsrc-current Thu Oct  6 09:15:09 UTC 2022
>Organization:
>Environment:
NetBSD npi 9.99.100 NetBSD 9.99.100 (RPI4) #0: Mon Oct  3 12:19:15 UTC 2022  adr@npi:/usr/src/sys/arch/evbarm/compile/RPI4 evbarm

>Description:
At configure target, without support for the following compiler attribute:

[...]
checking whether gcc supports __attribute ((target ("inline-all-stringops")))... no
[...]

The macro ATTR_INLINE_ALL_STRINGOPS ends up undefined, generating errors when compiling.

>How-To-Repeat:
Compile xine-ui without __attribute ((target ("inline-all-stringops"))) support (aarch64)

>Fix:
These patches add simple #ifdef blocks to avoid those errors.

patch-src_common_utils.h:
================================================================
$NetBSD$

--- src/common/utils.h.orig	2021-12-12 19:49:29.000000000 +0000
+++ src/common/utils.h
@@ -74,7 +74,11 @@ size_t strlcat(char *dst, const char *sr
 #endif

 #ifndef HAVE_STRLCPY
+#ifdef ATTR_INLINE_ALL_STRINGOPS
 size_t strlcpy (char *dst, const char *src, size_t size) ATTR_INLINE_ALL_STRINGOPS;
+#else
+size_t strlcpy (char *dst, const char *src, size_t size);
+#endif
 #endif

 char *xitk_vasprintf(const char *fmt, va_list ap)  __attribute__ ((format (printf, 1, 0)));
================================================================

patch-src_xitk_kbindings__common.c:
================================================================
$NetBSD$

--- src/xitk/kbindings_common.c.orig	2021-12-12 19:49:29.000000000 +0000
+++ src/xitk/kbindings_common.c
@@ -43,7 +43,11 @@ typedef union {
   char s[4 * 32];
 } refs_dummy_t;

+#ifdef ATTR_INLINE_ALL_STRINGOPS
 static ATTR_INLINE_ALL_STRINGOPS char *refs_set_dummy (refs_dummy_t *dummy, const char *text) {
+#else
+static char *refs_set_dummy (refs_dummy_t *dummy, const char *text) {
+#endif
   size_t l = strlen (text) + 1;
   if (l > sizeof (*dummy) - 8)
     l = sizeof (*dummy) - 8;
@@ -54,7 +58,11 @@ static ATTR_INLINE_ALL_STRINGOPS char *r
   return dummy->s + 4;
 }

+#ifdef ATTR_INLINE_ALL_STRINGOPS
 static ATTR_INLINE_ALL_STRINGOPS char *refs_strdup (const char *text) {
+#else
+static char *refs_strdup (const char *text) {
+#endif
   size_t l, s;
   char *m;

@@ -660,8 +668,12 @@ static int _kbindings_modifier_from_stri

 /*
  * Return a key binding entry (if available) matching with action string.
- */
+ */ 
+#ifdef ATTR_INLINE_ALL_STRINGOPS 
 static ATTR_INLINE_ALL_STRINGOPS kbinding_entry_t *_kbindings_lookup_action (kbinding_t *kbt, const char *action) {
+#else
+static kbinding_entry_t *_kbindings_lookup_action (kbinding_t *kbt, const char *action) {
+#endif
   union {
     int32_t i[6];
     char s[6 * 4];
================================================================

patch-src_xitk_xine-toolkit_skin.c:
================================================================
$NetBSD$

--- src/xitk/xine-toolkit/skin.c.orig	2021-12-12 19:49:29.000000000 +0000
+++ src/xitk/xine-toolkit/skin.c
@@ -75,7 +75,11 @@ struct xitk_skin_config_s {
   char                 sbuf[8192];
 };

+#ifdef ATTR_INLINE_ALL_STRINGOPS
 static ATTR_INLINE_ALL_STRINGOPS uint32_t _skin_strdup (xitk_skin_config_t *skonfig, const char *s) {
+#else
+static uint32_t _skin_strdup (xitk_skin_config_t *skonfig, const char *s) {
+#endif
   uint32_t r = skonfig->sbuf_pos;
   uint32_t l = strlen (s) + 1;
   if (l > sizeof (skonfig->sbuf) - r)
================================================================

patch-src_xitk_xine-toolkit_xitk.c:
================================================================
$NetBSD$

--- src/xitk/xine-toolkit/xitk.c.orig	2021-12-12 19:49:29.000000000 +0000
+++ src/xitk/xine-toolkit/xitk.c
@@ -2131,7 +2131,11 @@ static void _xitk_lower (uint8_t *s, siz
   }
 }

+#ifdef ATTR_INLINE_ALL_STRINGOPS
 size_t ATTR_INLINE_ALL_STRINGOPS xitk_lower_strlcpy (char *dest, const char *src, size_t dlen) {
+#else
+size_t xitk_lower_strlcpy (char *dest, const char *src, size_t dlen) {
+#endif
   uint8_t *q = (uint8_t *)dest;
   const uint8_t *p = (const uint8_t *)src;
   size_t l;
================================================================

>Audit-Trail:
From: David Holland <dholland-pbugs@netbsd.org>
To: gnats-bugs@netbsd.org
Cc: 
Subject: Re: pkg/57047: Xine-ui can't be built without "inline-all-stringops"
 __attribute (aarch64)
Date: Sat, 8 Oct 2022 02:49:14 +0000

 On Thu, Oct 06, 2022 at 09:35:01AM +0000, adr@sdf.org wrote:
  >  #ifndef HAVE_STRLCPY
  > +#ifdef ATTR_INLINE_ALL_STRINGOPS
  >  size_t strlcpy (char *dst, const char *src, size_t size) ATTR_INLINE_ALL_STRINGOPS;
  > +#else
  > +size_t strlcpy (char *dst, const char *src, size_t size);
  > +#endif
  >  #endif

 Surely it's sufficient to pass "-DATTR_INLINE_ALL_STRINGOPS="?

 -- 
 David A. Holland
 dholland@netbsd.org

From: adr <adr@SDF.ORG>
To: gnats-bugs@netbsd.org
Cc: pkg-manager@netbsd.org, gnats-admin@netbsd.org, pkgsrc-bugs@netbsd.org
Subject: Re: pkg/57047: Xine-ui can't be built without "inline-all-stringops"
 __attribute (aarch64)
Date: Sat, 8 Oct 2022 11:33:51 +0000 (UTC)

 On Sat, 8 Oct 2022, David Holland wrote:

 > Date: Sat,  8 Oct 2022 02:50:01 +0000 (UTC)
 > From: David Holland <dholland-pbugs@netbsd.org>
 > Reply-To: gnats-bugs@netbsd.org
 > To: pkg-manager@netbsd.org, gnats-admin@netbsd.org, pkgsrc-bugs@netbsd.org,
 >     adr@sdf.org
 > Subject: Re: pkg/57047: Xine-ui can't be built without "inline-all-stringops"
 >     __attribute (aarch64)
 > 
 > The following reply was made to PR pkg/57047; it has been noted by GNATS.
 >
 > From: David Holland <dholland-pbugs@netbsd.org>
 > To: gnats-bugs@netbsd.org
 > Cc:
 > Subject: Re: pkg/57047: Xine-ui can't be built without "inline-all-stringops"
 > __attribute (aarch64)
 > Date: Sat, 8 Oct 2022 02:49:14 +0000
 >
 > On Thu, Oct 06, 2022 at 09:35:01AM +0000, adr@sdf.org wrote:
 >  >  #ifndef HAVE_STRLCPY
 >  > +#ifdef ATTR_INLINE_ALL_STRINGOPS
 >  >  size_t strlcpy (char *dst, const char *src, size_t size) ATTR_INLINE_ALL_STRINGOPS;
 >  > +#else
 >  > +size_t strlcpy (char *dst, const char *src, size_t size);
 >  > +#endif
 >  >  #endif
 >
 > Surely it's sufficient to pass "-DATTR_INLINE_ALL_STRINGOPS="?

 Sure, but then ATTR_INLINE_ALL_STRINGOPS will be defined. I think
 that could be problematic in the future. The best option for me is
 include those patches so xine can be built in all archs on netbsd
 and contact upstream so they rework the code. Just my opinion.

 adr

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.47 2022/09/11 19:34:41 kim Exp $
$NetBSD: gnats_config.sh,v 1.9 2014/08/02 14:16:04 spz Exp $
Copyright © 1994-2022 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.