pkgsrc-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc/geography/opencpn Fix opencpn on arm



details:   https://anonhg.NetBSD.org/pkgsrc/rev/07cf139684fd
branches:  trunk
changeset: 368250:07cf139684fd
user:      bouyer <bouyer%pkgsrc.org@localhost>
date:      Tue Sep 12 17:31:20 2017 +0000

description:
Fix opencpn on arm

For some reason ocpnDC::DrawEllipse is miscompiled on NetBSD 8.0_BETA 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.
Add a memory barrier to works around this problem by avoiding the tail-call
optimisation.
Other similar functions in this file are properly compiled ...

Bump PKGREVISION

diffstat:

 geography/opencpn/Makefile                     |   4 ++--
 geography/opencpn/distinfo                     |   3 ++-
 geography/opencpn/patches/patch-src_ocpndc.cpp |  20 ++++++++++++++++++++
 3 files changed, 24 insertions(+), 3 deletions(-)

diffs (53 lines):

diff -r 19638bd4d43b -r 07cf139684fd geography/opencpn/Makefile
--- a/geography/opencpn/Makefile        Tue Sep 12 16:42:05 2017 +0000
+++ b/geography/opencpn/Makefile        Tue Sep 12 17:31:20 2017 +0000
@@ -1,8 +1,8 @@
-# $NetBSD: Makefile,v 1.16 2017/08/24 20:03:19 adam Exp $
+# $NetBSD: Makefile,v 1.17 2017/09/12 17:31:20 bouyer Exp $
 #
 
 VERSION=       4.8.0
-#PKGREVISION=  0
+PKGREVISION=   1
 DISTNAME=      OpenCPN-${VERSION}
 PKGNAME=       opencpn-${VERSION}
 PKGREVISION=   1
diff -r 19638bd4d43b -r 07cf139684fd geography/opencpn/distinfo
--- a/geography/opencpn/distinfo        Tue Sep 12 16:42:05 2017 +0000
+++ b/geography/opencpn/distinfo        Tue Sep 12 17:31:20 2017 +0000
@@ -1,4 +1,4 @@
-$NetBSD: distinfo,v 1.13 2017/08/24 12:56:57 bouyer Exp $
+$NetBSD: distinfo,v 1.14 2017/09/12 17:31:20 bouyer Exp $
 
 SHA1 (OpenCPN-4.8.0-a13bc435462ae6c029660f1caa458dca79c927ec.zip) = 33ecc34915951c270fd758ec00a69574bc44ea25
 RMD160 (OpenCPN-4.8.0-a13bc435462ae6c029660f1caa458dca79c927ec.zip) = 084ad8ace3336954402a17b7610c3e2807a270a1
@@ -17,4 +17,5 @@
 SHA1 (patch-src_crashprint.cpp) = a96e8aa980eb3b19c3dce3343582511d608e6625
 SHA1 (patch-src_glu_CMakeLists.txt) = d63494a41071097252ac9e2cb95db75041f30b62
 SHA1 (patch-src_mipmap_mipmap.c) = 3bdb2c37e7a6d89fc6a531af6e0396a1ff385aeb
+SHA1 (patch-src_ocpndc.cpp) = cd425bec24050176a08e7ec8280bf853fd10c756
 SHA1 (patch-src_tcmgr.cpp) = 3fb4edf3368f3f3907f231ebcabd8e5061699040
diff -r 19638bd4d43b -r 07cf139684fd geography/opencpn/patches/patch-src_ocpndc.cpp
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/geography/opencpn/patches/patch-src_ocpndc.cpp    Tue Sep 12 17:31:20 2017 +0000
@@ -0,0 +1,20 @@
+$NetBSD: patch-src_ocpndc.cpp,v 1.1 2017/09/12 17:31:20 bouyer Exp $
+For some reason ocpnDC::DrawEllipse is miscompiled on NetBSD 8.0_BETA 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 ...
+
+--- src/ocpndc.cpp.orig        2017-09-12 15:29:07.101981729 +0200
++++ src/ocpndc.cpp     2017-09-12 17:00:40.945848063 +0200
+@@ -769,6 +769,9 @@
+         glDisable( GL_BLEND );
+     }
+ #endif    
++#ifdef __arm__
++      asm volatile("" ::: "memory");
++#endif
+ }
+ 
+ void ocpnDC::DrawPolygon( int n, wxPoint points[], wxCoord xoffset, wxCoord yoffset, float scale )



Home | Main Index | Thread Index | Old Index