blob: 1a5439f34d792beeec5205e0991dc1072998459d [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,
Jiyong Park5603c6e2018-04-27 21:53:11 +09008 recovery_available: true,
dimitry7f048802019-05-03 15:57:34 +02009 native_bridge_supported: true,
dimitryc5ea3eb2017-10-05 17:23:10 +020010
Elliott Hughesd50a1de2018-02-05 17:30:57 -080011 srcs: [
12 "libdl.cpp",
13 "libdl_cfi.cpp",
14 ],
dimitryc5ea3eb2017-10-05 17:23:10 +020015
16 cflags: [
17 "-Wall",
18 "-Wextra",
19 "-Wunused",
20 "-Werror",
21 ],
22
23 // For private/CFIShadow.h.
24 include_dirs: ["bionic/libc"],
25
26 stl: "none",
Dan Willemsen6b3be172018-12-03 13:57:20 -080027 system_shared_libs: [],
Martin Stjernholm82d84bc2020-04-06 20:32:09 +010028 header_libs: ["libc_headers"],
Martin Stjernholm3ddcc1e2020-05-06 23:44:08 +010029 export_header_lib_headers: ["libc_headers"],
dimitryc5ea3eb2017-10-05 17:23:10 +020030
31 sanitize: {
32 never: true,
33 },
34}
35
Dan Willemsen208ae172015-09-16 16:33:27 -070036cc_library {
Dan Willemsen7ec52b12016-11-28 17:02:25 -080037 name: "libdl",
Yifan Hong5a39cee2020-01-21 16:43:56 -080038 ramdisk_available: true,
Jiyong Park5603c6e2018-04-27 21:53:11 +090039 recovery_available: true,
dimitry7f048802019-05-03 15:57:34 +020040 native_bridge_supported: true,
Dan Albert40f15ec2017-10-27 11:21:20 -070041 static_ndk_lib: true,
Dan Willemsen7ec52b12016-11-28 17:02:25 -080042
43 defaults: ["linux_bionic_supported"],
Dan Willemsen208ae172015-09-16 16:33:27 -070044
45 // NOTE: --exclude-libs=libgcc.a makes sure that any symbols libdl.so pulls from
46 // libgcc.a are made static to libdl.so. This in turn ensures that libraries that
47 // a) pull symbols from libgcc.a and b) depend on libdl.so will not rely on libdl.so
48 // to provide those symbols, but will instead pull them from libgcc.a. Specifically,
49 // we use this property to make sure libc.so has its own copy of the code from
50 // libgcc.a it uses.
51 //
52 // DO NOT REMOVE --exclude-libs!
53
Yi Kong7786a342018-08-31 19:01:56 -070054 ldflags: [
55 "-Wl,--exclude-libs=libgcc.a",
Yi Kong7ac2afb2019-05-06 16:23:10 -070056 "-Wl,--exclude-libs=libgcc_stripped.a",
Yi Kong7786a342018-08-31 19:01:56 -070057 "-Wl,--exclude-libs=libclang_rt.builtins-arm-android.a",
58 "-Wl,--exclude-libs=libclang_rt.builtins-aarch64-android.a",
59 "-Wl,--exclude-libs=libclang_rt.builtins-x86-android.a",
60 "-Wl,--exclude-libs=libclang_rt.builtins-x86_64-android.a",
61 ],
Dan Willemsen208ae172015-09-16 16:33:27 -070062
63 // for x86, exclude libgcc_eh.a for the same reasons as above
64 arch: {
Dan Willemsen9e6f98f2015-11-03 14:30:57 -080065 arm: {
Elliott Hughesd19b3c52018-09-06 16:04:08 -070066 version_script: ":libdl.arm.map",
Chih-Hung Hsiehecbff832018-05-23 18:45:53 -070067 pack_relocations: false,
Ian Pedowitzb6310c22018-01-18 16:26:19 -080068 ldflags: ["-Wl,--hash-style=both"],
Dan Willemsen9e6f98f2015-11-03 14:30:57 -080069 },
70 arm64: {
Elliott Hughesd19b3c52018-09-06 16:04:08 -070071 version_script: ":libdl.arm64.map",
Dan Willemsen9e6f98f2015-11-03 14:30:57 -080072 },
Dan Willemsen208ae172015-09-16 16:33:27 -070073 x86: {
Chih-Hung Hsiehecbff832018-05-23 18:45:53 -070074 pack_relocations: false,
Dimitry Ivanovac4bd2f2016-11-21 12:50:38 -080075 ldflags: [
76 "-Wl,--exclude-libs=libgcc_eh.a",
Ian Pedowitzb6310c22018-01-18 16:26:19 -080077 "-Wl,--hash-style=both",
Dimitry Ivanovac4bd2f2016-11-21 12:50:38 -080078 ],
Elliott Hughesd19b3c52018-09-06 16:04:08 -070079 version_script: ":libdl.x86.map",
Dan Willemsen208ae172015-09-16 16:33:27 -070080 },
81 x86_64: {
82 ldflags: ["-Wl,--exclude-libs=libgcc_eh.a"],
Elliott Hughesd19b3c52018-09-06 16:04:08 -070083 version_script: ":libdl.x86_64.map",
Dan Willemsen208ae172015-09-16 16:33:27 -070084 },
85 },
dimitrydc7cc622017-08-30 10:52:19 +020086 shared: {
dimitryc5ea3eb2017-10-05 17:23:10 +020087 whole_static_libs: ["libdl_static"],
dimitrydc7cc622017-08-30 10:52:19 +020088 },
89 static: {
Elliott Hughes46a943c2018-04-03 15:56:35 -070090 srcs: ["libdl_static.cpp"],
dimitrydc7cc622017-08-30 10:52:19 +020091 },
Dan Willemsen208ae172015-09-16 16:33:27 -070092 cflags: [
93 "-Wall",
94 "-Wextra",
95 "-Wunused",
96 "-Werror",
97 ],
98 stl: "none",
99
Ryan Prichard470b6662018-03-27 22:10:55 -0700100 nocrt: true,
Dan Willemsen208ae172015-09-16 16:33:27 -0700101 system_shared_libs: [],
Martin Stjernholm82d84bc2020-04-06 20:32:09 +0100102 header_libs: ["libc_headers"],
Pirama Arumuga Nainareeb2ee62019-02-15 11:40:40 -0800103
104 // Opt out of native_coverage when opting out of system_shared_libs
Pirama Arumuga Nainar852d5232018-12-20 13:52:19 -0800105 native_coverage: false,
Dan Willemsen208ae172015-09-16 16:33:27 -0700106
Dimitry Ivanovd9e427c2016-11-22 16:55:25 -0800107 // This is placeholder library the actual implementation is (currently)
108 // provided by the linker.
Elliott Hughesd50a1de2018-02-05 17:30:57 -0800109 shared_libs: ["ld-android"],
Dimitry Ivanovd9e427c2016-11-22 16:55:25 -0800110
111 sanitize: {
112 never: true,
113 },
Jiyong Parkc45fe9f2018-12-13 18:26:48 +0900114
115 stubs: {
116 symbol_file: "libdl.map.txt",
Jooyung Han26ddc4d2020-02-27 18:33:25 +0900117 versions: [
118 "29",
Dan Albert48943b22020-07-27 13:28:56 -0700119 "current",
Jooyung Han26ddc4d2020-02-27 18:33:25 +0900120 ],
Jiyong Parkc45fe9f2018-12-13 18:26:48 +0900121 },
Jiyong Parke87e0dc2019-10-02 17:09:33 +0900122
123 apex_available: [
124 "//apex_available:platform",
125 "com.android.runtime",
126 ],
Yi Kong15a05a72020-09-22 00:56:13 +0800127
128 lto: {
129 never: true,
130 },
Dimitry Ivanovd9e427c2016-11-22 16:55:25 -0800131}
132
dimitry8868d9e2019-03-19 13:01:42 +0100133cc_library {
134 name: "libdl_android",
135
136 defaults: ["linux_bionic_supported"],
Yifan Hong5a39cee2020-01-21 16:43:56 -0800137 ramdisk_available: true,
Jiyong Park3ff116a2019-04-02 23:04:52 +0900138 recovery_available: true,
dimitry7f048802019-05-03 15:57:34 +0200139 native_bridge_supported: true,
dimitry8868d9e2019-03-19 13:01:42 +0100140
141 // NOTE: --exclude-libs=libgcc.a makes sure that any symbols libdl.so pulls from
142 // libgcc.a are made static to libdl.so. This in turn ensures that libraries that
143 // a) pull symbols from libgcc.a and b) depend on libdl.so will not rely on libdl.so
144 // to provide those symbols, but will instead pull them from libgcc.a. Specifically,
145 // we use this property to make sure libc.so has its own copy of the code from
146 // libgcc.a it uses.
147 //
148 // DO NOT REMOVE --exclude-libs!
149
150 ldflags: [
151 "-Wl,--exclude-libs=libgcc.a",
Yi Kong7ac2afb2019-05-06 16:23:10 -0700152 "-Wl,--exclude-libs=libgcc_stripped.a",
dimitry8868d9e2019-03-19 13:01:42 +0100153 "-Wl,--exclude-libs=libclang_rt.builtins-arm-android.a",
154 "-Wl,--exclude-libs=libclang_rt.builtins-aarch64-android.a",
155 "-Wl,--exclude-libs=libclang_rt.builtins-x86-android.a",
156 "-Wl,--exclude-libs=libclang_rt.builtins-x86_64-android.a",
157 ],
158
159 // for x86, exclude libgcc_eh.a for the same reasons as above
160 arch: {
161 x86: {
162 ldflags: [
163 "-Wl,--exclude-libs=libgcc_eh.a",
164 ],
165 },
166 x86_64: {
167 ldflags: ["-Wl,--exclude-libs=libgcc_eh.a"],
168 },
169 },
170
171 srcs: [ "libdl_android.cpp" ],
172 version_script: "libdl_android.map.txt",
173
174 cflags: [
175 "-Wall",
176 "-Wextra",
177 "-Wunused",
178 "-Werror",
179 ],
180
181 stl: "none",
182
183 nocrt: true,
184 system_shared_libs: [],
Martin Stjernholm82d84bc2020-04-06 20:32:09 +0100185 header_libs: ["libc_headers"],
dimitry8868d9e2019-03-19 13:01:42 +0100186
187 // Opt out of native_coverage when opting out of system_shared_libs
188 native_coverage: false,
189
190 // This is placeholder library the actual implementation is (currently)
191 // provided by the linker.
192 shared_libs: ["ld-android"],
193
194 sanitize: {
195 never: true,
196 },
197
198 stubs: {
199 symbol_file: "libdl_android.map.txt",
Dan Albert48943b22020-07-27 13:28:56 -0700200 versions: ["current"],
dimitry8868d9e2019-03-19 13:01:42 +0100201 },
Martin Stjernholm3274cc42019-11-11 15:33:22 +0000202
203 apex_available: [
204 "//apex_available:platform",
205 "com.android.runtime",
206 ],
Yi Kong15a05a72020-09-22 00:56:13 +0800207
208 lto: {
209 never: true,
210 },
dimitry8868d9e2019-03-19 13:01:42 +0100211}
212
Dan Alberte8a91082016-08-04 13:45:44 -0700213ndk_library {
Dan Willemsen993b0832017-04-07 14:09:18 -0700214 name: "libdl",
dimitry7f048802019-05-03 15:57:34 +0200215 native_bridge_supported: true,
Dan Alberte8a91082016-08-04 13:45:44 -0700216 symbol_file: "libdl.map.txt",
217 first_version: "9",
218}
Dan Willemsenb93d3c22017-03-20 14:07:47 -0700219
220llndk_library {
Dan Willemsen993b0832017-04-07 14:09:18 -0700221 name: "libdl",
dimitry7f048802019-05-03 15:57:34 +0200222 native_bridge_supported: true,
Dan Willemsenb93d3c22017-03-20 14:07:47 -0700223 symbol_file: "libdl.map.txt",
224}
Elliott Hughesd19b3c52018-09-06 16:04:08 -0700225
226genrule {
227 name: "libdl.arm.map",
228 out: ["libdl.arm.map"],
229 srcs: ["libdl.map.txt"],
230 tool_files: [":bionic-generate-version-script"],
231 cmd: "$(location :bionic-generate-version-script) arm $(in) $(out)",
232}
233
234genrule {
235 name: "libdl.arm64.map",
236 out: ["libdl.arm64.map"],
237 srcs: ["libdl.map.txt"],
238 tool_files: [":bionic-generate-version-script"],
239 cmd: "$(location :bionic-generate-version-script) arm64 $(in) $(out)",
240}
241
242genrule {
243 name: "libdl.x86.map",
244 out: ["libdl.x86.map"],
245 srcs: ["libdl.map.txt"],
246 tool_files: [":bionic-generate-version-script"],
247 cmd: "$(location :bionic-generate-version-script) x86 $(in) $(out)",
248}
249
250genrule {
251 name: "libdl.x86_64.map",
252 out: ["libdl.x86_64.map"],
253 srcs: ["libdl.map.txt"],
254 tool_files: [":bionic-generate-version-script"],
255 cmd: "$(location :bionic-generate-version-script) x86_64 $(in) $(out)",
256}