All of lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH 1/1] package/spandsp: disable MMX on i686
@ 2020-11-22 16:26 Fabrice Fontaine
  2020-11-22 16:44 ` Baruch Siach
  0 siblings, 1 reply; 3+ messages in thread
From: Fabrice Fontaine @ 2020-11-22 16:26 UTC (permalink / raw)
  To: buildroot

MMX raises the following build failure on i686:

gsm0610_rpe.c: In function 'gsm0610_rpe_encoding':
gsm0610_rpe.c:132:5: error: invalid 'asm': invalid constraints for operand
     __asm__ __volatile__(
     ^~~~~~~

Fixes:
 - http://autobuild.buildroot.org/results/3e986c3109c392afe47fc98446a2563ac9776cf6
 - http://autobuild.buildroot.org/results/00ed4a4285b35d8ec0be09217e5b503e4820d971

Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
---
 ...igure.ac-fix-AVX-SSE-and-MMX-options.patch | 60 +++++++++++++++++++
 package/spandsp/spandsp.mk                    | 10 +++-
 2 files changed, 69 insertions(+), 1 deletion(-)
 create mode 100644 package/spandsp/0001-configure.ac-fix-AVX-SSE-and-MMX-options.patch

diff --git a/package/spandsp/0001-configure.ac-fix-AVX-SSE-and-MMX-options.patch b/package/spandsp/0001-configure.ac-fix-AVX-SSE-and-MMX-options.patch
new file mode 100644
index 0000000000..50eecfbf4b
--- /dev/null
+++ b/package/spandsp/0001-configure.ac-fix-AVX-SSE-and-MMX-options.patch
@@ -0,0 +1,60 @@
+From e7330bfe63efd0062fa51d50a4aaa0f1abd5ff75 Mon Sep 17 00:00:00 2001
+From: Fabrice Fontaine <fontaine.fabrice@gmail.com>
+Date: Sun, 22 Nov 2020 17:02:43 +0100
+Subject: [PATCH] configure.ac: fix AVX, SSE and MMX options
+
+AVX, SSE and MMX options are broken since
+https://github.com/freeswitch/spandsp/commit/87a900c70df73e128a5926587047f529105f5f64
+
+For example, when the user enables SSE, it will also enable MMX and the
+user can't disable MMX
+
+Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
+[Upstream status: https://github.com/freeswitch/spandsp/pull/20]
+---
+ configure.ac | 8 --------
+ 1 file changed, 8 deletions(-)
+
+diff --git a/configure.ac b/configure.ac
+index 83fb3fd..ac2592e 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -486,35 +486,27 @@ armv7[bl] | armv7-*)
+ x86_64-* | i386-* | i686-*)
+     if test "$enable_avx2" = "yes" ; then
+         AC_DEFINE([SPANDSP_USE_AVX2], [1], [Use the AVX2 instruction set (i386 and x86_64 only).])
+-        enable_avx="yes"
+     fi
+     if test "$enable_avx" = "yes" ; then
+         AC_DEFINE([SPANDSP_USE_AVX], [1], [Use the AVX instruction set (i386 and x86_64 only).])
+-        enable_sse4_2="yes"
+     fi
+     if test "$enable_sse4_2" = "yes" ; then
+         AC_DEFINE([SPANDSP_USE_SSE4_2], [1], [Use the SSE4.2 instruction set (i386 and x86_64 only).])
+-        enable_sse4_1="yes"
+     fi
+     if test "$enable_sse4_1" = "yes" ; then
+         AC_DEFINE([SPANDSP_USE_SSE4_1], [1], [Use the SSE4.1 instruction set (i386 and x86_64 only).])
+-        enable_ssse3="yes"
+     fi
+     if test "$enable_ssse3" = "yes" ; then
+         AC_DEFINE([SPANDSP_USE_SSSE3], [1], [Use the SSSE3 instruction set (i386 and x86_64 only).])
+-        enable_sse3="yes"
+     fi
+     if test "$enable_sse3" = "yes" ; then
+         AC_DEFINE([SPANDSP_USE_SSE3], [1], [Use the SSE3 instruction set (i386 and x86_64 only).])
+-        enable_sse2="yes"
+     fi
+     if test "$enable_sse2" = "yes" ; then
+         AC_DEFINE([SPANDSP_USE_SSE2], [1], [Use the SSE2 instruction set (i386 and x86_64 only).])
+-        enable_sse="yes"
+     fi
+     if test "$enable_sse" = "yes" ; then
+         AC_DEFINE([SPANDSP_USE_SSE], [1], [Use the SSE instruction set (i386 and x86_64 only).])
+-        enable_mmx="yes"
+     fi
+     if test "$enable_mmx" = "yes" ; then
+         AC_DEFINE([SPANDSP_USE_MMX], [1], [Use the MMX instruction set (i386 and x86_64 only).])
+-- 
+2.29.2
+
diff --git a/package/spandsp/spandsp.mk b/package/spandsp/spandsp.mk
index 42c0e3bb69..29fa39accc 100644
--- a/package/spandsp/spandsp.mk
+++ b/package/spandsp/spandsp.mk
@@ -8,6 +8,8 @@ SPANDSP_VERSION = 3.0.0-6ec23e5a7e
 SPANDSP_SITE = https://files.freeswitch.org/downloads/libs
 SPANDSP_LICENSE = LGPL-2.1 (library), GPL-2.0 (test suite)
 SPANDSP_LICENSE_FILES = COPYING
+# We're patching configure.ac
+SPANDSP_AUTORECONF = YES
 
 SPANDSP_DEPENDENCIES = tiff host-pkgconf
 SPANDSP_INSTALL_STAGING = YES
@@ -15,7 +17,6 @@ SPANDSP_CONF_ENV = LIBS="`$(PKG_CONFIG_HOST_BINARY) --libs libtiff-4`"
 
 SPANDSP_CONF_OPTS = \
 	--disable-builtin-tiff \
-	$(if $(BR2_X86_CPU_HAS_MMX),--enable-mmx,--disable-mmx) \
 	$(if $(BR2_X86_CPU_HAS_SSE),--enable-sse,--disable-sse) \
 	$(if $(BR2_X86_CPU_HAS_SSE2),--enable-sse2,--disable-sse2) \
 	$(if $(BR2_X86_CPU_HAS_SSE3),--enable-sse3,--disable-sse3) \
@@ -23,4 +24,11 @@ SPANDSP_CONF_OPTS = \
 	$(if $(BR2_X86_CPU_HAS_SSE4),--enable-sse4-1,--disable-sse4-1) \
 	$(if $(BR2_X86_CPU_HAS_SSE42),--enable-sse4-2,--disable-sse4-2)
 
+# MMX on i686 raises a build failure
+ifeq ($(BR2_X86_CPU_HAS_MMX)$(BR2_x86_64),yy)
+SPANDSP_CONF_OPTS += --enable-mmx
+else
+SPANDSP_CONF_OPTS += --disable-mmx
+endif
+
 $(eval $(autotools-package))
-- 
2.29.2

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [Buildroot] [PATCH 1/1] package/spandsp: disable MMX on i686
  2020-11-22 16:26 [Buildroot] [PATCH 1/1] package/spandsp: disable MMX on i686 Fabrice Fontaine
@ 2020-11-22 16:44 ` Baruch Siach
  2020-11-22 16:56   ` Fabrice Fontaine
  0 siblings, 1 reply; 3+ messages in thread
From: Baruch Siach @ 2020-11-22 16:44 UTC (permalink / raw)
  To: buildroot

Hi Fabrice,

On Sun, Nov 22 2020, Fabrice Fontaine wrote:
> MMX raises the following build failure on i686:
>
> gsm0610_rpe.c: In function 'gsm0610_rpe_encoding':
> gsm0610_rpe.c:132:5: error: invalid 'asm': invalid constraints for operand
>      __asm__ __volatile__(
>      ^~~~~~~
>
> Fixes:
>  - http://autobuild.buildroot.org/results/3e986c3109c392afe47fc98446a2563ac9776cf6
>  - http://autobuild.buildroot.org/results/00ed4a4285b35d8ec0be09217e5b503e4820d971
>
> Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
> ---

[snip]

> diff --git a/package/spandsp/spandsp.mk b/package/spandsp/spandsp.mk
> index 42c0e3bb69..29fa39accc 100644
> --- a/package/spandsp/spandsp.mk
> +++ b/package/spandsp/spandsp.mk
> @@ -8,6 +8,8 @@ SPANDSP_VERSION = 3.0.0-6ec23e5a7e
>  SPANDSP_SITE = https://files.freeswitch.org/downloads/libs
>  SPANDSP_LICENSE = LGPL-2.1 (library), GPL-2.0 (test suite)
>  SPANDSP_LICENSE_FILES = COPYING
> +# We're patching configure.ac
> +SPANDSP_AUTORECONF = YES
>  
>  SPANDSP_DEPENDENCIES = tiff host-pkgconf
>  SPANDSP_INSTALL_STAGING = YES
> @@ -15,7 +17,6 @@ SPANDSP_CONF_ENV = LIBS="`$(PKG_CONFIG_HOST_BINARY) --libs libtiff-4`"
>  
>  SPANDSP_CONF_OPTS = \
>  	--disable-builtin-tiff \
> -	$(if $(BR2_X86_CPU_HAS_MMX),--enable-mmx,--disable-mmx) \
>  	$(if $(BR2_X86_CPU_HAS_SSE),--enable-sse,--disable-sse) \
>  	$(if $(BR2_X86_CPU_HAS_SSE2),--enable-sse2,--disable-sse2) \
>  	$(if $(BR2_X86_CPU_HAS_SSE3),--enable-sse3,--disable-sse3) \
> @@ -23,4 +24,11 @@ SPANDSP_CONF_OPTS = \
>  	$(if $(BR2_X86_CPU_HAS_SSE4),--enable-sse4-1,--disable-sse4-1) \
>  	$(if $(BR2_X86_CPU_HAS_SSE42),--enable-sse4-2,--disable-sse4-2)
>  
> +# MMX on i686 raises a build failure
> +ifeq ($(BR2_X86_CPU_HAS_MMX)$(BR2_x86_64),yy)

Isn't BR2_X86_CPU_HAS_MMX always enabled for BR2_x86_64?

baruch

> +SPANDSP_CONF_OPTS += --enable-mmx
> +else
> +SPANDSP_CONF_OPTS += --disable-mmx
> +endif
> +
>  $(eval $(autotools-package))

-- 
                                                     ~. .~   Tk Open Systems
=}------------------------------------------------ooO--U--Ooo------------{=
   - baruch at tkos.co.il - tel: +972.52.368.4656, http://www.tkos.co.il -

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [Buildroot] [PATCH 1/1] package/spandsp: disable MMX on i686
  2020-11-22 16:44 ` Baruch Siach
@ 2020-11-22 16:56   ` Fabrice Fontaine
  0 siblings, 0 replies; 3+ messages in thread
From: Fabrice Fontaine @ 2020-11-22 16:56 UTC (permalink / raw)
  To: buildroot

Hi Baruch,

Le dim. 22 nov. 2020 ? 17:44, Baruch Siach <baruch@tkos.co.il> a ?crit :
>
> Hi Fabrice,
>
> On Sun, Nov 22 2020, Fabrice Fontaine wrote:
> > MMX raises the following build failure on i686:
> >
> > gsm0610_rpe.c: In function 'gsm0610_rpe_encoding':
> > gsm0610_rpe.c:132:5: error: invalid 'asm': invalid constraints for operand
> >      __asm__ __volatile__(
> >      ^~~~~~~
> >
> > Fixes:
> >  - http://autobuild.buildroot.org/results/3e986c3109c392afe47fc98446a2563ac9776cf6
> >  - http://autobuild.buildroot.org/results/00ed4a4285b35d8ec0be09217e5b503e4820d971
> >
> > Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
> > ---
>
> [snip]
>
> > diff --git a/package/spandsp/spandsp.mk b/package/spandsp/spandsp.mk
> > index 42c0e3bb69..29fa39accc 100644
> > --- a/package/spandsp/spandsp.mk
> > +++ b/package/spandsp/spandsp.mk
> > @@ -8,6 +8,8 @@ SPANDSP_VERSION = 3.0.0-6ec23e5a7e
> >  SPANDSP_SITE = https://files.freeswitch.org/downloads/libs
> >  SPANDSP_LICENSE = LGPL-2.1 (library), GPL-2.0 (test suite)
> >  SPANDSP_LICENSE_FILES = COPYING
> > +# We're patching configure.ac
> > +SPANDSP_AUTORECONF = YES
> >
> >  SPANDSP_DEPENDENCIES = tiff host-pkgconf
> >  SPANDSP_INSTALL_STAGING = YES
> > @@ -15,7 +17,6 @@ SPANDSP_CONF_ENV = LIBS="`$(PKG_CONFIG_HOST_BINARY) --libs libtiff-4`"
> >
> >  SPANDSP_CONF_OPTS = \
> >       --disable-builtin-tiff \
> > -     $(if $(BR2_X86_CPU_HAS_MMX),--enable-mmx,--disable-mmx) \
> >       $(if $(BR2_X86_CPU_HAS_SSE),--enable-sse,--disable-sse) \
> >       $(if $(BR2_X86_CPU_HAS_SSE2),--enable-sse2,--disable-sse2) \
> >       $(if $(BR2_X86_CPU_HAS_SSE3),--enable-sse3,--disable-sse3) \
> > @@ -23,4 +24,11 @@ SPANDSP_CONF_OPTS = \
> >       $(if $(BR2_X86_CPU_HAS_SSE4),--enable-sse4-1,--disable-sse4-1) \
> >       $(if $(BR2_X86_CPU_HAS_SSE42),--enable-sse4-2,--disable-sse4-2)
> >
> > +# MMX on i686 raises a build failure
> > +ifeq ($(BR2_X86_CPU_HAS_MMX)$(BR2_x86_64),yy)
>
> Isn't BR2_X86_CPU_HAS_MMX always enabled for BR2_x86_64?
I was not aware that MMX was always enabled on BR2_x86_64, I'll send a
v2 to enable mmx depending on the BR2_x86_64 value.
>
> baruch
>
> > +SPANDSP_CONF_OPTS += --enable-mmx
> > +else
> > +SPANDSP_CONF_OPTS += --disable-mmx
> > +endif
> > +
> >  $(eval $(autotools-package))
>
> --
>                                                      ~. .~   Tk Open Systems
> =}------------------------------------------------ooO--U--Ooo------------{=
>    - baruch at tkos.co.il - tel: +972.52.368.4656, http://www.tkos.co.il -
Best Regards,

Fabrice

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2020-11-22 16:56 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-11-22 16:26 [Buildroot] [PATCH 1/1] package/spandsp: disable MMX on i686 Fabrice Fontaine
2020-11-22 16:44 ` Baruch Siach
2020-11-22 16:56   ` Fabrice Fontaine

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.