From 9d759c4e38b84f29eb06845d4b68a55b0a8b8dcb Mon Sep 17 00:00:00 2001 From: cwen Date: Sun, 17 Nov 2019 00:14:36 +0000 Subject: [PATCH] vbam: various !x86 fixes: - limit the use of an asm optimisation for `std::sqrt()' to x86 archs, since it breaks the build everywhere else. - remove `-fopenmp' for base-gcc archs; it breaks the build on them - remove `-Wno-c++11-narrowing' from CXXFLAGS; no occurrence of it has been found, and such warning is notably useful for arm* and powerpc. Tested on sparc64 (kmos@), macppc and amd64 (me). OK kmos@ --- emulators/vbam/Makefile | 4 ++-- emulators/vbam/patches/patch-CMakeLists_txt | 16 ++++++++++++++++ .../vbam/patches/patch-src_filters_xBRZ_xbrz_cpp | 16 ++++++++++++++++ 3 files changed, 34 insertions(+), 2 deletions(-) create mode 100644 emulators/vbam/patches/patch-CMakeLists_txt create mode 100644 emulators/vbam/patches/patch-src_filters_xBRZ_xbrz_cpp diff --git a/emulators/vbam/Makefile b/emulators/vbam/Makefile index 90e85a0fea1..a49ee43e141 100644 --- a/emulators/vbam/Makefile +++ b/emulators/vbam/Makefile @@ -1,4 +1,4 @@ -# $OpenBSD: Makefile,v 1.33 2019/11/11 11:13:13 fcambus Exp $ +# $OpenBSD: Makefile,v 1.34 2019/11/17 00:14:36 cwen Exp $ BROKEN-alpha = ICE or OOM on hq_implementation.cpp BROKEN-hppa = ICE or OOM on src/filters/hq/c/hq_base.h:421 @@ -42,7 +42,7 @@ CONFIGURE_ARGS += -DENABLE_LTO=OFF # -DCMAKE_ASM_NASM_COMPILER=yasm, but then linking fails. CONFIGURE_ARGS += -DENABLE_ASM=OFF -CXXFLAGS += -Wno-c++11-narrowing -I${X11BASE}/include +CXXFLAGS += -I${X11BASE}/include NO_TEST = Yes diff --git a/emulators/vbam/patches/patch-CMakeLists_txt b/emulators/vbam/patches/patch-CMakeLists_txt new file mode 100644 index 00000000000..e879cde50b2 --- /dev/null +++ b/emulators/vbam/patches/patch-CMakeLists_txt @@ -0,0 +1,16 @@ +$OpenBSD: patch-CMakeLists_txt,v 1.3 2019/11/17 00:14:36 cwen Exp $ + +Fix build with ports-gcc: +eg++: error: libgomp.spec: No such file or directory + +Index: CMakeLists.txt +--- CMakeLists.txt.orig ++++ CMakeLists.txt +@@ -526,7 +526,6 @@ if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID S + endif() + endif() + +- set(MY_C_FLAGS ${MY_C_FLAGS} -fopenmp) + endif() + + if(CMAKE_CXX_COMPILER_ID STREQUAL GNU) diff --git a/emulators/vbam/patches/patch-src_filters_xBRZ_xbrz_cpp b/emulators/vbam/patches/patch-src_filters_xBRZ_xbrz_cpp new file mode 100644 index 00000000000..90ff002cf97 --- /dev/null +++ b/emulators/vbam/patches/patch-src_filters_xBRZ_xbrz_cpp @@ -0,0 +1,16 @@ +$OpenBSD: patch-src_filters_xBRZ_xbrz_cpp,v 1.1 2019/11/17 00:14:36 cwen Exp $ + +Fix "error: impossible constraint in 'asm'" on !x86 + +Index: src/filters/xBRZ/xbrz.cpp +--- src/filters/xBRZ/xbrz.cpp.orig ++++ src/filters/xBRZ/xbrz.cpp +@@ -66,7 +66,7 @@ uint32_t gradientARGB(uint32_t pixFront, uint32_t pixB + + inline double fastSqrt(double n) + { +-#ifdef __GNUC__ || __clang__ || __MINGW64_VERSION_MAJOR || __MINGW32_MAJOR_VERSION ++#if defined(__x86_64__) || defined(__i386__) + __asm__ ("fsqrt" : "+t" (n)); + return n; + #elif _MSC_VER && _M_IX86