blob: 6a3a82ea481996278cdb372c32317d80aa6133e2 [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",
119 "10000",
120 ],
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 ],
Dimitry Ivanovd9e427c2016-11-22 16:55:25 -0800127}
128
dimitry8868d9e2019-03-19 13:01:42 +0100129cc_library {
130 name: "libdl_android",
131
132 defaults: ["linux_bionic_supported"],
Yifan Hong5a39cee2020-01-21 16:43:56 -0800133 ramdisk_available: true,
Jiyong Park3ff116a2019-04-02 23:04:52 +0900134 recovery_available: true,
dimitry7f048802019-05-03 15:57:34 +0200135 native_bridge_supported: true,
dimitry8868d9e2019-03-19 13:01:42 +0100136
137 // NOTE: --exclude-libs=libgcc.a makes sure that any symbols libdl.so pulls from
138 // libgcc.a are made static to libdl.so. This in turn ensures that libraries that
139 // a) pull symbols from libgcc.a and b) depend on libdl.so will not rely on libdl.so
140 // to provide those symbols, but will instead pull them from libgcc.a. Specifically,
141 // we use this property to make sure libc.so has its own copy of the code from
142 // libgcc.a it uses.
143 //
144 // DO NOT REMOVE --exclude-libs!
145
146 ldflags: [
147 "-Wl,--exclude-libs=libgcc.a",
Yi Kong7ac2afb2019-05-06 16:23:10 -0700148 "-Wl,--exclude-libs=libgcc_stripped.a",
dimitry8868d9e2019-03-19 13:01:42 +0100149 "-Wl,--exclude-libs=libclang_rt.builtins-arm-android.a",
150 "-Wl,--exclude-libs=libclang_rt.builtins-aarch64-android.a",
151 "-Wl,--exclude-libs=libclang_rt.builtins-x86-android.a",
152 "-Wl,--exclude-libs=libclang_rt.builtins-x86_64-android.a",
153 ],
154
155 // for x86, exclude libgcc_eh.a for the same reasons as above
156 arch: {
157 x86: {
158 ldflags: [
159 "-Wl,--exclude-libs=libgcc_eh.a",
160 ],
161 },
162 x86_64: {
163 ldflags: ["-Wl,--exclude-libs=libgcc_eh.a"],
164 },
165 },
166
167 srcs: [ "libdl_android.cpp" ],
168 version_script: "libdl_android.map.txt",
169
170 cflags: [
171 "-Wall",
172 "-Wextra",
173 "-Wunused",
174 "-Werror",
175 ],
176
177 stl: "none",
178
179 nocrt: true,
180 system_shared_libs: [],
Martin Stjernholm82d84bc2020-04-06 20:32:09 +0100181 header_libs: ["libc_headers"],
dimitry8868d9e2019-03-19 13:01:42 +0100182
183 // Opt out of native_coverage when opting out of system_shared_libs
184 native_coverage: false,
185
186 // This is placeholder library the actual implementation is (currently)
187 // provided by the linker.
188 shared_libs: ["ld-android"],
189
190 sanitize: {
191 never: true,
192 },
193
194 stubs: {
195 symbol_file: "libdl_android.map.txt",
196 versions: ["10000"],
197 },
Martin Stjernholm3274cc42019-11-11 15:33:22 +0000198
199 apex_available: [
200 "//apex_available:platform",
201 "com.android.runtime",
202 ],
dimitry8868d9e2019-03-19 13:01:42 +0100203}
204
Dan Alberte8a91082016-08-04 13:45:44 -0700205ndk_library {
Dan Willemsen993b0832017-04-07 14:09:18 -0700206 name: "libdl",
dimitry7f048802019-05-03 15:57:34 +0200207 native_bridge_supported: true,
Dan Alberte8a91082016-08-04 13:45:44 -0700208 symbol_file: "libdl.map.txt",
209 first_version: "9",
210}
Dan Willemsenb93d3c22017-03-20 14:07:47 -0700211
212llndk_library {
Dan Willemsen993b0832017-04-07 14:09:18 -0700213 name: "libdl",
dimitry7f048802019-05-03 15:57:34 +0200214 native_bridge_supported: true,
Dan Willemsenb93d3c22017-03-20 14:07:47 -0700215 symbol_file: "libdl.map.txt",
216}
Elliott Hughesd19b3c52018-09-06 16:04:08 -0700217
218genrule {
219 name: "libdl.arm.map",
220 out: ["libdl.arm.map"],
221 srcs: ["libdl.map.txt"],
222 tool_files: [":bionic-generate-version-script"],
223 cmd: "$(location :bionic-generate-version-script) arm $(in) $(out)",
224}
225
226genrule {
227 name: "libdl.arm64.map",
228 out: ["libdl.arm64.map"],
229 srcs: ["libdl.map.txt"],
230 tool_files: [":bionic-generate-version-script"],
231 cmd: "$(location :bionic-generate-version-script) arm64 $(in) $(out)",
232}
233
234genrule {
235 name: "libdl.x86.map",
236 out: ["libdl.x86.map"],
237 srcs: ["libdl.map.txt"],
238 tool_files: [":bionic-generate-version-script"],
239 cmd: "$(location :bionic-generate-version-script) x86 $(in) $(out)",
240}
241
242genrule {
243 name: "libdl.x86_64.map",
244 out: ["libdl.x86_64.map"],
245 srcs: ["libdl.map.txt"],
246 tool_files: [":bionic-generate-version-script"],
247 cmd: "$(location :bionic-generate-version-script) x86_64 $(in) $(out)",
248}