blob: 37bdbdd469db87294f35bf816c046f844bf3dcbe [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"],
dimitryc5ea3eb2017-10-05 17:23:10 +020029
30 sanitize: {
31 never: true,
32 },
33}
34
Dan Willemsen208ae172015-09-16 16:33:27 -070035cc_library {
Dan Willemsen7ec52b12016-11-28 17:02:25 -080036 name: "libdl",
Yifan Hong5a39cee2020-01-21 16:43:56 -080037 ramdisk_available: true,
Jiyong Park5603c6e2018-04-27 21:53:11 +090038 recovery_available: true,
dimitry7f048802019-05-03 15:57:34 +020039 native_bridge_supported: true,
Dan Albert40f15ec2017-10-27 11:21:20 -070040 static_ndk_lib: true,
Dan Willemsen7ec52b12016-11-28 17:02:25 -080041
42 defaults: ["linux_bionic_supported"],
Dan Willemsen208ae172015-09-16 16:33:27 -070043
44 // NOTE: --exclude-libs=libgcc.a makes sure that any symbols libdl.so pulls from
45 // libgcc.a are made static to libdl.so. This in turn ensures that libraries that
46 // a) pull symbols from libgcc.a and b) depend on libdl.so will not rely on libdl.so
47 // to provide those symbols, but will instead pull them from libgcc.a. Specifically,
48 // we use this property to make sure libc.so has its own copy of the code from
49 // libgcc.a it uses.
50 //
51 // DO NOT REMOVE --exclude-libs!
52
Yi Kong7786a342018-08-31 19:01:56 -070053 ldflags: [
54 "-Wl,--exclude-libs=libgcc.a",
Yi Kong7ac2afb2019-05-06 16:23:10 -070055 "-Wl,--exclude-libs=libgcc_stripped.a",
Yi Kong7786a342018-08-31 19:01:56 -070056 "-Wl,--exclude-libs=libclang_rt.builtins-arm-android.a",
57 "-Wl,--exclude-libs=libclang_rt.builtins-aarch64-android.a",
58 "-Wl,--exclude-libs=libclang_rt.builtins-x86-android.a",
59 "-Wl,--exclude-libs=libclang_rt.builtins-x86_64-android.a",
60 ],
Dan Willemsen208ae172015-09-16 16:33:27 -070061
62 // for x86, exclude libgcc_eh.a for the same reasons as above
63 arch: {
Dan Willemsen9e6f98f2015-11-03 14:30:57 -080064 arm: {
Elliott Hughesd19b3c52018-09-06 16:04:08 -070065 version_script: ":libdl.arm.map",
Chih-Hung Hsiehecbff832018-05-23 18:45:53 -070066 pack_relocations: false,
Ian Pedowitzb6310c22018-01-18 16:26:19 -080067 ldflags: ["-Wl,--hash-style=both"],
Dan Willemsen9e6f98f2015-11-03 14:30:57 -080068 },
69 arm64: {
Elliott Hughesd19b3c52018-09-06 16:04:08 -070070 version_script: ":libdl.arm64.map",
Dan Willemsen9e6f98f2015-11-03 14:30:57 -080071 },
Dan Willemsen208ae172015-09-16 16:33:27 -070072 x86: {
Chih-Hung Hsiehecbff832018-05-23 18:45:53 -070073 pack_relocations: false,
Dimitry Ivanovac4bd2f2016-11-21 12:50:38 -080074 ldflags: [
75 "-Wl,--exclude-libs=libgcc_eh.a",
Ian Pedowitzb6310c22018-01-18 16:26:19 -080076 "-Wl,--hash-style=both",
Dimitry Ivanovac4bd2f2016-11-21 12:50:38 -080077 ],
Elliott Hughesd19b3c52018-09-06 16:04:08 -070078 version_script: ":libdl.x86.map",
Dan Willemsen208ae172015-09-16 16:33:27 -070079 },
80 x86_64: {
81 ldflags: ["-Wl,--exclude-libs=libgcc_eh.a"],
Elliott Hughesd19b3c52018-09-06 16:04:08 -070082 version_script: ":libdl.x86_64.map",
Dan Willemsen208ae172015-09-16 16:33:27 -070083 },
84 },
dimitrydc7cc622017-08-30 10:52:19 +020085 shared: {
dimitryc5ea3eb2017-10-05 17:23:10 +020086 whole_static_libs: ["libdl_static"],
dimitrydc7cc622017-08-30 10:52:19 +020087 },
88 static: {
Elliott Hughes46a943c2018-04-03 15:56:35 -070089 srcs: ["libdl_static.cpp"],
dimitrydc7cc622017-08-30 10:52:19 +020090 },
Dan Willemsen208ae172015-09-16 16:33:27 -070091 cflags: [
92 "-Wall",
93 "-Wextra",
94 "-Wunused",
95 "-Werror",
96 ],
97 stl: "none",
98
Ryan Prichard470b6662018-03-27 22:10:55 -070099 nocrt: true,
Dan Willemsen208ae172015-09-16 16:33:27 -0700100 system_shared_libs: [],
Martin Stjernholm82d84bc2020-04-06 20:32:09 +0100101 header_libs: ["libc_headers"],
Pirama Arumuga Nainareeb2ee62019-02-15 11:40:40 -0800102
103 // Opt out of native_coverage when opting out of system_shared_libs
Pirama Arumuga Nainar852d5232018-12-20 13:52:19 -0800104 native_coverage: false,
Dan Willemsen208ae172015-09-16 16:33:27 -0700105
Dimitry Ivanovd9e427c2016-11-22 16:55:25 -0800106 // This is placeholder library the actual implementation is (currently)
107 // provided by the linker.
Elliott Hughesd50a1de2018-02-05 17:30:57 -0800108 shared_libs: ["ld-android"],
Dimitry Ivanovd9e427c2016-11-22 16:55:25 -0800109
110 sanitize: {
111 never: true,
112 },
Jiyong Parkc45fe9f2018-12-13 18:26:48 +0900113
114 stubs: {
115 symbol_file: "libdl.map.txt",
Jooyung Han26ddc4d2020-02-27 18:33:25 +0900116 versions: [
117 "29",
118 "10000",
119 ],
Jiyong Parkc45fe9f2018-12-13 18:26:48 +0900120 },
Jiyong Parke87e0dc2019-10-02 17:09:33 +0900121
122 apex_available: [
123 "//apex_available:platform",
124 "com.android.runtime",
125 ],
Dimitry Ivanovd9e427c2016-11-22 16:55:25 -0800126}
127
dimitry8868d9e2019-03-19 13:01:42 +0100128cc_library {
129 name: "libdl_android",
130
131 defaults: ["linux_bionic_supported"],
Yifan Hong5a39cee2020-01-21 16:43:56 -0800132 ramdisk_available: true,
Jiyong Park3ff116a2019-04-02 23:04:52 +0900133 recovery_available: true,
dimitry7f048802019-05-03 15:57:34 +0200134 native_bridge_supported: true,
dimitry8868d9e2019-03-19 13:01:42 +0100135
136 // NOTE: --exclude-libs=libgcc.a makes sure that any symbols libdl.so pulls from
137 // libgcc.a are made static to libdl.so. This in turn ensures that libraries that
138 // a) pull symbols from libgcc.a and b) depend on libdl.so will not rely on libdl.so
139 // to provide those symbols, but will instead pull them from libgcc.a. Specifically,
140 // we use this property to make sure libc.so has its own copy of the code from
141 // libgcc.a it uses.
142 //
143 // DO NOT REMOVE --exclude-libs!
144
145 ldflags: [
146 "-Wl,--exclude-libs=libgcc.a",
Yi Kong7ac2afb2019-05-06 16:23:10 -0700147 "-Wl,--exclude-libs=libgcc_stripped.a",
dimitry8868d9e2019-03-19 13:01:42 +0100148 "-Wl,--exclude-libs=libclang_rt.builtins-arm-android.a",
149 "-Wl,--exclude-libs=libclang_rt.builtins-aarch64-android.a",
150 "-Wl,--exclude-libs=libclang_rt.builtins-x86-android.a",
151 "-Wl,--exclude-libs=libclang_rt.builtins-x86_64-android.a",
152 ],
153
154 // for x86, exclude libgcc_eh.a for the same reasons as above
155 arch: {
156 x86: {
157 ldflags: [
158 "-Wl,--exclude-libs=libgcc_eh.a",
159 ],
160 },
161 x86_64: {
162 ldflags: ["-Wl,--exclude-libs=libgcc_eh.a"],
163 },
164 },
165
166 srcs: [ "libdl_android.cpp" ],
167 version_script: "libdl_android.map.txt",
168
169 cflags: [
170 "-Wall",
171 "-Wextra",
172 "-Wunused",
173 "-Werror",
174 ],
175
176 stl: "none",
177
178 nocrt: true,
179 system_shared_libs: [],
Martin Stjernholm82d84bc2020-04-06 20:32:09 +0100180 header_libs: ["libc_headers"],
dimitry8868d9e2019-03-19 13:01:42 +0100181
182 // Opt out of native_coverage when opting out of system_shared_libs
183 native_coverage: false,
184
185 // This is placeholder library the actual implementation is (currently)
186 // provided by the linker.
187 shared_libs: ["ld-android"],
188
189 sanitize: {
190 never: true,
191 },
192
193 stubs: {
194 symbol_file: "libdl_android.map.txt",
195 versions: ["10000"],
196 },
Martin Stjernholm3274cc42019-11-11 15:33:22 +0000197
198 apex_available: [
199 "//apex_available:platform",
200 "com.android.runtime",
201 ],
dimitry8868d9e2019-03-19 13:01:42 +0100202}
203
Dan Alberte8a91082016-08-04 13:45:44 -0700204ndk_library {
Dan Willemsen993b0832017-04-07 14:09:18 -0700205 name: "libdl",
dimitry7f048802019-05-03 15:57:34 +0200206 native_bridge_supported: true,
Dan Alberte8a91082016-08-04 13:45:44 -0700207 symbol_file: "libdl.map.txt",
208 first_version: "9",
209}
Dan Willemsenb93d3c22017-03-20 14:07:47 -0700210
211llndk_library {
Dan Willemsen993b0832017-04-07 14:09:18 -0700212 name: "libdl",
dimitry7f048802019-05-03 15:57:34 +0200213 native_bridge_supported: true,
Dan Willemsenb93d3c22017-03-20 14:07:47 -0700214 symbol_file: "libdl.map.txt",
215}
Elliott Hughesd19b3c52018-09-06 16:04:08 -0700216
217genrule {
218 name: "libdl.arm.map",
219 out: ["libdl.arm.map"],
220 srcs: ["libdl.map.txt"],
221 tool_files: [":bionic-generate-version-script"],
222 cmd: "$(location :bionic-generate-version-script) arm $(in) $(out)",
223}
224
225genrule {
226 name: "libdl.arm64.map",
227 out: ["libdl.arm64.map"],
228 srcs: ["libdl.map.txt"],
229 tool_files: [":bionic-generate-version-script"],
230 cmd: "$(location :bionic-generate-version-script) arm64 $(in) $(out)",
231}
232
233genrule {
234 name: "libdl.x86.map",
235 out: ["libdl.x86.map"],
236 srcs: ["libdl.map.txt"],
237 tool_files: [":bionic-generate-version-script"],
238 cmd: "$(location :bionic-generate-version-script) x86 $(in) $(out)",
239}
240
241genrule {
242 name: "libdl.x86_64.map",
243 out: ["libdl.x86_64.map"],
244 srcs: ["libdl.map.txt"],
245 tool_files: [":bionic-generate-version-script"],
246 cmd: "$(location :bionic-generate-version-script) x86_64 $(in) $(out)",
247}