Ejemplo n.º 1
0
 def haveDragonegg():
     if not hasattr(SulongTestSuite, '_haveDragonegg'):
         SulongTestSuite._haveDragonegg = mx_sulong.dragonEggPath(
         ) is not None and os.path.exists(
             mx_sulong.dragonEggPath()) and mx_sulong.getGCC(
                 optional=True) is not None
     return SulongTestSuite._haveDragonegg
Ejemplo n.º 2
0
 def getBuildEnv(self, replaceVar=mx_subst.path_substitutions):
     env = super(SulongTestSuite, self).getBuildEnv(replaceVar=replaceVar)
     env['VPATH'] = os.path.join(self.dir, self.name)
     env['PROJECT'] = self.name
     env['TESTS'] = ' '.join(self.getTests())
     env['VARIANTS'] = ' '.join(self.getVariants())
     env['BUILD_REF'] = '1' if self.buildRef else '0'
     env['BUILD_SO'] = '1' if self.buildSharedObject else '0'
     env['SO_EXT'] = mx.add_lib_suffix("")
     env['CLANG'] = mx_sulong.findBundledLLVMProgram('clang')
     env['CLANGXX'] = mx_sulong.findBundledLLVMProgram('clang++')
     env['LLVM_OPT'] = mx_sulong.findBundledLLVMProgram('opt')
     env['LLVM_AS'] = mx_sulong.findBundledLLVMProgram('llvm-as')
     env['LLVM_LINK'] = mx_sulong.findBundledLLVMProgram('llvm-link')
     env['LLVM_OBJCOPY'] = mx_sulong.findBundledLLVMProgram('llvm-objcopy')
     env['GRAALVM_LLVM_HOME'] = mx_subst.path_substitutions.substitute("<path:SULONG_HOME>")
     if SulongTestSuite.haveDragonegg():
         env['DRAGONEGG'] = mx_sulong.dragonEggPath()
         env['DRAGONEGG_GCC'] = mx_sulong.getGCC()
         env['DRAGONEGG_LLVMAS'] = mx_sulong.findLLVMProgramForDragonegg("llvm-as")
         env['DRAGONEGG_FC'] = mx_sulong.getGFortran()
         env['FC'] = mx_sulong.getGFortran()
     elif not self._is_needs_rebuild_call and getattr(self, 'requireDragonegg', False):
         mx.abort('Could not find dragonegg, cannot build "{}" (requireDragonegg = True).'.format(self.name))
     return env
Ejemplo n.º 3
0
 def getBuildEnv(self, replaceVar=mx_subst.path_substitutions):
     env = super(SulongTestSuite, self).getBuildEnv(replaceVar=replaceVar)
     env['VPATH'] = os.path.join(self.dir, self.name)
     env['PROJECT'] = self.name
     env['TESTS'] = ' '.join(self.getTests())
     env['VARIANTS'] = ' '.join(self.getVariants())
     if SulongTestSuite.haveDragonegg():
         env['DRAGONEGG'] = mx_sulong.dragonEggPath()
         env['DRAGONEGG_GCC'] = mx_sulong.getGCC()
         env['DRAGONEGG_LLVMAS'] = mx_sulong.findLLVMProgramForDragonegg(
             "llvm-as")
     return env
Ejemplo n.º 4
0
 def getBuildEnv(self, replaceVar=mx_subst.path_substitutions):
     env = super(SulongTestSuite, self).getBuildEnv(replaceVar=replaceVar)
     env['VPATH'] = os.path.join(self.dir, self.name)
     env['PROJECT'] = self.name
     env['TESTS'] = ' '.join(self.getTests())
     env['VARIANTS'] = ' '.join(self.getVariants())
     env['BUILD_REF'] = '1' if self.buildRef else '0'
     env['SULONG_MAKE_CLANG_IMPLICIT_ARGS'] = mx_sulong.getClangImplicitArgs()
     if SulongTestSuite.haveDragonegg():
         env['DRAGONEGG'] = mx_sulong.dragonEggPath()
         env['DRAGONEGG_GCC'] = mx_sulong.getGCC()
         env['DRAGONEGG_LLVMAS'] = mx_sulong.findLLVMProgramForDragonegg("llvm-as")
     return env
Ejemplo n.º 5
0
 def getBuildEnv(self, replaceVar=mx_subst.path_substitutions):
     env = super(SulongTestSuite, self).getBuildEnv(replaceVar=replaceVar)
     env['VPATH'] = os.path.join(self.dir, self.name)
     env['PROJECT'] = self.name
     env['TESTS'] = ' '.join(self.getTests())
     env['VARIANTS'] = ' '.join(self.getVariants())
     env['BUILD_REF'] = '1' if self.buildRef else '0'
     env['SULONG_MAKE_CLANG_IMPLICIT_ARGS'] = mx_sulong.getClangImplicitArgs(
     )
     if SulongTestSuite.haveDragonegg():
         env['DRAGONEGG'] = mx_sulong.dragonEggPath()
         env['DRAGONEGG_GCC'] = mx_sulong.getGCC()
         env['DRAGONEGG_LLVMAS'] = mx_sulong.findLLVMProgramForDragonegg(
             "llvm-as")
     return env
Ejemplo n.º 6
0
 def getBuildEnv(self, replaceVar=mx_subst.path_substitutions):
     env = super(SulongTestSuite, self).getBuildEnv(replaceVar=replaceVar)
     env['VPATH'] = os.path.join(self.dir, self.name)
     env['PROJECT'] = self.name
     env['TESTS'] = ' '.join(self.getTests())
     env['VARIANTS'] = ' '.join(self.getVariants())
     env['BUILD_REF'] = '1' if self.buildRef else '0'
     env['SULONG_MAKE_CLANG_IMPLICIT_ARGS'] = mx_sulong.getClangImplicitArgs()
     if SulongTestSuite.haveDragonegg():
         env['DRAGONEGG'] = mx_sulong.dragonEggPath()
         env['DRAGONEGG_GCC'] = mx_sulong.getGCC()
         env['DRAGONEGG_LLVMAS'] = mx_sulong.findLLVMProgramForDragonegg("llvm-as")
         env['DRAGONEGG_FC'] = mx_sulong.getGFortran()
         env['FC'] = mx_sulong.getGFortran()
     elif not self._is_needs_rebuild_call and getattr(self, 'requireDragonegg', False):
         mx.abort('Could not find dragonegg, cannot build "{}" (requireDragonegg = True).'.format(self.name))
     return env
Ejemplo n.º 7
0
 def run(self, inputFile, outputFile, flags):
     tool, toolFlags = self.getTool(inputFile, outputFile)
     ret = self.runTool([
         tool, '-S', '-fplugin=' + mx_sulong.dragonEggPath(),
         '-fplugin-arg-dragonegg-emit-ir', '-o',
         '%s.tmp.ll' % outputFile
     ] + toolFlags + flags + [inputFile],
                        errorMsg='Cannot compile %s with %s' %
                        (inputFile, os.path.basename(tool)))
     if ret == 0:
         ret = self.runTool([
             mx_sulong.findLLVMProgram('llvm-as', ['3.2']), '-o',
             outputFile,
             '%s.tmp.ll' % outputFile
         ],
                            errorMsg='Cannot assemble %s with llvm-as' %
                            inputFile)
     return ret
Ejemplo n.º 8
0
 def haveDragonegg():
     if not hasattr(SulongTestSuite, '_haveDragonegg'):
         SulongTestSuite._haveDragonegg = mx_sulong.dragonEggPath() is not None and os.path.exists(mx_sulong.dragonEggPath()) and mx_sulong.getGCC(optional=True) is not None
     return SulongTestSuite._haveDragonegg
Ejemplo n.º 9
0
 def run(self, inputFile, outputFile, flags):
     tool, toolFlags = self.getTool(inputFile, outputFile)
     ret = self.runTool([tool, '-S', '-fplugin=' + mx_sulong.dragonEggPath(), '-fplugin-arg-dragonegg-emit-ir', '-o', '%s.tmp.ll' % outputFile] + toolFlags + flags + [inputFile], errorMsg='Cannot compile %s with %s' % (inputFile, os.path.basename(tool)))
     if ret == 0:
         ret = self.runTool([mx_sulong.findLLVMProgramForDragonegg('llvm-as'), '-o', outputFile, '%s.tmp.ll' % outputFile], errorMsg='Cannot assemble %s with llvm-as' % inputFile)
     return ret