Skip to contentSkip to conversation

package/sdl2: disable altivec built-in function for PowerPC

PATCH Superseded Romain Naour 1 participant 2 messages Feb 28, 2017

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/2 package/sdl2: disable altivec built-in function for PowerPC

As reported in this bug report [1], altivec support in SDL break arbitrary C++ code.

Issue reported by test-pkg script while testing supertux package:
error: could not convert 'true' from 'bool' to '__vector(4) __bool int'

[1] https://bugs.debian.org/cgi-bin/bugreport.cgi/?bug=770670

---
 package/sdl2/sdl2.mk | 10 ++++++++++
 1 file changed, 10 insertions(+)
package/sdl2/sdl2.mk +10 -0
index d2ee50d..628d906 100644
@@ -23,6 +23,16 @@ SDL2_CONF_OPTS += \
 # We must enable static build to get compilation successful.
 SDL2_CONF_OPTS += --enable-static
 
+# From https://bugs.debian.org/cgi-bin/bugreport.cgi/?bug=770670
+# "The problem lies within SDL_cpuinfo.h.  It includes altivec.h, which by
+# definition provides an unconditional vector, pixel and bool define in
+# standard-c++ mode.  In GNU-c++ mode this names are only defined
+# context-sensitive by cpp.  SDL_cpuinfo.h is included by SDL.h.
+# Including altivec.h makes arbitrary code break."
+ifeq ($(BR2_POWERPC_CPU_HAS_ALTIVEC),y)
+SDL2_CONF_OPTS += --disable-altivec
+endif
+
 ifeq ($(BR2_PACKAGE_HAS_UDEV),y)
 SDL2_DEPENDENCIES += udev
 SDL2_CONF_OPTS += --enable-libudev
Signature · 1 line
2.9.3
#1 lore raw

PATCH 2/2 package/supertux: new package

---
Coding style checked with check-package script (v1) and build tested with test-pkg script.

---
 DEVELOPERS                     |  1 +
 package/Config.in              |  1 +
 package/supertux/Config.in     | 37 +++++++++++++++++++++++++++++++
 package/supertux/supertux.hash |  2 ++
 package/supertux/supertux.mk   | 49 ++++++++++++++++++++++++++++++++++++++++++
 5 files changed, 90 insertions(+)
 create mode 100644 package/supertux/Config.in
 create mode 100644 package/supertux/supertux.hash
 create mode 100644 package/supertux/supertux.mk
DEVELOPERS +1 -0
index c80fdb4..8bde497 100644
@@ -1286,6 +1286,7 @@ F:	package/lugaru/
 F:	package/mcelog/
 F:	package/openpowerlink/
 F:	package/stress-ng/
+F:	package/supertux/
 F:	package/terminology/
 F:	package/upower/
 F:	package/xenomai/
package/Config.in +1 -0
index aad0842..f6bfa2e 100644
@@ -229,6 +229,7 @@ menu "Games"
 	source "package/rubix/Config.in"
 	source "package/sl/Config.in"
 	source "package/stella/Config.in"
+	source "package/supertux/Config.in"
 	source "package/supertuxkart/Config.in"
 endmenu
 
package/supertux/Config.in new file +37 -0
new file mode 100644
index 0000000..78022a1
@@ -0,0 +1,37 @@
+config BR2_PACKAGE_SUPERTUX
+	bool "supertux"
+	depends on BR2_INSTALL_LIBSTDCPP
+	depends on BR2_PACKAGE_HAS_LIBGL # libglew
+	depends on BR2_PACKAGE_OPENAL_ARCH_SUPPORTS
+	depends on BR2_PACKAGE_XORG7 # libglew, SDL2 OpenGL (GLX)
+	depends on BR2_TOOLCHAIN_GCC_AT_LEAST_4_7 # C++11
+	depends on BR2_TOOLCHAIN_HAS_THREADS_NPTL # openal
+	depends on BR2_USE_MMU # SDL2 OpenGL (GLX)
+	depends on !BR2_STATIC_LIBS # SDL2
+	depends on BR2_USE_WCHAR # Boost
+	select BR2_PACKAGE_BOOST
+	select BR2_PACKAGE_BOOST_DATE_TIME
+	select BR2_PACKAGE_BOOST_FILESYSTEM
+	select BR2_PACKAGE_BOOST_SYSTEM
+	select BR2_PACKAGE_LIBGLEW
+	select BR2_PACKAGE_LIBGLU # GL/glu.h
+	select BR2_PACKAGE_LIBOGG
+	select BR2_PACKAGE_LIBVORBIS
+	select BR2_PACKAGE_OPENAL
+	select BR2_PACKAGE_SDL2
+	select BR2_PACKAGE_SDL2_IMAGE
+	select BR2_PACKAGE_SDL2_OPENGL
+	help
+	  SuperTux is a free classic 2D jump'n run sidescroller game in
+	  a style similar to the original Super Mario games covered
+	  under the GNU GPL.
+
+	  http://supertux.github.io/
+
+comment "supertux needs X11 and a toolchain w/ C++, OpenGL backend, gcc >= 4.7, NPTL, dynamic library, wchar"
+	depends on BR2_PACKAGE_OPENAL_ARCH_SUPPORTS
+	depends on BR2_PACKAGE_XORG7
+	depends on BR2_USE_MMU
+	depends on !BR2_INSTALL_LIBSTDCPP || !BR2_PACKAGE_HAS_LIBGL || \
+		!BR2_TOOLCHAIN_GCC_AT_LEAST_4_7 || !BR2_TOOLCHAIN_HAS_THREADS_NPTL || \
+		BR2_STATIC_LIBS || !BR2_USE_WCHAR
package/supertux/supertux.hash new file +2 -0
new file mode 100644
index 0000000..c56f608
@@ -0,0 +1,2 @@
+# Locally calculated
+sha256 c9dc3b42991ce5c5d0d0cb94e44c4ec2373ad09029940f0e92331e7e9ada0ac5 SuperTux-v0.5.1-Source.tar.gz
package/supertux/supertux.mk new file +49 -0

49 lines not on this page · raw message

Signature · 1 line
2.9.3