Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH] sdl_gfx: don't use --enable-mmx on x86_64
@ 2012-10-14 18:47 Thomas Petazzoni
  2012-10-14 18:51 ` Peter Korsgaard
  0 siblings, 1 reply; 2+ messages in thread
From: Thomas Petazzoni @ 2012-10-14 18:47 UTC (permalink / raw)
  To: buildroot

Even though the MMX instructions are available on x86_64 processors,
the MMX code in sdl_gfx is written in IA32-specific assembly code, and
therefore does not build on x86_64. It generates the following build
issues:

SDL_imageFilter.c: Assembler messages:
SDL_imageFilter.c:34: Error: `pusha' is not supported in 64-bit mode
SDL_imageFilter.c:38: Error: `popa' is not supported in 64-bit mode
SDL_imageFilter.c:77: Error: `pusha' is not supported in 64-bit mode
SDL_imageFilter.c:93: Error: `popa' is not supported in 64-bit mode
[...]

We fix this by only enabling MMX support in this package when the
processor supports MMX *and* it is a IA32 compatible processor.

Fixes

  http://autobuild.buildroot.org/results/b9efc611f5da487079b6be37bb7a41a3198d63b9/

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
---
 package/sdl_gfx/sdl_gfx.mk |   11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)

diff --git a/package/sdl_gfx/sdl_gfx.mk b/package/sdl_gfx/sdl_gfx.mk
index e3ff630..c1c7f91 100644
--- a/package/sdl_gfx/sdl_gfx.mk
+++ b/package/sdl_gfx/sdl_gfx.mk
@@ -11,7 +11,14 @@ SDL_GFX_DEPENDENCIES = sdl
 SDL_GFX_CONF_OPT = \
 	--with-sdl-prefix=$(STAGING_DIR)/usr \
 	--disable-sdltest \
-	--enable-static \
-	$(if $(BR2_X86_CPU_HAS_MMX),--enable-mmx,--disable-mmx)
+	--enable-static
+
+# Even though x86_64 processors support MMX, the MMX-specific assembly
+# code in sdl_gfx is IA32 specific, and does not build for x86_64.
+ifeq ($(BR2_i386)$(BR2_X86_CPU_HAS_MMX),yy)
+SDL_GFX_CONF_OPT += --enable-mmx
+else
+SDL_GFX_CONF_OPT += --disable-mmx
+endif
 
 $(eval $(autotools-package))
-- 
1.7.9.5

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

* [Buildroot] [PATCH] sdl_gfx: don't use --enable-mmx on x86_64
  2012-10-14 18:47 [Buildroot] [PATCH] sdl_gfx: don't use --enable-mmx on x86_64 Thomas Petazzoni
@ 2012-10-14 18:51 ` Peter Korsgaard
  0 siblings, 0 replies; 2+ messages in thread
From: Peter Korsgaard @ 2012-10-14 18:51 UTC (permalink / raw)
  To: buildroot

>>>>> "Thomas" == Thomas Petazzoni <thomas.petazzoni@free-electrons.com> writes:

 Thomas> Even though the MMX instructions are available on x86_64 processors,
 Thomas> the MMX code in sdl_gfx is written in IA32-specific assembly code, and
 Thomas> therefore does not build on x86_64. It generates the following build
 Thomas> issues:

 Thomas> SDL_imageFilter.c: Assembler messages:
 Thomas> SDL_imageFilter.c:34: Error: `pusha' is not supported in 64-bit mode
 Thomas> SDL_imageFilter.c:38: Error: `popa' is not supported in 64-bit mode
 Thomas> SDL_imageFilter.c:77: Error: `pusha' is not supported in 64-bit mode
 Thomas> SDL_imageFilter.c:93: Error: `popa' is not supported in 64-bit mode
 Thomas> [...]

 Thomas> We fix this by only enabling MMX support in this package when the
 Thomas> processor supports MMX *and* it is a IA32 compatible processor.

 Thomas> Fixes

 Thomas>   http://autobuild.buildroot.org/results/b9efc611f5da487079b6be37bb7a41a3198d63b9/

Committed, thanks.

-- 
Bye, Peter Korsgaard

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

end of thread, other threads:[~2012-10-14 18:51 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-10-14 18:47 [Buildroot] [PATCH] sdl_gfx: don't use --enable-mmx on x86_64 Thomas Petazzoni
2012-10-14 18:51 ` Peter Korsgaard

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox