[pypy-svn] r19057 - in pypy/dist/pypy/translator/llvm: . module

ericvrp at codespeak.net ericvrp at codespeak.net
Thu Oct 27 09:08:08 CEST 2005


Author: ericvrp
Date: Thu Oct 27 09:08:07 2005
New Revision: 19057

Modified:
   pypy/dist/pypy/translator/llvm/build_llvm_module.py
   pypy/dist/pypy/translator/llvm/externs2ll.py
   pypy/dist/pypy/translator/llvm/module/genexterns.c
Log:
Sligtly better warnings in case gcc-llvm or upx is not available locally.

LLVM 1.6 will come out in a weeks time. We should see if using
gcc-llvm remotely (on codespeak) is still a good idea by then.
(gcc-llvm does not seem too hard to install after all)

note: this was not the reason for the failing tests.
      (rxe fixed those in r19054 (thanks!))



Modified: pypy/dist/pypy/translator/llvm/build_llvm_module.py
==============================================================================
--- pypy/dist/pypy/translator/llvm/build_llvm_module.py	(original)
+++ pypy/dist/pypy/translator/llvm/build_llvm_module.py	Thu Oct 27 09:08:07 2005
@@ -114,8 +114,8 @@
 
     if cleanup and exe_name and not profile:
         cmds.append('strip ' + exe_name)
-        upx = os.popen('which upx').read()
-        if upx: #compress file even further
+        upx = os.popen('which upx 2>&1').read()
+        if upx and not upx.startswith('which'): #compress file even further
             cmds.append('upx ' + exe_name)
 
     try:

Modified: pypy/dist/pypy/translator/llvm/externs2ll.py
==============================================================================
--- pypy/dist/pypy/translator/llvm/externs2ll.py	(original)
+++ pypy/dist/pypy/translator/llvm/externs2ll.py	Thu Oct 27 09:08:07 2005
@@ -15,8 +15,9 @@
     f = open(filename, "w")
     f.write(ccode)
     f.close()
-    
-    if os.popen('which llvm-gcc').read():   #local llvm CFE available
+
+    llvm_gcc = os.popen('which llvm-gcc 2>&1').read()
+    if llvm_gcc and not llvm_gcc.startswith('which'):   #local llvm CFE available
         #log('using local llvm-gcc')
         plain = filename[:-2]
         os.system("llvm-gcc -S %s.c -o %s.ll 2>&1" % (plain, plain))
@@ -74,7 +75,10 @@
         ll_lines2.append(line)
 
     llcode = '\n'.join(ll_lines2)
-    decl, impl = llcode.split('implementation')
+    try:
+        decl, impl = llcode.split('implementation')
+    except:
+        raise "Can't compile external function code (llcode.c): ERROR:", llcode
     impl += """;functions that should return a bool according to
     ; pypy/rpython/extfunctable.py  , but C doesn't have bools!
 

Modified: pypy/dist/pypy/translator/llvm/module/genexterns.c
==============================================================================
--- pypy/dist/pypy/translator/llvm/module/genexterns.c	(original)
+++ pypy/dist/pypy/translator/llvm/module/genexterns.c	Thu Oct 27 09:08:07 2005
@@ -24,9 +24,4 @@
 //the placeholder in the next line gets replaced by the actual python.h path
 #include __PYTHON_H__
 
-// Do this manually from python :-(
-//#include "ll_os.h"
-//#include "ll_math.h"
-//#include "ll_time.h"
-//#include "ll_strtod.h"
-
+// Append some genc files here manually from python



More information about the Pypy-commit mailing list