2015-09-17 01:33:27 +02:00
|
|
|
//
|
|
|
|
// libdl
|
|
|
|
//
|
2021-02-19 22:06:22 +01:00
|
|
|
package {
|
|
|
|
default_applicable_licenses: ["bionic_libdl_license"],
|
|
|
|
}
|
|
|
|
|
|
|
|
license {
|
|
|
|
name: "bionic_libdl_license",
|
|
|
|
visibility: [":__subpackages__"],
|
|
|
|
license_kinds: [
|
|
|
|
"SPDX-license-identifier-Apache-2.0",
|
|
|
|
],
|
|
|
|
license_text: [
|
|
|
|
"NOTICE",
|
|
|
|
],
|
|
|
|
}
|
|
|
|
|
2017-10-05 17:23:10 +02:00
|
|
|
cc_library_static {
|
|
|
|
name: "libdl_static",
|
2018-10-12 08:32:26 +02:00
|
|
|
defaults: ["linux_bionic_supported"],
|
2020-01-22 01:43:56 +01:00
|
|
|
ramdisk_available: true,
|
2020-10-22 03:36:36 +02:00
|
|
|
vendor_ramdisk_available: true,
|
2018-04-27 14:53:11 +02:00
|
|
|
recovery_available: true,
|
2019-05-03 15:57:34 +02:00
|
|
|
native_bridge_supported: true,
|
2017-10-05 17:23:10 +02:00
|
|
|
|
2018-02-06 02:30:57 +01:00
|
|
|
srcs: [
|
|
|
|
"libdl.cpp",
|
|
|
|
"libdl_cfi.cpp",
|
|
|
|
],
|
2017-10-05 17:23:10 +02:00
|
|
|
|
|
|
|
cflags: [
|
|
|
|
"-Wall",
|
|
|
|
"-Wextra",
|
|
|
|
"-Wunused",
|
|
|
|
"-Werror",
|
|
|
|
],
|
|
|
|
|
|
|
|
// For private/CFIShadow.h.
|
|
|
|
include_dirs: ["bionic/libc"],
|
|
|
|
|
|
|
|
stl: "none",
|
2018-12-03 22:57:20 +01:00
|
|
|
system_shared_libs: [],
|
2020-04-06 21:32:09 +02:00
|
|
|
header_libs: ["libc_headers"],
|
2020-05-07 00:44:08 +02:00
|
|
|
export_header_lib_headers: ["libc_headers"],
|
2017-10-05 17:23:10 +02:00
|
|
|
|
|
|
|
sanitize: {
|
|
|
|
never: true,
|
|
|
|
},
|
|
|
|
}
|
|
|
|
|
2015-09-17 01:33:27 +02:00
|
|
|
cc_library {
|
2016-11-29 02:02:25 +01:00
|
|
|
name: "libdl",
|
2020-01-22 01:43:56 +01:00
|
|
|
ramdisk_available: true,
|
2020-10-22 03:36:36 +02:00
|
|
|
vendor_ramdisk_available: true,
|
2018-04-27 14:53:11 +02:00
|
|
|
recovery_available: true,
|
2019-05-03 15:57:34 +02:00
|
|
|
native_bridge_supported: true,
|
2017-10-27 20:21:20 +02:00
|
|
|
static_ndk_lib: true,
|
2016-11-29 02:02:25 +01:00
|
|
|
|
|
|
|
defaults: ["linux_bionic_supported"],
|
2015-09-17 01:33:27 +02:00
|
|
|
|
|
|
|
// NOTE: --exclude-libs=libgcc.a makes sure that any symbols libdl.so pulls from
|
|
|
|
// libgcc.a are made static to libdl.so. This in turn ensures that libraries that
|
|
|
|
// a) pull symbols from libgcc.a and b) depend on libdl.so will not rely on libdl.so
|
|
|
|
// to provide those symbols, but will instead pull them from libgcc.a. Specifically,
|
|
|
|
// we use this property to make sure libc.so has its own copy of the code from
|
|
|
|
// libgcc.a it uses.
|
|
|
|
//
|
|
|
|
// DO NOT REMOVE --exclude-libs!
|
|
|
|
|
2018-09-01 04:01:56 +02:00
|
|
|
ldflags: [
|
|
|
|
"-Wl,--exclude-libs=libgcc.a",
|
2019-05-07 01:23:10 +02:00
|
|
|
"-Wl,--exclude-libs=libgcc_stripped.a",
|
2018-09-01 04:01:56 +02:00
|
|
|
"-Wl,--exclude-libs=libclang_rt.builtins-arm-android.a",
|
|
|
|
"-Wl,--exclude-libs=libclang_rt.builtins-aarch64-android.a",
|
2021-01-28 23:06:52 +01:00
|
|
|
"-Wl,--exclude-libs=libclang_rt.builtins-i686-android.a",
|
2022-10-11 21:01:30 +02:00
|
|
|
"-Wl,--exclude-libs=libclang_rt.builtins-riscv64-android.a",
|
2018-09-01 04:01:56 +02:00
|
|
|
"-Wl,--exclude-libs=libclang_rt.builtins-x86_64-android.a",
|
|
|
|
],
|
2015-09-17 01:33:27 +02:00
|
|
|
|
|
|
|
// for x86, exclude libgcc_eh.a for the same reasons as above
|
|
|
|
arch: {
|
2015-11-03 23:30:57 +01:00
|
|
|
arm: {
|
2018-09-07 01:04:08 +02:00
|
|
|
version_script: ":libdl.arm.map",
|
2018-05-24 03:45:53 +02:00
|
|
|
pack_relocations: false,
|
2018-01-19 01:26:19 +01:00
|
|
|
ldflags: ["-Wl,--hash-style=both"],
|
2015-11-03 23:30:57 +01:00
|
|
|
},
|
|
|
|
arm64: {
|
2018-09-07 01:04:08 +02:00
|
|
|
version_script: ":libdl.arm64.map",
|
2015-11-03 23:30:57 +01:00
|
|
|
},
|
2022-10-11 21:01:30 +02:00
|
|
|
riscv64: {
|
|
|
|
version_script: ":libdl.riscv64.map",
|
|
|
|
},
|
2015-09-17 01:33:27 +02:00
|
|
|
x86: {
|
2018-05-24 03:45:53 +02:00
|
|
|
pack_relocations: false,
|
2016-11-21 21:50:38 +01:00
|
|
|
ldflags: [
|
|
|
|
"-Wl,--exclude-libs=libgcc_eh.a",
|
2018-01-19 01:26:19 +01:00
|
|
|
"-Wl,--hash-style=both",
|
2016-11-21 21:50:38 +01:00
|
|
|
],
|
2018-09-07 01:04:08 +02:00
|
|
|
version_script: ":libdl.x86.map",
|
2015-09-17 01:33:27 +02:00
|
|
|
},
|
|
|
|
x86_64: {
|
|
|
|
ldflags: ["-Wl,--exclude-libs=libgcc_eh.a"],
|
2018-09-07 01:04:08 +02:00
|
|
|
version_script: ":libdl.x86_64.map",
|
2015-09-17 01:33:27 +02:00
|
|
|
},
|
|
|
|
},
|
2017-08-30 10:52:19 +02:00
|
|
|
shared: {
|
2017-10-05 17:23:10 +02:00
|
|
|
whole_static_libs: ["libdl_static"],
|
2017-08-30 10:52:19 +02:00
|
|
|
},
|
|
|
|
static: {
|
2018-04-04 00:56:35 +02:00
|
|
|
srcs: ["libdl_static.cpp"],
|
2017-08-30 10:52:19 +02:00
|
|
|
},
|
2015-09-17 01:33:27 +02:00
|
|
|
cflags: [
|
|
|
|
"-Wall",
|
|
|
|
"-Wextra",
|
|
|
|
"-Wunused",
|
|
|
|
"-Werror",
|
|
|
|
],
|
|
|
|
stl: "none",
|
|
|
|
|
2018-03-28 07:10:55 +02:00
|
|
|
nocrt: true,
|
2015-09-17 01:33:27 +02:00
|
|
|
system_shared_libs: [],
|
2020-04-06 21:32:09 +02:00
|
|
|
header_libs: ["libc_headers"],
|
2019-02-15 20:40:40 +01:00
|
|
|
|
|
|
|
// Opt out of native_coverage when opting out of system_shared_libs
|
2018-12-20 22:52:19 +01:00
|
|
|
native_coverage: false,
|
2015-09-17 01:33:27 +02:00
|
|
|
|
2016-11-23 01:55:25 +01:00
|
|
|
// This is placeholder library the actual implementation is (currently)
|
|
|
|
// provided by the linker.
|
2018-02-06 02:30:57 +01:00
|
|
|
shared_libs: ["ld-android"],
|
2016-11-23 01:55:25 +01:00
|
|
|
|
|
|
|
sanitize: {
|
|
|
|
never: true,
|
|
|
|
},
|
2018-12-13 10:26:48 +01:00
|
|
|
|
|
|
|
stubs: {
|
|
|
|
symbol_file: "libdl.map.txt",
|
2020-02-27 10:33:25 +01:00
|
|
|
versions: [
|
|
|
|
"29",
|
2020-07-27 22:28:56 +02:00
|
|
|
"current",
|
2020-02-27 10:33:25 +01:00
|
|
|
],
|
2018-12-13 10:26:48 +01:00
|
|
|
},
|
2021-03-02 19:23:04 +01:00
|
|
|
llndk: {
|
|
|
|
symbol_file: "libdl.map.txt",
|
|
|
|
},
|
2019-10-02 10:09:33 +02:00
|
|
|
|
|
|
|
apex_available: [
|
|
|
|
"//apex_available:platform",
|
|
|
|
"com.android.runtime",
|
|
|
|
],
|
2020-09-21 18:56:13 +02:00
|
|
|
|
|
|
|
lto: {
|
|
|
|
never: true,
|
|
|
|
},
|
2016-11-23 01:55:25 +01:00
|
|
|
}
|
|
|
|
|
2019-03-19 13:01:42 +01:00
|
|
|
cc_library {
|
|
|
|
name: "libdl_android",
|
|
|
|
|
|
|
|
defaults: ["linux_bionic_supported"],
|
2020-01-22 01:43:56 +01:00
|
|
|
ramdisk_available: true,
|
2020-10-22 03:36:36 +02:00
|
|
|
vendor_ramdisk_available: true,
|
2019-04-02 16:04:52 +02:00
|
|
|
recovery_available: true,
|
2019-05-03 15:57:34 +02:00
|
|
|
native_bridge_supported: true,
|
2019-03-19 13:01:42 +01:00
|
|
|
|
|
|
|
// NOTE: --exclude-libs=libgcc.a makes sure that any symbols libdl.so pulls from
|
|
|
|
// libgcc.a are made static to libdl.so. This in turn ensures that libraries that
|
|
|
|
// a) pull symbols from libgcc.a and b) depend on libdl.so will not rely on libdl.so
|
|
|
|
// to provide those symbols, but will instead pull them from libgcc.a. Specifically,
|
|
|
|
// we use this property to make sure libc.so has its own copy of the code from
|
|
|
|
// libgcc.a it uses.
|
|
|
|
//
|
|
|
|
// DO NOT REMOVE --exclude-libs!
|
|
|
|
|
|
|
|
ldflags: [
|
|
|
|
"-Wl,--exclude-libs=libgcc.a",
|
2019-05-07 01:23:10 +02:00
|
|
|
"-Wl,--exclude-libs=libgcc_stripped.a",
|
2019-03-19 13:01:42 +01:00
|
|
|
"-Wl,--exclude-libs=libclang_rt.builtins-arm-android.a",
|
|
|
|
"-Wl,--exclude-libs=libclang_rt.builtins-aarch64-android.a",
|
2021-01-28 23:06:52 +01:00
|
|
|
"-Wl,--exclude-libs=libclang_rt.builtins-i686-android.a",
|
2022-10-11 21:01:30 +02:00
|
|
|
"-Wl,--exclude-libs=libclang_rt.builtins-riscv64-android.a",
|
2019-03-19 13:01:42 +01:00
|
|
|
"-Wl,--exclude-libs=libclang_rt.builtins-x86_64-android.a",
|
|
|
|
],
|
|
|
|
|
|
|
|
// for x86, exclude libgcc_eh.a for the same reasons as above
|
|
|
|
arch: {
|
|
|
|
x86: {
|
|
|
|
ldflags: [
|
|
|
|
"-Wl,--exclude-libs=libgcc_eh.a",
|
|
|
|
],
|
|
|
|
},
|
|
|
|
x86_64: {
|
|
|
|
ldflags: ["-Wl,--exclude-libs=libgcc_eh.a"],
|
|
|
|
},
|
|
|
|
},
|
|
|
|
|
|
|
|
srcs: [ "libdl_android.cpp" ],
|
|
|
|
version_script: "libdl_android.map.txt",
|
|
|
|
|
|
|
|
cflags: [
|
|
|
|
"-Wall",
|
|
|
|
"-Wextra",
|
|
|
|
"-Wunused",
|
|
|
|
"-Werror",
|
|
|
|
],
|
|
|
|
|
|
|
|
stl: "none",
|
|
|
|
|
|
|
|
nocrt: true,
|
|
|
|
system_shared_libs: [],
|
2020-04-06 21:32:09 +02:00
|
|
|
header_libs: ["libc_headers"],
|
2019-03-19 13:01:42 +01:00
|
|
|
|
|
|
|
// Opt out of native_coverage when opting out of system_shared_libs
|
|
|
|
native_coverage: false,
|
|
|
|
|
|
|
|
// This is placeholder library the actual implementation is (currently)
|
|
|
|
// provided by the linker.
|
|
|
|
shared_libs: ["ld-android"],
|
|
|
|
|
|
|
|
sanitize: {
|
|
|
|
never: true,
|
|
|
|
},
|
|
|
|
|
|
|
|
stubs: {
|
|
|
|
symbol_file: "libdl_android.map.txt",
|
2020-07-27 22:28:56 +02:00
|
|
|
versions: ["current"],
|
2019-03-19 13:01:42 +01:00
|
|
|
},
|
2019-11-11 16:33:22 +01:00
|
|
|
|
|
|
|
apex_available: [
|
|
|
|
"//apex_available:platform",
|
|
|
|
"com.android.runtime",
|
|
|
|
],
|
2020-09-21 18:56:13 +02:00
|
|
|
|
|
|
|
lto: {
|
|
|
|
never: true,
|
|
|
|
},
|
2019-03-19 13:01:42 +01:00
|
|
|
}
|
|
|
|
|
2016-08-04 22:45:44 +02:00
|
|
|
ndk_library {
|
2017-04-07 23:09:18 +02:00
|
|
|
name: "libdl",
|
2016-08-04 22:45:44 +02:00
|
|
|
symbol_file: "libdl.map.txt",
|
|
|
|
first_version: "9",
|
|
|
|
}
|
2017-03-20 22:07:47 +01:00
|
|
|
|
2018-09-07 01:04:08 +02:00
|
|
|
genrule {
|
|
|
|
name: "libdl.arm.map",
|
|
|
|
out: ["libdl.arm.map"],
|
|
|
|
srcs: ["libdl.map.txt"],
|
2022-07-01 01:35:11 +02:00
|
|
|
tools: ["generate-version-script"],
|
|
|
|
cmd: "$(location generate-version-script) arm $(in) $(out)",
|
2018-09-07 01:04:08 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
genrule {
|
|
|
|
name: "libdl.arm64.map",
|
|
|
|
out: ["libdl.arm64.map"],
|
|
|
|
srcs: ["libdl.map.txt"],
|
2022-07-01 01:35:11 +02:00
|
|
|
tools: ["generate-version-script"],
|
|
|
|
cmd: "$(location generate-version-script) arm64 $(in) $(out)",
|
2018-09-07 01:04:08 +02:00
|
|
|
}
|
|
|
|
|
2022-10-11 21:01:30 +02:00
|
|
|
genrule {
|
|
|
|
name: "libdl.riscv64.map",
|
|
|
|
out: ["libdl.riscv64.map"],
|
|
|
|
srcs: ["libdl.map.txt"],
|
|
|
|
tools: ["generate-version-script"],
|
|
|
|
cmd: "$(location generate-version-script) riscv64 $(in) $(out)",
|
|
|
|
}
|
|
|
|
|
2018-09-07 01:04:08 +02:00
|
|
|
genrule {
|
|
|
|
name: "libdl.x86.map",
|
|
|
|
out: ["libdl.x86.map"],
|
|
|
|
srcs: ["libdl.map.txt"],
|
2022-07-01 01:35:11 +02:00
|
|
|
tools: ["generate-version-script"],
|
|
|
|
cmd: "$(location generate-version-script) x86 $(in) $(out)",
|
2018-09-07 01:04:08 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
genrule {
|
|
|
|
name: "libdl.x86_64.map",
|
|
|
|
out: ["libdl.x86_64.map"],
|
|
|
|
srcs: ["libdl.map.txt"],
|
2022-07-01 01:35:11 +02:00
|
|
|
tools: ["generate-version-script"],
|
|
|
|
cmd: "$(location generate-version-script) x86_64 $(in) $(out)",
|
2018-09-07 01:04:08 +02:00
|
|
|
}
|