From d9e35c65715f5376ffa1954aadfefbb4f3aab32d Mon Sep 17 00:00:00 2001
From: Mick Jordan <mick.jordan@oracle.com>
Date: Thu, 29 Jun 2017 14:09:08 -0700
Subject: [PATCH] ensure correct mx primary suite for llvm compiler wrappers

---
 mx.fastr/compilers/fastr-c++ | 2 +-
 mx.fastr/compilers/fastr-cc  | 2 +-
 mx.fastr/compilers/fastr-cpp | 2 +-
 mx.fastr/compilers/fastr-fc  | 2 +-
 4 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/mx.fastr/compilers/fastr-c++ b/mx.fastr/compilers/fastr-c++
index 4a2d1badc8..940ad0e0fe 100755
--- a/mx.fastr/compilers/fastr-c++
+++ b/mx.fastr/compilers/fastr-c++
@@ -40,7 +40,7 @@ while [ $DIR != "/" ] ; do
 done
 
 if [ $with_sulong = 1 ] && [ "$FASTR_SULONG_IGNORE" = "" ] ; then
-    mx --dynamicimport sulong fastr-c++ $@
+    MX_PRIMARY_SUITE_PATH=$DIR/fastr mx --dynamicimport sulong fastr-c++ $@
 else
     g++ $@
 fi
diff --git a/mx.fastr/compilers/fastr-cc b/mx.fastr/compilers/fastr-cc
index bd1c573723..30f313e3a2 100755
--- a/mx.fastr/compilers/fastr-cc
+++ b/mx.fastr/compilers/fastr-cc
@@ -40,7 +40,7 @@ while [ $DIR != "/" ] ; do
 done
 
 if [ $with_sulong = 1 ] && [ "$FASTR_SULONG_IGNORE" = "" ] ; then
-	mx --dynamicimport sulong fastr-cc $@
+	MX_PRIMARY_SUITE_PATH=$DIR/fastr mx --dynamicimport sulong fastr-cc $@
 else
     gcc $@
 fi
diff --git a/mx.fastr/compilers/fastr-cpp b/mx.fastr/compilers/fastr-cpp
index 10fc355b3f..26444e34c0 100755
--- a/mx.fastr/compilers/fastr-cpp
+++ b/mx.fastr/compilers/fastr-cpp
@@ -40,7 +40,7 @@ while [ $DIR != "/" ] ; do
 done
 
 if [ $with_sulong = 1 ] && [ "$FASTR_SULONG_IGNORE" = "" ] ; then
-	mx --dynamicimport sulong fastr-cpp $@
+	MX_PRIMARY_SUITE_PATH=$DIR/fastr mx --dynamicimport sulong fastr-cpp $@
 else
     cpp $@
 fi
diff --git a/mx.fastr/compilers/fastr-fc b/mx.fastr/compilers/fastr-fc
index e5d38d6206..741eacb49c 100755
--- a/mx.fastr/compilers/fastr-fc
+++ b/mx.fastr/compilers/fastr-fc
@@ -40,7 +40,7 @@ while [ $DIR != "/" ] ; do
 done
 
 if [ $with_sulong = 1 ] && [ "$FASTR_SULONG_IGNORE" = "" ] ; then
-    mx --dynamicimport sulong fastr-fc $@
+    MX_PRIMARY_SUITE_PATH=$DIR/fastr mx --dynamicimport sulong fastr-fc $@
 else
     gfortran $@
 fi
-- 
GitLab