summaryrefslogtreecommitdiff
path: root/lang
diff options
context:
space:
mode:
authormaya <maya@pkgsrc.org>2016-09-28 15:34:54 +0000
committermaya <maya@pkgsrc.org>2016-09-28 15:34:54 +0000
commit420653c59ae99922b360a2365625045081bf1e42 (patch)
treea1f0a48444318164224b891f4de69fc6964e8e80 /lang
parent088aad3304383ccaae75bead536ea590d569ec28 (diff)
downloadpkgsrc-420653c59ae99922b360a2365625045081bf1e42.tar.gz
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 (limited to 'lang')
-rw-r--r--lang/g95/distinfo3
-rw-r--r--lang/g95/patches/patch-libf95.a-0.93_runtime_mutex.c22
2 files changed, 24 insertions, 1 deletions
diff --git a/lang/g95/distinfo b/lang/g95/distinfo
index 144b71b44d9..dd003d979b1 100644
--- a/lang/g95/distinfo
+++ b/lang/g95/distinfo
@@ -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_ff.c) = d873e3fd699d9c9fd06681c1e136cf16cf013a1a
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 --git a/lang/g95/patches/patch-libf95.a-0.93_runtime_mutex.c b/lang/g95/patches/patch-libf95.a-0.93_runtime_mutex.c
new file mode 100644
index 00000000000..7fad226e9f4
--- /dev/null
+++ b/lang/g95/patches/patch-libf95.a-0.93_runtime_mutex.c
@@ -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)