[Libclc-dev] [PATCH 2/4] configure: Add target specific asm rule.

Jan Vesely via Libclc-dev libclc-dev at lists.llvm.org
Tue Nov 13 12:16:12 PST 2018


Run the file through target specific preprocessing stage.
Signed-off-by: Jan Vesely <jan.vesely at rutgers.edu>
---
 configure.py | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/configure.py b/configure.py
index 2a5d3a7..dab5dc9 100755
--- a/configure.py
+++ b/configure.py
@@ -213,6 +213,8 @@ for target in targets:
       clang_bc_flags += ' -mcpu=' + device['gpu']
     clang_bc_rule = "CLANG_CL_BC_" + target + "_" + device['gpu']
     c_compiler_rule(b, clang_bc_rule, "LLVM-CC", llvm_clang, clang_bc_flags)
+    as_bc_rule = "LLVM_AS_BC_" + target + "_" + device['gpu']
+    b.rule(as_bc_rule, "%s -E -P %s -x cl $in -o - | %s -o $out" % (llvm_clang, clang_bc_flags, llvm_as), 'LLVM-AS $out')
 
     objects = []
     sources_seen = set()
@@ -265,7 +267,7 @@ for target in targets:
           src_file = os.path.join(src_path, src)
           ext = os.path.splitext(src)[1]
           if ext == '.ll':
-            b.build(obj, 'LLVM_AS', src_file)
+            b.build(obj, as_bc_rule, src_file)
           else:
             b.build(obj, clang_bc_rule, src_file)
 
-- 
2.19.1



More information about the Libclc-dev mailing list