OSDN Git Service

android: add support for libLLVMTableGenGlobalISel
authorMauro Rossi <issor.oruam@gmail.com>
Sun, 9 Feb 2020 19:40:44 +0000 (20:40 +0100)
committerMauro Rossi <issor.oruam@gmail.com>
Thu, 15 Apr 2021 11:05:08 +0000 (13:05 +0200)
Fixes the following building error:

external/llvm/utils/TableGen/GlobalISel/CodeExpander.h:50:
error: undefined reference to 'llvm::CodeExpander::emit(llvm::raw_ostream&) const'

llvm/utils/TableGen/Android.bp
llvm/utils/TableGen/GlobalISel/Android.bp [new file with mode: 0644]

index 7dc34a6..69d0487 100644 (file)
@@ -4,6 +4,7 @@ cc_binary_host {
     srcs: ["*.cpp"],
 
     static_libs: [
+        "libLLVMTableGenGlobalISel",
         "libLLVMTableGen",
         "libLLVMSupport",
     ],
@@ -32,3 +33,5 @@ cc_binary_host {
         },
     },
 }
+
+subdirs = ["*"]
diff --git a/llvm/utils/TableGen/GlobalISel/Android.bp b/llvm/utils/TableGen/GlobalISel/Android.bp
new file mode 100644 (file)
index 0000000..6faf3ed
--- /dev/null
@@ -0,0 +1,33 @@
+cc_library_static {
+    name: "libLLVMTableGenGlobalISel",
+    defaults: ["llvm-defaults-no-generated-headers"],
+    srcs: ["*.cpp"],
+
+    static_libs: [
+        "libLLVMSupport",
+    ],
+
+    host_ldlibs: ["-lm"],
+    target: {
+        windows: {
+            enabled: false,
+        },
+        // llvm-defaults turns off host builds by default, turn it back on for
+        // modules that are used to build llvm-tblgen
+        host: {
+            enabled: true,
+        },
+        darwin: {
+            host_ldlibs: [
+                "-lpthread",
+                "-ldl",
+            ],
+        },
+        linux: {
+            host_ldlibs: [
+                "-lpthread",
+                "-ldl",
+            ],
+        },
+    },
+}