[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
02/02: gnu: sbc: Fix build on non-x86 architectures.
From: |
guix-commits |
Subject: |
02/02: gnu: sbc: Fix build on non-x86 architectures. |
Date: |
Mon, 21 Dec 2020 17:41:04 -0500 (EST) |
mbakke pushed a commit to branch staging
in repository guix.
commit 85ba5e9335207beef9a650e96d5d64787beb9256
Author: Marius Bakke <marius@gnu.org>
AuthorDate: Mon Dec 21 23:38:22 2020 +0100
gnu: sbc: Fix build on non-x86 architectures.
* gnu/packages/patches/sbc-fix-build-non-x86.patch: New file.
* gnu/local.mk (dist_patch_DATA): Adjust accordingly.
* gnu/packages/linux.scm (sbc)[source](patches): New field.
---
gnu/local.mk | 1 +
gnu/packages/linux.scm | 1 +
gnu/packages/patches/sbc-fix-build-non-x86.patch | 17 +++++++++++++++++
3 files changed, 19 insertions(+)
diff --git a/gnu/local.mk b/gnu/local.mk
index 91039ed..36b0895 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -1600,6 +1600,7 @@ dist_patch_DATA =
\
%D%/packages/patches/rust-reproducible-builds.patch \
%D%/packages/patches/rust-openssl-sys-no-vendor.patch \
%D%/packages/patches/rxvt-unicode-escape-sequences.patch \
+ %D%/packages/patches/sbc-fix-build-non-x86.patch \
%D%/packages/patches/sbcl-clml-fix-types.patch \
%D%/packages/patches/scalapack-blacs-mpi-deprecations.patch \
%D%/packages/patches/scheme48-tests.patch \
diff --git a/gnu/packages/linux.scm b/gnu/packages/linux.scm
index 6a7ce7f..09bc56d 100644
--- a/gnu/packages/linux.scm
+++ b/gnu/packages/linux.scm
@@ -4654,6 +4654,7 @@ event traces from the kernel (via the relaying through
the debug file system).")
(method url-fetch)
(uri (string-append "mirror://kernel.org/linux/bluetooth/sbc-"
version ".tar.xz"))
+ (patches (search-patches "sbc-fix-build-non-x86.patch"))
(sha256
(base32
"1liig5856crb331dps18mp0s13zbkv7yh007zqhq97m94fcddfhc"))))
diff --git a/gnu/packages/patches/sbc-fix-build-non-x86.patch
b/gnu/packages/patches/sbc-fix-build-non-x86.patch
new file mode 100644
index 0000000..56ea916
--- /dev/null
+++ b/gnu/packages/patches/sbc-fix-build-non-x86.patch
@@ -0,0 +1,17 @@
+Don't refer to x86-specific function on other architectures to avoid linker
error.
+
+Submitted upstream at
<https://marc.info/?l=linux-bluetooth&m=160857625608440&w=2>
+
+diff --git a/sbc/sbc_primitives.c b/sbc/sbc_primitives.c
+--- a/sbc/sbc_primitives.c
++++ b/sbc/sbc_primitives.c
+@@ -593,7 +593,9 @@ static int sbc_calc_scalefactors_j(
+
+ static void sbc_init_primitives_x86(struct sbc_encoder_state *state)
+ {
++#if defined(__x86_64__) || defined(__i386__)
+ __builtin_cpu_init();
++#endif
+
+ #ifdef SBC_BUILD_WITH_MMX_SUPPORT
+ if (__builtin_cpu_supports("mmx"))