linux-bluetooth.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Marius Bakke <marius@gnu.org>
To: Luiz Augusto von Dentz <luiz.dentz@gmail.com>
Cc: Marcel Holtmann <marcel@holtmann.org>,
	Luiz Augusto von Dentz <luiz.von.dentz@intel.com>,
	"linux-bluetooth@vger.kernel.org"
	<linux-bluetooth@vger.kernel.org>
Subject: Re: [PATCH v2] sbc_primitives: Fix build on non-x86.
Date: Tue, 22 Dec 2020 12:06:08 +0100	[thread overview]
Message-ID: <87eeji6qxr.fsf@gnu.org> (raw)
In-Reply-To: <CABBYNZJ1PGCTVEon28vBN0apNjne2r5NgHY8e1WDtDML+4aeEw@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 1366 bytes --]

Luiz Augusto von Dentz <luiz.dentz@gmail.com> skriver:

> Hi Marius,
>
> On Mon, Dec 21, 2020 at 10:45 AM <marius@gnu.org> wrote:
>>
>> 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();
>
> I would probably have the entire function under the #if here.

That makes sense; v3 sent!

Thanks,
Marius

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 507 bytes --]

      parent reply	other threads:[~2020-12-22 11:07 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 ` [PATCH v2] sbc_primitives: Fix build on non-x86 marius
2020-12-22  1:57   ` 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     ` Marius Bakke [this message]

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=87eeji6qxr.fsf@gnu.org \
    --to=marius@gnu.org \
    --cc=linux-bluetooth@vger.kernel.org \
    --cc=luiz.dentz@gmail.com \
    --cc=luiz.von.dentz@intel.com \
    --cc=marcel@holtmann.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).