From patchwork Thu Nov 17 17:47:12 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Sergio Prado X-Patchwork-Id: 696265 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from fraxinus.osuosl.org (smtp4.osuosl.org [140.211.166.137]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3tKTSz4SPNz9t1d for ; Fri, 18 Nov 2016 05:01:07 +1100 (AEDT) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=e-labworks-com.20150623.gappssmtp.com header.i=@e-labworks-com.20150623.gappssmtp.com header.b="gLPEv/2S"; dkim-atps=neutral Received: from localhost (localhost [127.0.0.1]) by fraxinus.osuosl.org (Postfix) with ESMTP id 1B94F892B4; Thu, 17 Nov 2016 18:01:06 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from fraxinus.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id wXDxzZDx5DZI; Thu, 17 Nov 2016 18:01:05 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by fraxinus.osuosl.org (Postfix) with ESMTP id 05C83892AD; Thu, 17 Nov 2016 18:01:05 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from whitealder.osuosl.org (smtp1.osuosl.org [140.211.166.138]) by ash.osuosl.org (Postfix) with ESMTP id 2E6981C03FB for ; Thu, 17 Nov 2016 18:01:03 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id 2A3358725D for ; Thu, 17 Nov 2016 18:01:03 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from whitealder.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id rGfMWh5kTALt for ; Thu, 17 Nov 2016 18:01:02 +0000 (UTC) X-Greylist: delayed 00:13:36 by SQLgrey-1.7.6 Received: from mail-qk0-f196.google.com (mail-qk0-f196.google.com [209.85.220.196]) by whitealder.osuosl.org (Postfix) with ESMTPS id F006486E03 for ; Thu, 17 Nov 2016 18:01:01 +0000 (UTC) Received: by mail-qk0-f196.google.com with SMTP id h201so27409659qke.3 for ; Thu, 17 Nov 2016 10:01:01 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=e-labworks-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=j5gYSu1CNUm6M3wBB8wV3MmTKeA7FzSLxGtknY2wJBE=; b=gLPEv/2ST7cs9/n45hHpwUtHm0EyXvgYJgS1a1aSKgcdHtcRb/OwdNwi22zBJNaEt2 f/BljuAghxjWBCi4tBrKkIBMY6qnNN/BrRBuIWjypTfXvpyXoVmpSZ0kyYjT91BxeVwf xqv9BqiDWtOsJK1elfqSwiil/K5926YuWClGeFFMtLRCaP68eGHL66nr5XI/MIiekGaC 4UtKL4QNgGdDB7Kjj9kLFa/CVt67C1d3p9YyxKKlz6nWETjfudtwLN9v+8GvlyjmmSSH dLXt/oyMcwCZmlvlafEMM5E1uuVFc3KMMoEN1aE6U6iCKvgwhoMrxIdeZ5r76jOeG3xR xShg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=j5gYSu1CNUm6M3wBB8wV3MmTKeA7FzSLxGtknY2wJBE=; b=Zl9MxYPvGEBQ7h7KXFtw6Fo5XLa7atZ2HRmolE1AvG2kuSPR3YswkiStn+u4d1+1Bo 8TDKT5fXwGqz8Zq8vq1lCihKxSxKzKmtxy6m8ympPmGFJM4b75rOMQ6C3gl05lLFZ8sh Be4XP+dSGL6pCLxLPq8jqDYBSLDlR8zYNBO/GOlv4iKl4wP2RkkPATNgjF6BNDjBqagn q318F8m6/9BhB7U4LM5CgUu95iFzNzV96mBhUNDthdEnd38q0bzKcKMkULx1yKgLT8k9 BRscM4ACquB6QU1IBVyFXdHtowmOGNNKrQzm8UiglbMJxUyI0s8s/WO0eZ30nYTC8zaB DJag== X-Gm-Message-State: AKaTC02AzPvctuGrFvf8RPhs5fGhldH49tnXdWvUOdM0WcGb8wAIDuWZ7yuZ7wB0jR7fWA== X-Received: by 10.55.170.206 with SMTP id t197mr4695216qke.151.1479404844611; Thu, 17 Nov 2016 09:47:24 -0800 (PST) Received: from localhost.localdomain ([177.32.224.184]) by smtp.gmail.com with ESMTPSA id p19sm1977021qte.23.2016.11.17.09.47.23 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 17 Nov 2016 09:47:24 -0800 (PST) From: Sergio Prado To: buildroot@buildroot.org Date: Thu, 17 Nov 2016 15:47:12 -0200 Message-Id: <1479404832-11783-1-git-send-email-sergio.prado@e-labworks.com> X-Mailer: git-send-email 1.9.1 MIME-Version: 1.0 Subject: [Buildroot] [PATCH] stella: fix bug when compiling with PPC altivec vectorization X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: buildroot-bounces@busybox.net Sender: "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 when PPC altivec is enabled. [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 --- ...XFLAGS-so-we-can-append-values-to-user-de.patch | 40 ++++++++++++++++++++++ package/stella/stella.mk | 14 +++++++- 2 files changed, 53 insertions(+), 1 deletion(-) create mode 100644 package/stella/0004-Override-CXXFLAGS-so-we-can-append-values-to-user-de.patch diff --git a/package/stella/0004-Override-CXXFLAGS-so-we-can-append-values-to-user-de.patch b/package/stella/0004-Override-CXXFLAGS-so-we-can-append-values-to-user-de.patch new file mode 100644 index 000000000000..7e82c571e2c1 --- /dev/null +++ b/package/stella/0004-Override-CXXFLAGS-so-we-can-append-values-to-user-de.patch @@ -0,0 +1,40 @@ +From f81bec4d6e523df308158d6bd6f948be4d0183ba Mon Sep 17 00:00:00 2001 +From: Sergio Prado +Date: Thu, 17 Nov 2016 15:26:56 -0200 +Subject: [PATCH] Override CXXFLAGS so we can append values to user-defined + CXXFLAGS. + +Signed-off-by: Sergio Prado +--- + Makefile | 8 ++++---- + 1 file changed, 4 insertions(+), 4 deletions(-) + +diff --git a/Makefile b/Makefile +index 6dd0129587b3..7133ca58ac49 100644 +--- a/Makefile ++++ b/Makefile +@@ -49,17 +49,17 @@ ifdef CXXFLAGS + else + CXXFLAGS:= -O2 + endif +-CXXFLAGS+= -Wall -Wextra -Wno-unused-parameter -Wno-ignored-qualifiers ++override 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 ++ override CXXFLAGS+= -Wno-multichar -Wunused -fno-rtti -Woverloaded-virtual -Wnon-virtual-dtor + endif + + ifdef PROFILE + PROF:= -g -pg -fprofile-arcs -ftest-coverage +- CXXFLAGS+= $(PROF) ++ override CXXFLAGS+= $(PROF) + else + ifdef HAVE_GCC +- CXXFLAGS+= -fomit-frame-pointer ++ override CXXFLAGS+= -fomit-frame-pointer + endif + endif + +-- +1.9.1 + diff --git a/package/stella/stella.mk b/package/stella/stella.mk index 2e9d57b8c1ea..11cdd6adcd97 100644 --- a/package/stella/stella.mk +++ b/package/stella/stella.mk @@ -12,11 +12,23 @@ STELLA_LICENSE_FILES = Copyright.txt License.txt STELLA_DEPENDENCIES = sdl2 libpng zlib +STELLA_CXXFLAGS = $(TARGET_CFLAGS) + +# PPC altivec vectorization triggers a bug when compiling with -std=c++11 +# so let's compile it with -std=gnu++11 +ifeq ($(BR2_POWERPC_CPU_HAS_ALTIVEC),y) +STELLA_CXXFLAGS += -std=gnu++11 +else +STELLA_CXXFLAGS += -std=c++11 +endif + STELLA_CONF_OPTS = \ --host=$(GNU_TARGET_NAME) \ --prefix=/usr \ --with-sdl-prefix=$(STAGING_DIR)/usr +STELLA_MAKE_OPTS += CXXFLAGS="$(STELLA_CXXFLAGS)" + # The configure script is not autoconf based, so we use the # generic-package infrastructure define STELLA_CONFIGURE_CMDS @@ -28,7 +40,7 @@ define STELLA_CONFIGURE_CMDS endef define STELLA_BUILD_CMDS - $(TARGET_MAKE_ENV) $(MAKE) -C $(@D) + $(TARGET_MAKE_ENV) $(MAKE) $(STELLA_MAKE_OPTS) -C $(@D) endef define STELLA_INSTALL_TARGET_CMDS