Ryan Prichard | 80e40f0 | 2019-10-31 19:54:46 -0700 | [diff] [blame] | 1 | // ======================================================== |
| 2 | // linker_wrapper - Linux Bionic (on the host) |
| 3 | // ======================================================== |
Colin Cross | 97f0aef | 2016-07-14 16:05:46 -0700 | [diff] [blame] | 4 | |
Dan Willemsen | 7ccc50d | 2017-09-18 21:28:14 -0700 | [diff] [blame] | 5 | // This is used for bionic on (host) Linux to bootstrap our linker embedded into |
| 6 | // a binary. |
| 7 | // |
| 8 | // Host bionic binaries do not have a PT_INTERP section, instead this gets |
| 9 | // embedded as the entry point, and the linker is embedded as ELF sections in |
| 10 | // each binary. There's a linker script that sets all of that up (generated by |
| 11 | // extract_linker), and defines the extern symbols used in this file. |
| 12 | cc_object { |
| 13 | name: "linker_wrapper", |
| 14 | host_supported: true, |
| 15 | device_supported: false, |
| 16 | target: { |
Elliott Hughes | d50a1de | 2018-02-05 17:30:57 -0800 | [diff] [blame] | 17 | linux_bionic: { |
| 18 | enabled: true, |
| 19 | }, |
| 20 | linux_glibc: { |
| 21 | enabled: false, |
| 22 | }, |
| 23 | darwin: { |
| 24 | enabled: false, |
| 25 | }, |
Dan Willemsen | 7ccc50d | 2017-09-18 21:28:14 -0700 | [diff] [blame] | 26 | }, |
| 27 | |
| 28 | cflags: [ |
| 29 | "-fno-stack-protector", |
| 30 | "-Wstrict-overflow=5", |
| 31 | "-fvisibility=hidden", |
| 32 | "-Wall", |
| 33 | "-Wextra", |
| 34 | "-Wno-unused", |
| 35 | "-Werror", |
| 36 | ], |
| 37 | |
| 38 | srcs: [ |
| 39 | "linker_wrapper.cpp", |
| 40 | ], |
| 41 | arch: { |
| 42 | x86_64: { |
| 43 | srcs: ["arch/x86_64/begin.S"], |
| 44 | }, |
| 45 | }, |
| 46 | |
| 47 | prefix_symbols: "__dlwrap_", |
| 48 | |
| 49 | // We need to access Bionic private headers in the linker. |
| 50 | include_dirs: ["bionic/libc"], |
| 51 | } |
| 52 | |
Ryan Prichard | 80e40f0 | 2019-10-31 19:54:46 -0700 | [diff] [blame] | 53 | // ======================================================== |
| 54 | // linker default configuration |
| 55 | // ======================================================== |
| 56 | |
| 57 | // Configuration for the linker binary and any of its static libraries. |
| 58 | cc_defaults { |
| 59 | name: "linker_defaults", |
| 60 | arch: { |
| 61 | arm: { |
| 62 | cflags: ["-D__work_around_b_24465209__"], |
| 63 | }, |
| 64 | x86: { |
| 65 | cflags: ["-D__work_around_b_24465209__"], |
| 66 | }, |
| 67 | }, |
| 68 | |
| 69 | cflags: [ |
| 70 | "-fno-stack-protector", |
| 71 | "-Wstrict-overflow=5", |
| 72 | "-fvisibility=hidden", |
| 73 | "-Wall", |
| 74 | "-Wextra", |
| 75 | "-Wunused", |
| 76 | "-Werror", |
| 77 | ], |
| 78 | |
| 79 | // TODO: split out the asflags. |
| 80 | asflags: [ |
| 81 | "-fno-stack-protector", |
| 82 | "-Wstrict-overflow=5", |
| 83 | "-fvisibility=hidden", |
| 84 | "-Wall", |
| 85 | "-Wextra", |
| 86 | "-Wunused", |
| 87 | "-Werror", |
| 88 | ], |
| 89 | |
| 90 | product_variables: { |
| 91 | debuggable: { |
| 92 | cppflags: ["-DUSE_LD_CONFIG_FILE"], |
| 93 | }, |
| 94 | }, |
| 95 | |
| 96 | cppflags: ["-Wold-style-cast"], |
| 97 | |
| 98 | static_libs: [ |
| 99 | "libziparchive", |
| 100 | "libbase", |
| 101 | "libz", |
| 102 | |
| 103 | "libasync_safe", |
| 104 | |
| 105 | "liblog", |
| 106 | ], |
| 107 | |
| 108 | // We need to access Bionic private headers in the linker. |
| 109 | include_dirs: ["bionic/libc"], |
| 110 | } |
| 111 | |
| 112 | // ======================================================== |
| 113 | // linker components |
| 114 | // ======================================================== |
| 115 | |
| 116 | // Enable a module on all targets the linker runs on (ordinary Android targets, Linux Bionic, and |
| 117 | // native bridge implementations). |
| 118 | cc_defaults { |
| 119 | name: "linker_all_targets", |
| 120 | defaults: ["linux_bionic_supported"], |
| 121 | recovery_available: true, |
| 122 | native_bridge_supported: true, |
| 123 | } |
| 124 | |
| 125 | cc_library_static { |
Ryan Prichard | 249757b | 2019-11-01 17:18:28 -0700 | [diff] [blame^] | 126 | name: "liblinker_main", |
| 127 | defaults: ["linker_defaults", "linker_all_targets"], |
| 128 | srcs: ["linker_main.cpp"], |
| 129 | |
| 130 | // Ensure that the compiler won't insert string function calls before ifuncs are resolved. |
| 131 | cflags: ["-ffreestanding"], |
| 132 | } |
| 133 | |
| 134 | cc_library_static { |
Ryan Prichard | 80e40f0 | 2019-10-31 19:54:46 -0700 | [diff] [blame] | 135 | name: "liblinker_malloc", |
| 136 | defaults: ["linker_defaults", "linker_all_targets"], |
| 137 | srcs: ["linker_memory.cpp"], |
| 138 | } |
| 139 | |
| 140 | cc_library_static { |
| 141 | name: "liblinker_debuggerd_stub", |
| 142 | defaults: ["linker_defaults", "linker_all_targets"], |
| 143 | srcs: ["linker_debuggerd_stub.cpp"], |
| 144 | } |
| 145 | |
| 146 | // ======================================================== |
| 147 | // template for the linker binary |
| 148 | // ======================================================== |
| 149 | |
dimitry | b8b3a76 | 2018-09-25 12:31:11 +0200 | [diff] [blame] | 150 | filegroup { |
| 151 | name: "linker_sources", |
Colin Cross | 97f0aef | 2016-07-14 16:05:46 -0700 | [diff] [blame] | 152 | srcs: [ |
| 153 | "dlfcn.cpp", |
| 154 | "linker.cpp", |
| 155 | "linker_block_allocator.cpp", |
Dimitry Ivanov | 769b33f | 2016-07-21 11:33:40 -0700 | [diff] [blame] | 156 | "linker_dlwarning.cpp", |
Evgenii Stepanov | 0a3637d | 2016-07-06 13:20:59 -0700 | [diff] [blame] | 157 | "linker_cfi.cpp", |
Dimitry Ivanov | 4cabfaa | 2017-03-07 11:19:05 -0800 | [diff] [blame] | 158 | "linker_config.cpp", |
Colin Cross | 97f0aef | 2016-07-14 16:05:46 -0700 | [diff] [blame] | 159 | "linker_gdb_support.cpp", |
Dimitry Ivanov | 48ec288 | 2016-08-04 11:50:36 -0700 | [diff] [blame] | 160 | "linker_globals.cpp", |
Colin Cross | 97f0aef | 2016-07-14 16:05:46 -0700 | [diff] [blame] | 161 | "linker_libc_support.c", |
Dimitry Ivanov | 451909d | 2017-01-26 16:52:59 -0800 | [diff] [blame] | 162 | "linker_libcxx_support.cpp", |
Dimitry Ivanov | b943f30 | 2016-08-03 16:00:10 -0700 | [diff] [blame] | 163 | "linker_namespaces.cpp", |
Colin Cross | 97f0aef | 2016-07-14 16:05:46 -0700 | [diff] [blame] | 164 | "linker_logger.cpp", |
| 165 | "linker_mapped_file_fragment.cpp", |
| 166 | "linker_phdr.cpp", |
| 167 | "linker_sdk_versions.cpp", |
Dimitry Ivanov | 48ec288 | 2016-08-04 11:50:36 -0700 | [diff] [blame] | 168 | "linker_soinfo.cpp", |
Ryan Prichard | 45d1349 | 2019-01-03 02:51:30 -0800 | [diff] [blame] | 169 | "linker_tls.cpp", |
Colin Cross | 97f0aef | 2016-07-14 16:05:46 -0700 | [diff] [blame] | 170 | "linker_utils.cpp", |
| 171 | "rt.cpp", |
| 172 | ], |
dimitry | b8b3a76 | 2018-09-25 12:31:11 +0200 | [diff] [blame] | 173 | } |
Colin Cross | 97f0aef | 2016-07-14 16:05:46 -0700 | [diff] [blame] | 174 | |
dimitry | b8b3a76 | 2018-09-25 12:31:11 +0200 | [diff] [blame] | 175 | filegroup { |
| 176 | name: "linker_sources_arm", |
| 177 | srcs: [ |
| 178 | "arch/arm/begin.S", |
dimitry | b8b3a76 | 2018-09-25 12:31:11 +0200 | [diff] [blame] | 179 | ], |
| 180 | } |
| 181 | |
| 182 | filegroup { |
| 183 | name: "linker_sources_arm64", |
| 184 | srcs: [ |
| 185 | "arch/arm64/begin.S", |
Ryan Prichard | ffaae70 | 2019-01-23 17:47:10 -0800 | [diff] [blame] | 186 | "arch/arm64/tlsdesc_resolver.S", |
dimitry | b8b3a76 | 2018-09-25 12:31:11 +0200 | [diff] [blame] | 187 | ], |
| 188 | } |
| 189 | |
| 190 | filegroup { |
| 191 | name: "linker_sources_x86", |
| 192 | srcs: [ |
| 193 | "arch/x86/begin.S", |
| 194 | ], |
| 195 | } |
| 196 | |
| 197 | filegroup { |
| 198 | name: "linker_sources_x86_64", |
| 199 | srcs: [ |
| 200 | "arch/x86_64/begin.S", |
| 201 | ], |
| 202 | } |
| 203 | |
| 204 | filegroup { |
| 205 | name: "linker_sources_mips", |
| 206 | srcs: [ |
| 207 | "arch/mips/begin.S", |
| 208 | "linker_mips.cpp", |
| 209 | ], |
| 210 | } |
| 211 | |
| 212 | filegroup { |
| 213 | name: "linker_sources_mips64", |
| 214 | srcs: [ |
| 215 | "arch/mips64/begin.S", |
| 216 | "linker_mips.cpp", |
| 217 | ], |
| 218 | } |
| 219 | |
dimitry | b8b3a76 | 2018-09-25 12:31:11 +0200 | [diff] [blame] | 220 | cc_defaults { |
Ryan Prichard | 80e40f0 | 2019-10-31 19:54:46 -0700 | [diff] [blame] | 221 | name: "linker_version_script_overlay", |
| 222 | arch: { |
| 223 | arm: { version_script: "linker.arm.map" }, |
| 224 | arm64: { version_script: "linker.generic.map" }, |
| 225 | x86: { version_script: "linker.generic.map" }, |
| 226 | x86_64: { version_script: "linker.generic.map" }, |
| 227 | mips: { version_script: "linker.generic.map" }, |
| 228 | mips64: { version_script: "linker.generic.map" }, |
| 229 | }, |
| 230 | } |
| 231 | |
| 232 | // A template for the linker binary. May be inherited by native bridge implementations. |
| 233 | cc_defaults { |
| 234 | name: "linker_bin_template", |
| 235 | defaults: ["linker_defaults"], |
| 236 | |
| 237 | srcs: [":linker_sources"], |
| 238 | |
Colin Cross | 97f0aef | 2016-07-14 16:05:46 -0700 | [diff] [blame] | 239 | arch: { |
| 240 | arm: { |
Ryan Prichard | 80e40f0 | 2019-10-31 19:54:46 -0700 | [diff] [blame] | 241 | srcs: [":linker_sources_arm"], |
| 242 | static_libs: ["libunwind_llvm"], |
| 243 | }, |
| 244 | arm64: { |
| 245 | srcs: [":linker_sources_arm64"], |
Colin Cross | 97f0aef | 2016-07-14 16:05:46 -0700 | [diff] [blame] | 246 | }, |
| 247 | x86: { |
Ryan Prichard | 80e40f0 | 2019-10-31 19:54:46 -0700 | [diff] [blame] | 248 | srcs: [":linker_sources_x86"], |
| 249 | }, |
| 250 | x86_64: { |
| 251 | srcs: [":linker_sources_x86_64"], |
| 252 | }, |
| 253 | mips: { |
| 254 | srcs: [":linker_sources_mips"], |
| 255 | }, |
| 256 | mips64: { |
| 257 | srcs: [":linker_sources_mips64"], |
Colin Cross | 97f0aef | 2016-07-14 16:05:46 -0700 | [diff] [blame] | 258 | }, |
| 259 | }, |
| 260 | |
Ryan Prichard | 80e40f0 | 2019-10-31 19:54:46 -0700 | [diff] [blame] | 261 | // -shared is used to overwrite the -Bstatic and -static flags triggered by enabling |
| 262 | // static_executable. This dynamic linker is actually a shared object linked with static |
| 263 | // libraries. |
Colin Cross | 97f0aef | 2016-07-14 16:05:46 -0700 | [diff] [blame] | 264 | ldflags: [ |
| 265 | "-shared", |
| 266 | "-Wl,-Bsymbolic", |
| 267 | "-Wl,--exclude-libs,ALL", |
dimitry | 8e8c2c0 | 2018-01-04 12:08:32 +0100 | [diff] [blame] | 268 | "-Wl,-soname,ld-android.so", |
Colin Cross | 97f0aef | 2016-07-14 16:05:46 -0700 | [diff] [blame] | 269 | ], |
| 270 | |
Dimitry Ivanov | fc0d480 | 2016-12-06 11:10:09 -0800 | [diff] [blame] | 271 | // we are going to link libc++_static manually because |
| 272 | // when stl is not set to "none" build system adds libdl |
| 273 | // to the list of static libraries which needs to be |
| 274 | // avoided in the case of building loader. |
| 275 | stl: "none", |
| 276 | |
Colin Cross | 97f0aef | 2016-07-14 16:05:46 -0700 | [diff] [blame] | 277 | // we don't want crtbegin.o (because we have begin.o), so unset it |
| 278 | // just for this module |
| 279 | nocrt: true, |
| 280 | |
dimitry | b8b3a76 | 2018-09-25 12:31:11 +0200 | [diff] [blame] | 281 | static_executable: true, |
| 282 | |
| 283 | // Leave the symbols in the shared library so that stack unwinders can produce |
| 284 | // meaningful name resolution. |
| 285 | strip: { |
| 286 | keep_symbols: true, |
| 287 | }, |
| 288 | |
| 289 | // Insert an extra objcopy step to add prefix to symbols. This is needed to prevent gdb |
| 290 | // looking up symbols in the linker by mistake. |
| 291 | prefix_symbols: "__dl_", |
| 292 | |
| 293 | sanitize: { |
| 294 | hwaddress: false, |
| 295 | }, |
dimitry | b8b3a76 | 2018-09-25 12:31:11 +0200 | [diff] [blame] | 296 | |
Colin Cross | 97f0aef | 2016-07-14 16:05:46 -0700 | [diff] [blame] | 297 | static_libs: [ |
Ryan Prichard | 249757b | 2019-11-01 17:18:28 -0700 | [diff] [blame^] | 298 | "liblinker_main", |
Ryan Prichard | 80e40f0 | 2019-10-31 19:54:46 -0700 | [diff] [blame] | 299 | "liblinker_malloc", |
| 300 | |
| 301 | "libc++_static", |
Colin Cross | 97f0aef | 2016-07-14 16:05:46 -0700 | [diff] [blame] | 302 | "libc_nomalloc", |
Ryan Prichard | 249757b | 2019-11-01 17:18:28 -0700 | [diff] [blame^] | 303 | "libc_dynamic_dispatch", |
Dimitry Ivanov | 451909d | 2017-01-26 16:52:59 -0800 | [diff] [blame] | 304 | "libm", |
Colin Cross | 97f0aef | 2016-07-14 16:05:46 -0700 | [diff] [blame] | 305 | ], |
Colin Cross | 97f0aef | 2016-07-14 16:05:46 -0700 | [diff] [blame] | 306 | |
Ryan Prichard | d9a4115 | 2019-10-14 16:58:53 -0700 | [diff] [blame] | 307 | // Ensure that if the linker needs __gnu_Unwind_Find_exidx, then the linker will have a |
| 308 | // definition of the symbol. The linker links against libgcc.a, whose arm32 unwinder has a weak |
| 309 | // reference to __gnu_Unwind_Find_exidx, which isn't sufficient to pull in the strong definition |
| 310 | // of __gnu_Unwind_Find_exidx from libc. An unresolved weak reference would create a |
| 311 | // non-relative dynamic relocation in the linker binary, which complicates linker startup. |
| 312 | // |
| 313 | // This line should be unnecessary because the linker's dependency on libunwind_llvm.a should |
| 314 | // override libgcc.a, but this line provides a simpler guarantee. It can be removed once the |
| 315 | // linker stops linking against libgcc.a's arm32 unwinder. |
| 316 | whole_static_libs: ["libc_unwind_static"], |
| 317 | |
Ryan Prichard | 80e40f0 | 2019-10-31 19:54:46 -0700 | [diff] [blame] | 318 | system_shared_libs: [], |
| 319 | |
| 320 | // Opt out of native_coverage when opting out of system_shared_libs |
| 321 | native_coverage: false, |
| 322 | } |
| 323 | |
| 324 | // ======================================================== |
| 325 | // linker[_asan][64] binary |
| 326 | // ======================================================== |
| 327 | |
| 328 | cc_binary { |
Colin Cross | 97f0aef | 2016-07-14 16:05:46 -0700 | [diff] [blame] | 329 | name: "linker", |
Ryan Prichard | 80e40f0 | 2019-10-31 19:54:46 -0700 | [diff] [blame] | 330 | defaults: [ |
| 331 | "linker_bin_template", |
| 332 | "linux_bionic_supported", |
| 333 | "linker_version_script_overlay", |
| 334 | ], |
| 335 | |
Colin Cross | 10fffb4 | 2016-12-08 09:57:35 -0800 | [diff] [blame] | 336 | symlinks: ["linker_asan"], |
Colin Cross | 97f0aef | 2016-07-14 16:05:46 -0700 | [diff] [blame] | 337 | multilib: { |
Jiyong Park | 57b9d1e | 2019-01-17 03:14:45 +0900 | [diff] [blame] | 338 | lib32: { |
| 339 | cflags: ["-DLIB_PATH=\"lib\""], |
| 340 | }, |
Colin Cross | 97f0aef | 2016-07-14 16:05:46 -0700 | [diff] [blame] | 341 | lib64: { |
Jiyong Park | 57b9d1e | 2019-01-17 03:14:45 +0900 | [diff] [blame] | 342 | cflags: ["-DLIB_PATH=\"lib64\""], |
Colin Cross | 97f0aef | 2016-07-14 16:05:46 -0700 | [diff] [blame] | 343 | suffix: "64", |
Colin Cross | 10fffb4 | 2016-12-08 09:57:35 -0800 | [diff] [blame] | 344 | }, |
Colin Cross | 97f0aef | 2016-07-14 16:05:46 -0700 | [diff] [blame] | 345 | }, |
Pirama Arumuga Nainar | fcd3538 | 2019-02-14 13:48:01 -0800 | [diff] [blame] | 346 | |
Ryan Prichard | 80e40f0 | 2019-10-31 19:54:46 -0700 | [diff] [blame] | 347 | compile_multilib: "both", |
| 348 | xom: false, |
| 349 | |
| 350 | recovery_available: true, |
| 351 | apex_available: [ |
| 352 | "//apex_available:platform", |
| 353 | "com.android.runtime", |
| 354 | ], |
Pirama Arumuga Nainar | fcd3538 | 2019-02-14 13:48:01 -0800 | [diff] [blame] | 355 | |
Colin Cross | 97f0aef | 2016-07-14 16:05:46 -0700 | [diff] [blame] | 356 | target: { |
Dan Willemsen | 7ec52b1 | 2016-11-28 17:02:25 -0800 | [diff] [blame] | 357 | android: { |
Ryan Prichard | 80e40f0 | 2019-10-31 19:54:46 -0700 | [diff] [blame] | 358 | srcs: [ |
| 359 | "linker_debuggerd_android.cpp", |
| 360 | ], |
Dan Albert | 4ea1921 | 2019-07-23 13:31:14 -0700 | [diff] [blame] | 361 | static_libs: [ |
| 362 | "libc++demangle", |
| 363 | "libdebuggerd_handler_fallback", |
| 364 | ], |
Dan Willemsen | 7ec52b1 | 2016-11-28 17:02:25 -0800 | [diff] [blame] | 365 | }, |
Ryan Prichard | 80e40f0 | 2019-10-31 19:54:46 -0700 | [diff] [blame] | 366 | linux_bionic: { |
| 367 | static_libs: [ |
| 368 | "liblinker_debuggerd_stub", |
| 369 | ], |
| 370 | } |
Colin Cross | 97f0aef | 2016-07-14 16:05:46 -0700 | [diff] [blame] | 371 | }, |
Colin Cross | 97f0aef | 2016-07-14 16:05:46 -0700 | [diff] [blame] | 372 | } |
dimitry | 11da1dc | 2018-01-05 13:35:43 +0100 | [diff] [blame] | 373 | |
Ryan Prichard | 80e40f0 | 2019-10-31 19:54:46 -0700 | [diff] [blame] | 374 | // ======================================================== |
| 375 | // assorted modules |
| 376 | // ======================================================== |
| 377 | |
Elliott Hughes | 90f96b9 | 2019-05-09 15:56:39 -0700 | [diff] [blame] | 378 | sh_binary { |
| 379 | name: "ldd", |
| 380 | src: "ldd", |
| 381 | } |
| 382 | |
dimitry | 11da1dc | 2018-01-05 13:35:43 +0100 | [diff] [blame] | 383 | cc_library { |
| 384 | // NOTE: --exclude-libs=libgcc.a makes sure that any symbols ld-android.so pulls from |
| 385 | // libgcc.a are made static to ld-android.so. This in turn ensures that libraries that |
| 386 | // a) pull symbols from libgcc.a and b) depend on ld-android.so will not rely on ld-android.so |
| 387 | // to provide those symbols, but will instead pull them from libgcc.a. Specifically, |
| 388 | // we use this property to make sure libc.so has its own copy of the code from |
| 389 | // libgcc.a it uses. |
| 390 | // |
| 391 | // DO NOT REMOVE --exclude-libs! |
| 392 | |
Yi Kong | 7786a34 | 2018-08-31 19:01:56 -0700 | [diff] [blame] | 393 | ldflags: [ |
| 394 | "-Wl,--exclude-libs=libgcc.a", |
Yi Kong | 7ac2afb | 2019-05-06 16:23:10 -0700 | [diff] [blame] | 395 | "-Wl,--exclude-libs=libgcc_stripped.a", |
Yi Kong | 7786a34 | 2018-08-31 19:01:56 -0700 | [diff] [blame] | 396 | "-Wl,--exclude-libs=libclang_rt.builtins-arm-android.a", |
| 397 | "-Wl,--exclude-libs=libclang_rt.builtins-aarch64-android.a", |
| 398 | "-Wl,--exclude-libs=libclang_rt.builtins-x86-android.a", |
| 399 | "-Wl,--exclude-libs=libclang_rt.builtins-x86_64-android.a", |
| 400 | ], |
dimitry | 11da1dc | 2018-01-05 13:35:43 +0100 | [diff] [blame] | 401 | |
| 402 | // for x86, exclude libgcc_eh.a for the same reasons as above |
| 403 | arch: { |
| 404 | x86: { |
| 405 | ldflags: ["-Wl,--exclude-libs=libgcc_eh.a"], |
| 406 | }, |
| 407 | x86_64: { |
| 408 | ldflags: ["-Wl,--exclude-libs=libgcc_eh.a"], |
| 409 | }, |
| 410 | }, |
dimitry | 581723e | 2018-01-05 14:31:44 +0100 | [diff] [blame] | 411 | |
| 412 | srcs: ["ld_android.cpp"], |
dimitry | 11da1dc | 2018-01-05 13:35:43 +0100 | [diff] [blame] | 413 | cflags: [ |
| 414 | "-Wall", |
| 415 | "-Wextra", |
| 416 | "-Wunused", |
| 417 | "-Werror", |
| 418 | ], |
| 419 | stl: "none", |
| 420 | |
| 421 | name: "ld-android", |
Ryan Prichard | 80e40f0 | 2019-10-31 19:54:46 -0700 | [diff] [blame] | 422 | defaults: ["linux_bionic_supported", "linker_version_script_overlay"], |
Jiyong Park | 5603c6e | 2018-04-27 21:53:11 +0900 | [diff] [blame] | 423 | recovery_available: true, |
dimitry | 7f04880 | 2019-05-03 15:57:34 +0200 | [diff] [blame] | 424 | native_bridge_supported: true, |
dimitry | 11da1dc | 2018-01-05 13:35:43 +0100 | [diff] [blame] | 425 | |
Ryan Prichard | 470b666 | 2018-03-27 22:10:55 -0700 | [diff] [blame] | 426 | nocrt: true, |
dimitry | 11da1dc | 2018-01-05 13:35:43 +0100 | [diff] [blame] | 427 | system_shared_libs: [], |
| 428 | |
Pirama Arumuga Nainar | fcd3538 | 2019-02-14 13:48:01 -0800 | [diff] [blame] | 429 | // Opt out of native_coverage when opting out of system_shared_libs |
| 430 | native_coverage: false, |
| 431 | |
dimitry | 11da1dc | 2018-01-05 13:35:43 +0100 | [diff] [blame] | 432 | sanitize: { |
| 433 | never: true, |
| 434 | }, |
Jiyong Park | e87e0dc | 2019-10-02 17:09:33 +0900 | [diff] [blame] | 435 | |
| 436 | apex_available: [ |
| 437 | "//apex_available:platform", |
| 438 | "com.android.runtime", |
| 439 | ], |
dimitry | 11da1dc | 2018-01-05 13:35:43 +0100 | [diff] [blame] | 440 | } |
Elliott Hughes | 15a2b7b | 2019-02-15 13:48:38 -0800 | [diff] [blame] | 441 | |
| 442 | cc_test { |
| 443 | name: "linker-unit-tests", |
| 444 | |
| 445 | cflags: [ |
| 446 | "-g", |
| 447 | "-Wall", |
| 448 | "-Wextra", |
| 449 | "-Wunused", |
| 450 | "-Werror", |
| 451 | ], |
| 452 | |
| 453 | // We need to access Bionic private headers in the linker. |
| 454 | include_dirs: ["bionic/libc"], |
| 455 | |
| 456 | srcs: [ |
| 457 | // Tests. |
| 458 | "linker_block_allocator_test.cpp", |
| 459 | "linker_config_test.cpp", |
| 460 | "linked_list_test.cpp", |
| 461 | "linker_sleb128_test.cpp", |
| 462 | "linker_utils_test.cpp", |
| 463 | |
| 464 | // Parts of the linker that we're testing. |
| 465 | "linker_block_allocator.cpp", |
| 466 | "linker_config.cpp", |
| 467 | "linker_test_globals.cpp", |
| 468 | "linker_utils.cpp", |
| 469 | ], |
| 470 | |
| 471 | static_libs: [ |
| 472 | "libasync_safe", |
| 473 | "libbase", |
| 474 | "liblog", |
| 475 | ], |
| 476 | } |