blob: 5c9fc9ca0b8b73a60c607614c0547a6538b7168d [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,
Colin Cross8393a8b2020-10-19 13:37:49 -070044 llndk_stubs: "libdl.llndk",
Dan Willemsen7ec52b12016-11-28 17:02:25 -080045
46 defaults: ["linux_bionic_supported"],
Dan Willemsen208ae172015-09-16 16:33:27 -070047
48 // NOTE: --exclude-libs=libgcc.a makes sure that any symbols libdl.so pulls from
49 // libgcc.a are made static to libdl.so. This in turn ensures that libraries that
50 // a) pull symbols from libgcc.a and b) depend on libdl.so will not rely on libdl.so
51 // to provide those symbols, but will instead pull them from libgcc.a. Specifically,
52 // we use this property to make sure libc.so has its own copy of the code from
53 // libgcc.a it uses.
54 //
55 // DO NOT REMOVE --exclude-libs!
56
Yi Kong7786a342018-08-31 19:01:56 -070057 ldflags: [
58 "-Wl,--exclude-libs=libgcc.a",
Yi Kong7ac2afb2019-05-06 16:23:10 -070059 "-Wl,--exclude-libs=libgcc_stripped.a",
Yi Kong7786a342018-08-31 19:01:56 -070060 "-Wl,--exclude-libs=libclang_rt.builtins-arm-android.a",
61 "-Wl,--exclude-libs=libclang_rt.builtins-aarch64-android.a",
Ryan Prichardef147872021-01-28 14:06:52 -080062 "-Wl,--exclude-libs=libclang_rt.builtins-i686-android.a",
Yi Kong7786a342018-08-31 19:01:56 -070063 "-Wl,--exclude-libs=libclang_rt.builtins-x86_64-android.a",
64 ],
Dan Willemsen208ae172015-09-16 16:33:27 -070065
66 // for x86, exclude libgcc_eh.a for the same reasons as above
67 arch: {
Dan Willemsen9e6f98f2015-11-03 14:30:57 -080068 arm: {
Elliott Hughesd19b3c52018-09-06 16:04:08 -070069 version_script: ":libdl.arm.map",
Chih-Hung Hsiehecbff832018-05-23 18:45:53 -070070 pack_relocations: false,
Ian Pedowitzb6310c22018-01-18 16:26:19 -080071 ldflags: ["-Wl,--hash-style=both"],
Dan Willemsen9e6f98f2015-11-03 14:30:57 -080072 },
73 arm64: {
Elliott Hughesd19b3c52018-09-06 16:04:08 -070074 version_script: ":libdl.arm64.map",
Dan Willemsen9e6f98f2015-11-03 14:30:57 -080075 },
Dan Willemsen208ae172015-09-16 16:33:27 -070076 x86: {
Chih-Hung Hsiehecbff832018-05-23 18:45:53 -070077 pack_relocations: false,
Dimitry Ivanovac4bd2f2016-11-21 12:50:38 -080078 ldflags: [
79 "-Wl,--exclude-libs=libgcc_eh.a",
Ian Pedowitzb6310c22018-01-18 16:26:19 -080080 "-Wl,--hash-style=both",
Dimitry Ivanovac4bd2f2016-11-21 12:50:38 -080081 ],
Elliott Hughesd19b3c52018-09-06 16:04:08 -070082 version_script: ":libdl.x86.map",
Dan Willemsen208ae172015-09-16 16:33:27 -070083 },
84 x86_64: {
85 ldflags: ["-Wl,--exclude-libs=libgcc_eh.a"],
Elliott Hughesd19b3c52018-09-06 16:04:08 -070086 version_script: ":libdl.x86_64.map",
Dan Willemsen208ae172015-09-16 16:33:27 -070087 },
88 },
dimitrydc7cc622017-08-30 10:52:19 +020089 shared: {
dimitryc5ea3eb2017-10-05 17:23:10 +020090 whole_static_libs: ["libdl_static"],
dimitrydc7cc622017-08-30 10:52:19 +020091 },
92 static: {
Elliott Hughes46a943c2018-04-03 15:56:35 -070093 srcs: ["libdl_static.cpp"],
dimitrydc7cc622017-08-30 10:52:19 +020094 },
Dan Willemsen208ae172015-09-16 16:33:27 -070095 cflags: [
96 "-Wall",
97 "-Wextra",
98 "-Wunused",
99 "-Werror",
100 ],
101 stl: "none",
102
Ryan Prichard470b6662018-03-27 22:10:55 -0700103 nocrt: true,
Dan Willemsen208ae172015-09-16 16:33:27 -0700104 system_shared_libs: [],
Martin Stjernholm82d84bc2020-04-06 20:32:09 +0100105 header_libs: ["libc_headers"],
Pirama Arumuga Nainareeb2ee62019-02-15 11:40:40 -0800106
107 // Opt out of native_coverage when opting out of system_shared_libs
Pirama Arumuga Nainar852d5232018-12-20 13:52:19 -0800108 native_coverage: false,
Dan Willemsen208ae172015-09-16 16:33:27 -0700109
Dimitry Ivanovd9e427c2016-11-22 16:55:25 -0800110 // This is placeholder library the actual implementation is (currently)
111 // provided by the linker.
Elliott Hughesd50a1de2018-02-05 17:30:57 -0800112 shared_libs: ["ld-android"],
Dimitry Ivanovd9e427c2016-11-22 16:55:25 -0800113
114 sanitize: {
115 never: true,
116 },
Jiyong Parkc45fe9f2018-12-13 18:26:48 +0900117
118 stubs: {
119 symbol_file: "libdl.map.txt",
Jooyung Han26ddc4d2020-02-27 18:33:25 +0900120 versions: [
121 "29",
Dan Albert48943b22020-07-27 13:28:56 -0700122 "current",
Jooyung Han26ddc4d2020-02-27 18:33:25 +0900123 ],
Jiyong Parkc45fe9f2018-12-13 18:26:48 +0900124 },
Jiyong Parke87e0dc2019-10-02 17:09:33 +0900125
126 apex_available: [
127 "//apex_available:platform",
128 "com.android.runtime",
129 ],
Yi Kong15a05a72020-09-22 00:56:13 +0800130
131 lto: {
132 never: true,
133 },
Dimitry Ivanovd9e427c2016-11-22 16:55:25 -0800134}
135
dimitry8868d9e2019-03-19 13:01:42 +0100136cc_library {
137 name: "libdl_android",
138
139 defaults: ["linux_bionic_supported"],
Yifan Hong5a39cee2020-01-21 16:43:56 -0800140 ramdisk_available: true,
Yifan Hongb04490d2020-10-21 18:36:36 -0700141 vendor_ramdisk_available: true,
Jiyong Park3ff116a2019-04-02 23:04:52 +0900142 recovery_available: true,
dimitry7f048802019-05-03 15:57:34 +0200143 native_bridge_supported: true,
dimitry8868d9e2019-03-19 13:01:42 +0100144
145 // NOTE: --exclude-libs=libgcc.a makes sure that any symbols libdl.so pulls from
146 // libgcc.a are made static to libdl.so. This in turn ensures that libraries that
147 // a) pull symbols from libgcc.a and b) depend on libdl.so will not rely on libdl.so
148 // to provide those symbols, but will instead pull them from libgcc.a. Specifically,
149 // we use this property to make sure libc.so has its own copy of the code from
150 // libgcc.a it uses.
151 //
152 // DO NOT REMOVE --exclude-libs!
153
154 ldflags: [
155 "-Wl,--exclude-libs=libgcc.a",
Yi Kong7ac2afb2019-05-06 16:23:10 -0700156 "-Wl,--exclude-libs=libgcc_stripped.a",
dimitry8868d9e2019-03-19 13:01:42 +0100157 "-Wl,--exclude-libs=libclang_rt.builtins-arm-android.a",
158 "-Wl,--exclude-libs=libclang_rt.builtins-aarch64-android.a",
Ryan Prichardef147872021-01-28 14:06:52 -0800159 "-Wl,--exclude-libs=libclang_rt.builtins-i686-android.a",
dimitry8868d9e2019-03-19 13:01:42 +0100160 "-Wl,--exclude-libs=libclang_rt.builtins-x86_64-android.a",
161 ],
162
163 // for x86, exclude libgcc_eh.a for the same reasons as above
164 arch: {
165 x86: {
166 ldflags: [
167 "-Wl,--exclude-libs=libgcc_eh.a",
168 ],
169 },
170 x86_64: {
171 ldflags: ["-Wl,--exclude-libs=libgcc_eh.a"],
172 },
173 },
174
175 srcs: [ "libdl_android.cpp" ],
176 version_script: "libdl_android.map.txt",
177
178 cflags: [
179 "-Wall",
180 "-Wextra",
181 "-Wunused",
182 "-Werror",
183 ],
184
185 stl: "none",
186
187 nocrt: true,
188 system_shared_libs: [],
Martin Stjernholm82d84bc2020-04-06 20:32:09 +0100189 header_libs: ["libc_headers"],
dimitry8868d9e2019-03-19 13:01:42 +0100190
191 // Opt out of native_coverage when opting out of system_shared_libs
192 native_coverage: false,
193
194 // This is placeholder library the actual implementation is (currently)
195 // provided by the linker.
196 shared_libs: ["ld-android"],
197
198 sanitize: {
199 never: true,
200 },
201
202 stubs: {
203 symbol_file: "libdl_android.map.txt",
Dan Albert48943b22020-07-27 13:28:56 -0700204 versions: ["current"],
dimitry8868d9e2019-03-19 13:01:42 +0100205 },
Martin Stjernholm3274cc42019-11-11 15:33:22 +0000206
207 apex_available: [
208 "//apex_available:platform",
209 "com.android.runtime",
210 ],
Yi Kong15a05a72020-09-22 00:56:13 +0800211
212 lto: {
213 never: true,
214 },
dimitry8868d9e2019-03-19 13:01:42 +0100215}
216
Dan Alberte8a91082016-08-04 13:45:44 -0700217ndk_library {
Dan Willemsen993b0832017-04-07 14:09:18 -0700218 name: "libdl",
Dan Alberte8a91082016-08-04 13:45:44 -0700219 symbol_file: "libdl.map.txt",
220 first_version: "9",
221}
Dan Willemsenb93d3c22017-03-20 14:07:47 -0700222
223llndk_library {
Colin Cross8393a8b2020-10-19 13:37:49 -0700224 name: "libdl.llndk",
dimitry7f048802019-05-03 15:57:34 +0200225 native_bridge_supported: true,
Dan Willemsenb93d3c22017-03-20 14:07:47 -0700226 symbol_file: "libdl.map.txt",
227}
Elliott Hughesd19b3c52018-09-06 16:04:08 -0700228
229genrule {
230 name: "libdl.arm.map",
231 out: ["libdl.arm.map"],
232 srcs: ["libdl.map.txt"],
233 tool_files: [":bionic-generate-version-script"],
234 cmd: "$(location :bionic-generate-version-script) arm $(in) $(out)",
235}
236
237genrule {
238 name: "libdl.arm64.map",
239 out: ["libdl.arm64.map"],
240 srcs: ["libdl.map.txt"],
241 tool_files: [":bionic-generate-version-script"],
242 cmd: "$(location :bionic-generate-version-script) arm64 $(in) $(out)",
243}
244
245genrule {
246 name: "libdl.x86.map",
247 out: ["libdl.x86.map"],
248 srcs: ["libdl.map.txt"],
249 tool_files: [":bionic-generate-version-script"],
250 cmd: "$(location :bionic-generate-version-script) x86 $(in) $(out)",
251}
252
253genrule {
254 name: "libdl.x86_64.map",
255 out: ["libdl.x86_64.map"],
256 srcs: ["libdl.map.txt"],
257 tool_files: [":bionic-generate-version-script"],
258 cmd: "$(location :bionic-generate-version-script) x86_64 $(in) $(out)",
259}