• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1// Collect target specific code generation libraries
2MCLD_ARM_LIBS = [
3    "libmcldARMTarget",
4    "libmcldARMInfo",
5]
6MCLD_AARCH64_LIBS = [
7    "libmcldAArch64Target",
8    "libmcldAArch64Info",
9]
10MCLD_MIPS_LIBS = [
11    "libmcldMipsTarget",
12    "libmcldMipsInfo",
13]
14MCLD_X86_LIBS = [
15    "libmcldX86Target",
16    "libmcldX86Info",
17]
18
19// Build Options.inc from Options.td
20llvm_tblgen {
21    name: "mcld-gen-options",
22    in: "Options.td",
23    outs: ["Options.inc"],
24}
25
26cc_binary {
27    name: "ld.mc",
28    defaults: ["mcld-defaults"],
29    host_supported: true,
30    generated_headers: ["mcld-gen-options"],
31
32    srcs: ["Main.cpp"],
33
34    // arch-specific static libraries depend on libmcldTarget.
35    // Can be removed once soong supports transitive static library dependencies
36    group_static_libs: true,
37    static_libs: [
38        "libmcldADT",
39        "libmcldCore",
40        "libmcldFragment",
41        "libmcldLD",
42        "libmcldLDVariant",
43        "libmcldMC",
44        "libmcldObject",
45        "libmcldScript",
46        "libmcldSupport",
47        "libmcldTarget",
48    ],
49
50    shared_libs: [
51        "libLLVM",
52    ],
53
54    target: {
55        host: {
56            shared_libs: ["libz-host"],
57            static_libs: MCLD_ARM_LIBS + MCLD_AARCH64_LIBS +
58                MCLD_MIPS_LIBS + MCLD_X86_LIBS,
59        },
60        android: {
61            shared_libs: ["libz"],
62        },
63
64        // Add target specific code generation libraries
65        android_arm: {
66            static_libs: MCLD_ARM_LIBS,
67        },
68        android_arm64: {
69            // Include ARM libs to enable 32-bit linking on AARCH64 targets
70            static_libs: MCLD_ARM_LIBS + MCLD_AARCH64_LIBS,
71        },
72        android_mips: {
73            static_libs: MCLD_MIPS_LIBS,
74        },
75        android_mips64: {
76            static_libs: MCLD_MIPS_LIBS,
77        },
78        android_x86: {
79            static_libs: MCLD_X86_LIBS,
80        },
81        android_x86_64: {
82            static_libs: MCLD_X86_LIBS,
83        },
84        arm_on_x86: {
85            static_libs: MCLD_ARM_LIBS + MCLD_AARCH64_LIBS,
86        },
87        arm_on_x86_64: {
88            static_libs: MCLD_ARM_LIBS + MCLD_AARCH64_LIBS,
89        },
90    },
91}
92