diff options
author | Romain Naour <romain.naour@gmail.com> | 2017-03-25 22:59:00 +0100 |
---|---|---|
committer | Thomas Petazzoni <thomas.petazzoni@free-electrons.com> | 2017-04-15 12:15:27 +0200 |
commit | 9b4f1b73e7711a3eb3a233b7d727fd9d1fa4cf36 (patch) | |
tree | 1e3da34078e4f77eff200502073814b910149a82 | |
parent | 14defc5d6f125a0718f2aa8190f729d44777886b (diff) | |
download | buildroot-9b4f1b73e7711a3eb3a233b7d727fd9d1fa4cf36.tar.gz buildroot-9b4f1b73e7711a3eb3a233b7d727fd9d1fa4cf36.zip |
package/supertux: fix bug when compiling with PPC altivec vectorization
>From [1]:
Acording to a bug report in GCC [2]:
"You need to use -std=g++11 or undefine bool after the include of altivec.h
as context sensitive keywords is not part of the C++11 standard".
So use gnu++11 instead of c++11 only for altivec system.
This allow to revert [3] and keep Altivec vectorization.
[1] 0024465d8a7b51f7fc7c9e8581072695d869adca
[2] https://gcc.gnu.org/bugzilla/show_bug.cgi?id=58241#c3
[3] d2903aaf1314b50a8a10ce937d2b33c5c42e463e
Signed-off-by: Romain Naour <romain.naour@gmail.com>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
-rw-r--r-- | package/supertux/supertux.mk | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/package/supertux/supertux.mk b/package/supertux/supertux.mk index 4fb0611458..f49df35751 100644 --- a/package/supertux/supertux.mk +++ b/package/supertux/supertux.mk @@ -46,4 +46,25 @@ endef SUPERTUX_POST_PATCH_HOOKS += SUPERTUX_REMOVE_PEDANTIC endif +# 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." +# +# Acording to a bug report in GCC [1]: +# "You need to use -std=g++11 or undefine bool after the include of altivec.h +# as context sensitive keywords is not part of the C++11 standard". +# So use gnu++11 instead of c++11 only for altivec system. +# [1] https://gcc.gnu.org/bugzilla/show_bug.cgi?id=58241#c3 +ifeq ($(BR2_POWERPC_CPU_HAS_ALTIVEC),y) +define SUPERTUX_FIX_ALTIVEC_ISSUE + $(SED) 's%std=c++0x%std=gnu++0x%' $(@D)/CMakeLists.txt + $(SED) 's%std=c++11%std=gnu++11%' $(@D)/CMakeLists.txt + $(SED) 's%std=c++0x%std=gnu++0x%' $(@D)/external/tinygettext/CMakeLists.txt +endef +SUPERTUX_POST_PATCH_HOOKS += SUPERTUX_FIX_ALTIVEC_ISSUE +endif + $(eval $(cmake-package)) |