* [PATCH v2] sbc_primitives: Fix build on non-x86. [not found] <PH0PR11MB51269918A2B84A3120EBD8E4D3C00@PH0PR11MB5126.namprd11.prod.outlook.com> @ 2020-12-21 18:41 ` marius 2020-12-22 1:57 ` Luiz Augusto von Dentz 0 siblings, 1 reply; 5+ messages in thread From: marius @ 2020-12-21 18:41 UTC (permalink / raw) To: Marcel Holtmann; +Cc: Luiz Augusto von Dentz, linux-bluetooth, Marius Bakke 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 ^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH v2] sbc_primitives: Fix build on non-x86. 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 11:06 ` [PATCH v2] " Marius Bakke 0 siblings, 2 replies; 5+ messages in thread From: Luiz Augusto von Dentz @ 2020-12-22 1:57 UTC (permalink / raw) To: marius Cc: Marcel Holtmann, Luiz Augusto von Dentz, linux-bluetooth@vger.kernel.org, Marius Bakke 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. > +#endif > > #ifdef SBC_BUILD_WITH_MMX_SUPPORT > if (__builtin_cpu_supports("mmx")) > -- > 2.29.2 > -- Luiz Augusto von Dentz ^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH v3] sbc_primitives: Fix build on non-x86. 2020-12-22 1:57 ` Luiz Augusto von Dentz @ 2020-12-22 11:04 ` Marius Bakke 2020-12-22 21:17 ` Luiz Augusto von Dentz 2020-12-22 11:06 ` [PATCH v2] " Marius Bakke 1 sibling, 1 reply; 5+ messages in thread From: Marius Bakke @ 2020-12-22 11:04 UTC (permalink / raw) To: Marcel Holtmann; +Cc: Luiz Augusto von Dentz, linux-bluetooth, Marius Bakke From: Marius Bakke <marius@gnu.org> 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..09c214a 100644 --- a/sbc/sbc_primitives.c +++ b/sbc/sbc_primitives.c @@ -593,6 +593,7 @@ 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(); #ifdef SBC_BUILD_WITH_MMX_SUPPORT @@ -604,6 +605,7 @@ static void sbc_init_primitives_x86(struct sbc_encoder_state *state) if (__builtin_cpu_supports("sse4.2")) sbc_init_primitives_sse(state); #endif +#endif } /* -- 2.29.2 ^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH v3] sbc_primitives: Fix build on non-x86. 2020-12-22 11:04 ` [PATCH v3] " Marius Bakke @ 2020-12-22 21:17 ` Luiz Augusto von Dentz 0 siblings, 0 replies; 5+ messages in thread From: Luiz Augusto von Dentz @ 2020-12-22 21:17 UTC (permalink / raw) To: Marius Bakke Cc: Marcel Holtmann, Luiz Augusto von Dentz, linux-bluetooth@vger.kernel.org, Marius Bakke Hi Marius, On Tue, Dec 22, 2020 at 3:07 AM Marius Bakke <marius@devup.no> wrote: > > From: Marius Bakke <marius@gnu.org> > > 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..09c214a 100644 > --- a/sbc/sbc_primitives.c > +++ b/sbc/sbc_primitives.c > @@ -593,6 +593,7 @@ 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(); > > #ifdef SBC_BUILD_WITH_MMX_SUPPORT > @@ -604,6 +605,7 @@ static void sbc_init_primitives_x86(struct sbc_encoder_state *state) > if (__builtin_cpu_supports("sse4.2")) > sbc_init_primitives_sse(state); > #endif > +#endif > } > > /* > -- > 2.29.2 Applied, thanks. -- Luiz Augusto von Dentz ^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH v2] sbc_primitives: Fix build on non-x86. 2020-12-22 1:57 ` Luiz Augusto von Dentz 2020-12-22 11:04 ` [PATCH v3] " Marius Bakke @ 2020-12-22 11:06 ` Marius Bakke 1 sibling, 0 replies; 5+ messages in thread From: Marius Bakke @ 2020-12-22 11:06 UTC (permalink / raw) To: Luiz Augusto von Dentz Cc: Marcel Holtmann, Luiz Augusto von Dentz, linux-bluetooth@vger.kernel.org [-- 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 --] ^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2020-12-22 21:18 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[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 ` [PATCH v2] " Marius Bakke
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).