Follow up from my previous diff [0]

> http://build-failures.rhaalovely.net/sparc64/2019-11-12/emulators/vbam.log
> http://build-failures.rhaalovely.net/aarch64/2019-11-13/emulators/vbam.log
(macppc incoming, mips64 didn't build it yet)

1) it looks like the asm part only works on x86, since amd64 and
   i386 have packages, so i'm proposing naively to fall back to
   the basic std::sqrt() call for all other archs.
2) remove `-Wno-c++11-narrowing': hiding this causes char signedness
   issues harder to track (more on macppc than arm*), and it does not
   emit a warning about this actually.
3) for gcc archs, remove `-fopenmp', it breaks the build

I've not bumped REVISION, as it changes nothing for the archs where
this newer version of vbam has been successfully built.

The runtime is broken on macppc (blank screen), the code contains
many parts where it's clearly said it's not endian-neutral. But it
builds [2].

I tested on amd64, it builds and works fine.

Comments/feedback are welcome,

Charlène.


[0] https://marc.info/?l=openbsd-ports&m=156208982623912&w=2
[1]
http://build-failures.rhaalovely.net/sparc64/2019-10-11/emulators/vbam.log
[2] https://bin.charlenew.xyz/vbam.log


Index: Makefile
===================================================================
RCS file: /cvs/ports/emulators/vbam/Makefile,v
retrieving revision 1.33
diff -u -p -u -p -r1.33 Makefile
--- Makefile    11 Nov 2019 11:13:13 -0000      1.33
+++ Makefile    15 Nov 2019 20:03:49 -0000
@@ -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
 
Index: patches/patch-CMakeLists_txt
===================================================================
RCS file: patches/patch-CMakeLists_txt
diff -N patches/patch-CMakeLists_txt
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ patches/patch-CMakeLists_txt        15 Nov 2019 20:03:49 -0000
@@ -0,0 +1,16 @@
+$OpenBSD$
+
+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)
Index: patches/patch-src_filters_xBRZ_xbrz_cpp
===================================================================
RCS file: patches/patch-src_filters_xBRZ_xbrz_cpp
diff -N patches/patch-src_filters_xBRZ_xbrz_cpp
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ patches/patch-src_filters_xBRZ_xbrz_cpp     15 Nov 2019 20:03:49 -0000
@@ -0,0 +1,16 @@
+$OpenBSD$
+
+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

Reply via email to