All of lore.kernel.org
 help / color / mirror / Atom feed
From: marius@gnu.org
To: Marcel Holtmann <marcel@holtmann.org>
Cc: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>,
	linux-bluetooth@vger.kernel.org, Marius Bakke <marius@devup.no>
Subject: [PATCH v2] sbc_primitives: Fix build on non-x86.
Date: Mon, 21 Dec 2020 19:41:14 +0100	[thread overview]
Message-ID: <20201221184114.1300-1-marius@gnu.org> (raw)
In-Reply-To: <PH0PR11MB51269918A2B84A3120EBD8E4D3C00@PH0PR11MB5126.namprd11.prod.outlook.com>

From: Marius Bakke <marius@devup.no>

Don't call __builtin_cpu_init unless targeting i386 or x86_64.
Otherwise we get an error at link time:

  CC       sbc/sbc_primitives.lo
sbc/sbc_primitives.c: In function ‘sbc_init_primitives_x86’:
sbc/sbc_primitives.c:596:2: warning: implicit declaration of function ‘__builtin_cpu_init’; did you mean ‘__builtin_irint’? [-Wimplicit-function-declaration]
[...]
  CCLD     src/sbcdec
ld: sbc/.libs/libsbc-private.a(sbc_primitives.o): in function `sbc_init_primitives':
sbc_primitives.c:(.text+0x3a30): undefined reference to `__builtin_cpu_init'
---
 sbc/sbc_primitives.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/sbc/sbc_primitives.c b/sbc/sbc_primitives.c
index 97a75be..d8e166a 100644
--- 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"))
-- 
2.29.2


       reply	other threads:[~2020-12-21 18:42 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <PH0PR11MB51269918A2B84A3120EBD8E4D3C00@PH0PR11MB5126.namprd11.prod.outlook.com>
2020-12-21 18:41 ` marius [this message]
2020-12-22  1:57   ` [PATCH v2] sbc_primitives: Fix build on non-x86 Luiz Augusto von Dentz
2020-12-22 11:04     ` [PATCH v3] " Marius Bakke
2020-12-22 21:17       ` Luiz Augusto von Dentz
2020-12-22 11:06     ` [PATCH v2] " Marius Bakke

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20201221184114.1300-1-marius@gnu.org \
    --to=marius@gnu.org \
    --cc=linux-bluetooth@vger.kernel.org \
    --cc=luiz.von.dentz@intel.com \
    --cc=marcel@holtmann.org \
    --cc=marius@devup.no \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.