commit:     201709d5fe0cb18bb6f8f1fd8942ee2cba15a18b
Author:     Fabian Groffen <grobian <AT> gentoo <DOT> org>
AuthorDate: Sun May 30 13:56:49 2021 +0000
Commit:     Fabian Groffen <grobian <AT> gentoo <DOT> org>
CommitDate: Sun May 30 13:56:58 2021 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=201709d5

sys-libs/librtas-2.0.2-r1: fix resulting libs using musl

Bug: https://bugs.gentoo.org/779109
Package-Manager: Portage-3.0.18, Repoman-3.0.2
Signed-off-by: Fabian Groffen <grobian <AT> gentoo.org>

 sys-libs/librtas/files/librtas-2.0.2-musl.patch | 30 +++++++++++++++++++++++++
 sys-libs/librtas/librtas-2.0.2-r1.ebuild        |  4 +++-
 2 files changed, 33 insertions(+), 1 deletion(-)

diff --git a/sys-libs/librtas/files/librtas-2.0.2-musl.patch 
b/sys-libs/librtas/files/librtas-2.0.2-musl.patch
new file mode 100644
index 00000000000..a0e92f17fcb
--- /dev/null
+++ b/sys-libs/librtas/files/librtas-2.0.2-musl.patch
@@ -0,0 +1,30 @@
+From caa55523aca6997d55fc9c68ed121c2c2bccc569 Mon Sep 17 00:00:00 2001
+From: Fabian Groffen <[email protected]>
+Date: Mon, 24 May 2021 10:06:54 +0200
+Subject: [PATCH] librtasevent: include endian.h for beXXtoh macros
+
+In particular using musl libc, without this include, the calls to
+be16toh/be32toh result in a compiler warning about an undefined symbol.
+Since in musl these are actually implemented by macros, the symbols
+remain undefined in the final shared library, making the library
+unusable.
+
+Issue: https://github.com/ibm-power-utilities/librtas/issues/10
+Signed-off-by: Fabian Groffen <[email protected]>
+---
+ librtasevent_src/rtas_event.h | 2 ++
+ 1 file changed, 2 insertions(+)
+
+diff --git a/librtasevent_src/rtas_event.h b/librtasevent_src/rtas_event.h
+index ece6f1d..b38cd7a 100644
+--- a/librtasevent_src/rtas_event.h
++++ b/librtasevent_src/rtas_event.h
+@@ -23,6 +23,8 @@
+ #ifndef _H_RTAS_EVENT
+ #define _H_RTAS_EVENT
+ 
++#include <endian.h>
++
+ #define PRNT_FMT        "%-20s%08x"
+ #define PRNT_FMT_L      PRNT_FMT"    "
+ #define PRNT_FMT_R      PRNT_FMT"\n"

diff --git a/sys-libs/librtas/librtas-2.0.2-r1.ebuild 
b/sys-libs/librtas/librtas-2.0.2-r1.ebuild
index ec20aa39588..61863ff24d3 100644
--- a/sys-libs/librtas/librtas-2.0.2-r1.ebuild
+++ b/sys-libs/librtas/librtas-2.0.2-r1.ebuild
@@ -1,4 +1,4 @@
-# Copyright 1999-2020 Gentoo Authors
+# Copyright 1999-2021 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
 EAPI=7
@@ -13,6 +13,8 @@ SLOT="0"
 KEYWORDS="ppc ppc64 ~ppc64-linux"
 IUSE="static-libs"
 
+PATCHES=( "${FILESDIR}"/${P}-musl.patch )
+
 src_prepare() {
        default
        eautoreconf

Reply via email to