blob: a41aa2d2eed02835690c7f9b015317a32d7eab26 [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,
dimitryc5ea3eb2017-10-05 17:23:10 +02008
Elliott Hughesd50a1de2018-02-05 17:30:57 -08009 srcs: [
10 "libdl.cpp",
11 "libdl_cfi.cpp",
12 ],
dimitryc5ea3eb2017-10-05 17:23:10 +020013
14 cflags: [
15 "-Wall",
16 "-Wextra",
17 "-Wunused",
18 "-Werror",
19 ],
20
21 // For private/CFIShadow.h.
22 include_dirs: ["bionic/libc"],
23
24 stl: "none",
Dan Willemsen6b3be172018-12-03 13:57:20 -080025 system_shared_libs: [],
dimitryc5ea3eb2017-10-05 17:23:10 +020026
27 sanitize: {
28 never: true,
29 },
30}
31
Dan Willemsen208ae172015-09-16 16:33:27 -070032cc_library {
Dan Willemsen7ec52b12016-11-28 17:02:25 -080033 name: "libdl",
Jiyong Park5603c6e2018-04-27 21:53:11 +090034 recovery_available: true,
Dan Albert40f15ec2017-10-27 11:21:20 -070035 static_ndk_lib: true,
Dan Willemsen7ec52b12016-11-28 17:02:25 -080036
37 defaults: ["linux_bionic_supported"],
Dan Willemsen208ae172015-09-16 16:33:27 -070038
39 // NOTE: --exclude-libs=libgcc.a makes sure that any symbols libdl.so pulls from
40 // libgcc.a are made static to libdl.so. This in turn ensures that libraries that
41 // a) pull symbols from libgcc.a and b) depend on libdl.so will not rely on libdl.so
42 // to provide those symbols, but will instead pull them from libgcc.a. Specifically,
43 // we use this property to make sure libc.so has its own copy of the code from
44 // libgcc.a it uses.
45 //
46 // DO NOT REMOVE --exclude-libs!
47
Yi Kong7786a342018-08-31 19:01:56 -070048 ldflags: [
49 "-Wl,--exclude-libs=libgcc.a",
50 "-Wl,--exclude-libs=libclang_rt.builtins-arm-android.a",
51 "-Wl,--exclude-libs=libclang_rt.builtins-aarch64-android.a",
52 "-Wl,--exclude-libs=libclang_rt.builtins-x86-android.a",
53 "-Wl,--exclude-libs=libclang_rt.builtins-x86_64-android.a",
54 ],
Dan Willemsen208ae172015-09-16 16:33:27 -070055
56 // for x86, exclude libgcc_eh.a for the same reasons as above
57 arch: {
Dan Willemsen9e6f98f2015-11-03 14:30:57 -080058 arm: {
Elliott Hughesd19b3c52018-09-06 16:04:08 -070059 version_script: ":libdl.arm.map",
Chih-Hung Hsiehecbff832018-05-23 18:45:53 -070060 pack_relocations: false,
Ian Pedowitzb6310c22018-01-18 16:26:19 -080061 ldflags: ["-Wl,--hash-style=both"],
Dan Willemsen9e6f98f2015-11-03 14:30:57 -080062 },
63 arm64: {
Elliott Hughesd19b3c52018-09-06 16:04:08 -070064 version_script: ":libdl.arm64.map",
Dan Willemsen9e6f98f2015-11-03 14:30:57 -080065 },
Dan Willemsen208ae172015-09-16 16:33:27 -070066 x86: {
Chih-Hung Hsiehecbff832018-05-23 18:45:53 -070067 pack_relocations: false,
Dimitry Ivanovac4bd2f2016-11-21 12:50:38 -080068 ldflags: [
69 "-Wl,--exclude-libs=libgcc_eh.a",
Ian Pedowitzb6310c22018-01-18 16:26:19 -080070 "-Wl,--hash-style=both",
Dimitry Ivanovac4bd2f2016-11-21 12:50:38 -080071 ],
Elliott Hughesd19b3c52018-09-06 16:04:08 -070072 version_script: ":libdl.x86.map",
Dan Willemsen208ae172015-09-16 16:33:27 -070073 },
74 x86_64: {
75 ldflags: ["-Wl,--exclude-libs=libgcc_eh.a"],
Elliott Hughesd19b3c52018-09-06 16:04:08 -070076 version_script: ":libdl.x86_64.map",
Dan Willemsen208ae172015-09-16 16:33:27 -070077 },
78 },
dimitrydc7cc622017-08-30 10:52:19 +020079 shared: {
dimitryc5ea3eb2017-10-05 17:23:10 +020080 whole_static_libs: ["libdl_static"],
dimitrydc7cc622017-08-30 10:52:19 +020081 },
82 static: {
Elliott Hughes46a943c2018-04-03 15:56:35 -070083 srcs: ["libdl_static.cpp"],
dimitrydc7cc622017-08-30 10:52:19 +020084 },
Dan Willemsen208ae172015-09-16 16:33:27 -070085 cflags: [
86 "-Wall",
87 "-Wextra",
88 "-Wunused",
89 "-Werror",
90 ],
91 stl: "none",
92
Ryan Prichard470b6662018-03-27 22:10:55 -070093 nocrt: true,
Dan Willemsen208ae172015-09-16 16:33:27 -070094 system_shared_libs: [],
Pirama Arumuga Nainareeb2ee62019-02-15 11:40:40 -080095
96 // Opt out of native_coverage when opting out of system_shared_libs
Pirama Arumuga Nainar852d5232018-12-20 13:52:19 -080097 native_coverage: false,
Dan Willemsen208ae172015-09-16 16:33:27 -070098
Dimitry Ivanovd9e427c2016-11-22 16:55:25 -080099 // This is placeholder library the actual implementation is (currently)
100 // provided by the linker.
Elliott Hughesd50a1de2018-02-05 17:30:57 -0800101 shared_libs: ["ld-android"],
Dimitry Ivanovd9e427c2016-11-22 16:55:25 -0800102
103 sanitize: {
104 never: true,
105 },
Jiyong Parkc45fe9f2018-12-13 18:26:48 +0900106
107 stubs: {
108 symbol_file: "libdl.map.txt",
109 versions: ["10000"],
110 },
Dimitry Ivanovd9e427c2016-11-22 16:55:25 -0800111}
112
dimitry8868d9e2019-03-19 13:01:42 +0100113cc_library {
114 name: "libdl_android",
115
116 defaults: ["linux_bionic_supported"],
117
118 // NOTE: --exclude-libs=libgcc.a makes sure that any symbols libdl.so pulls from
119 // libgcc.a are made static to libdl.so. This in turn ensures that libraries that
120 // a) pull symbols from libgcc.a and b) depend on libdl.so will not rely on libdl.so
121 // to provide those symbols, but will instead pull them from libgcc.a. Specifically,
122 // we use this property to make sure libc.so has its own copy of the code from
123 // libgcc.a it uses.
124 //
125 // DO NOT REMOVE --exclude-libs!
126
127 ldflags: [
128 "-Wl,--exclude-libs=libgcc.a",
129 "-Wl,--exclude-libs=libclang_rt.builtins-arm-android.a",
130 "-Wl,--exclude-libs=libclang_rt.builtins-aarch64-android.a",
131 "-Wl,--exclude-libs=libclang_rt.builtins-x86-android.a",
132 "-Wl,--exclude-libs=libclang_rt.builtins-x86_64-android.a",
133 ],
134
135 // for x86, exclude libgcc_eh.a for the same reasons as above
136 arch: {
137 x86: {
138 ldflags: [
139 "-Wl,--exclude-libs=libgcc_eh.a",
140 ],
141 },
142 x86_64: {
143 ldflags: ["-Wl,--exclude-libs=libgcc_eh.a"],
144 },
145 },
146
147 srcs: [ "libdl_android.cpp" ],
148 version_script: "libdl_android.map.txt",
149
150 cflags: [
151 "-Wall",
152 "-Wextra",
153 "-Wunused",
154 "-Werror",
155 ],
156
157 stl: "none",
158
159 nocrt: true,
160 system_shared_libs: [],
161
162 // Opt out of native_coverage when opting out of system_shared_libs
163 native_coverage: false,
164
165 // This is placeholder library the actual implementation is (currently)
166 // provided by the linker.
167 shared_libs: ["ld-android"],
168
169 sanitize: {
170 never: true,
171 },
172
173 stubs: {
174 symbol_file: "libdl_android.map.txt",
175 versions: ["10000"],
176 },
177}
178
Dan Alberte8a91082016-08-04 13:45:44 -0700179ndk_library {
Dan Willemsen993b0832017-04-07 14:09:18 -0700180 name: "libdl",
Dan Alberte8a91082016-08-04 13:45:44 -0700181 symbol_file: "libdl.map.txt",
182 first_version: "9",
183}
Dan Willemsenb93d3c22017-03-20 14:07:47 -0700184
185llndk_library {
Dan Willemsen993b0832017-04-07 14:09:18 -0700186 name: "libdl",
Dan Willemsenb93d3c22017-03-20 14:07:47 -0700187 symbol_file: "libdl.map.txt",
188}
Elliott Hughesd19b3c52018-09-06 16:04:08 -0700189
190genrule {
191 name: "libdl.arm.map",
192 out: ["libdl.arm.map"],
193 srcs: ["libdl.map.txt"],
194 tool_files: [":bionic-generate-version-script"],
195 cmd: "$(location :bionic-generate-version-script) arm $(in) $(out)",
196}
197
198genrule {
199 name: "libdl.arm64.map",
200 out: ["libdl.arm64.map"],
201 srcs: ["libdl.map.txt"],
202 tool_files: [":bionic-generate-version-script"],
203 cmd: "$(location :bionic-generate-version-script) arm64 $(in) $(out)",
204}
205
206genrule {
207 name: "libdl.x86.map",
208 out: ["libdl.x86.map"],
209 srcs: ["libdl.map.txt"],
210 tool_files: [":bionic-generate-version-script"],
211 cmd: "$(location :bionic-generate-version-script) x86 $(in) $(out)",
212}
213
214genrule {
215 name: "libdl.x86_64.map",
216 out: ["libdl.x86_64.map"],
217 srcs: ["libdl.map.txt"],
218 tool_files: [":bionic-generate-version-script"],
219 cmd: "$(location :bionic-generate-version-script) x86_64 $(in) $(out)",
220}