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