blob: e45eb6e6462bac71849e4568ce9d20869dbf5510 [file] [log] [blame]
Colin Cross2722ebb2016-07-11 16:20:06 -07001//
2// Copyright (C) 2012 The Android Open Source Project
3//
4// Licensed under the Apache License, Version 2.0 (the "License");
5// you may not use this file except in compliance with the License.
6// You may obtain a copy of the License at
7//
8// http://www.apache.org/licenses/LICENSE-2.0
9//
10// Unless required by applicable law or agreed to in writing, software
11// distributed under the License is distributed on an "AS IS" BASIS,
12// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13// See the License for the specific language governing permissions and
14// limitations under the License.
15//
16
17cc_defaults {
18 name: "bionic_testlib_defaults",
19 host_supported: true,
Chih-Hung Hsieh84f0dcd2017-10-02 11:47:31 -070020 cflags: [
21 "-Wall",
22 "-Werror",
23 ],
Dimitry Ivanova36e59b2016-09-01 11:37:39 -070024 ldflags: [
Dimitry Ivanovd11d1e42016-10-05 02:51:17 -070025 "-Wl,--rpath,${ORIGIN}",
Dimitry Ivanova36e59b2016-09-01 11:37:39 -070026 "-Wl,--enable-new-dtags",
27 ],
28 relative_install_path: "bionic-loader-test-libs",
29 gtest: false,
Colin Cross2722ebb2016-07-11 16:20:06 -070030 sanitize: {
Evgenii Stepanov0a3637d2016-07-06 13:20:59 -070031 address: false,
32 coverage: false,
Colin Cross2722ebb2016-07-11 16:20:06 -070033 },
Yabin Cui1f553ea2017-01-13 12:31:59 -080034 stl: "libc++_static",
Colin Cross2722ebb2016-07-11 16:20:06 -070035 target: {
36 darwin: {
37 enabled: false,
38 },
39 },
40}
41
42// -----------------------------------------------------------------------------
43// Library to test gnu-styled hash
44// -----------------------------------------------------------------------------
Dimitry Ivanova36e59b2016-09-01 11:37:39 -070045cc_test_library {
Colin Cross2722ebb2016-07-11 16:20:06 -070046 name: "libgnu-hash-table-library",
47 defaults: ["bionic_testlib_defaults"],
48 srcs: ["dlext_test_library.cpp"],
49 ldflags: ["-Wl,--hash-style=gnu"],
50 arch: {
51 mips: {
52 enabled: false,
53 },
54 mips64: {
55 enabled: false,
56 },
57 },
58}
59
60// -----------------------------------------------------------------------------
61// Library to test sysv-styled hash
62// -----------------------------------------------------------------------------
Dimitry Ivanova36e59b2016-09-01 11:37:39 -070063cc_test_library {
Colin Cross2722ebb2016-07-11 16:20:06 -070064 name: "libsysv-hash-table-library",
65 defaults: ["bionic_testlib_defaults"],
66 srcs: ["dlext_test_library.cpp"],
67 ldflags: ["-Wl,--hash-style=sysv"],
68}
69
70// -----------------------------------------------------------------------------
71// Library used by dlext tests - with GNU RELRO program header
72// -----------------------------------------------------------------------------
73// In Android.mk to support creating symlinks
74
75// -----------------------------------------------------------------------------
76// Library used by dlext tests - without GNU RELRO program header
77// -----------------------------------------------------------------------------
Dimitry Ivanova36e59b2016-09-01 11:37:39 -070078cc_test_library {
Colin Cross2722ebb2016-07-11 16:20:06 -070079 name: "libdlext_test_norelro",
Dimitry Ivanova36e59b2016-09-01 11:37:39 -070080 defaults: ["bionic_testlib_defaults"],
Colin Cross2722ebb2016-07-11 16:20:06 -070081 srcs: ["dlext_test_library.cpp"],
82 ldflags: ["-Wl,-z,norelro"],
83 shared_libs = ["libtest_simple"],
84}
85
86// -----------------------------------------------------------------------------
87// Library used by dlext tests - different name non-default location
88// -----------------------------------------------------------------------------
89// In Android.mk to support installing to /data
90
91// -----------------------------------------------------------------------------
92// Libraries used by dlext tests for open from a zip-file
93// -----------------------------------------------------------------------------
94// In Android.mk to support installing to /data
95
96// ----------------------------------------------------------------------------
97// Library with soname which does not match filename
98// ----------------------------------------------------------------------------
99// In Android.mk to support zipped and aligned tests
100
101// -----------------------------------------------------------------------------
102// Library used by dlext tests - zipped and aligned
103// -----------------------------------------------------------------------------
104// In Android.mk to support zipped and aligned tests
105
106// -----------------------------------------------------------------------------
107// Library used by dlfcn tests
108// -----------------------------------------------------------------------------
Dimitry Ivanova36e59b2016-09-01 11:37:39 -0700109cc_test_library {
Colin Cross2722ebb2016-07-11 16:20:06 -0700110 name: "libtest_simple",
111 defaults: ["bionic_testlib_defaults"],
112 srcs: ["dlopen_testlib_simple.cpp"],
113}
114
115// -----------------------------------------------------------------------------
dimitry965d06d2017-11-28 16:03:07 +0100116// Library used by dlext direct unload on the namespace boundary tests
117// -----------------------------------------------------------------------------
118cc_test_library {
119 name: "libtest_missing_symbol",
120 defaults: ["bionic_testlib_defaults"],
121 srcs: ["dlopen_testlib_missing_symbol.cpp"],
122 allow_undefined_symbols: true,
123 relative_install_path: "bionic-loader-test-libs/public_namespace_libs",
124}
125
126
127// -----------------------------------------------------------------------------
128// Library used by dlext indirect unload on the namespace boundary tests
129//
130// These libraries produce following dependency graph:
131// libtest_missing_symbol_root (private ns)
132// +-> libbnstest_public (public ns)
133// +-> libtest_missing_symbol_child_public (public ns)
134// +-> libnstest_public (public ns)
135// +-> libtest_missing_symbol_child_private (private_ns)
136// +-> libnstest_public (public_ns)
137//
138// All libraries except libtest_missing_symbol are located in
139// private_namespace_libs/
140// -----------------------------------------------------------------------------
141cc_test_library {
142 name: "libtest_missing_symbol_child_public",
143 defaults: ["bionic_testlib_defaults"],
144 srcs: ["empty.cpp"],
145 relative_install_path: "bionic-loader-test-libs/public_namespace_libs",
146 shared_libs: ["libnstest_public"],
147}
148
149cc_test_library {
150 name: "libtest_missing_symbol_child_private",
151 defaults: ["bionic_testlib_defaults"],
152 srcs: ["empty.cpp"],
153 relative_install_path: "bionic-loader-test-libs/private_namespace_libs",
154 shared_libs: ["libnstest_public"],
155}
156
157cc_test_library {
158 name: "libtest_missing_symbol_root",
159 defaults: ["bionic_testlib_defaults"],
160 srcs: ["dlopen_testlib_missing_symbol.cpp"],
161 relative_install_path: "bionic-loader-test-libs/private_namespace_libs",
162 allow_undefined_symbols: true,
163 shared_libs: [
164 "libnstest_public",
165 "libtest_missing_symbol_child_public",
166 "libtest_missing_symbol_child_private",
167 ],
168}
169
170// -----------------------------------------------------------------------------
171// -----------------------------------------------------------------------------
Colin Cross2722ebb2016-07-11 16:20:06 -0700172// Library used by dlfcn nodelete tests
173// -----------------------------------------------------------------------------
Dimitry Ivanova36e59b2016-09-01 11:37:39 -0700174cc_test_library {
Colin Cross2722ebb2016-07-11 16:20:06 -0700175 name: "libtest_nodelete_1",
176 defaults: ["bionic_testlib_defaults"],
177 srcs: ["dlopen_nodelete_1.cpp"],
178}
179
180// -----------------------------------------------------------------------------
181// Library used by dlfcn nodelete tests
182// -----------------------------------------------------------------------------
Dimitry Ivanova36e59b2016-09-01 11:37:39 -0700183cc_test_library {
Colin Cross2722ebb2016-07-11 16:20:06 -0700184 name: "libtest_nodelete_2",
185 defaults: ["bionic_testlib_defaults"],
186 srcs: ["dlopen_nodelete_2.cpp"],
187}
188
189// -----------------------------------------------------------------------------
190// Library used by dlfcn nodelete tests
191// -----------------------------------------------------------------------------
Dimitry Ivanova36e59b2016-09-01 11:37:39 -0700192cc_test_library {
Colin Cross2722ebb2016-07-11 16:20:06 -0700193 name: "libtest_nodelete_dt_flags_1",
194 defaults: ["bionic_testlib_defaults"],
195 srcs: ["dlopen_nodelete_dt_flags_1.cpp"],
196 ldflags: ["-Wl,-z,nodelete"],
197}
198
199// -----------------------------------------------------------------------------
200// Build test helper libraries for linker namespaces
dimitry965d06d2017-11-28 16:03:07 +0100201//
202// This set of libraries is used to verify linker namespaces.
203//
204// Test cases
205// 1. Check that private libraries loaded in different namespaces are
206// different. Check that dlsym does not confuse them.
207// 2. Check that public libraries loaded in different namespaces are shared
208// between them.
209// 3. Check that namespace sticks on dlopen
210// 4. Check that having access to shared library (libnstest_public.so)
211// does not expose symbols from dependent library (libnstest_public_internal.so)
212//
213// Dependency tree (visibility)
214// libnstest_root.so (this should be local to the namespace)
215// +-> libnstest_public.so
216// +-> libnstest_public_internal.so
217// +-> libnstest_private.so
218//
219// libnstest_dlopened.so (library in private namespace dlopened from libnstest_root.so)
Colin Cross2722ebb2016-07-11 16:20:06 -0700220// -----------------------------------------------------------------------------
dimitry965d06d2017-11-28 16:03:07 +0100221cc_test_library {
222 name: "libnstest_root",
223 defaults: ["bionic_testlib_defaults"],
224 srcs: ["namespaces_root.cpp"],
225 relative_install_path: "bionic-loader-test-libs/private_namespace_libs",
226 shared_libs: [
227 "libnstest_public",
228 "libnstest_private",
229 ],
230}
231
232cc_test_library {
233 name: "libnstest_public_internal",
234 defaults: ["bionic_testlib_defaults"],
235 srcs: ["namespaces_public_internal.cpp"],
236 relative_install_path: "bionic-loader-test-libs/public_namespace_libs",
237}
238
239cc_test_library {
240 name: "libnstest_public",
241 defaults: ["bionic_testlib_defaults"],
242 srcs: ["namespaces_public.cpp"],
243 relative_install_path: "bionic-loader-test-libs/public_namespace_libs",
244 shared_libs: ["libnstest_public_internal"],
245}
246
247cc_test_library {
248 name: "libnstest_private",
249 defaults: ["bionic_testlib_defaults"],
250 srcs: ["namespaces_private.cpp"],
251 relative_install_path: "bionic-loader-test-libs/private_namespace_libs",
252}
253
254cc_test_library {
255 name: "libnstest_dlopened",
256 defaults: ["bionic_testlib_defaults"],
257 srcs: ["namespaces_dlopened.cpp"],
258 relative_install_path: "bionic-loader-test-libs/private_namespace_libs",
259}
Colin Cross2722ebb2016-07-11 16:20:06 -0700260
261// -----------------------------------------------------------------------------
262// Build DT_RUNPATH test helper libraries
263// -----------------------------------------------------------------------------
264// include $(LOCAL_PATH)/Android.build.dt_runpath.mk
265
266// -----------------------------------------------------------------------------
267// Build library with two parents
268// -----------------------------------------------------------------------------
269// include $(LOCAL_PATH)/Android.build.dlopen_2_parents_reloc.mk
270
271// -----------------------------------------------------------------------------
272// Build libtest_check_order_dlsym.so with its dependencies.
273// -----------------------------------------------------------------------------
274// include $(LOCAL_PATH)/Android.build.dlopen_check_order_dlsym.mk
275
276// -----------------------------------------------------------------------------
277// Build libtest_check_order_siblings.so with its dependencies.
278// -----------------------------------------------------------------------------
279// include $(LOCAL_PATH)/Android.build.dlopen_check_order_reloc_siblings.mk
280
281// -----------------------------------------------------------------------------
282// Build libtest_check_order_root.so with its dependencies.
283// -----------------------------------------------------------------------------
284// include $(LOCAL_PATH)/Android.build.dlopen_check_order_reloc_main_executable.mk
285
286// -----------------------------------------------------------------------------
287// Build libtest_versioned_lib.so with its dependencies.
288// -----------------------------------------------------------------------------
289// include $(LOCAL_PATH)/Android.build.versioned_lib.mk
290
291// -----------------------------------------------------------------------------
292// Build libraries needed by pthread_atfork tests
293// -----------------------------------------------------------------------------
294// include $(LOCAL_PATH)/Android.build.pthread_atfork.mk
295
296// -----------------------------------------------------------------------------
297// Library with dependency loop used by dlfcn tests
298//
299// libtest_with_dependency_loop -> a -> b -> c -> a
300// -----------------------------------------------------------------------------
Dimitry Ivanova36e59b2016-09-01 11:37:39 -0700301cc_test_library {
Colin Cross2722ebb2016-07-11 16:20:06 -0700302 name: "libtest_with_dependency_loop",
303 defaults: ["bionic_testlib_defaults"],
304 srcs: ["dlopen_testlib_loopy_root.cpp"],
305 shared_libs: ["libtest_with_dependency_loop_a"],
306}
307
308// -----------------------------------------------------------------------------
309// libtest_with_dependency_loop_a.so
310// -----------------------------------------------------------------------------
Dimitry Ivanova36e59b2016-09-01 11:37:39 -0700311cc_test_library {
Colin Cross2722ebb2016-07-11 16:20:06 -0700312 name: "libtest_with_dependency_loop_a",
313 defaults: ["bionic_testlib_defaults"],
314 srcs: ["dlopen_testlib_loopy_a.cpp"],
315 shared_libs: ["libtest_with_dependency_loop_b_tmp"],
316}
317
318// -----------------------------------------------------------------------------
319// libtest_with_dependency_loop_b.so
320//
321// this is temporary placeholder - will be removed
322// -----------------------------------------------------------------------------
Dimitry Ivanova36e59b2016-09-01 11:37:39 -0700323cc_test_library {
Colin Cross2722ebb2016-07-11 16:20:06 -0700324 name: "libtest_with_dependency_loop_b_tmp",
325 defaults: ["bionic_testlib_defaults"],
326 srcs: ["dlopen_testlib_loopy_invalid.cpp"],
327 ldflags: ["-Wl,-soname=libtest_with_dependency_loop_b.so"],
328}
329
330// -----------------------------------------------------------------------------
331// libtest_with_dependency_loop_b.so
332// -----------------------------------------------------------------------------
Dimitry Ivanova36e59b2016-09-01 11:37:39 -0700333cc_test_library {
Colin Cross2722ebb2016-07-11 16:20:06 -0700334 name: "libtest_with_dependency_loop_b",
335 defaults: ["bionic_testlib_defaults"],
336 srcs: ["dlopen_testlib_loopy_b.cpp"],
337 shared_libs: ["libtest_with_dependency_loop_c"],
338}
339
340// -----------------------------------------------------------------------------
341// libtest_with_dependency_loop_c.so
342// -----------------------------------------------------------------------------
Dimitry Ivanova36e59b2016-09-01 11:37:39 -0700343cc_test_library {
Colin Cross2722ebb2016-07-11 16:20:06 -0700344 name: "libtest_with_dependency_loop_c",
345 defaults: ["bionic_testlib_defaults"],
346 srcs: ["dlopen_testlib_loopy_c.cpp"],
347 shared_libs: ["libtest_with_dependency_loop_a"],
348}
349
350// -----------------------------------------------------------------------------
351// libtest_relo_check_dt_needed_order.so
352// |
353// +-> libtest_relo_check_dt_needed_order_1.so
354// |
355// +-> libtest_relo_check_dt_needed_order_2.so
356// -----------------------------------------------------------------------------
357
358
Dimitry Ivanova36e59b2016-09-01 11:37:39 -0700359cc_test_library {
Colin Cross2722ebb2016-07-11 16:20:06 -0700360 name: "libtest_relo_check_dt_needed_order",
361 defaults: ["bionic_testlib_defaults"],
362 srcs: ["dlopen_testlib_relo_check_dt_needed_order.cpp"],
363 shared_libs: [
364 "libtest_relo_check_dt_needed_order_1",
365 "libtest_relo_check_dt_needed_order_2",
366 ],
367}
368
Dimitry Ivanova36e59b2016-09-01 11:37:39 -0700369cc_test_library {
Colin Cross2722ebb2016-07-11 16:20:06 -0700370 name: "libtest_relo_check_dt_needed_order_1",
371 defaults: ["bionic_testlib_defaults"],
372 srcs: ["dlopen_testlib_relo_check_dt_needed_order_1.cpp"],
373}
374
Dimitry Ivanova36e59b2016-09-01 11:37:39 -0700375cc_test_library {
Colin Cross2722ebb2016-07-11 16:20:06 -0700376 name: "libtest_relo_check_dt_needed_order_2",
377 defaults: ["bionic_testlib_defaults"],
378 srcs: ["dlopen_testlib_relo_check_dt_needed_order_2.cpp"],
379}
380
381// -----------------------------------------------------------------------------
382// Library with dependency used by dlfcn tests
383// -----------------------------------------------------------------------------
384// In Android.mk to support dependency on libdlext_test
385
386// -----------------------------------------------------------------------------
387// Library used by ifunc tests
388// -----------------------------------------------------------------------------
Dimitry Ivanova36e59b2016-09-01 11:37:39 -0700389cc_test_library {
Colin Cross2722ebb2016-07-11 16:20:06 -0700390 name: "libtest_ifunc",
391 defaults: ["bionic_testlib_defaults"],
Dimitry Ivanov21975b22017-05-02 16:31:56 -0700392 srcs: ["dlopen_testlib_ifunc.cpp"],
Colin Cross2722ebb2016-07-11 16:20:06 -0700393
Colin Cross2722ebb2016-07-11 16:20:06 -0700394 arch: {
395 mips: {
396 enabled: false,
397 },
398 mips64: {
399 enabled: false,
400 },
401 },
Dimitry Ivanov21975b22017-05-02 16:31:56 -0700402}
403
404cc_test_library {
405 name: "libtest_ifunc_variable",
406 defaults: ["bionic_testlib_defaults"],
407 srcs: ["dlopen_testlib_ifunc_variable.cpp"],
408 shared_libs: [ "libtest_ifunc_variable_impl" ],
409
410 arch: {
411 mips: {
412 enabled: false,
413 },
414 mips64: {
415 enabled: false,
416 },
417 },
Dimitry Ivanov21975b22017-05-02 16:31:56 -0700418}
419
420cc_test_library {
421 name: "libtest_ifunc_variable_impl",
422 defaults: ["bionic_testlib_defaults"],
423 srcs: ["dlopen_testlib_ifunc_variable_impl.cpp"],
424
425 arch: {
426 mips: {
427 enabled: false,
428 },
429 mips64: {
430 enabled: false,
431 },
432 },
Colin Cross2722ebb2016-07-11 16:20:06 -0700433}
434
435// -----------------------------------------------------------------------------
436// Library used by atexit tests
437// -----------------------------------------------------------------------------
438
Dimitry Ivanova36e59b2016-09-01 11:37:39 -0700439cc_test_library {
Colin Cross2722ebb2016-07-11 16:20:06 -0700440 name: "libtest_atexit",
441 defaults: ["bionic_testlib_defaults"],
442 srcs: ["atexit_testlib.cpp"],
443}
444
445// -----------------------------------------------------------------------------
446// This library is used by dl_load test to check symbol preempting
447// by main executable
448// -----------------------------------------------------------------------------
Dimitry Ivanova36e59b2016-09-01 11:37:39 -0700449cc_test_library {
Colin Cross2722ebb2016-07-11 16:20:06 -0700450 name: "libdl_preempt_test_1",
451 defaults: ["bionic_testlib_defaults"],
452 srcs: ["dl_preempt_library_1.cpp"],
453}
454
455// -----------------------------------------------------------------------------
456// This library is used by dl_load test to check symbol preempting
457// by libdl_preempt_test_1.so
458// -----------------------------------------------------------------------------
Dimitry Ivanova36e59b2016-09-01 11:37:39 -0700459cc_test_library {
Colin Cross2722ebb2016-07-11 16:20:06 -0700460 name: "libdl_preempt_test_2",
461 defaults: ["bionic_testlib_defaults"],
462 srcs: ["dl_preempt_library_2.cpp"],
463}
464
465// -----------------------------------------------------------------------------
466// Library with DF_1_GLOBAL
467// -----------------------------------------------------------------------------
Dimitry Ivanova36e59b2016-09-01 11:37:39 -0700468cc_test_library {
Colin Cross2722ebb2016-07-11 16:20:06 -0700469 name: "libdl_test_df_1_global",
470 defaults: ["bionic_testlib_defaults"],
471 srcs: ["dl_df_1_global.cpp"],
472 ldflags: ["-Wl,-z,global"],
473
474 target: {
475 host: {
476 // TODO (dimitry): host ld.gold does not yet support -z global
477 // remove this line once it is updated.
478 ldflags: ["-fuse-ld=bfd"],
479 },
480 },
481}
482
483// -----------------------------------------------------------------------------
484// Library using symbol from libdl_test_df_1_global
485// -----------------------------------------------------------------------------
Dimitry Ivanova36e59b2016-09-01 11:37:39 -0700486cc_test_library {
Colin Cross2722ebb2016-07-11 16:20:06 -0700487 name: "libtest_dlsym_df_1_global",
488 defaults: ["bionic_testlib_defaults"],
489 srcs: ["dl_df_1_use_global.cpp"],
490}
491
492// -----------------------------------------------------------------------------
Jiyong Park01162f22017-10-16 15:31:09 +0900493// Library with DF_1_GLOBAL which will be dlopened
494// (note: libdl_test_df_1_global above will be included in DT_NEEDED)
495// -----------------------------------------------------------------------------
496cc_test_library {
497 name: "libtest_dlopen_df_1_global",
498 defaults: ["bionic_testlib_defaults"],
499 srcs: ["dl_df_1_global_dummy.cpp"],
500 ldflags: ["-Wl,-z,global"],
501
502 target: {
503 host: {
504 // TODO (dimitry): host ld.gold does not yet support -z global
505 // remove this line once it is updated.
506 ldflags: ["-fuse-ld=bfd"],
507 },
508 },
509}
510
511
512// -----------------------------------------------------------------------------
Colin Cross2722ebb2016-07-11 16:20:06 -0700513// Library with weak function
514// -----------------------------------------------------------------------------
Dimitry Ivanova36e59b2016-09-01 11:37:39 -0700515cc_test_library {
Colin Cross2722ebb2016-07-11 16:20:06 -0700516 name: "libtest_dlsym_weak_func",
517 defaults: ["bionic_testlib_defaults"],
518 srcs: ["dlsym_weak_function.cpp"],
519}
520
521// -----------------------------------------------------------------------------
522// Library to check RTLD_LOCAL with dlsym in 'this'
523// -----------------------------------------------------------------------------
Dimitry Ivanova36e59b2016-09-01 11:37:39 -0700524cc_test_library {
Colin Cross2722ebb2016-07-11 16:20:06 -0700525 name: "libtest_dlsym_from_this",
526 defaults: ["bionic_testlib_defaults"],
527 srcs: ["dlsym_from_this_symbol.cpp"],
528 shared_libs: ["libtest_dlsym_from_this_child"],
Colin Cross2722ebb2016-07-11 16:20:06 -0700529}
530
531// -----------------------------------------------------------------------------
Dimitry Ivanova36e59b2016-09-01 11:37:39 -0700532cc_test_library {
Colin Cross2722ebb2016-07-11 16:20:06 -0700533 name: "libtest_dlsym_from_this_child",
534 defaults: ["bionic_testlib_defaults"],
535 srcs: ["dlsym_from_this_functions.cpp"],
536 shared_libs: ["libtest_dlsym_from_this_grandchild"],
537}
538
539// -----------------------------------------------------------------------------
Dimitry Ivanova36e59b2016-09-01 11:37:39 -0700540cc_test_library {
Colin Cross2722ebb2016-07-11 16:20:06 -0700541 name: "libtest_dlsym_from_this_grandchild",
542 defaults: ["bionic_testlib_defaults"],
543 srcs: ["dlsym_from_this_symbol2.cpp"],
544}
545
546// -----------------------------------------------------------------------------
547// Empty library
548// -----------------------------------------------------------------------------
Dimitry Ivanova36e59b2016-09-01 11:37:39 -0700549cc_test_library {
Colin Cross2722ebb2016-07-11 16:20:06 -0700550 name: "libtest_empty",
551 defaults: ["bionic_testlib_defaults"],
552 srcs: ["empty.cpp"],
553}
554
555// -----------------------------------------------------------------------------
dimitry8db36a52017-10-23 15:10:10 +0200556// Library for inaccessible shared library test
557// -----------------------------------------------------------------------------
558cc_test_library {
559 name: "libtestshared",
560 defaults: ["bionic_testlib_defaults"],
561 srcs: ["empty.cpp"],
Nan Zhangdab0fd52017-11-07 11:05:24 -0800562 relative_install_path: "bionic-loader-test-libs/inaccessible_libs",
dimitry8db36a52017-10-23 15:10:10 +0200563}
564
565// -----------------------------------------------------------------------------
Colin Cross2722ebb2016-07-11 16:20:06 -0700566// Library with weak undefined function
567// -----------------------------------------------------------------------------
Dimitry Ivanova36e59b2016-09-01 11:37:39 -0700568cc_test_library {
Colin Cross2722ebb2016-07-11 16:20:06 -0700569 name: "libtest_dlopen_weak_undefined_func",
570 defaults: ["bionic_testlib_defaults"],
571 srcs: ["dlopen_weak_undefined.cpp"],
572}
573
574// -----------------------------------------------------------------------------
Dimitry Ivanovd0b5c3a2016-11-25 12:23:11 -0800575// Check that RTLD_NEXT of a libc symbol works in dlopened library
576// -----------------------------------------------------------------------------
577cc_test_library {
578 name: "libtest_check_rtld_next_from_library",
579 defaults: ["bionic_testlib_defaults"],
580 srcs: ["check_rtld_next_from_library.cpp"],
Dimitry Ivanovd0b5c3a2016-11-25 12:23:11 -0800581}
582
583// -----------------------------------------------------------------------------
Colin Cross2722ebb2016-07-11 16:20:06 -0700584// Library with constructor that calls dlopen() b/7941716
585// -----------------------------------------------------------------------------
Dimitry Ivanova36e59b2016-09-01 11:37:39 -0700586cc_test_library {
Colin Cross2722ebb2016-07-11 16:20:06 -0700587 name: "libtest_dlopen_from_ctor",
588 defaults: ["bionic_testlib_defaults"],
589 srcs: ["dlopen_testlib_dlopen_from_ctor.cpp"],
Colin Cross2722ebb2016-07-11 16:20:06 -0700590}
591
592// -----------------------------------------------------------------------------
Dimitry Ivanovec90e242017-02-10 11:04:20 -0800593// Libraries used to check init/fini call order
Dimitry Ivanovea8f3962017-02-09 13:31:57 -0800594// -----------------------------------------------------------------------------
595cc_test_library {
596 name: "libtest_init_fini_order_root",
597 defaults: ["bionic_testlib_defaults"],
598 srcs: ["dlopen_check_init_fini_root.cpp"],
Dimitry Ivanovec90e242017-02-10 11:04:20 -0800599 shared_libs: [
600 "libtest_init_fini_order_child",
601 "libtest_init_fini_order_grand_child",
602 ],
603}
604
605cc_test_library {
606 name: "libtest_init_fini_order_root2",
607 defaults: ["bionic_testlib_defaults"],
608 srcs: ["dlopen_check_init_fini_root.cpp"],
609 shared_libs: [
610 "libtest_init_fini_order_grand_child",
611 "libtest_init_fini_order_child",
612 ],
Dimitry Ivanovea8f3962017-02-09 13:31:57 -0800613}
614
615cc_test_library {
616 name: "libtest_init_fini_order_child",
617 defaults: ["bionic_testlib_defaults"],
618 srcs: ["dlopen_check_init_fini_child.cpp"],
619 shared_libs: ["libtest_init_fini_order_grand_child"],
620}
621
622cc_test_library {
623 name: "libtest_init_fini_order_grand_child",
624 defaults: ["bionic_testlib_defaults"],
625 srcs: ["dlopen_check_init_fini_grand_child.cpp"],
626}
627
628// -----------------------------------------------------------------------------
Colin Cross2722ebb2016-07-11 16:20:06 -0700629// Library that depends on the library with constructor that calls dlopen() b/7941716
630// -----------------------------------------------------------------------------
Dimitry Ivanova36e59b2016-09-01 11:37:39 -0700631cc_test_library {
Colin Cross2722ebb2016-07-11 16:20:06 -0700632 name: "libtest_dlopen_from_ctor_main",
633 defaults: ["bionic_testlib_defaults"],
634 srcs: ["empty.cpp"],
635 shared_libs: ["libtest_dlopen_from_ctor"],
636}
637
638// -----------------------------------------------------------------------------
639// Tool to use to align the shared libraries in a zip file.
640// -----------------------------------------------------------------------------
641cc_binary_host {
642 name: "bionic_tests_zipalign",
643 srcs: ["bionic_tests_zipalign.cpp"],
644 cflags: [
645 "-Wall",
646 "-Werror",
647 ],
648
649 static_libs: [
650 "libziparchive",
651 "liblog",
652 "libbase",
653 "libz",
654 "libutils",
655 ],
Colin Cross2722ebb2016-07-11 16:20:06 -0700656}
Evgenii Stepanov0a3637d2016-07-06 13:20:59 -0700657
658cc_test_library {
659 name: "libcfi-test",
660 defaults: ["bionic_testlib_defaults"],
661 srcs: ["cfi_test_lib.cpp"],
662 sanitize: {
663 cfi: false,
664 },
665}
666
667cc_test_library {
668 name: "libcfi-test-bad",
669 defaults: ["bionic_testlib_defaults"],
670 srcs: ["cfi_test_bad_lib.cpp"],
671 sanitize: {
672 cfi: false,
673 },
674}
Evgenii Stepanov68ecec12017-01-31 13:19:30 -0800675
676cc_test {
677 name: "cfi_test_helper",
678 host_supported: false,
679 defaults: ["bionic_testlib_defaults"],
680 srcs: ["cfi_test_helper.cpp"],
681 ldflags: ["-rdynamic"],
682}
683
684cc_test {
685 name: "cfi_test_helper2",
686 host_supported: false,
687 defaults: ["bionic_testlib_defaults"],
688 srcs: ["cfi_test_helper2.cpp"],
689 shared_libs: ["libcfi-test"],
690 ldflags: ["-Wl,--rpath,${ORIGIN}/.."],
691}
Elliott Hugheseb04ed52017-03-29 13:48:02 -0700692
693cc_test {
694 name: "preinit_getauxval_test_helper",
695 host_supported: false,
696 defaults: ["bionic_testlib_defaults"],
697 srcs: ["preinit_getauxval_test_helper.cpp"],
698}
699
700cc_test {
701 name: "preinit_syscall_test_helper",
702 host_supported: false,
703 defaults: ["bionic_testlib_defaults"],
704 srcs: ["preinit_syscall_test_helper.cpp"],
705}
Jiyong Park02586a22017-05-20 01:01:24 +0900706
707cc_test {
708 name: "ld_preload_test_helper",
709 host_supported: false,
710 defaults: ["bionic_testlib_defaults"],
711 srcs: ["ld_preload_test_helper.cpp"],
712 shared_libs: ["ld_preload_test_helper_lib1"],
713 ldflags: ["-Wl,--rpath,${ORIGIN}/.."],
714}
715
716cc_test_library {
717 name: "ld_preload_test_helper_lib1",
718 host_supported: false,
719 defaults: ["bionic_testlib_defaults"],
720 srcs: ["ld_preload_test_helper_lib1.cpp"],
721}
722
723cc_test_library {
724 name: "ld_preload_test_helper_lib2",
725 host_supported: false,
726 defaults: ["bionic_testlib_defaults"],
727 srcs: ["ld_preload_test_helper_lib2.cpp"],
728}
729
730cc_test {
731 name: "ld_config_test_helper",
732 host_supported: false,
733 defaults: ["bionic_testlib_defaults"],
734 srcs: ["ld_config_test_helper.cpp"],
735 shared_libs: ["ld_config_test_helper_lib1"],
736 ldflags: ["-Wl,--rpath,${ORIGIN}/.."],
737}
738
739cc_test_library {
740 name: "ld_config_test_helper_lib1",
741 host_supported: false,
742 defaults: ["bionic_testlib_defaults"],
743 srcs: ["ld_config_test_helper_lib1.cpp"],
744 shared_libs: ["ld_config_test_helper_lib2"],
Nan Zhangdab0fd52017-11-07 11:05:24 -0800745 relative_install_path: "bionic-loader-test-libs/ns2",
Jiyong Park02586a22017-05-20 01:01:24 +0900746}
747
748cc_test_library {
749 name: "ld_config_test_helper_lib2",
750 host_supported: false,
751 defaults: ["bionic_testlib_defaults"],
752 srcs: ["ld_config_test_helper_lib2.cpp"],
Nan Zhangdab0fd52017-11-07 11:05:24 -0800753 relative_install_path: "bionic-loader-test-libs/ns2",
Jiyong Park02586a22017-05-20 01:01:24 +0900754}
755
756cc_test_library {
757 name: "ld_config_test_helper_lib3",
758 host_supported: false,
759 defaults: ["bionic_testlib_defaults"],
760 srcs: ["ld_config_test_helper_lib3.cpp"],
761}