pkgsrc-Changes-HG archive

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

[pkgsrc/trunk]: pkgsrc/lang/g95 lang/g95: blindly apply patch to help netbsd/...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/16aaff0d83e9
branches:  trunk
changeset: 353109:16aaff0d83e9
user:      maya <maya%pkgsrc.org@localhost>
date:      Wed Sep 28 15:34:54 2016 +0000

description:
lang/g95: blindly apply patch to help netbsd/mips build issues.

netbsd/mips gcc defaults to -mips1 which lacks ll/sc instructions
(or anything like them), and rejects the assembly code used here.

switch to mips3 (bare minimum for synchronization primitives) for
these instructions. this will result in runtime failures (illegal
instruction) on mips1, but we're unlikely to see any such users
(MIPS3 was released in 1992).

I'm not comfortable using the proper fix of switching to using
__sync_* because that seems to be a compiler builtin and gcc 4.1.2
might not have it.
Also, that change requires careful testing that this 'dumb' change
doesn't. Additionally, g95 is a dead end (upstream gone), so not
worth the effort.

PR pkg/44547: pkgsrc build failure for g95 on NetBSD/cobalt

diffstat:

 lang/g95/distinfo                                    |   3 +-
 lang/g95/patches/patch-libf95.a-0.93_runtime_mutex.c |  22 ++++++++++++++++++++
 2 files changed, 24 insertions(+), 1 deletions(-)

diffs (40 lines):

diff -r 5f4418782b18 -r 16aaff0d83e9 lang/g95/distinfo
--- a/lang/g95/distinfo Wed Sep 28 14:39:00 2016 +0000
+++ b/lang/g95/distinfo Wed Sep 28 15:34:54 2016 +0000
@@ -1,4 +1,4 @@
-$NetBSD: distinfo,v 1.26 2016/09/27 20:51:11 maya Exp $
+$NetBSD: distinfo,v 1.27 2016/09/28 15:34:54 maya Exp $
 
 SHA1 (g95_source.tgz) = b5e503fd6459b65cbda73190685f9490230d9cff
 RMD160 (g95_source.tgz) = 98d03e9a1835f4b3553a72a798bdf1d90a757176
@@ -33,3 +33,4 @@
 SHA1 (patch-libf95.a-0.93_math_x87.S) = 25dc2b613969947ae60fdc9b1dc6d9524b0157be
 SHA1 (patch-libf95.a-0.93_quad_power16.c) = eb6711bcd1018cac675dbbe212cd22a831a9d191
 SHA1 (patch-libf95.a-0.93_runtime_main.c) = dfde68072f38bf5bbb9c54ebeea5b9ce07d0c6be
+SHA1 (patch-libf95.a-0.93_runtime_mutex.c) = 8252537e4cbc5fd53b3f89e4403b581e3c73e52c
diff -r 5f4418782b18 -r 16aaff0d83e9 lang/g95/patches/patch-libf95.a-0.93_runtime_mutex.c
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/lang/g95/patches/patch-libf95.a-0.93_runtime_mutex.c      Wed Sep 28 15:34:54 2016 +0000
@@ -0,0 +1,22 @@
+$NetBSD: patch-libf95.a-0.93_runtime_mutex.c,v 1.1 2016/09/28 15:34:54 maya Exp $
+
+gcc on netbsd/mips rejects ll/sc as it targets mips1 which lacks
+these instructions. tell it it's mips3 code. it will crash
+at runtime for mips1 (unlikely to compile this package), but
+makes it possible to build for newer mips.
+
+--- libf95.a-0.93/runtime/mutex.c.orig 2008-09-17 03:45:13.000000000 +0000
++++ libf95.a-0.93/runtime/mutex.c
+@@ -116,9 +116,12 @@ int old_val, temp;
+ 
+     __asm__ __volatile__("   move %5, %2     \n"
+                        "1: move %2, %5     \n"
++                       "   .set push       \n"
++                       "   .set mips3      \n"
+                        "   ll   %0, %4     \n"
+                        "   bne  %0, %3, 2f \n"
+                        "   sc   %2, %1     \n"
++                       "   .set pop        \n"
+                        "   beqz %2, 1b     \n"
+                        "2:\n"
+                        : "=&r" (old_val), "=m" (*addr)



Home | Main Index | Thread Index | Old Index