All of lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH v2] stella: fix bug when compiling with PPC altivec vectorization
@ 2016-12-01 18:33 Sergio Prado
  2016-12-02 21:00 ` Thomas Petazzoni
  0 siblings, 1 reply; 2+ messages in thread
From: Sergio Prado @ 2016-12-01 18:33 UTC (permalink / raw)
  To: buildroot

PPC altivec vectorization triggers a bug when compiling with -std=c++11
because "bool" is redefined in altivec.h.

src/emucore/Event.hxx:112:23: error: cannot convert ?bool? to ?__vector(4) __bool int? in assignment
         myKeyTable[i] = false;
                       ^

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 let's compile with -std=gnu++11 by default.

Tested on ARM, x86 and PPC.

[1] https://gcc.gnu.org/bugzilla/show_bug.cgi?id=58241#c3

Fixes:
http://autobuild.buildroot.net/results/0970d2c8e1787ceffc46b589522e53d52675e03c
http://autobuild.buildroot.net/results/ec1bc57675b6e53af0cd33d7b99cd2e3bf5d9d7e

Signed-off-by: Sergio Prado <sergio.prado@e-labworks.com>
---

Changes v1 -> v2:
  - compile with gnu++11 on all archs (suggested by Sam Bobroff)

---
 ...-gnu-11-standard-to-prevent-errors-on-PPC.patch | 35 ++++++++++++++++++++++
 1 file changed, 35 insertions(+)
 create mode 100644 package/stella/0004-Use-gnu-11-standard-to-prevent-errors-on-PPC.patch

diff --git a/package/stella/0004-Use-gnu-11-standard-to-prevent-errors-on-PPC.patch b/package/stella/0004-Use-gnu-11-standard-to-prevent-errors-on-PPC.patch
new file mode 100644
index 000000000000..76d12a2cdd93
--- /dev/null
+++ b/package/stella/0004-Use-gnu-11-standard-to-prevent-errors-on-PPC.patch
@@ -0,0 +1,35 @@
+From 6946a491cae42b971aad3bc5d822e0e549eca8bd Mon Sep 17 00:00:00 2001
+From: Sergio Prado <sergio.prado@e-labworks.com>
+Date: Thu, 1 Dec 2016 15:20:33 -0200
+Subject: [PATCH] Use gnu++11 standard to prevent errors on PPC.
+
+PPC altivec vectorization triggers a bug when compiling with -std=c++11
+because "bool" is redefined in altivec.h.
+
+Acording to a bug report in GCC, "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 let's use gnu++11 standard.
+
+Signed-off-by: Sergio Prado <sergio.prado@e-labworks.com>
+---
+ Makefile | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/Makefile b/Makefile
+index 6dd0129587b3..6ed50ea4c335 100644
+--- a/Makefile
++++ b/Makefile
+@@ -51,7 +51,7 @@ else
+ endif
+ CXXFLAGS+= -Wall -Wextra -Wno-unused-parameter -Wno-ignored-qualifiers
+ ifdef HAVE_GCC
+-  CXXFLAGS+= -Wno-multichar -Wunused -fno-rtti -Woverloaded-virtual -Wnon-virtual-dtor -std=c++11
++  CXXFLAGS+= -Wno-multichar -Wunused -fno-rtti -Woverloaded-virtual -Wnon-virtual-dtor -std=gnu++11
+ endif
+ 
+ ifdef PROFILE
+-- 
+1.9.1
+
-- 
1.9.1

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

* [Buildroot] [PATCH v2] stella: fix bug when compiling with PPC altivec vectorization
  2016-12-01 18:33 [Buildroot] [PATCH v2] stella: fix bug when compiling with PPC altivec vectorization Sergio Prado
@ 2016-12-02 21:00 ` Thomas Petazzoni
  0 siblings, 0 replies; 2+ messages in thread
From: Thomas Petazzoni @ 2016-12-02 21:00 UTC (permalink / raw)
  To: buildroot

Hello,

On Thu,  1 Dec 2016 16:33:24 -0200, Sergio Prado wrote:
> PPC altivec vectorization triggers a bug when compiling with -std=c++11
> because "bool" is redefined in altivec.h.
> 
> src/emucore/Event.hxx:112:23: error: cannot convert ?bool? to ?__vector(4) __bool int? in assignment
>          myKeyTable[i] = false;
>                        ^
> 
> 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 let's compile with -std=gnu++11 by default.
> 
> Tested on ARM, x86 and PPC.
> 
> [1] https://gcc.gnu.org/bugzilla/show_bug.cgi?id=58241#c3
> 
> Fixes:
> http://autobuild.buildroot.net/results/0970d2c8e1787ceffc46b589522e53d52675e03c
> http://autobuild.buildroot.net/results/ec1bc57675b6e53af0cd33d7b99cd2e3bf5d9d7e
> 
> Signed-off-by: Sergio Prado <sergio.prado@e-labworks.com>
> ---

Applied to master, thanks.

Thomas
-- 
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com

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

end of thread, other threads:[~2016-12-02 21:00 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-12-01 18:33 [Buildroot] [PATCH v2] stella: fix bug when compiling with PPC altivec vectorization Sergio Prado
2016-12-02 21:00 ` Thomas Petazzoni

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.