blob: cee43a384b2aa6e5a35124d608f343945e3fc7ff [file] [log] [blame]
Dan Willemsen208ae172015-09-16 16:33:27 -07001//
2// libdl
3//
dimitryc5ea3eb2017-10-05 17:23:10 +02004cc_library_static {
5 name: "libdl_static",
Dan Willemsen17b35592018-10-11 23:32:26 -07006 defaults: ["linux_bionic_supported"],
Yifan Hong5a39cee2020-01-21 16:43:56 -08007 ramdisk_available: true,
Yifan Hongb04490d2020-10-21 18:36:36 -07008 vendor_ramdisk_available: true,
Jiyong Park5603c6e2018-04-27 21:53:11 +09009 recovery_available: true,
dimitry7f048802019-05-03 15:57:34 +020010 native_bridge_supported: true,
dimitryc5ea3eb2017-10-05 17:23:10 +020011
Elliott Hughesd50a1de2018-02-05 17:30:57 -080012 srcs: [
13 "libdl.cpp",
14 "libdl_cfi.cpp",
15 ],
dimitryc5ea3eb2017-10-05 17:23:10 +020016
17 cflags: [
18 "-Wall",
19 "-Wextra",
20 "-Wunused",
21 "-Werror",
22 ],
23
24 // For private/CFIShadow.h.
25 include_dirs: ["bionic/libc"],
26
27 stl: "none",
Dan Willemsen6b3be172018-12-03 13:57:20 -080028 system_shared_libs: [],
Martin Stjernholm82d84bc2020-04-06 20:32:09 +010029 header_libs: ["libc_headers"],
Martin Stjernholm3ddcc1e2020-05-06 23:44:08 +010030 export_header_lib_headers: ["libc_headers"],
dimitryc5ea3eb2017-10-05 17:23:10 +020031
32 sanitize: {
33 never: true,
34 },
35}
36
Dan Willemsen208ae172015-09-16 16:33:27 -070037cc_library {
Dan Willemsen7ec52b12016-11-28 17:02:25 -080038 name: "libdl",
Yifan Hong5a39cee2020-01-21 16:43:56 -080039 ramdisk_available: true,
Yifan Hongb04490d2020-10-21 18:36:36 -070040 vendor_ramdisk_available: true,
Jiyong Park5603c6e2018-04-27 21:53:11 +090041 recovery_available: true,
dimitry7f048802019-05-03 15:57:34 +020042 native_bridge_supported: true,
Dan Albert40f15ec2017-10-27 11:21:20 -070043 static_ndk_lib: true,
Dan Willemsen7ec52b12016-11-28 17:02:25 -080044
45 defaults: ["linux_bionic_supported"],
Dan Willemsen208ae172015-09-16 16:33:27 -070046
47 // NOTE: --exclude-libs=libgcc.a makes sure that any symbols libdl.so pulls from
48 // libgcc.a are made static to libdl.so. This in turn ensures that libraries that
49 // a) pull symbols from libgcc.a and b) depend on libdl.so will not rely on libdl.so
50 // to provide those symbols, but will instead pull them from libgcc.a. Specifically,
51 // we use this property to make sure libc.so has its own copy of the code from
52 // libgcc.a it uses.
53 //
54 // DO NOT REMOVE --exclude-libs!
55
Yi Kong7786a342018-08-31 19:01:56 -070056 ldflags: [
57 "-Wl,--exclude-libs=libgcc.a",
Yi Kong7ac2afb2019-05-06 16:23:10 -070058 "-Wl,--exclude-libs=libgcc_stripped.a",
Yi Kong7786a342018-08-31 19:01:56 -070059 "-Wl,--exclude-libs=libclang_rt.builtins-arm-android.a",
60 "-Wl,--exclude-libs=libclang_rt.builtins-aarch64-android.a",
61 "-Wl,--exclude-libs=libclang_rt.builtins-x86-android.a",
62 "-Wl,--exclude-libs=libclang_rt.builtins-x86_64-android.a",
63 ],
Dan Willemsen208ae172015-09-16 16:33:27 -070064
65 // for x86, exclude libgcc_eh.a for the same reasons as above
66 arch: {
Dan Willemsen9e6f98f2015-11-03 14:30:57 -080067 arm: {
Elliott Hughesd19b3c52018-09-06 16:04:08 -070068 version_script: ":libdl.arm.map",
Chih-Hung Hsiehecbff832018-05-23 18:45:53 -070069 pack_relocations: false,
Ian Pedowitzb6310c22018-01-18 16:26:19 -080070 ldflags: ["-Wl,--hash-style=both"],
Dan Willemsen9e6f98f2015-11-03 14:30:57 -080071 },
72 arm64: {
Elliott Hughesd19b3c52018-09-06 16:04:08 -070073 version_script: ":libdl.arm64.map",
Dan Willemsen9e6f98f2015-11-03 14:30:57 -080074 },
Dan Willemsen208ae172015-09-16 16:33:27 -070075 x86: {
Chih-Hung Hsiehecbff832018-05-23 18:45:53 -070076 pack_relocations: false,
Dimitry Ivanovac4bd2f2016-11-21 12:50:38 -080077 ldflags: [
78 "-Wl,--exclude-libs=libgcc_eh.a",
Ian Pedowitzb6310c22018-01-18 16:26:19 -080079 "-Wl,--hash-style=both",
Dimitry Ivanovac4bd2f2016-11-21 12:50:38 -080080 ],
Elliott Hughesd19b3c52018-09-06 16:04:08 -070081 version_script: ":libdl.x86.map",
Dan Willemsen208ae172015-09-16 16:33:27 -070082 },
83 x86_64: {
84 ldflags: ["-Wl,--exclude-libs=libgcc_eh.a"],
Elliott Hughesd19b3c52018-09-06 16:04:08 -070085 version_script: ":libdl.x86_64.map",
Dan Willemsen208ae172015-09-16 16:33:27 -070086 },
87 },
dimitrydc7cc622017-08-30 10:52:19 +020088 shared: {
dimitryc5ea3eb2017-10-05 17:23:10 +020089 whole_static_libs: ["libdl_static"],
dimitrydc7cc622017-08-30 10:52:19 +020090 },
91 static: {
Elliott Hughes46a943c2018-04-03 15:56:35 -070092 srcs: ["libdl_static.cpp"],
dimitrydc7cc622017-08-30 10:52:19 +020093 },
Dan Willemsen208ae172015-09-16 16:33:27 -070094 cflags: [
95 "-Wall",
96 "-Wextra",
97 "-Wunused",
98 "-Werror",
99 ],
100 stl: "none",
101
Ryan Prichard470b6662018-03-27 22:10:55 -0700102 nocrt: true,
Dan Willemsen208ae172015-09-16 16:33:27 -0700103 system_shared_libs: [],
Martin Stjernholm82d84bc2020-04-06 20:32:09 +0100104 header_libs: ["libc_headers"],
Pirama Arumuga Nainareeb2ee62019-02-15 11:40:40 -0800105
106 // Opt out of native_coverage when opting out of system_shared_libs
Pirama Arumuga Nainar852d5232018-12-20 13:52:19 -0800107 native_coverage: false,
Dan Willemsen208ae172015-09-16 16:33:27 -0700108
Dimitry Ivanovd9e427c2016-11-22 16:55:25 -0800109 // This is placeholder library the actual implementation is (currently)
110 // provided by the linker.
Elliott Hughesd50a1de2018-02-05 17:30:57 -0800111 shared_libs: ["ld-android"],
Dimitry Ivanovd9e427c2016-11-22 16:55:25 -0800112
113 sanitize: {
114 never: true,
115 },
Jiyong Parkc45fe9f2018-12-13 18:26:48 +0900116
117 stubs: {
118 symbol_file: "libdl.map.txt",
Jooyung Han26ddc4d2020-02-27 18:33:25 +0900119 versions: [
120 "29",
121 "10000",
122 ],
Jiyong Parkc45fe9f2018-12-13 18:26:48 +0900123 },
Jiyong Parke87e0dc2019-10-02 17:09:33 +0900124
125 apex_available: [
126 "//apex_available:platform",
127 "com.android.runtime",
128 ],
Dimitry Ivanovd9e427c2016-11-22 16:55:25 -0800129}
130
dimitry8868d9e2019-03-19 13:01:42 +0100131cc_library {
132 name: "libdl_android",
133
134 defaults: ["linux_bionic_supported"],
Yifan Hong5a39cee2020-01-21 16:43:56 -0800135 ramdisk_available: true,
Yifan Hongb04490d2020-10-21 18:36:36 -0700136 vendor_ramdisk_available: true,
Jiyong Park3ff116a2019-04-02 23:04:52 +0900137 recovery_available: true,
dimitry7f048802019-05-03 15:57:34 +0200138 native_bridge_supported: true,
dimitry8868d9e2019-03-19 13:01:42 +0100139
140 // NOTE: --exclude-libs=libgcc.a makes sure that any symbols libdl.so pulls from
141 // libgcc.a are made static to libdl.so. This in turn ensures that libraries that
142 // a) pull symbols from libgcc.a and b) depend on libdl.so will not rely on libdl.so
143 // to provide those symbols, but will instead pull them from libgcc.a. Specifically,
144 // we use this property to make sure libc.so has its own copy of the code from
145 // libgcc.a it uses.
146 //
147 // DO NOT REMOVE --exclude-libs!
148
149 ldflags: [
150 "-Wl,--exclude-libs=libgcc.a",
Yi Kong7ac2afb2019-05-06 16:23:10 -0700151 "-Wl,--exclude-libs=libgcc_stripped.a",
dimitry8868d9e2019-03-19 13:01:42 +0100152 "-Wl,--exclude-libs=libclang_rt.builtins-arm-android.a",
153 "-Wl,--exclude-libs=libclang_rt.builtins-aarch64-android.a",
154 "-Wl,--exclude-libs=libclang_rt.builtins-x86-android.a",
155 "-Wl,--exclude-libs=libclang_rt.builtins-x86_64-android.a",
156 ],
157
158 // for x86, exclude libgcc_eh.a for the same reasons as above
159 arch: {
160 x86: {
161 ldflags: [
162 "-Wl,--exclude-libs=libgcc_eh.a",
163 ],
164 },
165 x86_64: {
166 ldflags: ["-Wl,--exclude-libs=libgcc_eh.a"],
167 },
168 },
169
170 srcs: [ "libdl_android.cpp" ],
171 version_script: "libdl_android.map.txt",
172
173 cflags: [
174 "-Wall",
175 "-Wextra",
176 "-Wunused",
177 "-Werror",
178 ],
179
180 stl: "none",
181
182 nocrt: true,
183 system_shared_libs: [],
Martin Stjernholm82d84bc2020-04-06 20:32:09 +0100184 header_libs: ["libc_headers"],
dimitry8868d9e2019-03-19 13:01:42 +0100185
186 // Opt out of native_coverage when opting out of system_shared_libs
187 native_coverage: false,
188
189 // This is placeholder library the actual implementation is (currently)
190 // provided by the linker.
191 shared_libs: ["ld-android"],
192
193 sanitize: {
194 never: true,
195 },
196
197 stubs: {
198 symbol_file: "libdl_android.map.txt",
199 versions: ["10000"],
200 },
Martin Stjernholm3274cc42019-11-11 15:33:22 +0000201
202 apex_available: [
203 "//apex_available:platform",
204 "com.android.runtime",
205 ],
dimitry8868d9e2019-03-19 13:01:42 +0100206}
207
Dan Alberte8a91082016-08-04 13:45:44 -0700208ndk_library {
Dan Willemsen993b0832017-04-07 14:09:18 -0700209 name: "libdl",
dimitry7f048802019-05-03 15:57:34 +0200210 native_bridge_supported: true,
Dan Alberte8a91082016-08-04 13:45:44 -0700211 symbol_file: "libdl.map.txt",
212 first_version: "9",
213}
Dan Willemsenb93d3c22017-03-20 14:07:47 -0700214
215llndk_library {
Dan Willemsen993b0832017-04-07 14:09:18 -0700216 name: "libdl",
dimitry7f048802019-05-03 15:57:34 +0200217 native_bridge_supported: true,
Dan Willemsenb93d3c22017-03-20 14:07:47 -0700218 symbol_file: "libdl.map.txt",
219}
Elliott Hughesd19b3c52018-09-06 16:04:08 -0700220
221genrule {
222 name: "libdl.arm.map",
223 out: ["libdl.arm.map"],
224 srcs: ["libdl.map.txt"],
225 tool_files: [":bionic-generate-version-script"],
226 cmd: "$(location :bionic-generate-version-script) arm $(in) $(out)",
227}
228
229genrule {
230 name: "libdl.arm64.map",
231 out: ["libdl.arm64.map"],
232 srcs: ["libdl.map.txt"],
233 tool_files: [":bionic-generate-version-script"],
234 cmd: "$(location :bionic-generate-version-script) arm64 $(in) $(out)",
235}
236
237genrule {
238 name: "libdl.x86.map",
239 out: ["libdl.x86.map"],
240 srcs: ["libdl.map.txt"],
241 tool_files: [":bionic-generate-version-script"],
242 cmd: "$(location :bionic-generate-version-script) x86 $(in) $(out)",
243}
244
245genrule {
246 name: "libdl.x86_64.map",
247 out: ["libdl.x86_64.map"],
248 srcs: ["libdl.map.txt"],
249 tool_files: [":bionic-generate-version-script"],
250 cmd: "$(location :bionic-generate-version-script) x86_64 $(in) $(out)",
251}