blob: 59f1937c74c294e010368a26d3f0d312062e21b9 [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",
114 versions: ["10000"],
115 },
Jiyong Parke87e0dc2019-10-02 17:09:33 +0900116
117 apex_available: [
118 "//apex_available:platform",
119 "com.android.runtime",
120 ],
Dimitry Ivanovd9e427c2016-11-22 16:55:25 -0800121}
122
dimitry8868d9e2019-03-19 13:01:42 +0100123cc_library {
124 name: "libdl_android",
125
126 defaults: ["linux_bionic_supported"],
Yifan Hong5a39cee2020-01-21 16:43:56 -0800127 ramdisk_available: true,
Jiyong Park3ff116a2019-04-02 23:04:52 +0900128 recovery_available: true,
dimitry7f048802019-05-03 15:57:34 +0200129 native_bridge_supported: true,
dimitry8868d9e2019-03-19 13:01:42 +0100130
131 // NOTE: --exclude-libs=libgcc.a makes sure that any symbols libdl.so pulls from
132 // libgcc.a are made static to libdl.so. This in turn ensures that libraries that
133 // a) pull symbols from libgcc.a and b) depend on libdl.so will not rely on libdl.so
134 // to provide those symbols, but will instead pull them from libgcc.a. Specifically,
135 // we use this property to make sure libc.so has its own copy of the code from
136 // libgcc.a it uses.
137 //
138 // DO NOT REMOVE --exclude-libs!
139
140 ldflags: [
141 "-Wl,--exclude-libs=libgcc.a",
Yi Kong7ac2afb2019-05-06 16:23:10 -0700142 "-Wl,--exclude-libs=libgcc_stripped.a",
dimitry8868d9e2019-03-19 13:01:42 +0100143 "-Wl,--exclude-libs=libclang_rt.builtins-arm-android.a",
144 "-Wl,--exclude-libs=libclang_rt.builtins-aarch64-android.a",
145 "-Wl,--exclude-libs=libclang_rt.builtins-x86-android.a",
146 "-Wl,--exclude-libs=libclang_rt.builtins-x86_64-android.a",
147 ],
148
149 // for x86, exclude libgcc_eh.a for the same reasons as above
150 arch: {
151 x86: {
152 ldflags: [
153 "-Wl,--exclude-libs=libgcc_eh.a",
154 ],
155 },
156 x86_64: {
157 ldflags: ["-Wl,--exclude-libs=libgcc_eh.a"],
158 },
159 },
160
161 srcs: [ "libdl_android.cpp" ],
162 version_script: "libdl_android.map.txt",
163
164 cflags: [
165 "-Wall",
166 "-Wextra",
167 "-Wunused",
168 "-Werror",
169 ],
170
171 stl: "none",
172
173 nocrt: true,
174 system_shared_libs: [],
175
176 // Opt out of native_coverage when opting out of system_shared_libs
177 native_coverage: false,
178
179 // This is placeholder library the actual implementation is (currently)
180 // provided by the linker.
181 shared_libs: ["ld-android"],
182
183 sanitize: {
184 never: true,
185 },
186
187 stubs: {
188 symbol_file: "libdl_android.map.txt",
189 versions: ["10000"],
190 },
Martin Stjernholm3274cc42019-11-11 15:33:22 +0000191
192 apex_available: [
193 "//apex_available:platform",
194 "com.android.runtime",
195 ],
dimitry8868d9e2019-03-19 13:01:42 +0100196}
197
Dan Alberte8a91082016-08-04 13:45:44 -0700198ndk_library {
Dan Willemsen993b0832017-04-07 14:09:18 -0700199 name: "libdl",
dimitry7f048802019-05-03 15:57:34 +0200200 native_bridge_supported: true,
Dan Alberte8a91082016-08-04 13:45:44 -0700201 symbol_file: "libdl.map.txt",
202 first_version: "9",
203}
Dan Willemsenb93d3c22017-03-20 14:07:47 -0700204
205llndk_library {
Dan Willemsen993b0832017-04-07 14:09:18 -0700206 name: "libdl",
dimitry7f048802019-05-03 15:57:34 +0200207 native_bridge_supported: true,
Dan Willemsenb93d3c22017-03-20 14:07:47 -0700208 symbol_file: "libdl.map.txt",
209}
Elliott Hughesd19b3c52018-09-06 16:04:08 -0700210
211genrule {
212 name: "libdl.arm.map",
213 out: ["libdl.arm.map"],
214 srcs: ["libdl.map.txt"],
215 tool_files: [":bionic-generate-version-script"],
216 cmd: "$(location :bionic-generate-version-script) arm $(in) $(out)",
217}
218
219genrule {
220 name: "libdl.arm64.map",
221 out: ["libdl.arm64.map"],
222 srcs: ["libdl.map.txt"],
223 tool_files: [":bionic-generate-version-script"],
224 cmd: "$(location :bionic-generate-version-script) arm64 $(in) $(out)",
225}
226
227genrule {
228 name: "libdl.x86.map",
229 out: ["libdl.x86.map"],
230 srcs: ["libdl.map.txt"],
231 tool_files: [":bionic-generate-version-script"],
232 cmd: "$(location :bionic-generate-version-script) x86 $(in) $(out)",
233}
234
235genrule {
236 name: "libdl.x86_64.map",
237 out: ["libdl.x86_64.map"],
238 srcs: ["libdl.map.txt"],
239 tool_files: [":bionic-generate-version-script"],
240 cmd: "$(location :bionic-generate-version-script) x86_64 $(in) $(out)",
241}