blob: 8e3a3fc25bc6954aab65fdd26a921f2f8d659899 [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: [],
dimitryc5ea3eb2017-10-05 17:23:10 +020028
29 sanitize: {
30 never: true,
31 },
32}
33
Dan Willemsen208ae172015-09-16 16:33:27 -070034cc_library {
Dan Willemsen7ec52b12016-11-28 17:02:25 -080035 name: "libdl",
Yifan Hong5a39cee2020-01-21 16:43:56 -080036 ramdisk_available: true,
Jiyong Park5603c6e2018-04-27 21:53:11 +090037 recovery_available: true,
dimitry7f048802019-05-03 15:57:34 +020038 native_bridge_supported: true,
Dan Albert40f15ec2017-10-27 11:21:20 -070039 static_ndk_lib: true,
Dan Willemsen7ec52b12016-11-28 17:02:25 -080040
41 defaults: ["linux_bionic_supported"],
Dan Willemsen208ae172015-09-16 16:33:27 -070042
43 // NOTE: --exclude-libs=libgcc.a makes sure that any symbols libdl.so pulls from
44 // libgcc.a are made static to libdl.so. This in turn ensures that libraries that
45 // a) pull symbols from libgcc.a and b) depend on libdl.so will not rely on libdl.so
46 // to provide those symbols, but will instead pull them from libgcc.a. Specifically,
47 // we use this property to make sure libc.so has its own copy of the code from
48 // libgcc.a it uses.
49 //
50 // DO NOT REMOVE --exclude-libs!
51
Yi Kong7786a342018-08-31 19:01:56 -070052 ldflags: [
53 "-Wl,--exclude-libs=libgcc.a",
Yi Kong7ac2afb2019-05-06 16:23:10 -070054 "-Wl,--exclude-libs=libgcc_stripped.a",
Yi Kong7786a342018-08-31 19:01:56 -070055 "-Wl,--exclude-libs=libclang_rt.builtins-arm-android.a",
56 "-Wl,--exclude-libs=libclang_rt.builtins-aarch64-android.a",
57 "-Wl,--exclude-libs=libclang_rt.builtins-x86-android.a",
58 "-Wl,--exclude-libs=libclang_rt.builtins-x86_64-android.a",
59 ],
Dan Willemsen208ae172015-09-16 16:33:27 -070060
61 // for x86, exclude libgcc_eh.a for the same reasons as above
62 arch: {
Dan Willemsen9e6f98f2015-11-03 14:30:57 -080063 arm: {
Elliott Hughesd19b3c52018-09-06 16:04:08 -070064 version_script: ":libdl.arm.map",
Chih-Hung Hsiehecbff832018-05-23 18:45:53 -070065 pack_relocations: false,
Ian Pedowitzb6310c22018-01-18 16:26:19 -080066 ldflags: ["-Wl,--hash-style=both"],
Dan Willemsen9e6f98f2015-11-03 14:30:57 -080067 },
68 arm64: {
Elliott Hughesd19b3c52018-09-06 16:04:08 -070069 version_script: ":libdl.arm64.map",
Dan Willemsen9e6f98f2015-11-03 14:30:57 -080070 },
Dan Willemsen208ae172015-09-16 16:33:27 -070071 x86: {
Chih-Hung Hsiehecbff832018-05-23 18:45:53 -070072 pack_relocations: false,
Dimitry Ivanovac4bd2f2016-11-21 12:50:38 -080073 ldflags: [
74 "-Wl,--exclude-libs=libgcc_eh.a",
Ian Pedowitzb6310c22018-01-18 16:26:19 -080075 "-Wl,--hash-style=both",
Dimitry Ivanovac4bd2f2016-11-21 12:50:38 -080076 ],
Elliott Hughesd19b3c52018-09-06 16:04:08 -070077 version_script: ":libdl.x86.map",
Dan Willemsen208ae172015-09-16 16:33:27 -070078 },
79 x86_64: {
80 ldflags: ["-Wl,--exclude-libs=libgcc_eh.a"],
Elliott Hughesd19b3c52018-09-06 16:04:08 -070081 version_script: ":libdl.x86_64.map",
Dan Willemsen208ae172015-09-16 16:33:27 -070082 },
83 },
dimitrydc7cc622017-08-30 10:52:19 +020084 shared: {
dimitryc5ea3eb2017-10-05 17:23:10 +020085 whole_static_libs: ["libdl_static"],
dimitrydc7cc622017-08-30 10:52:19 +020086 },
87 static: {
Elliott Hughes46a943c2018-04-03 15:56:35 -070088 srcs: ["libdl_static.cpp"],
dimitrydc7cc622017-08-30 10:52:19 +020089 },
Dan Willemsen208ae172015-09-16 16:33:27 -070090 cflags: [
91 "-Wall",
92 "-Wextra",
93 "-Wunused",
94 "-Werror",
95 ],
96 stl: "none",
97
Ryan Prichard470b6662018-03-27 22:10:55 -070098 nocrt: true,
Dan Willemsen208ae172015-09-16 16:33:27 -070099 system_shared_libs: [],
Pirama Arumuga Nainareeb2ee62019-02-15 11:40:40 -0800100
101 // Opt out of native_coverage when opting out of system_shared_libs
Pirama Arumuga Nainar852d5232018-12-20 13:52:19 -0800102 native_coverage: false,
Dan Willemsen208ae172015-09-16 16:33:27 -0700103
Dimitry Ivanovd9e427c2016-11-22 16:55:25 -0800104 // This is placeholder library the actual implementation is (currently)
105 // provided by the linker.
Elliott Hughesd50a1de2018-02-05 17:30:57 -0800106 shared_libs: ["ld-android"],
Dimitry Ivanovd9e427c2016-11-22 16:55:25 -0800107
108 sanitize: {
109 never: true,
110 },
Jiyong Parkc45fe9f2018-12-13 18:26:48 +0900111
112 stubs: {
113 symbol_file: "libdl.map.txt",
Jooyung Han26ddc4d2020-02-27 18:33:25 +0900114 versions: [
115 "29",
116 "10000",
117 ],
Jiyong Parkc45fe9f2018-12-13 18:26:48 +0900118 },
Jiyong Parke87e0dc2019-10-02 17:09:33 +0900119
120 apex_available: [
121 "//apex_available:platform",
122 "com.android.runtime",
123 ],
Dimitry Ivanovd9e427c2016-11-22 16:55:25 -0800124}
125
dimitry8868d9e2019-03-19 13:01:42 +0100126cc_library {
127 name: "libdl_android",
128
129 defaults: ["linux_bionic_supported"],
Yifan Hong5a39cee2020-01-21 16:43:56 -0800130 ramdisk_available: true,
Jiyong Park3ff116a2019-04-02 23:04:52 +0900131 recovery_available: true,
dimitry7f048802019-05-03 15:57:34 +0200132 native_bridge_supported: true,
dimitry8868d9e2019-03-19 13:01:42 +0100133
134 // NOTE: --exclude-libs=libgcc.a makes sure that any symbols libdl.so pulls from
135 // libgcc.a are made static to libdl.so. This in turn ensures that libraries that
136 // a) pull symbols from libgcc.a and b) depend on libdl.so will not rely on libdl.so
137 // to provide those symbols, but will instead pull them from libgcc.a. Specifically,
138 // we use this property to make sure libc.so has its own copy of the code from
139 // libgcc.a it uses.
140 //
141 // DO NOT REMOVE --exclude-libs!
142
143 ldflags: [
144 "-Wl,--exclude-libs=libgcc.a",
Yi Kong7ac2afb2019-05-06 16:23:10 -0700145 "-Wl,--exclude-libs=libgcc_stripped.a",
dimitry8868d9e2019-03-19 13:01:42 +0100146 "-Wl,--exclude-libs=libclang_rt.builtins-arm-android.a",
147 "-Wl,--exclude-libs=libclang_rt.builtins-aarch64-android.a",
148 "-Wl,--exclude-libs=libclang_rt.builtins-x86-android.a",
149 "-Wl,--exclude-libs=libclang_rt.builtins-x86_64-android.a",
150 ],
151
152 // for x86, exclude libgcc_eh.a for the same reasons as above
153 arch: {
154 x86: {
155 ldflags: [
156 "-Wl,--exclude-libs=libgcc_eh.a",
157 ],
158 },
159 x86_64: {
160 ldflags: ["-Wl,--exclude-libs=libgcc_eh.a"],
161 },
162 },
163
164 srcs: [ "libdl_android.cpp" ],
165 version_script: "libdl_android.map.txt",
166
167 cflags: [
168 "-Wall",
169 "-Wextra",
170 "-Wunused",
171 "-Werror",
172 ],
173
174 stl: "none",
175
176 nocrt: true,
177 system_shared_libs: [],
178
179 // Opt out of native_coverage when opting out of system_shared_libs
180 native_coverage: false,
181
182 // This is placeholder library the actual implementation is (currently)
183 // provided by the linker.
184 shared_libs: ["ld-android"],
185
186 sanitize: {
187 never: true,
188 },
189
190 stubs: {
191 symbol_file: "libdl_android.map.txt",
192 versions: ["10000"],
193 },
Martin Stjernholm3274cc42019-11-11 15:33:22 +0000194
195 apex_available: [
196 "//apex_available:platform",
197 "com.android.runtime",
198 ],
dimitry8868d9e2019-03-19 13:01:42 +0100199}
200
Dan Alberte8a91082016-08-04 13:45:44 -0700201ndk_library {
Dan Willemsen993b0832017-04-07 14:09:18 -0700202 name: "libdl",
dimitry7f048802019-05-03 15:57:34 +0200203 native_bridge_supported: true,
Dan Alberte8a91082016-08-04 13:45:44 -0700204 symbol_file: "libdl.map.txt",
205 first_version: "9",
206}
Dan Willemsenb93d3c22017-03-20 14:07:47 -0700207
208llndk_library {
Dan Willemsen993b0832017-04-07 14:09:18 -0700209 name: "libdl",
dimitry7f048802019-05-03 15:57:34 +0200210 native_bridge_supported: true,
Dan Willemsenb93d3c22017-03-20 14:07:47 -0700211 symbol_file: "libdl.map.txt",
212}
Elliott Hughesd19b3c52018-09-06 16:04:08 -0700213
214genrule {
215 name: "libdl.arm.map",
216 out: ["libdl.arm.map"],
217 srcs: ["libdl.map.txt"],
218 tool_files: [":bionic-generate-version-script"],
219 cmd: "$(location :bionic-generate-version-script) arm $(in) $(out)",
220}
221
222genrule {
223 name: "libdl.arm64.map",
224 out: ["libdl.arm64.map"],
225 srcs: ["libdl.map.txt"],
226 tool_files: [":bionic-generate-version-script"],
227 cmd: "$(location :bionic-generate-version-script) arm64 $(in) $(out)",
228}
229
230genrule {
231 name: "libdl.x86.map",
232 out: ["libdl.x86.map"],
233 srcs: ["libdl.map.txt"],
234 tool_files: [":bionic-generate-version-script"],
235 cmd: "$(location :bionic-generate-version-script) x86 $(in) $(out)",
236}
237
238genrule {
239 name: "libdl.x86_64.map",
240 out: ["libdl.x86_64.map"],
241 srcs: ["libdl.map.txt"],
242 tool_files: [":bionic-generate-version-script"],
243 cmd: "$(location :bionic-generate-version-script) x86_64 $(in) $(out)",
244}