NetBSD Problem Report #56749

From www@netbsd.org  Mon Mar 14 12:25:56 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 AC0551A921F
	for <gnats-bugs@gnats.NetBSD.org>; Mon, 14 Mar 2022 12:25:56 +0000 (UTC)
Message-Id: <20220314122555.23E8D1A9239@mollari.NetBSD.org>
Date: Mon, 14 Mar 2022 12:25:55 +0000 (UTC)
From: pekdon@gmail.com
Reply-To: pekdon@gmail.com
To: gnats-bugs@NetBSD.org
Subject: audio/alsa-lib fails to build on Solarish
X-Send-Pr-Version: www-1.0

>Number:         56749
>Category:       pkg
>Synopsis:       audio/alsa-lib fails to build on Solarish
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    pkg-manager
>State:          closed
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Mon Mar 14 12:30:00 +0000 2022
>Closed-Date:    Mon Mar 14 14:08:58 +0000 2022
>Last-Modified:  Mon Mar 14 14:10:01 +0000 2022
>Originator:     Claes Nästén
>Release:        trunk 2022-03-13
>Organization:
>Environment:
Seen on bulktracker (as well as Solaris 10)
>Description:
Building audio/alsa-lib fails with the following error:

'/home/pbulk/build/audio/alsa-lib/work/alsa-lib-1.2.6.1'
  CC       cards.lo
In file included from ../../include/sound/asound.h:2,
                 from ../../include/local.h:155,
                 from control_local.h:22,
                 from cards.c:35:
../../include/alsa/sound/type_compat.h:33:10: fatal error: byteswap.h: No such file or directory
   33 | #include <byteswap.h>
      |          ^~~~~~~~~~~~
compilation terminated.
>How-To-Repeat:
Build audio/alsa-lib on Solarish
>Fix:
--- a/audio/alsa-lib/patches/patch-include_sound_type__compat.h
+++ b/audio/alsa-lib/patches/patch-include_sound_type__compat.h
@@ -1,6 +1,6 @@
 $NetBSD: patch-include_sound_type__compat.h,v 1.1 2021/05/12 14:12:13 ryoon Exp $

---- include/sound/type_compat.h.orig   2020-06-29 10:51:08.000000000 +0000
+--- include/sound/type_compat.h.orig   2021-06-14 10:28:44.000000000 +0000
 +++ include/sound/type_compat.h
 @@ -1,5 +1,5 @@
 -#ifndef __TYPE_COMPAT_H
@@ -10,10 +10,13 @@ $NetBSD: patch-include_sound_type__compat.h,v 1.1 2021/05/12 14:12:13 ryoon Exp

  #ifndef DOC_HIDDEN
  #include <stdint.h>
-@@ -16,6 +16,20 @@ typedef int32_t __s32;
+@@ -15,7 +15,30 @@ typedef int16_t __s16;
+ typedef int32_t __s32;
  typedef int64_t __s64;

++#ifndef __sun
  #include <endian.h>
++#endif
 +#if defined(__NetBSD__)
 +#include <machine/bswap.h>
 +#if BYTE_ORDER == LITTLE_ENDIAN
@@ -27,19 +30,27 @@ $NetBSD: patch-include_sound_type__compat.h,v 1.1 2021/05/12 14:12:13 ryoon Exp
 +#define __cpu_to_le16(x) bswap16(x)
 +#define __cpu_to_be16(x) (x)
 +#endif
++#else
++#ifdef __sun
++#include <sys/byteorder.h>
++#define __cpu_to_le32(x) LE_32(x)
++#define __cpu_to_be32(x) BE_32(x)
++#define __cpu_to_le16(x) LE_16(x)
++#define __cpu_to_be16(x) BE_16(x)
 +#else
  #include <byteswap.h>
  #if __BYTE_ORDER == __LITTLE_ENDIAN
  #define __cpu_to_le32(x) (x)
-@@ -28,6 +42,7 @@ typedef int64_t __s64;
+@@ -28,6 +51,8 @@ typedef int64_t __s64;
  #define __cpu_to_le16(x) bswap_16(x)
  #define __cpu_to_be16(x) (x)
  #endif
++#endif
 +#endif

  #define __le32_to_cpu __cpu_to_le32
  #define __be32_to_cpu __cpu_to_be32
-@@ -54,4 +69,4 @@ typedef int64_t __s64;
+@@ -54,4 +79,4 @@ typedef int64_t __s64;

  #endif /* DOC_HIDDEN */


>Release-Note:

>Audit-Trail:

State-Changed-From-To: open->closed
State-Changed-By: wiz@NetBSD.org
State-Changed-When: Mon, 14 Mar 2022 14:08:58 +0000
State-Changed-Why:
Committed, thanks.


From: "Thomas Klausner" <wiz@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/56749 CVS commit: pkgsrc/audio/alsa-lib
Date: Mon, 14 Mar 2022 14:08:42 +0000

 Module Name:	pkgsrc
 Committed By:	wiz
 Date:		Mon Mar 14 14:08:42 UTC 2022

 Modified Files:
 	pkgsrc/audio/alsa-lib: Makefile distinfo
 	pkgsrc/audio/alsa-lib/patches: patch-include_sound_type__compat.h

 Log Message:
 alsa-lib: fix build on Solaris

 From Claes Nästén in PR 56749


 To generate a diff of this commit:
 cvs rdiff -u -r1.27 -r1.28 pkgsrc/audio/alsa-lib/Makefile
 cvs rdiff -u -r1.35 -r1.36 pkgsrc/audio/alsa-lib/distinfo
 cvs rdiff -u -r1.1 -r1.2 \
     pkgsrc/audio/alsa-lib/patches/patch-include_sound_type__compat.h

 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.

>Unformatted:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.51 2026/08/10 02:28:17 riastradh Exp $
$NetBSD: gnats_config.sh,v 1.10 2026/05/13 22:00:09 riastradh Exp $
Copyright © 1994-2026 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.