From bca9a9011f8ff3a72aa5d4e8d9762f8a4fa30171 Mon Sep 17 00:00:00 2001 From: Jools Wills Date: Wed, 28 Oct 2015 05:12:46 +0000 Subject: [PATCH] add RASPBIAN options to workaround threading issues when building for ARMV7 on Raspbian raspbian is built for an armv6 target, so when building for armv7, there is a problem with the ABI compatibility for threaded applications. /usr/include/c++/*/ext/concurrence.h - undefining __GCC_HAVE_SYNC_COMPARE_AND_SWAP_2 makes it use _S_mutex as it would when ppsspp is built for an armv6 target see https://github.com/raspberrypi/firmware/issues/491#issuecomment-151723041 fixes problems found by users on #7479 --- CMakeLists.txt | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 8a01df827d..d4c9f3cff2 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -42,8 +42,6 @@ if(EXISTS "/opt/vc/include/bcm_host.h") set(RPI ON) set(USING_GLES2 ON) set(USING_FBDEV ON) - # disable armv7 on rpi2 as building for armv6 causes a crash - https://github.com/hrydgard/ppsspp/issues/7479 - set(ARMV7 OFF) endif() if(BB) @@ -94,6 +92,7 @@ option(BB "Set to ON if targeting a Beaglebone/Beaglebone Black device" ${BB}) option(USING_EGL "Set to ON if target environment uses EGL" ${USING_EGL}) option(USING_FBDEV "Set to ON if target environment uses fbdev (eg. Pandora)" ${USING_FBDEV}) option(USING_GLES2 "Set to ON if target device uses OpenGL ES 2.0" ${USING_GLES2}) +option(RASPBIAN "Set to ON to workaround threading issues when building for ARMV7 on Raspbian" ${RASPBIAN}) # :: Frontends option(USING_QT_UI "Set to ON if you wish to use the Qt frontend wrapper" ${USING_QT_UI}) option(MOBILE_DEVICE "Set to ON when targetting a mobile device" ${MOBILE_DEVICE}) @@ -194,6 +193,9 @@ endif() if(MOBILE_DEVICE) add_definitions(-DMOBILE_DEVICE) endif() +if(ARMV7 AND RASPBIAN) + add_definitions(-U__GCC_HAVE_SYNC_COMPARE_AND_SWAP_2) +endif() if (NOT CMAKE_BUILD_TYPE) message(STATUS "No build type selected, default to Release")