summaryrefslogtreecommitdiff
path: root/geography/opencpn-plugin-watchdog/patches
diff options
context:
space:
mode:
authorbouyer <bouyer@pkgsrc.org>2018-04-19 09:59:28 +0000
committerbouyer <bouyer@pkgsrc.org>2018-04-19 09:59:28 +0000
commit8deb59ca2739af87644f4106edde20b5f77de6c1 (patch)
treeb6c697122e5ee60b7e25436175e31f78cc9afef0 /geography/opencpn-plugin-watchdog/patches
parent1a0656e371a111bc94d8e93128728514f69fc174 (diff)
downloadpkgsrc-8deb59ca2739af87644f4106edde20b5f77de6c1.tar.gz
src/wddc.cpp has the same miscompilation issue as opencpn's ocpndc.cpp,
so apply the same workaround. Bump PKGREVISION
Diffstat (limited to 'geography/opencpn-plugin-watchdog/patches')
-rw-r--r--geography/opencpn-plugin-watchdog/patches/patch-src_wddc.cpp38
1 files changed, 38 insertions, 0 deletions
diff --git a/geography/opencpn-plugin-watchdog/patches/patch-src_wddc.cpp b/geography/opencpn-plugin-watchdog/patches/patch-src_wddc.cpp
new file mode 100644
index 00000000000..7fd5908de79
--- /dev/null
+++ b/geography/opencpn-plugin-watchdog/patches/patch-src_wddc.cpp
@@ -0,0 +1,38 @@
+$NetBSD: patch-src_wddc.cpp,v 1.1 2018/04/19 09:59:28 bouyer Exp $
+
+Same problem as opencpn/patches/patch-src_ocpndc.cpp:
+
+For some reason wdDC::DrawEllipse is miscompiled on NetBSD 8.0_BETA and
+gcc 6.4 from HEAD earmv7hf:
+for the tail call to dc->DrawEllipse() the compiler emits a bx instruction,
+but forgets to load the address of the function in the register.
+The memory barrier works around this problem by avoiding the tail-call
+optimisation.
+Other similar functions in this file are properly compiled ...
+I suspect it's related to the vfp register use in these functions.
+
+wdDC::DrawRoundedRectangle appears to be compiled OK, but it's similar
+to ocpnDC::DrawRounderRectangle so to be safe I apply the hack here as well.
+
+--- src/wddc.cpp.orig 2018-04-19 11:16:39.711460532 +0200
++++ src/wddc.cpp 2018-04-19 11:21:45.535313650 +0200
+@@ -712,6 +712,9 @@
+
+ }
+ #endif
++#ifdef __arm__
++ asm volatile("" ::: "memory");
++#endif
+ }
+
+ void wdDC::DrawCircle( wxCoord x, wxCoord y, wxCoord radius )
+@@ -771,6 +774,9 @@
+ glDisable( GL_BLEND );
+ }
+ #endif
++#ifdef __arm__
++ asm volatile("" ::: "memory");
++#endif
+ }
+
+ void wdDC::DrawPolygon( int n, wxPoint points[], wxCoord xoffset, wxCoord yoffset )