blob: b3f9e975009c4be23029c4b09351de3a7d2047e4 [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,
Colin Cross8393a8b2020-10-19 13:37:49 -070042 llndk_stubs: "libdl.llndk",
Dan Willemsen7ec52b12016-11-28 17:02:25 -080043
44 defaults: ["linux_bionic_supported"],
Dan Willemsen208ae172015-09-16 16:33:27 -070045
46 // NOTE: --exclude-libs=libgcc.a makes sure that any symbols libdl.so pulls from
47 // libgcc.a are made static to libdl.so. This in turn ensures that libraries that
48 // a) pull symbols from libgcc.a and b) depend on libdl.so will not rely on libdl.so
49 // to provide those symbols, but will instead pull them from libgcc.a. Specifically,
50 // we use this property to make sure libc.so has its own copy of the code from
51 // libgcc.a it uses.
52 //
53 // DO NOT REMOVE --exclude-libs!
54
Yi Kong7786a342018-08-31 19:01:56 -070055 ldflags: [
56 "-Wl,--exclude-libs=libgcc.a",
Yi Kong7ac2afb2019-05-06 16:23:10 -070057 "-Wl,--exclude-libs=libgcc_stripped.a",
Yi Kong7786a342018-08-31 19:01:56 -070058 "-Wl,--exclude-libs=libclang_rt.builtins-arm-android.a",
59 "-Wl,--exclude-libs=libclang_rt.builtins-aarch64-android.a",
60 "-Wl,--exclude-libs=libclang_rt.builtins-x86-android.a",
61 "-Wl,--exclude-libs=libclang_rt.builtins-x86_64-android.a",
62 ],
Dan Willemsen208ae172015-09-16 16:33:27 -070063
64 // for x86, exclude libgcc_eh.a for the same reasons as above
65 arch: {
Dan Willemsen9e6f98f2015-11-03 14:30:57 -080066 arm: {
Elliott Hughesd19b3c52018-09-06 16:04:08 -070067 version_script: ":libdl.arm.map",
Chih-Hung Hsiehecbff832018-05-23 18:45:53 -070068 pack_relocations: false,
Ian Pedowitzb6310c22018-01-18 16:26:19 -080069 ldflags: ["-Wl,--hash-style=both"],
Dan Willemsen9e6f98f2015-11-03 14:30:57 -080070 },
71 arm64: {
Elliott Hughesd19b3c52018-09-06 16:04:08 -070072 version_script: ":libdl.arm64.map",
Dan Willemsen9e6f98f2015-11-03 14:30:57 -080073 },
Dan Willemsen208ae172015-09-16 16:33:27 -070074 x86: {
Chih-Hung Hsiehecbff832018-05-23 18:45:53 -070075 pack_relocations: false,
Dimitry Ivanovac4bd2f2016-11-21 12:50:38 -080076 ldflags: [
77 "-Wl,--exclude-libs=libgcc_eh.a",
Ian Pedowitzb6310c22018-01-18 16:26:19 -080078 "-Wl,--hash-style=both",
Dimitry Ivanovac4bd2f2016-11-21 12:50:38 -080079 ],
Elliott Hughesd19b3c52018-09-06 16:04:08 -070080 version_script: ":libdl.x86.map",
Dan Willemsen208ae172015-09-16 16:33:27 -070081 },
82 x86_64: {
83 ldflags: ["-Wl,--exclude-libs=libgcc_eh.a"],
Elliott Hughesd19b3c52018-09-06 16:04:08 -070084 version_script: ":libdl.x86_64.map",
Dan Willemsen208ae172015-09-16 16:33:27 -070085 },
86 },
dimitrydc7cc622017-08-30 10:52:19 +020087 shared: {
dimitryc5ea3eb2017-10-05 17:23:10 +020088 whole_static_libs: ["libdl_static"],
dimitrydc7cc622017-08-30 10:52:19 +020089 },
90 static: {
Elliott Hughes46a943c2018-04-03 15:56:35 -070091 srcs: ["libdl_static.cpp"],
dimitrydc7cc622017-08-30 10:52:19 +020092 },
Dan Willemsen208ae172015-09-16 16:33:27 -070093 cflags: [
94 "-Wall",
95 "-Wextra",
96 "-Wunused",
97 "-Werror",
98 ],
99 stl: "none",
100
Ryan Prichard470b6662018-03-27 22:10:55 -0700101 nocrt: true,
Dan Willemsen208ae172015-09-16 16:33:27 -0700102 system_shared_libs: [],
Martin Stjernholm82d84bc2020-04-06 20:32:09 +0100103 header_libs: ["libc_headers"],
Pirama Arumuga Nainareeb2ee62019-02-15 11:40:40 -0800104
105 // Opt out of native_coverage when opting out of system_shared_libs
Pirama Arumuga Nainar852d5232018-12-20 13:52:19 -0800106 native_coverage: false,
Dan Willemsen208ae172015-09-16 16:33:27 -0700107
Dimitry Ivanovd9e427c2016-11-22 16:55:25 -0800108 // This is placeholder library the actual implementation is (currently)
109 // provided by the linker.
Elliott Hughesd50a1de2018-02-05 17:30:57 -0800110 shared_libs: ["ld-android"],
Dimitry Ivanovd9e427c2016-11-22 16:55:25 -0800111
112 sanitize: {
113 never: true,
114 },
Jiyong Parkc45fe9f2018-12-13 18:26:48 +0900115
116 stubs: {
117 symbol_file: "libdl.map.txt",
Jooyung Han26ddc4d2020-02-27 18:33:25 +0900118 versions: [
119 "29",
Dan Albert48943b22020-07-27 13:28:56 -0700120 "current",
Jooyung Han26ddc4d2020-02-27 18:33:25 +0900121 ],
Jiyong Parkc45fe9f2018-12-13 18:26:48 +0900122 },
Jiyong Parke87e0dc2019-10-02 17:09:33 +0900123
124 apex_available: [
125 "//apex_available:platform",
126 "com.android.runtime",
127 ],
Yi Kong15a05a72020-09-22 00:56:13 +0800128
129 lto: {
130 never: true,
131 },
Dimitry Ivanovd9e427c2016-11-22 16:55:25 -0800132}
133
dimitry8868d9e2019-03-19 13:01:42 +0100134cc_library {
135 name: "libdl_android",
136
137 defaults: ["linux_bionic_supported"],
Yifan Hong5a39cee2020-01-21 16:43:56 -0800138 ramdisk_available: true,
Jiyong Park3ff116a2019-04-02 23:04:52 +0900139 recovery_available: true,
dimitry7f048802019-05-03 15:57:34 +0200140 native_bridge_supported: true,
dimitry8868d9e2019-03-19 13:01:42 +0100141
142 // NOTE: --exclude-libs=libgcc.a makes sure that any symbols libdl.so pulls from
143 // libgcc.a are made static to libdl.so. This in turn ensures that libraries that
144 // a) pull symbols from libgcc.a and b) depend on libdl.so will not rely on libdl.so
145 // to provide those symbols, but will instead pull them from libgcc.a. Specifically,
146 // we use this property to make sure libc.so has its own copy of the code from
147 // libgcc.a it uses.
148 //
149 // DO NOT REMOVE --exclude-libs!
150
151 ldflags: [
152 "-Wl,--exclude-libs=libgcc.a",
Yi Kong7ac2afb2019-05-06 16:23:10 -0700153 "-Wl,--exclude-libs=libgcc_stripped.a",
dimitry8868d9e2019-03-19 13:01:42 +0100154 "-Wl,--exclude-libs=libclang_rt.builtins-arm-android.a",
155 "-Wl,--exclude-libs=libclang_rt.builtins-aarch64-android.a",
156 "-Wl,--exclude-libs=libclang_rt.builtins-x86-android.a",
157 "-Wl,--exclude-libs=libclang_rt.builtins-x86_64-android.a",
158 ],
159
160 // for x86, exclude libgcc_eh.a for the same reasons as above
161 arch: {
162 x86: {
163 ldflags: [
164 "-Wl,--exclude-libs=libgcc_eh.a",
165 ],
166 },
167 x86_64: {
168 ldflags: ["-Wl,--exclude-libs=libgcc_eh.a"],
169 },
170 },
171
172 srcs: [ "libdl_android.cpp" ],
173 version_script: "libdl_android.map.txt",
174
175 cflags: [
176 "-Wall",
177 "-Wextra",
178 "-Wunused",
179 "-Werror",
180 ],
181
182 stl: "none",
183
184 nocrt: true,
185 system_shared_libs: [],
Martin Stjernholm82d84bc2020-04-06 20:32:09 +0100186 header_libs: ["libc_headers"],
dimitry8868d9e2019-03-19 13:01:42 +0100187
188 // Opt out of native_coverage when opting out of system_shared_libs
189 native_coverage: false,
190
191 // This is placeholder library the actual implementation is (currently)
192 // provided by the linker.
193 shared_libs: ["ld-android"],
194
195 sanitize: {
196 never: true,
197 },
198
199 stubs: {
200 symbol_file: "libdl_android.map.txt",
Dan Albert48943b22020-07-27 13:28:56 -0700201 versions: ["current"],
dimitry8868d9e2019-03-19 13:01:42 +0100202 },
Martin Stjernholm3274cc42019-11-11 15:33:22 +0000203
204 apex_available: [
205 "//apex_available:platform",
206 "com.android.runtime",
207 ],
Yi Kong15a05a72020-09-22 00:56:13 +0800208
209 lto: {
210 never: true,
211 },
dimitry8868d9e2019-03-19 13:01:42 +0100212}
213
Dan Alberte8a91082016-08-04 13:45:44 -0700214ndk_library {
Dan Willemsen993b0832017-04-07 14:09:18 -0700215 name: "libdl",
dimitry7f048802019-05-03 15:57:34 +0200216 native_bridge_supported: true,
Dan Alberte8a91082016-08-04 13:45:44 -0700217 symbol_file: "libdl.map.txt",
218 first_version: "9",
219}
Dan Willemsenb93d3c22017-03-20 14:07:47 -0700220
221llndk_library {
Colin Cross8393a8b2020-10-19 13:37:49 -0700222 name: "libdl.llndk",
dimitry7f048802019-05-03 15:57:34 +0200223 native_bridge_supported: true,
Dan Willemsenb93d3c22017-03-20 14:07:47 -0700224 symbol_file: "libdl.map.txt",
225}
Elliott Hughesd19b3c52018-09-06 16:04:08 -0700226
227genrule {
228 name: "libdl.arm.map",
229 out: ["libdl.arm.map"],
230 srcs: ["libdl.map.txt"],
231 tool_files: [":bionic-generate-version-script"],
232 cmd: "$(location :bionic-generate-version-script) arm $(in) $(out)",
233}
234
235genrule {
236 name: "libdl.arm64.map",
237 out: ["libdl.arm64.map"],
238 srcs: ["libdl.map.txt"],
239 tool_files: [":bionic-generate-version-script"],
240 cmd: "$(location :bionic-generate-version-script) arm64 $(in) $(out)",
241}
242
243genrule {
244 name: "libdl.x86.map",
245 out: ["libdl.x86.map"],
246 srcs: ["libdl.map.txt"],
247 tool_files: [":bionic-generate-version-script"],
248 cmd: "$(location :bionic-generate-version-script) x86 $(in) $(out)",
249}
250
251genrule {
252 name: "libdl.x86_64.map",
253 out: ["libdl.x86_64.map"],
254 srcs: ["libdl.map.txt"],
255 tool_files: [":bionic-generate-version-script"],
256 cmd: "$(location :bionic-generate-version-script) x86_64 $(in) $(out)",
257}