blob: cf723beba29e5bbd840cb41c93cd26d4951f8496 [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"],
Jiyong Park5603c6e2018-04-27 21:53:11 +09007 recovery_available: true,
dimitry7f048802019-05-03 15:57:34 +02008 native_bridge_supported: true,
dimitryc5ea3eb2017-10-05 17:23:10 +02009
Elliott Hughesd50a1de2018-02-05 17:30:57 -080010 srcs: [
11 "libdl.cpp",
12 "libdl_cfi.cpp",
13 ],
dimitryc5ea3eb2017-10-05 17:23:10 +020014
15 cflags: [
16 "-Wall",
17 "-Wextra",
18 "-Wunused",
19 "-Werror",
20 ],
21
22 // For private/CFIShadow.h.
23 include_dirs: ["bionic/libc"],
24
25 stl: "none",
Dan Willemsen6b3be172018-12-03 13:57:20 -080026 system_shared_libs: [],
dimitryc5ea3eb2017-10-05 17:23:10 +020027
28 sanitize: {
29 never: true,
30 },
31}
32
Dan Willemsen208ae172015-09-16 16:33:27 -070033cc_library {
Dan Willemsen7ec52b12016-11-28 17:02:25 -080034 name: "libdl",
Jiyong Park5603c6e2018-04-27 21:53:11 +090035 recovery_available: true,
dimitry7f048802019-05-03 15:57:34 +020036 native_bridge_supported: true,
Dan Albert40f15ec2017-10-27 11:21:20 -070037 static_ndk_lib: true,
Dan Willemsen7ec52b12016-11-28 17:02:25 -080038
39 defaults: ["linux_bionic_supported"],
Dan Willemsen208ae172015-09-16 16:33:27 -070040
41 // NOTE: --exclude-libs=libgcc.a makes sure that any symbols libdl.so pulls from
42 // libgcc.a are made static to libdl.so. This in turn ensures that libraries that
43 // a) pull symbols from libgcc.a and b) depend on libdl.so will not rely on libdl.so
44 // to provide those symbols, but will instead pull them from libgcc.a. Specifically,
45 // we use this property to make sure libc.so has its own copy of the code from
46 // libgcc.a it uses.
47 //
48 // DO NOT REMOVE --exclude-libs!
49
Yi Kong7786a342018-08-31 19:01:56 -070050 ldflags: [
51 "-Wl,--exclude-libs=libgcc.a",
52 "-Wl,--exclude-libs=libclang_rt.builtins-arm-android.a",
53 "-Wl,--exclude-libs=libclang_rt.builtins-aarch64-android.a",
54 "-Wl,--exclude-libs=libclang_rt.builtins-x86-android.a",
55 "-Wl,--exclude-libs=libclang_rt.builtins-x86_64-android.a",
56 ],
Dan Willemsen208ae172015-09-16 16:33:27 -070057
58 // for x86, exclude libgcc_eh.a for the same reasons as above
59 arch: {
Dan Willemsen9e6f98f2015-11-03 14:30:57 -080060 arm: {
Elliott Hughesd19b3c52018-09-06 16:04:08 -070061 version_script: ":libdl.arm.map",
Chih-Hung Hsiehecbff832018-05-23 18:45:53 -070062 pack_relocations: false,
Ian Pedowitzb6310c22018-01-18 16:26:19 -080063 ldflags: ["-Wl,--hash-style=both"],
Dan Willemsen9e6f98f2015-11-03 14:30:57 -080064 },
65 arm64: {
Elliott Hughesd19b3c52018-09-06 16:04:08 -070066 version_script: ":libdl.arm64.map",
Dan Willemsen9e6f98f2015-11-03 14:30:57 -080067 },
Dan Willemsen208ae172015-09-16 16:33:27 -070068 x86: {
Chih-Hung Hsiehecbff832018-05-23 18:45:53 -070069 pack_relocations: false,
Dimitry Ivanovac4bd2f2016-11-21 12:50:38 -080070 ldflags: [
71 "-Wl,--exclude-libs=libgcc_eh.a",
Ian Pedowitzb6310c22018-01-18 16:26:19 -080072 "-Wl,--hash-style=both",
Dimitry Ivanovac4bd2f2016-11-21 12:50:38 -080073 ],
Elliott Hughesd19b3c52018-09-06 16:04:08 -070074 version_script: ":libdl.x86.map",
Dan Willemsen208ae172015-09-16 16:33:27 -070075 },
76 x86_64: {
77 ldflags: ["-Wl,--exclude-libs=libgcc_eh.a"],
Elliott Hughesd19b3c52018-09-06 16:04:08 -070078 version_script: ":libdl.x86_64.map",
Dan Willemsen208ae172015-09-16 16:33:27 -070079 },
80 },
dimitrydc7cc622017-08-30 10:52:19 +020081 shared: {
dimitryc5ea3eb2017-10-05 17:23:10 +020082 whole_static_libs: ["libdl_static"],
dimitrydc7cc622017-08-30 10:52:19 +020083 },
84 static: {
Elliott Hughes46a943c2018-04-03 15:56:35 -070085 srcs: ["libdl_static.cpp"],
dimitrydc7cc622017-08-30 10:52:19 +020086 },
Dan Willemsen208ae172015-09-16 16:33:27 -070087 cflags: [
88 "-Wall",
89 "-Wextra",
90 "-Wunused",
91 "-Werror",
92 ],
93 stl: "none",
94
Ryan Prichard470b6662018-03-27 22:10:55 -070095 nocrt: true,
Dan Willemsen208ae172015-09-16 16:33:27 -070096 system_shared_libs: [],
Pirama Arumuga Nainareeb2ee62019-02-15 11:40:40 -080097
98 // Opt out of native_coverage when opting out of system_shared_libs
Pirama Arumuga Nainar852d5232018-12-20 13:52:19 -080099 native_coverage: false,
Dan Willemsen208ae172015-09-16 16:33:27 -0700100
Dimitry Ivanovd9e427c2016-11-22 16:55:25 -0800101 // This is placeholder library the actual implementation is (currently)
102 // provided by the linker.
Elliott Hughesd50a1de2018-02-05 17:30:57 -0800103 shared_libs: ["ld-android"],
Dimitry Ivanovd9e427c2016-11-22 16:55:25 -0800104
105 sanitize: {
106 never: true,
107 },
Jiyong Parkc45fe9f2018-12-13 18:26:48 +0900108
109 stubs: {
110 symbol_file: "libdl.map.txt",
111 versions: ["10000"],
112 },
Dimitry Ivanovd9e427c2016-11-22 16:55:25 -0800113}
114
dimitry8868d9e2019-03-19 13:01:42 +0100115cc_library {
116 name: "libdl_android",
117
118 defaults: ["linux_bionic_supported"],
Jiyong Park3ff116a2019-04-02 23:04:52 +0900119 recovery_available: true,
dimitry7f048802019-05-03 15:57:34 +0200120 native_bridge_supported: true,
dimitry8868d9e2019-03-19 13:01:42 +0100121
122 // NOTE: --exclude-libs=libgcc.a makes sure that any symbols libdl.so pulls from
123 // libgcc.a are made static to libdl.so. This in turn ensures that libraries that
124 // a) pull symbols from libgcc.a and b) depend on libdl.so will not rely on libdl.so
125 // to provide those symbols, but will instead pull them from libgcc.a. Specifically,
126 // we use this property to make sure libc.so has its own copy of the code from
127 // libgcc.a it uses.
128 //
129 // DO NOT REMOVE --exclude-libs!
130
131 ldflags: [
132 "-Wl,--exclude-libs=libgcc.a",
133 "-Wl,--exclude-libs=libclang_rt.builtins-arm-android.a",
134 "-Wl,--exclude-libs=libclang_rt.builtins-aarch64-android.a",
135 "-Wl,--exclude-libs=libclang_rt.builtins-x86-android.a",
136 "-Wl,--exclude-libs=libclang_rt.builtins-x86_64-android.a",
137 ],
138
139 // for x86, exclude libgcc_eh.a for the same reasons as above
140 arch: {
141 x86: {
142 ldflags: [
143 "-Wl,--exclude-libs=libgcc_eh.a",
144 ],
145 },
146 x86_64: {
147 ldflags: ["-Wl,--exclude-libs=libgcc_eh.a"],
148 },
149 },
150
151 srcs: [ "libdl_android.cpp" ],
152 version_script: "libdl_android.map.txt",
153
154 cflags: [
155 "-Wall",
156 "-Wextra",
157 "-Wunused",
158 "-Werror",
159 ],
160
161 stl: "none",
162
163 nocrt: true,
164 system_shared_libs: [],
165
166 // Opt out of native_coverage when opting out of system_shared_libs
167 native_coverage: false,
168
169 // This is placeholder library the actual implementation is (currently)
170 // provided by the linker.
171 shared_libs: ["ld-android"],
172
173 sanitize: {
174 never: true,
175 },
176
177 stubs: {
178 symbol_file: "libdl_android.map.txt",
179 versions: ["10000"],
180 },
181}
182
Dan Alberte8a91082016-08-04 13:45:44 -0700183ndk_library {
Dan Willemsen993b0832017-04-07 14:09:18 -0700184 name: "libdl",
dimitry7f048802019-05-03 15:57:34 +0200185 native_bridge_supported: true,
Dan Alberte8a91082016-08-04 13:45:44 -0700186 symbol_file: "libdl.map.txt",
187 first_version: "9",
188}
Dan Willemsenb93d3c22017-03-20 14:07:47 -0700189
190llndk_library {
Dan Willemsen993b0832017-04-07 14:09:18 -0700191 name: "libdl",
dimitry7f048802019-05-03 15:57:34 +0200192 native_bridge_supported: true,
Dan Willemsenb93d3c22017-03-20 14:07:47 -0700193 symbol_file: "libdl.map.txt",
194}
Elliott Hughesd19b3c52018-09-06 16:04:08 -0700195
196genrule {
197 name: "libdl.arm.map",
198 out: ["libdl.arm.map"],
199 srcs: ["libdl.map.txt"],
200 tool_files: [":bionic-generate-version-script"],
201 cmd: "$(location :bionic-generate-version-script) arm $(in) $(out)",
202}
203
204genrule {
205 name: "libdl.arm64.map",
206 out: ["libdl.arm64.map"],
207 srcs: ["libdl.map.txt"],
208 tool_files: [":bionic-generate-version-script"],
209 cmd: "$(location :bionic-generate-version-script) arm64 $(in) $(out)",
210}
211
212genrule {
213 name: "libdl.x86.map",
214 out: ["libdl.x86.map"],
215 srcs: ["libdl.map.txt"],
216 tool_files: [":bionic-generate-version-script"],
217 cmd: "$(location :bionic-generate-version-script) x86 $(in) $(out)",
218}
219
220genrule {
221 name: "libdl.x86_64.map",
222 out: ["libdl.x86_64.map"],
223 srcs: ["libdl.map.txt"],
224 tool_files: [":bionic-generate-version-script"],
225 cmd: "$(location :bionic-generate-version-script) x86_64 $(in) $(out)",
226}