blob: 039d1e101b4dec45146ade384fbe2000a984d1d8 [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
Bob Badouraa7d8352021-02-19 13:06:22 -080017package {
Aditya Choudharyd9d37c02024-02-02 13:57:12 +000018 default_team: "trendy_team_native_tools_libraries",
Bob Badouraa7d8352021-02-19 13:06:22 -080019 default_applicable_licenses: ["bionic_tests_license"],
20}
21
Colin Cross2722ebb2016-07-11 16:20:06 -070022cc_defaults {
23 name: "bionic_testlib_defaults",
24 host_supported: true,
Chih-Hung Hsieh84f0dcd2017-10-02 11:47:31 -070025 cflags: [
26 "-Wall",
27 "-Werror",
28 ],
Dimitry Ivanova36e59b2016-09-01 11:37:39 -070029 ldflags: [
Dimitry Ivanovd11d1e42016-10-05 02:51:17 -070030 "-Wl,--rpath,${ORIGIN}",
Dimitry Ivanova36e59b2016-09-01 11:37:39 -070031 "-Wl,--enable-new-dtags",
32 ],
Evgenii Stepanovd957e962023-11-28 15:14:39 -080033 static_libs: ["libbase"],
Dimitry Ivanova36e59b2016-09-01 11:37:39 -070034 relative_install_path: "bionic-loader-test-libs",
35 gtest: false,
Colin Cross2722ebb2016-07-11 16:20:06 -070036 sanitize: {
Evgenii Stepanov0a3637d2016-07-06 13:20:59 -070037 address: false,
Colin Cross2722ebb2016-07-11 16:20:06 -070038 },
Yabin Cui1f553ea2017-01-13 12:31:59 -080039 stl: "libc++_static",
Colin Cross2722ebb2016-07-11 16:20:06 -070040 target: {
41 darwin: {
42 enabled: false,
43 },
44 },
Florian Mayer37b4a152022-10-03 14:29:16 -070045 strip: {
46 none: true,
47 },
Colin Cross2722ebb2016-07-11 16:20:06 -070048}
49
50// -----------------------------------------------------------------------------
Ryan Pricharde4ee12f2019-01-15 20:35:00 -080051// Libraries and helper binaries for ELF TLS
Elliott Hughes9724e932018-03-23 18:46:07 -070052// -----------------------------------------------------------------------------
53cc_test_library {
Ryan Pricharde4ee12f2019-01-15 20:35:00 -080054 name: "libtest_elftls_shared_var",
55 defaults: ["bionic_testlib_defaults"],
56 srcs: ["elftls_shared_var.cpp"],
Ryan Pricharde4ee12f2019-01-15 20:35:00 -080057}
58
59cc_test_library {
60 name: "libtest_elftls_shared_var_ie",
61 defaults: ["bionic_testlib_defaults"],
62 srcs: ["elftls_shared_var_ie.cpp"],
Ryan Pricharde4ee12f2019-01-15 20:35:00 -080063 shared_libs: ["libtest_elftls_shared_var"],
64}
65
66cc_test_library {
67 name: "libtest_elftls_tprel",
68 defaults: ["bionic_testlib_defaults"],
69 srcs: ["elftls_tprel.cpp"],
Ryan Pricharde4ee12f2019-01-15 20:35:00 -080070}
71
72cc_test {
73 name: "elftls_dlopen_ie_error_helper",
74 defaults: ["bionic_testlib_defaults"],
75 srcs: ["elftls_dlopen_ie_error_helper.cpp"],
76 ldflags: ["-Wl,--rpath,${ORIGIN}/.."],
77}
78
Ryan Prichard06d2d792019-01-23 23:19:19 -080079cc_test_library {
80 name: "libtest_elftls_dynamic",
81 defaults: ["bionic_testlib_defaults"],
82 srcs: ["elftls_dynamic.cpp"],
Ryan Prichard06d2d792019-01-23 23:19:19 -080083 shared_libs: ["libtest_elftls_shared_var"],
84}
85
Vy Nguyend5007512020-07-14 17:37:04 -040086cc_test {
Elliott Hughes1eacc0e2024-01-19 19:05:36 +000087 name: "thread_exit_cb_helper",
88 defaults: ["bionic_testlib_defaults"],
89 srcs: ["thread_exit_cb_helper.cpp"],
Vy Nguyend5007512020-07-14 17:37:04 -040090}
91
92cc_test {
Elliott Hughes1eacc0e2024-01-19 19:05:36 +000093 name: "tls_properties_helper",
94 defaults: ["bionic_testlib_defaults"],
95 srcs: ["tls_properties_helper.cpp"],
96 shared_libs: ["libtest_elftls_shared_var"],
Vy Nguyend5007512020-07-14 17:37:04 -040097}
98
Ryan Prichard06d2d792019-01-23 23:19:19 -080099cc_test_library {
100 name: "libtest_elftls_dynamic_filler_1",
101 defaults: ["bionic_testlib_defaults"],
102 srcs: ["elftls_dynamic_filler.cpp"],
Dan Willemsen4bcfe3c2019-04-19 14:55:34 -0700103 cflags: [
Dan Willemsen4bcfe3c2019-04-19 14:55:34 -0700104 "-DTLS_FILLER=100",
105 ],
Ryan Prichard06d2d792019-01-23 23:19:19 -0800106}
107
108cc_test_library {
109 name: "libtest_elftls_dynamic_filler_2",
110 defaults: ["bionic_testlib_defaults"],
111 srcs: ["elftls_dynamic_filler.cpp"],
Dan Willemsen4bcfe3c2019-04-19 14:55:34 -0700112 cflags: [
Dan Willemsen4bcfe3c2019-04-19 14:55:34 -0700113 "-DTLS_FILLER=200",
114 ],
Ryan Prichard06d2d792019-01-23 23:19:19 -0800115}
116
117cc_test_library {
118 name: "libtest_elftls_dynamic_filler_3",
119 defaults: ["bionic_testlib_defaults"],
120 srcs: ["elftls_dynamic_filler.cpp"],
Dan Willemsen4bcfe3c2019-04-19 14:55:34 -0700121 cflags: [
Dan Willemsen4bcfe3c2019-04-19 14:55:34 -0700122 "-DTLS_FILLER=300",
123 ],
Ryan Prichard06d2d792019-01-23 23:19:19 -0800124}
125
Elliott Hughes9724e932018-03-23 18:46:07 -0700126// -----------------------------------------------------------------------------
Colin Cross2722ebb2016-07-11 16:20:06 -0700127// Library to test gnu-styled hash
128// -----------------------------------------------------------------------------
Dimitry Ivanova36e59b2016-09-01 11:37:39 -0700129cc_test_library {
Colin Cross2722ebb2016-07-11 16:20:06 -0700130 name: "libgnu-hash-table-library",
131 defaults: ["bionic_testlib_defaults"],
132 srcs: ["dlext_test_library.cpp"],
133 ldflags: ["-Wl,--hash-style=gnu"],
Colin Cross2722ebb2016-07-11 16:20:06 -0700134}
135
136// -----------------------------------------------------------------------------
137// Library to test sysv-styled hash
138// -----------------------------------------------------------------------------
Dimitry Ivanova36e59b2016-09-01 11:37:39 -0700139cc_test_library {
Colin Cross2722ebb2016-07-11 16:20:06 -0700140 name: "libsysv-hash-table-library",
141 defaults: ["bionic_testlib_defaults"],
142 srcs: ["dlext_test_library.cpp"],
143 ldflags: ["-Wl,--hash-style=sysv"],
144}
145
146// -----------------------------------------------------------------------------
147// Library used by dlext tests - with GNU RELRO program header
148// -----------------------------------------------------------------------------
Dan Willemsen4bcfe3c2019-04-19 14:55:34 -0700149cc_test_library {
150 name: "libdlext_test",
151 defaults: ["bionic_testlib_defaults"],
152 srcs: ["dlext_test_library.cpp"],
153 ldflags: ["-Wl,-z,relro"],
154 shared_libs: ["libtest_simple"],
155}
Colin Cross2722ebb2016-07-11 16:20:06 -0700156
157// -----------------------------------------------------------------------------
158// Library used by dlext tests - without GNU RELRO program header
159// -----------------------------------------------------------------------------
Dimitry Ivanova36e59b2016-09-01 11:37:39 -0700160cc_test_library {
Colin Cross2722ebb2016-07-11 16:20:06 -0700161 name: "libdlext_test_norelro",
Dimitry Ivanova36e59b2016-09-01 11:37:39 -0700162 defaults: ["bionic_testlib_defaults"],
Colin Cross2722ebb2016-07-11 16:20:06 -0700163 srcs: ["dlext_test_library.cpp"],
164 ldflags: ["-Wl,-z,norelro"],
Elliott Hughesd50a1de2018-02-05 17:30:57 -0800165 shared_libs: ["libtest_simple"],
Colin Cross2722ebb2016-07-11 16:20:06 -0700166}
167
168// -----------------------------------------------------------------------------
Dan Willemsen4bcfe3c2019-04-19 14:55:34 -0700169// Library used by dlext tests - recursive use of RELRO sharing
170// -----------------------------------------------------------------------------
171cc_test_library {
172 name: "libdlext_test_recursive",
173 defaults: ["bionic_testlib_defaults"],
174 srcs: ["dlext_test_recursive_library.cpp"],
175 ldflags: ["-Wl,-z,relro"],
176 shared_libs: ["libdlext_test"],
177}
178
179// -----------------------------------------------------------------------------
Colin Cross2722ebb2016-07-11 16:20:06 -0700180// Library used by dlext tests - different name non-default location
181// -----------------------------------------------------------------------------
Dan Willemsen4bcfe3c2019-04-19 14:55:34 -0700182cc_test_library {
183 name: "libdlext_test_fd",
184 defaults: ["bionic_testlib_defaults"],
185 host_supported: false,
186 srcs: ["dlext_test_library.cpp"],
187 ldflags: ["-Wl,--rpath,${ORIGIN}/.."],
188 relative_install_path: "bionic-loader-test-libs/libdlext_test_fd",
189 shared_libs: ["libtest_simple"],
190}
Colin Cross2722ebb2016-07-11 16:20:06 -0700191
192// -----------------------------------------------------------------------------
193// Libraries used by dlext tests for open from a zip-file
194// -----------------------------------------------------------------------------
Dan Willemsen4bcfe3c2019-04-19 14:55:34 -0700195cc_test_library {
196 name: "libdlext_test_zip",
197 defaults: ["bionic_testlib_defaults"],
198 host_supported: false,
199 srcs: ["dlext_test_library.cpp"],
200 shared_libs: ["libatest_simple_zip"],
201 relative_install_path: "bionic-loader-test-libs/libdlext_test_zip",
202}
203
204cc_test_library {
205 name: "libatest_simple_zip",
206 defaults: ["bionic_testlib_defaults"],
207 host_supported: false,
208 srcs: ["dlopen_testlib_simple.cpp"],
209 relative_install_path: "bionic-loader-test-libs/libatest_simple_zip",
210}
Colin Cross2722ebb2016-07-11 16:20:06 -0700211
212// ----------------------------------------------------------------------------
213// Library with soname which does not match filename
214// ----------------------------------------------------------------------------
Dan Willemsen4bcfe3c2019-04-19 14:55:34 -0700215cc_test_library {
216 name: "libdlext_test_different_soname",
217 defaults: ["bionic_testlib_defaults"],
218 srcs: ["dlext_test_library.cpp"],
219 ldflags: ["-Wl,-soname=libdlext_test_soname.so"],
220}
Colin Cross2722ebb2016-07-11 16:20:06 -0700221
222// -----------------------------------------------------------------------------
223// Library used by dlext tests - zipped and aligned
224// -----------------------------------------------------------------------------
225// In Android.mk to support zipped and aligned tests
226
227// -----------------------------------------------------------------------------
228// Library used by dlfcn tests
229// -----------------------------------------------------------------------------
Dimitry Ivanova36e59b2016-09-01 11:37:39 -0700230cc_test_library {
Colin Cross2722ebb2016-07-11 16:20:06 -0700231 name: "libtest_simple",
232 defaults: ["bionic_testlib_defaults"],
233 srcs: ["dlopen_testlib_simple.cpp"],
234}
235
236// -----------------------------------------------------------------------------
Florian Mayerc10d0642023-03-22 16:12:49 -0700237// Libraries used by hwasan_test
238// -----------------------------------------------------------------------------
239cc_test_library {
240 name: "libtest_simple_hwasan",
241 arch: {
242 arm64: {
243 enabled: true,
244 },
245 },
246 sanitize: {
247 hwaddress: true,
248 },
249 relative_install_path: "hwasan",
250 enabled: false,
251 srcs: ["dlopen_testlib_simple_hwasan.cpp"],
252}
253
254cc_test_library {
255 // A weird name. This is the vanilla (non-HWASan) copy of the library that
256 // is used for the hwasan test.
257 name: "libtest_simple_hwasan_nohwasan",
258 arch: {
259 arm64: {
260 enabled: true,
261 },
262 },
263 stem: "libtest_simple_hwasan",
264 enabled: false,
265 srcs: ["dlopen_testlib_simple_hwasan.cpp"],
266}
267
268// -----------------------------------------------------------------------------
dimitry965d06d2017-11-28 16:03:07 +0100269// Library used by dlext direct unload on the namespace boundary tests
270// -----------------------------------------------------------------------------
271cc_test_library {
272 name: "libtest_missing_symbol",
273 defaults: ["bionic_testlib_defaults"],
274 srcs: ["dlopen_testlib_missing_symbol.cpp"],
275 allow_undefined_symbols: true,
276 relative_install_path: "bionic-loader-test-libs/public_namespace_libs",
277}
278
dimitry965d06d2017-11-28 16:03:07 +0100279// -----------------------------------------------------------------------------
280// Library used by dlext indirect unload on the namespace boundary tests
281//
282// These libraries produce following dependency graph:
283// libtest_missing_symbol_root (private ns)
284// +-> libbnstest_public (public ns)
285// +-> libtest_missing_symbol_child_public (public ns)
286// +-> libnstest_public (public ns)
287// +-> libtest_missing_symbol_child_private (private_ns)
288// +-> libnstest_public (public_ns)
289//
290// All libraries except libtest_missing_symbol are located in
291// private_namespace_libs/
292// -----------------------------------------------------------------------------
293cc_test_library {
294 name: "libtest_missing_symbol_child_public",
295 defaults: ["bionic_testlib_defaults"],
296 srcs: ["empty.cpp"],
297 relative_install_path: "bionic-loader-test-libs/public_namespace_libs",
298 shared_libs: ["libnstest_public"],
299}
300
301cc_test_library {
302 name: "libtest_missing_symbol_child_private",
303 defaults: ["bionic_testlib_defaults"],
304 srcs: ["empty.cpp"],
305 relative_install_path: "bionic-loader-test-libs/private_namespace_libs",
306 shared_libs: ["libnstest_public"],
307}
308
309cc_test_library {
310 name: "libtest_missing_symbol_root",
311 defaults: ["bionic_testlib_defaults"],
312 srcs: ["dlopen_testlib_missing_symbol.cpp"],
313 relative_install_path: "bionic-loader-test-libs/private_namespace_libs",
314 allow_undefined_symbols: true,
315 shared_libs: [
316 "libnstest_public",
317 "libtest_missing_symbol_child_public",
318 "libtest_missing_symbol_child_private",
319 ],
320}
321
322// -----------------------------------------------------------------------------
323// -----------------------------------------------------------------------------
Colin Cross2722ebb2016-07-11 16:20:06 -0700324// Library used by dlfcn nodelete tests
325// -----------------------------------------------------------------------------
Dimitry Ivanova36e59b2016-09-01 11:37:39 -0700326cc_test_library {
Colin Cross2722ebb2016-07-11 16:20:06 -0700327 name: "libtest_nodelete_1",
328 defaults: ["bionic_testlib_defaults"],
329 srcs: ["dlopen_nodelete_1.cpp"],
330}
331
332// -----------------------------------------------------------------------------
333// Library used by dlfcn nodelete tests
334// -----------------------------------------------------------------------------
Dimitry Ivanova36e59b2016-09-01 11:37:39 -0700335cc_test_library {
Colin Cross2722ebb2016-07-11 16:20:06 -0700336 name: "libtest_nodelete_2",
337 defaults: ["bionic_testlib_defaults"],
338 srcs: ["dlopen_nodelete_2.cpp"],
339}
340
341// -----------------------------------------------------------------------------
342// Library used by dlfcn nodelete tests
343// -----------------------------------------------------------------------------
Dimitry Ivanova36e59b2016-09-01 11:37:39 -0700344cc_test_library {
Colin Cross2722ebb2016-07-11 16:20:06 -0700345 name: "libtest_nodelete_dt_flags_1",
346 defaults: ["bionic_testlib_defaults"],
347 srcs: ["dlopen_nodelete_dt_flags_1.cpp"],
348 ldflags: ["-Wl,-z,nodelete"],
349}
350
351// -----------------------------------------------------------------------------
352// Build test helper libraries for linker namespaces
dimitry965d06d2017-11-28 16:03:07 +0100353//
354// This set of libraries is used to verify linker namespaces.
355//
356// Test cases
357// 1. Check that private libraries loaded in different namespaces are
358// different. Check that dlsym does not confuse them.
359// 2. Check that public libraries loaded in different namespaces are shared
360// between them.
361// 3. Check that namespace sticks on dlopen
362// 4. Check that having access to shared library (libnstest_public.so)
363// does not expose symbols from dependent library (libnstest_public_internal.so)
364//
365// Dependency tree (visibility)
366// libnstest_root.so (this should be local to the namespace)
367// +-> libnstest_public.so
368// +-> libnstest_public_internal.so
369// +-> libnstest_private.so
370//
371// libnstest_dlopened.so (library in private namespace dlopened from libnstest_root.so)
Colin Cross2722ebb2016-07-11 16:20:06 -0700372// -----------------------------------------------------------------------------
dimitry965d06d2017-11-28 16:03:07 +0100373cc_test_library {
374 name: "libnstest_root",
375 defaults: ["bionic_testlib_defaults"],
376 srcs: ["namespaces_root.cpp"],
377 relative_install_path: "bionic-loader-test-libs/private_namespace_libs",
378 shared_libs: [
379 "libnstest_public",
380 "libnstest_private",
381 ],
382}
383
384cc_test_library {
385 name: "libnstest_public_internal",
386 defaults: ["bionic_testlib_defaults"],
387 srcs: ["namespaces_public_internal.cpp"],
388 relative_install_path: "bionic-loader-test-libs/public_namespace_libs",
389}
390
391cc_test_library {
392 name: "libnstest_public",
393 defaults: ["bionic_testlib_defaults"],
394 srcs: ["namespaces_public.cpp"],
395 relative_install_path: "bionic-loader-test-libs/public_namespace_libs",
396 shared_libs: ["libnstest_public_internal"],
397}
398
399cc_test_library {
400 name: "libnstest_private",
401 defaults: ["bionic_testlib_defaults"],
402 srcs: ["namespaces_private.cpp"],
403 relative_install_path: "bionic-loader-test-libs/private_namespace_libs",
404}
405
406cc_test_library {
407 name: "libnstest_dlopened",
408 defaults: ["bionic_testlib_defaults"],
409 srcs: ["namespaces_dlopened.cpp"],
410 relative_install_path: "bionic-loader-test-libs/private_namespace_libs",
411}
Colin Cross2722ebb2016-07-11 16:20:06 -0700412
413// -----------------------------------------------------------------------------
Logan Chien9ee45912018-01-18 12:05:09 +0800414// Build test helper libraries for linker namespaces for allow all shared libs
415//
416// This set of libraries is used to verify linker namespaces for allow all
417// shared libs.
418//
419// Test cases
420// 1. Check that namespace a exposes libnstest_ns_a_public1 to
421// namespace b while keeping libnstest_ns_a_public1_internal as an
422// internal lib.
423// 2. Check that namespace b exposes all libraries to namespace a.
424//
425// Dependency tree (visibility)
426// libnstest_ns_b_public2.so (ns:b)
427// +-> libnstest_ns_a_public1.so (ns:a)
428// +-> libnstest_ns_a_public2_internal.so (ns:a)
429// +-> libnstest_ns_b_public3.so (ns:b)
430//
431// -----------------------------------------------------------------------------
432cc_test_library {
433 name: "libnstest_ns_a_public1",
434 defaults: ["bionic_testlib_defaults"],
435 srcs: ["libnstest_ns_a_public1.cpp"],
436 relative_install_path: "bionic-loader-test-libs/ns_a",
437 shared_libs: [
438 "libnstest_ns_a_public1_internal",
439 "libnstest_ns_b_public3",
440 ],
441}
442
443cc_test_library {
444 name: "libnstest_ns_a_public1_internal",
445 defaults: ["bionic_testlib_defaults"],
446 srcs: ["libnstest_ns_a_public1_internal.cpp"],
447 relative_install_path: "bionic-loader-test-libs/ns_a",
448}
449
450cc_test_library {
451 name: "libnstest_ns_b_public2",
452 defaults: ["bionic_testlib_defaults"],
453 srcs: ["libnstest_ns_b_public2.cpp"],
454 relative_install_path: "bionic-loader-test-libs/ns_b",
455 shared_libs: ["libnstest_ns_a_public1"],
456}
457
458cc_test_library {
459 name: "libnstest_ns_b_public3",
460 defaults: ["bionic_testlib_defaults"],
461 srcs: ["libnstest_ns_b_public3.cpp"],
462 relative_install_path: "bionic-loader-test-libs/ns_b",
463}
464
465// -----------------------------------------------------------------------------
Dan Willemsen4bcfe3c2019-04-19 14:55:34 -0700466// Build test helper libraries for linker namespaces
467//
468// This set of libraries is to test isolated namespaces
469//
470// Isolated namespaces do not allow loading of the library outside of
471// the search paths.
472//
473// This library cannot be loaded in isolated namespace because one of DT_NEEDED
474// libraries is outside of the search paths.
475//
476// libnstest_root_not_isolated.so (DT_RUNPATH = $ORIGIN/../private_namespace_libs_external/)
477// +-> libnstest_public.so
478// +-> libnstest_private_external.so (located in $ORIGIN/../private_namespace_libs_external/)
479//
480// Search path: $NATIVE_TESTS/private_namespace_libs/
481//
Colin Cross2722ebb2016-07-11 16:20:06 -0700482// -----------------------------------------------------------------------------
Dan Willemsen4bcfe3c2019-04-19 14:55:34 -0700483
484cc_test_library {
485 name: "libnstest_root_not_isolated",
486 defaults: ["bionic_testlib_defaults"],
487 host_supported: false,
488 srcs: ["namespaces_root.cpp"],
489 shared_libs: [
490 "libnstest_public",
491 "libnstest_private_external",
492 ],
493 relative_install_path: "bionic-loader-test-libs/private_namespace_libs",
494 ldflags: ["-Wl,--rpath,$ORIGIN/../private_namespace_libs_external"],
495}
496
497cc_test_library {
498 name: "libnstest_private_external",
499 defaults: ["bionic_testlib_defaults"],
500 host_supported: false,
501 srcs: ["namespaces_private.cpp"],
502 relative_install_path: "bionic-loader-test-libs/private_namespace_libs_external",
503}
504
505// -----------------------------------------------------------------------------
Ryan Prichard22fa3dd2020-01-31 14:47:48 -0800506// ns_hidden_child linker namespace test
507// -----------------------------------------------------------------------------
508
509cc_test {
510 name: "ns_hidden_child_helper",
511 host_supported: false,
512 defaults: ["bionic_testlib_defaults"],
513 srcs: ["ns_hidden_child_helper.cpp"],
514 shared_libs: [
515 "libns_hidden_child_internal",
516 "libns_hidden_child_global",
517 "libdl_android",
518 ],
519 ldflags: ["-Wl,--rpath,${ORIGIN}/.."],
520}
521
522cc_test_library {
523 name: "libns_hidden_child_global",
524 defaults: ["bionic_testlib_defaults"],
525 host_supported: false,
526 srcs: ["ns_hidden_child_global.cpp"],
527 shared_libs: ["libns_hidden_child_internal"],
528 ldflags: ["-Wl,-z,global"],
529}
530
531cc_test_library {
532 name: "libns_hidden_child_internal",
533 defaults: ["bionic_testlib_defaults"],
534 host_supported: false,
535 srcs: ["ns_hidden_child_internal.cpp"],
536}
537
538cc_test_library {
539 name: "libns_hidden_child_public",
540 defaults: ["bionic_testlib_defaults"],
541 host_supported: false,
542 srcs: ["ns_hidden_child_public.cpp"],
543 shared_libs: ["libns_hidden_child_internal"],
544}
545
546cc_test_library {
547 name: "libns_hidden_child_app",
548 defaults: ["bionic_testlib_defaults"],
549 host_supported: false,
550 srcs: ["ns_hidden_child_app.cpp"],
551 shared_libs: ["libns_hidden_child_public"],
552 relative_install_path: "bionic-loader-test-libs/ns_hidden_child_app",
553}
554
555// -----------------------------------------------------------------------------
Dan Willemsen4bcfe3c2019-04-19 14:55:34 -0700556// Build DT_RUNPATH test helper libraries
557//
558// Dependencies
559//
560// libtest_dt_runpath_d.so runpath: ${ORIGIN}/dt_runpath_b_c_x, ${ORIGIN}/dt_runpath_y/${LIB}
561// |-> dt_runpath_b_c_x/libtest_dt_runpath_b.so runpath: ${ORIGIN}/../dt_runpath_a
562// | |-> dt_runpath_a/libtest_dt_runpath_a.so
563// |-> dt_runpath_b_c_x/libtest_dt_runpath_c.so runpath: ${ORIGIN}/invalid_dt_runpath
564// | |-> libtest_dt_runpath_a.so (soname)
565// |-> dt_runpath_y/lib[64]/libtest_dt_runpath_y.so
566//
567// This one is used to test dlopen
568// dt_runpath_b_c_x/libtest_dt_runpath_x.so
569//
570// -----------------------------------------------------------------------------
571
572// A leaf library in a non-standard directory.
573cc_test_library {
574 name: "libtest_dt_runpath_a",
575 defaults: ["bionic_testlib_defaults"],
576 srcs: ["empty.cpp"],
577 relative_install_path: "bionic-loader-test-libs/dt_runpath_a",
578}
579
580// Depends on library A with a DT_RUNPATH
581cc_test_library {
582 name: "libtest_dt_runpath_b",
583 defaults: ["bionic_testlib_defaults"],
584 srcs: ["empty.cpp"],
585 shared_libs: ["libtest_dt_runpath_a"],
586 relative_install_path: "bionic-loader-test-libs/dt_runpath_b_c_x",
587 ldflags: ["-Wl,--rpath,${ORIGIN}/../dt_runpath_a"],
588}
589
590// Depends on library A with an incorrect DT_RUNPATH. This does not matter
591// because B is the first in the D (below) dependency order, and library A
592// is already loaded using the correct DT_RUNPATH from library B.
593cc_test_library {
594 name: "libtest_dt_runpath_c",
595 defaults: ["bionic_testlib_defaults"],
596 srcs: ["empty.cpp"],
597 shared_libs: ["libtest_dt_runpath_a"],
598 relative_install_path: "bionic-loader-test-libs/dt_runpath_b_c_x",
599 ldflags: ["-Wl,--rpath,${ORIGIN}/invalid_dt_runpath"],
600}
601
602// D depends on B, C, and Y with DT_RUNPATH.
603cc_test_library {
604 name: "libtest_dt_runpath_d",
605 defaults: ["bionic_testlib_defaults"],
606 srcs: ["dlopen_b.cpp"],
607 shared_libs: [
608 "libtest_dt_runpath_b",
609 "libtest_dt_runpath_c",
610 "libtest_dt_runpath_y",
611 ],
612 ldflags: [
613 "-Wl,--rpath,${ORIGIN}/dt_runpath_b_c_x",
614 "-Wl,--rpath,${ORIGIN}/dt_runpath_y/${LIB}",
615 ],
616}
617
618// D version for open-from-zip test with runpath
619cc_test_library {
620 name: "libtest_dt_runpath_d_zip",
621 srcs: ["dlopen_b.cpp"],
622 shared_libs: [
623 "libtest_dt_runpath_b",
624 "libtest_dt_runpath_c",
625 "libtest_dt_runpath_y",
626 ],
627 cflags: [
628 "-Wall",
629 "-Werror",
630 ],
631 gtest: false,
632 relative_install_path: "libtest_dt_runpath_d_zip",
633 ldflags: [
634 "-Wl,--rpath,${ORIGIN}/dt_runpath_b_c_x",
635 "-Wl,--rpath,${ORIGIN}/dt_runpath_y/${LIB}",
636 ],
637 sanitize: {
638 address: false,
Dan Willemsen4bcfe3c2019-04-19 14:55:34 -0700639 },
640 stl: "libc++_static",
641 target: {
642 darwin: {
643 enabled: false,
644 },
645 },
646}
647
648// A leaf library in a directory library D has DT_RUNPATH for.
649cc_test_library {
650 name: "libtest_dt_runpath_x",
651 defaults: ["bionic_testlib_defaults"],
652 srcs: ["empty.cpp"],
653 relative_install_path: "bionic-loader-test-libs/dt_runpath_b_c_x",
654}
655
656// A leaf library in lib or lib64 directory
657cc_test_library {
658 name: "libtest_dt_runpath_y",
659 defaults: ["bionic_testlib_defaults"],
660 srcs: ["empty.cpp"],
661
662 multilib: {
663 lib32: {
664 relative_install_path: "bionic-loader-test-libs/dt_runpath_y/lib",
665 },
666 lib64: {
667 relative_install_path: "bionic-loader-test-libs/dt_runpath_y/lib64",
668 },
669 },
670}
Colin Cross2722ebb2016-07-11 16:20:06 -0700671
672// -----------------------------------------------------------------------------
673// Build library with two parents
Dan Willemsen4bcfe3c2019-04-19 14:55:34 -0700674//
675// Libraries used by dlfcn tests to verify local group ref_counting
676// libtest_two_parents*.so
Colin Cross2722ebb2016-07-11 16:20:06 -0700677// -----------------------------------------------------------------------------
Dan Willemsen4bcfe3c2019-04-19 14:55:34 -0700678
679// ..._child.so - correct answer
680cc_test_library {
681 name: "libtest_two_parents_child",
682 defaults: ["bionic_testlib_defaults"],
683 srcs: ["dlopen_2_parents_reloc_answer.cpp"],
684}
685
686// ..._parent1.so - correct answer
687cc_test_library {
688 name: "libtest_two_parents_parent1",
689 defaults: ["bionic_testlib_defaults"],
690 srcs: ["dlopen_check_order_reloc_answer_impl.cpp"],
691 shared_libs: ["libtest_two_parents_child"],
692 cflags: ["-D__ANSWER=42"],
693}
694
695// ..._parent2.so - incorrect answer
696cc_test_library {
697 name: "libtest_two_parents_parent2",
698 defaults: ["bionic_testlib_defaults"],
699 srcs: ["dlopen_check_order_reloc_answer_impl.cpp"],
700 shared_libs: ["libtest_two_parents_child"],
701 cflags: ["-D__ANSWER=1"],
702}
Colin Cross2722ebb2016-07-11 16:20:06 -0700703
704// -----------------------------------------------------------------------------
705// Build libtest_check_order_dlsym.so with its dependencies.
Dan Willemsen4bcfe3c2019-04-19 14:55:34 -0700706//
707// Libraries used by dlfcn tests to verify correct load order:
Colin Cross2722ebb2016-07-11 16:20:06 -0700708// -----------------------------------------------------------------------------
Dan Willemsen4bcfe3c2019-04-19 14:55:34 -0700709
710// libtest_check_order_2_right.so
711cc_test_library {
712 name: "libtest_check_order_dlsym_2_right",
713 defaults: ["bionic_testlib_defaults"],
714 srcs: ["dlopen_check_order_dlsym_answer.cpp"],
715 cflags: ["-D__ANSWER=42"],
716}
717
718// libtest_check_order_a.so
719cc_test_library {
720 name: "libtest_check_order_dlsym_a",
721 defaults: ["bionic_testlib_defaults"],
722 srcs: ["dlopen_check_order_dlsym_answer.cpp"],
723 cflags: ["-D__ANSWER=1"],
724}
725
726// libtest_check_order_b.so
727cc_test_library {
728 name: "libtest_check_order_dlsym_b",
729 defaults: ["bionic_testlib_defaults"],
730 srcs: ["dlopen_check_order_dlsym_answer.cpp"],
731 cflags: [
732 "-D__ANSWER=2",
733 "-D__ANSWER2=43",
734 ],
735}
736
737// libtest_check_order_c.so
738cc_test_library {
739 name: "libtest_check_order_dlsym_3_c",
740 defaults: ["bionic_testlib_defaults"],
741 srcs: ["dlopen_check_order_dlsym_answer.cpp"],
742 cflags: ["-D__ANSWER=3"],
743}
744
745// libtest_check_order_d.so
746cc_test_library {
747 name: "libtest_check_order_dlsym_d",
748 defaults: ["bionic_testlib_defaults"],
749 shared_libs: ["libtest_check_order_dlsym_b"],
750 srcs: ["dlopen_check_order_dlsym_answer.cpp"],
751 cflags: [
752 "-D__ANSWER=4",
753 "-D__ANSWER2=4",
754 ],
755}
756
757// libtest_check_order_left.so
758cc_test_library {
759 name: "libtest_check_order_dlsym_1_left",
760 defaults: ["bionic_testlib_defaults"],
761 shared_libs: [
762 "libtest_check_order_dlsym_a",
763 "libtest_check_order_dlsym_b",
764 ],
765 srcs: ["empty.cpp"],
766}
767
768// libtest_check_order.so
769cc_test_library {
770 name: "libtest_check_order_dlsym",
771 defaults: ["bionic_testlib_defaults"],
772 shared_libs: [
773 "libtest_check_order_dlsym_1_left",
774 "libtest_check_order_dlsym_2_right",
775 "libtest_check_order_dlsym_3_c",
776 ],
777 srcs: ["empty.cpp"],
778}
Colin Cross2722ebb2016-07-11 16:20:06 -0700779
780// -----------------------------------------------------------------------------
781// Build libtest_check_order_siblings.so with its dependencies.
Dan Willemsen4bcfe3c2019-04-19 14:55:34 -0700782//
783// Libraries used by dlfcn tests to verify correct relocation order:
784// libtest_check_order_reloc_siblings*.so
Colin Cross2722ebb2016-07-11 16:20:06 -0700785// -----------------------------------------------------------------------------
Dan Willemsen4bcfe3c2019-04-19 14:55:34 -0700786
787// ..._1.so - empty
788cc_test_library {
789 name: "libtest_check_order_reloc_siblings_1",
790 defaults: ["bionic_testlib_defaults"],
791 shared_libs: [
792 "libtest_check_order_reloc_siblings_a",
793 "libtest_check_order_reloc_siblings_b",
794 ],
795 srcs: ["empty.cpp"],
796}
797
798// ..._2.so - empty
799cc_test_library {
800 name: "libtest_check_order_reloc_siblings_2",
801 defaults: ["bionic_testlib_defaults"],
802 shared_libs: [
803 "libtest_check_order_reloc_siblings_c",
804 "libtest_check_order_reloc_siblings_d",
805 ],
806 srcs: [
807 "dlopen_check_order_reloc_grandchild_answer.cpp",
808 ],
809 allow_undefined_symbols: true,
810}
811
812// ..._3.so - get_answer2();
813cc_test_library {
814 name: "libtest_check_order_reloc_siblings_3",
815 defaults: ["bionic_testlib_defaults"],
816 shared_libs: [
817 "libtest_check_order_reloc_siblings_e",
818 "libtest_check_order_reloc_siblings_f",
819 ],
820 srcs: [
821 "dlopen_check_order_reloc_nephew_answer.cpp",
822 ],
823}
824
825// ..._a.so <- correct impl
826cc_test_library {
827 name: "libtest_check_order_reloc_siblings_a",
828 defaults: ["bionic_testlib_defaults"],
829 srcs: [
830 "dlopen_check_order_reloc_answer_impl.cpp",
831 ],
832 cflags: ["-D__ANSWER=42"],
833}
834
835// ..._b.so
836cc_test_library {
837 name: "libtest_check_order_reloc_siblings_b",
838 defaults: ["bionic_testlib_defaults"],
839 srcs: [
840 "dlopen_check_order_reloc_answer_impl.cpp",
841 ],
842 cflags: ["-D__ANSWER=1"],
843}
844
845// ..._c.so
846cc_test_library {
847 name: "libtest_check_order_reloc_siblings_c",
848 defaults: ["bionic_testlib_defaults"],
849 shared_libs: [
850 "libtest_check_order_reloc_siblings_c_1",
851 "libtest_check_order_reloc_siblings_c_2",
852 ],
853 srcs: [
854 "dlopen_check_order_reloc_answer_impl.cpp",
855 ],
856 cflags: ["-D__ANSWER=2"],
857}
858
859// ..._d.so
860cc_test_library {
861 name: "libtest_check_order_reloc_siblings_d",
862 defaults: ["bionic_testlib_defaults"],
863 srcs: [
864 "dlopen_check_order_reloc_answer_impl.cpp",
865 ],
866 cflags: ["-D__ANSWER=3"],
867}
868
869// ..._e.so
870cc_test_library {
871 name: "libtest_check_order_reloc_siblings_e",
872 defaults: ["bionic_testlib_defaults"],
873 srcs: [
874 "dlopen_check_order_reloc_answer_impl.cpp",
875 ],
876 cflags: [
877 "-D__ANSWER=4",
878 ],
879}
880
881// ..._f.so <- get_answer()
882cc_test_library {
883 name: "libtest_check_order_reloc_siblings_f",
884 defaults: ["bionic_testlib_defaults"],
885 srcs: [
886 "dlopen_check_order_reloc_answer.cpp",
887 ],
888}
889
890// ..._c_1.so
891cc_test_library {
892 name: "libtest_check_order_reloc_siblings_c_1",
893 defaults: ["bionic_testlib_defaults"],
894 srcs: [
895 "dlopen_check_order_reloc_grandchild_answer_impl.cpp",
896 ],
897 cflags: ["-D__ANSWER=42"],
898}
899
900// ..._c_2.so
901cc_test_library {
902 name: "libtest_check_order_reloc_siblings_c_2",
903 defaults: ["bionic_testlib_defaults"],
904 srcs: [
905 "dlopen_check_order_reloc_grandchild_answer_impl.cpp",
906 ],
907 cflags: ["-D__ANSWER=0"],
908}
909
910// libtest_check_order_reloc_siblings.so
911cc_test_library {
912 name: "libtest_check_order_reloc_siblings",
913 defaults: ["bionic_testlib_defaults"],
914 shared_libs: [
915 "libtest_check_order_reloc_siblings_1",
916 "libtest_check_order_reloc_siblings_2",
917 "libtest_check_order_reloc_siblings_3",
918 ],
919 srcs: [
920 "empty.cpp",
921 ],
922}
Colin Cross2722ebb2016-07-11 16:20:06 -0700923
924// -----------------------------------------------------------------------------
925// Build libtest_check_order_root.so with its dependencies.
Dan Willemsen4bcfe3c2019-04-19 14:55:34 -0700926//
927// Libraries used by dlfcn tests to verify correct relocation order:
928// libtest_check_order_reloc_root*.so
Colin Cross2722ebb2016-07-11 16:20:06 -0700929// -----------------------------------------------------------------------------
Dan Willemsen4bcfe3c2019-04-19 14:55:34 -0700930
931// ..._1.so - empty
932cc_test_library {
933 name: "libtest_check_order_reloc_root_1",
934 defaults: ["bionic_testlib_defaults"],
935 srcs: ["empty.cpp"],
936}
937
938// ..._2.so - this one has the incorrect answer
939cc_test_library {
940 name: "libtest_check_order_reloc_root_2",
941 defaults: ["bionic_testlib_defaults"],
942 srcs: ["dlopen_check_order_reloc_root_answer_impl.cpp"],
943 cflags: ["-D__ANSWER=2"],
944}
945
946// libtest_check_order_reloc_root.so <- implements get_answer3()
947cc_test_library {
948 name: "libtest_check_order_reloc_root",
949 defaults: ["bionic_testlib_defaults"],
950 srcs: ["dlopen_check_order_reloc_root_answer.cpp"],
951 shared_libs: [
952 "libtest_check_order_reloc_root_1",
953 "libtest_check_order_reloc_root_2",
954 ],
955}
Colin Cross2722ebb2016-07-11 16:20:06 -0700956
957// -----------------------------------------------------------------------------
958// Build libtest_versioned_lib.so with its dependencies.
Dan Willemsen4bcfe3c2019-04-19 14:55:34 -0700959//
960// Libraries used to test versioned symbols
Colin Cross2722ebb2016-07-11 16:20:06 -0700961// -----------------------------------------------------------------------------
Dan Willemsen4bcfe3c2019-04-19 14:55:34 -0700962
963cc_test_library {
964 name: "libtest_versioned_uselibv1",
965 defaults: ["bionic_testlib_defaults"],
966 srcs: ["versioned_uselib.cpp"],
967 shared_libs: ["libtest_versioned_libv1"],
968}
969
970cc_test_library {
971 name: "libtest_versioned_uselibv2",
972 defaults: ["bionic_testlib_defaults"],
973 srcs: ["versioned_uselib.cpp"],
974 shared_libs: ["libtest_versioned_libv2"],
975 version_script: "versioned_uselib.map",
976}
977
978cc_test_library {
979 name: "libtest_versioned_uselibv2_other",
980 defaults: ["bionic_testlib_defaults"],
981 srcs: ["versioned_uselib.cpp"],
982 shared_libs: [
983 "libtest_versioned_otherlib_empty",
984 "libtest_versioned_libv2",
985 ],
986}
987
988cc_test_library {
989 name: "libtest_versioned_uselibv3_other",
990 defaults: ["bionic_testlib_defaults"],
991 srcs: ["versioned_uselib.cpp"],
992 shared_libs: [
993 "libtest_versioned_otherlib_empty",
994 "libtest_versioned_lib",
995 ],
996}
997
998// lib v1 - this one used during static linking but never used at runtime
999// which forces libtest_versioned_uselibv1 to use function v1 from
1000// libtest_versioned_lib.so
1001cc_test_library {
1002 name: "libtest_versioned_libv1",
1003 defaults: ["bionic_testlib_defaults"],
1004 srcs: ["versioned_lib_v1.cpp"],
1005 version_script: "versioned_lib_v1.map",
1006 ldflags: ["-Wl,-soname,libtest_versioned_lib.so"],
1007}
1008
1009// lib v2 - to make libtest_versioned_uselibv2.so use version 2 of versioned_function()
1010cc_test_library {
1011 name: "libtest_versioned_libv2",
1012 defaults: ["bionic_testlib_defaults"],
1013 srcs: ["versioned_lib_v2.cpp"],
1014 version_script: "versioned_lib_v2.map",
1015 ldflags: ["-Wl,-soname,libtest_versioned_lib.so"],
1016}
1017
1018// last version - this one is used at the runtime and exports 3 versions
1019// of versioned_symbol().
1020cc_test_library {
1021 name: "libtest_versioned_lib",
1022 defaults: ["bionic_testlib_defaults"],
1023 srcs: ["versioned_lib_v3.cpp"],
1024 version_script: "versioned_lib_v3.map",
1025}
1026
1027// This library is empty, the actual implementation will provide an unversioned
1028// symbol for versioned_function().
1029cc_test_library {
1030 name: "libtest_versioned_otherlib_empty",
1031 defaults: ["bionic_testlib_defaults"],
1032 srcs: ["empty.cpp"],
1033 ldflags: ["-Wl,-soname,libtest_versioned_otherlib.so"],
1034}
1035
1036cc_test_library {
1037 name: "libtest_versioned_otherlib",
1038 defaults: ["bionic_testlib_defaults"],
1039 srcs: ["versioned_lib_other.cpp"],
1040 version_script: "versioned_lib_other.map",
1041}
Colin Cross2722ebb2016-07-11 16:20:06 -07001042
1043// -----------------------------------------------------------------------------
1044// Build libraries needed by pthread_atfork tests
Dan Willemsen4bcfe3c2019-04-19 14:55:34 -07001045
1046// This library used to test phtread_atfork handler behaviour
1047// during/after dlclose.
Colin Cross2722ebb2016-07-11 16:20:06 -07001048// -----------------------------------------------------------------------------
Dan Willemsen4bcfe3c2019-04-19 14:55:34 -07001049cc_test_library {
1050 name: "libtest_pthread_atfork",
1051 defaults: ["bionic_testlib_defaults"],
1052 srcs: ["pthread_atfork.cpp"],
1053}
Colin Cross2722ebb2016-07-11 16:20:06 -07001054
1055// -----------------------------------------------------------------------------
1056// Library with dependency loop used by dlfcn tests
1057//
1058// libtest_with_dependency_loop -> a -> b -> c -> a
1059// -----------------------------------------------------------------------------
Dimitry Ivanova36e59b2016-09-01 11:37:39 -07001060cc_test_library {
Colin Cross2722ebb2016-07-11 16:20:06 -07001061 name: "libtest_with_dependency_loop",
1062 defaults: ["bionic_testlib_defaults"],
1063 srcs: ["dlopen_testlib_loopy_root.cpp"],
1064 shared_libs: ["libtest_with_dependency_loop_a"],
1065}
1066
1067// -----------------------------------------------------------------------------
1068// libtest_with_dependency_loop_a.so
1069// -----------------------------------------------------------------------------
Dimitry Ivanova36e59b2016-09-01 11:37:39 -07001070cc_test_library {
Colin Cross2722ebb2016-07-11 16:20:06 -07001071 name: "libtest_with_dependency_loop_a",
1072 defaults: ["bionic_testlib_defaults"],
1073 srcs: ["dlopen_testlib_loopy_a.cpp"],
1074 shared_libs: ["libtest_with_dependency_loop_b_tmp"],
1075}
1076
1077// -----------------------------------------------------------------------------
1078// libtest_with_dependency_loop_b.so
1079//
1080// this is temporary placeholder - will be removed
1081// -----------------------------------------------------------------------------
Dimitry Ivanova36e59b2016-09-01 11:37:39 -07001082cc_test_library {
Colin Cross2722ebb2016-07-11 16:20:06 -07001083 name: "libtest_with_dependency_loop_b_tmp",
1084 defaults: ["bionic_testlib_defaults"],
1085 srcs: ["dlopen_testlib_loopy_invalid.cpp"],
1086 ldflags: ["-Wl,-soname=libtest_with_dependency_loop_b.so"],
1087}
1088
1089// -----------------------------------------------------------------------------
1090// libtest_with_dependency_loop_b.so
1091// -----------------------------------------------------------------------------
Dimitry Ivanova36e59b2016-09-01 11:37:39 -07001092cc_test_library {
Colin Cross2722ebb2016-07-11 16:20:06 -07001093 name: "libtest_with_dependency_loop_b",
1094 defaults: ["bionic_testlib_defaults"],
1095 srcs: ["dlopen_testlib_loopy_b.cpp"],
1096 shared_libs: ["libtest_with_dependency_loop_c"],
1097}
1098
1099// -----------------------------------------------------------------------------
1100// libtest_with_dependency_loop_c.so
1101// -----------------------------------------------------------------------------
Dimitry Ivanova36e59b2016-09-01 11:37:39 -07001102cc_test_library {
Colin Cross2722ebb2016-07-11 16:20:06 -07001103 name: "libtest_with_dependency_loop_c",
1104 defaults: ["bionic_testlib_defaults"],
1105 srcs: ["dlopen_testlib_loopy_c.cpp"],
1106 shared_libs: ["libtest_with_dependency_loop_a"],
1107}
1108
1109// -----------------------------------------------------------------------------
1110// libtest_relo_check_dt_needed_order.so
1111// |
1112// +-> libtest_relo_check_dt_needed_order_1.so
1113// |
1114// +-> libtest_relo_check_dt_needed_order_2.so
1115// -----------------------------------------------------------------------------
1116
Dimitry Ivanova36e59b2016-09-01 11:37:39 -07001117cc_test_library {
Colin Cross2722ebb2016-07-11 16:20:06 -07001118 name: "libtest_relo_check_dt_needed_order",
1119 defaults: ["bionic_testlib_defaults"],
1120 srcs: ["dlopen_testlib_relo_check_dt_needed_order.cpp"],
1121 shared_libs: [
1122 "libtest_relo_check_dt_needed_order_1",
1123 "libtest_relo_check_dt_needed_order_2",
1124 ],
1125}
1126
Dimitry Ivanova36e59b2016-09-01 11:37:39 -07001127cc_test_library {
Colin Cross2722ebb2016-07-11 16:20:06 -07001128 name: "libtest_relo_check_dt_needed_order_1",
1129 defaults: ["bionic_testlib_defaults"],
1130 srcs: ["dlopen_testlib_relo_check_dt_needed_order_1.cpp"],
1131}
1132
Dimitry Ivanova36e59b2016-09-01 11:37:39 -07001133cc_test_library {
Colin Cross2722ebb2016-07-11 16:20:06 -07001134 name: "libtest_relo_check_dt_needed_order_2",
1135 defaults: ["bionic_testlib_defaults"],
1136 srcs: ["dlopen_testlib_relo_check_dt_needed_order_2.cpp"],
1137}
1138
1139// -----------------------------------------------------------------------------
1140// Library with dependency used by dlfcn tests
1141// -----------------------------------------------------------------------------
Dan Willemsen4bcfe3c2019-04-19 14:55:34 -07001142cc_test_library {
1143 name: "libtest_with_dependency",
1144 defaults: ["bionic_testlib_defaults"],
1145 srcs: ["dlopen_testlib_simple.cpp"],
1146 shared_libs: ["libdlext_test"],
1147}
Colin Cross2722ebb2016-07-11 16:20:06 -07001148
1149// -----------------------------------------------------------------------------
1150// Library used by ifunc tests
1151// -----------------------------------------------------------------------------
Dimitry Ivanova36e59b2016-09-01 11:37:39 -07001152cc_test_library {
Colin Cross2722ebb2016-07-11 16:20:06 -07001153 name: "libtest_ifunc",
1154 defaults: ["bionic_testlib_defaults"],
Dimitry Ivanov21975b22017-05-02 16:31:56 -07001155 srcs: ["dlopen_testlib_ifunc.cpp"],
Dimitry Ivanov21975b22017-05-02 16:31:56 -07001156}
1157
1158cc_test_library {
1159 name: "libtest_ifunc_variable",
1160 defaults: ["bionic_testlib_defaults"],
1161 srcs: ["dlopen_testlib_ifunc_variable.cpp"],
Elliott Hughesd50a1de2018-02-05 17:30:57 -08001162 shared_libs: ["libtest_ifunc_variable_impl"],
Dimitry Ivanov21975b22017-05-02 16:31:56 -07001163}
1164
1165cc_test_library {
1166 name: "libtest_ifunc_variable_impl",
1167 defaults: ["bionic_testlib_defaults"],
1168 srcs: ["dlopen_testlib_ifunc_variable_impl.cpp"],
Colin Cross2722ebb2016-07-11 16:20:06 -07001169}
1170
1171// -----------------------------------------------------------------------------
1172// Library used by atexit tests
1173// -----------------------------------------------------------------------------
1174
Dimitry Ivanova36e59b2016-09-01 11:37:39 -07001175cc_test_library {
Colin Cross2722ebb2016-07-11 16:20:06 -07001176 name: "libtest_atexit",
1177 defaults: ["bionic_testlib_defaults"],
1178 srcs: ["atexit_testlib.cpp"],
1179}
1180
1181// -----------------------------------------------------------------------------
1182// This library is used by dl_load test to check symbol preempting
1183// by main executable
1184// -----------------------------------------------------------------------------
Dimitry Ivanova36e59b2016-09-01 11:37:39 -07001185cc_test_library {
Colin Cross2722ebb2016-07-11 16:20:06 -07001186 name: "libdl_preempt_test_1",
1187 defaults: ["bionic_testlib_defaults"],
1188 srcs: ["dl_preempt_library_1.cpp"],
1189}
1190
1191// -----------------------------------------------------------------------------
1192// This library is used by dl_load test to check symbol preempting
1193// by libdl_preempt_test_1.so
1194// -----------------------------------------------------------------------------
Dimitry Ivanova36e59b2016-09-01 11:37:39 -07001195cc_test_library {
Colin Cross2722ebb2016-07-11 16:20:06 -07001196 name: "libdl_preempt_test_2",
1197 defaults: ["bionic_testlib_defaults"],
1198 srcs: ["dl_preempt_library_2.cpp"],
1199}
1200
1201// -----------------------------------------------------------------------------
1202// Library with DF_1_GLOBAL
1203// -----------------------------------------------------------------------------
Dimitry Ivanova36e59b2016-09-01 11:37:39 -07001204cc_test_library {
Colin Cross2722ebb2016-07-11 16:20:06 -07001205 name: "libdl_test_df_1_global",
1206 defaults: ["bionic_testlib_defaults"],
1207 srcs: ["dl_df_1_global.cpp"],
1208 ldflags: ["-Wl,-z,global"],
Colin Cross2722ebb2016-07-11 16:20:06 -07001209}
1210
1211// -----------------------------------------------------------------------------
1212// Library using symbol from libdl_test_df_1_global
1213// -----------------------------------------------------------------------------
Dimitry Ivanova36e59b2016-09-01 11:37:39 -07001214cc_test_library {
Colin Cross2722ebb2016-07-11 16:20:06 -07001215 name: "libtest_dlsym_df_1_global",
1216 defaults: ["bionic_testlib_defaults"],
1217 srcs: ["dl_df_1_use_global.cpp"],
1218}
1219
1220// -----------------------------------------------------------------------------
Jiyong Park01162f22017-10-16 15:31:09 +09001221// Library with DF_1_GLOBAL which will be dlopened
1222// (note: libdl_test_df_1_global above will be included in DT_NEEDED)
1223// -----------------------------------------------------------------------------
1224cc_test_library {
1225 name: "libtest_dlopen_df_1_global",
1226 defaults: ["bionic_testlib_defaults"],
1227 srcs: ["dl_df_1_global_dummy.cpp"],
1228 ldflags: ["-Wl,-z,global"],
Jiyong Park01162f22017-10-16 15:31:09 +09001229}
1230
Jiyong Park01162f22017-10-16 15:31:09 +09001231// -----------------------------------------------------------------------------
Colin Cross2722ebb2016-07-11 16:20:06 -07001232// Library with weak function
1233// -----------------------------------------------------------------------------
Dimitry Ivanova36e59b2016-09-01 11:37:39 -07001234cc_test_library {
Colin Cross2722ebb2016-07-11 16:20:06 -07001235 name: "libtest_dlsym_weak_func",
1236 defaults: ["bionic_testlib_defaults"],
1237 srcs: ["dlsym_weak_function.cpp"],
1238}
1239
1240// -----------------------------------------------------------------------------
1241// Library to check RTLD_LOCAL with dlsym in 'this'
1242// -----------------------------------------------------------------------------
Dimitry Ivanova36e59b2016-09-01 11:37:39 -07001243cc_test_library {
Colin Cross2722ebb2016-07-11 16:20:06 -07001244 name: "libtest_dlsym_from_this",
1245 defaults: ["bionic_testlib_defaults"],
1246 srcs: ["dlsym_from_this_symbol.cpp"],
1247 shared_libs: ["libtest_dlsym_from_this_child"],
Colin Cross2722ebb2016-07-11 16:20:06 -07001248}
1249
1250// -----------------------------------------------------------------------------
Dimitry Ivanova36e59b2016-09-01 11:37:39 -07001251cc_test_library {
Colin Cross2722ebb2016-07-11 16:20:06 -07001252 name: "libtest_dlsym_from_this_child",
1253 defaults: ["bionic_testlib_defaults"],
1254 srcs: ["dlsym_from_this_functions.cpp"],
1255 shared_libs: ["libtest_dlsym_from_this_grandchild"],
1256}
1257
1258// -----------------------------------------------------------------------------
Dimitry Ivanova36e59b2016-09-01 11:37:39 -07001259cc_test_library {
Colin Cross2722ebb2016-07-11 16:20:06 -07001260 name: "libtest_dlsym_from_this_grandchild",
1261 defaults: ["bionic_testlib_defaults"],
1262 srcs: ["dlsym_from_this_symbol2.cpp"],
1263}
1264
1265// -----------------------------------------------------------------------------
1266// Empty library
1267// -----------------------------------------------------------------------------
Dimitry Ivanova36e59b2016-09-01 11:37:39 -07001268cc_test_library {
Colin Cross2722ebb2016-07-11 16:20:06 -07001269 name: "libtest_empty",
1270 defaults: ["bionic_testlib_defaults"],
1271 srcs: ["empty.cpp"],
1272}
1273
1274// -----------------------------------------------------------------------------
dimitry8db36a52017-10-23 15:10:10 +02001275// Library for inaccessible shared library test
1276// -----------------------------------------------------------------------------
1277cc_test_library {
1278 name: "libtestshared",
1279 defaults: ["bionic_testlib_defaults"],
1280 srcs: ["empty.cpp"],
Nan Zhangdab0fd52017-11-07 11:05:24 -08001281 relative_install_path: "bionic-loader-test-libs/inaccessible_libs",
dimitry8db36a52017-10-23 15:10:10 +02001282}
1283
1284// -----------------------------------------------------------------------------
Colin Cross2722ebb2016-07-11 16:20:06 -07001285// Library with weak undefined function
1286// -----------------------------------------------------------------------------
Dimitry Ivanova36e59b2016-09-01 11:37:39 -07001287cc_test_library {
Colin Cross2722ebb2016-07-11 16:20:06 -07001288 name: "libtest_dlopen_weak_undefined_func",
1289 defaults: ["bionic_testlib_defaults"],
1290 srcs: ["dlopen_weak_undefined.cpp"],
1291}
1292
1293// -----------------------------------------------------------------------------
Dimitry Ivanovd0b5c3a2016-11-25 12:23:11 -08001294// Check that RTLD_NEXT of a libc symbol works in dlopened library
1295// -----------------------------------------------------------------------------
1296cc_test_library {
1297 name: "libtest_check_rtld_next_from_library",
1298 defaults: ["bionic_testlib_defaults"],
1299 srcs: ["check_rtld_next_from_library.cpp"],
Pirama Arumuga Nainar8035caa2020-06-09 12:48:10 -07001300 native_coverage: false,
Dimitry Ivanovd0b5c3a2016-11-25 12:23:11 -08001301}
1302
1303// -----------------------------------------------------------------------------
Colin Cross2722ebb2016-07-11 16:20:06 -07001304// Library with constructor that calls dlopen() b/7941716
1305// -----------------------------------------------------------------------------
Dimitry Ivanova36e59b2016-09-01 11:37:39 -07001306cc_test_library {
Colin Cross2722ebb2016-07-11 16:20:06 -07001307 name: "libtest_dlopen_from_ctor",
1308 defaults: ["bionic_testlib_defaults"],
1309 srcs: ["dlopen_testlib_dlopen_from_ctor.cpp"],
Colin Cross2722ebb2016-07-11 16:20:06 -07001310}
1311
1312// -----------------------------------------------------------------------------
Dimitry Ivanovec90e242017-02-10 11:04:20 -08001313// Libraries used to check init/fini call order
Dimitry Ivanovea8f3962017-02-09 13:31:57 -08001314// -----------------------------------------------------------------------------
1315cc_test_library {
1316 name: "libtest_init_fini_order_root",
1317 defaults: ["bionic_testlib_defaults"],
1318 srcs: ["dlopen_check_init_fini_root.cpp"],
Dimitry Ivanovec90e242017-02-10 11:04:20 -08001319 shared_libs: [
1320 "libtest_init_fini_order_child",
1321 "libtest_init_fini_order_grand_child",
1322 ],
1323}
1324
1325cc_test_library {
1326 name: "libtest_init_fini_order_root2",
1327 defaults: ["bionic_testlib_defaults"],
1328 srcs: ["dlopen_check_init_fini_root.cpp"],
1329 shared_libs: [
1330 "libtest_init_fini_order_grand_child",
1331 "libtest_init_fini_order_child",
1332 ],
Dimitry Ivanovea8f3962017-02-09 13:31:57 -08001333}
1334
1335cc_test_library {
1336 name: "libtest_init_fini_order_child",
1337 defaults: ["bionic_testlib_defaults"],
1338 srcs: ["dlopen_check_init_fini_child.cpp"],
1339 shared_libs: ["libtest_init_fini_order_grand_child"],
1340}
1341
1342cc_test_library {
1343 name: "libtest_init_fini_order_grand_child",
1344 defaults: ["bionic_testlib_defaults"],
1345 srcs: ["dlopen_check_init_fini_grand_child.cpp"],
1346}
1347
1348// -----------------------------------------------------------------------------
Colin Cross2722ebb2016-07-11 16:20:06 -07001349// Library that depends on the library with constructor that calls dlopen() b/7941716
1350// -----------------------------------------------------------------------------
Dimitry Ivanova36e59b2016-09-01 11:37:39 -07001351cc_test_library {
Colin Cross2722ebb2016-07-11 16:20:06 -07001352 name: "libtest_dlopen_from_ctor_main",
1353 defaults: ["bionic_testlib_defaults"],
1354 srcs: ["empty.cpp"],
1355 shared_libs: ["libtest_dlopen_from_ctor"],
1356}
1357
1358// -----------------------------------------------------------------------------
dimitry55547db2018-05-25 14:17:37 +02001359// Libraries with non-trivial thread_local variable to test dlclose()
dimitry06016f22018-01-05 11:39:28 +01001360// -----------------------------------------------------------------------------
1361cc_test_library {
1362 name: "libtest_thread_local_dtor",
1363 defaults: ["bionic_testlib_defaults"],
1364 srcs: ["thread_local_dtor.cpp"],
1365}
1366
dimitry55547db2018-05-25 14:17:37 +02001367cc_test_library {
1368 name: "libtest_thread_local_dtor2",
1369 defaults: ["bionic_testlib_defaults"],
1370 srcs: ["thread_local_dtor2.cpp"],
1371}
1372
1373// -----------------------------------------------------------------------------
1374// Library dt_needs libtest_thread_local_dtor/2 (to check no-unload on load_group)
1375// -----------------------------------------------------------------------------
1376cc_test_library {
1377 name: "libtest_indirect_thread_local_dtor",
1378 defaults: ["bionic_testlib_defaults"],
1379 srcs: ["empty.cpp"],
1380 shared_libs: [
1381 "libtest_thread_local_dtor",
1382 "libtest_thread_local_dtor2",
1383 ],
1384}
1385
dimitry06016f22018-01-05 11:39:28 +01001386// -----------------------------------------------------------------------------
Colin Cross2722ebb2016-07-11 16:20:06 -07001387// Tool to use to align the shared libraries in a zip file.
1388// -----------------------------------------------------------------------------
1389cc_binary_host {
1390 name: "bionic_tests_zipalign",
1391 srcs: ["bionic_tests_zipalign.cpp"],
1392 cflags: [
1393 "-Wall",
1394 "-Werror",
1395 ],
1396
1397 static_libs: [
1398 "libziparchive",
1399 "liblog",
1400 "libbase",
1401 "libz",
1402 "libutils",
1403 ],
Colin Cross2722ebb2016-07-11 16:20:06 -07001404}
Evgenii Stepanov0a3637d2016-07-06 13:20:59 -07001405
1406cc_test_library {
1407 name: "libcfi-test",
1408 defaults: ["bionic_testlib_defaults"],
1409 srcs: ["cfi_test_lib.cpp"],
1410 sanitize: {
1411 cfi: false,
1412 },
1413}
1414
1415cc_test_library {
1416 name: "libcfi-test-bad",
1417 defaults: ["bionic_testlib_defaults"],
1418 srcs: ["cfi_test_bad_lib.cpp"],
1419 sanitize: {
1420 cfi: false,
1421 },
1422}
Evgenii Stepanov68ecec12017-01-31 13:19:30 -08001423
1424cc_test {
1425 name: "cfi_test_helper",
1426 host_supported: false,
1427 defaults: ["bionic_testlib_defaults"],
1428 srcs: ["cfi_test_helper.cpp"],
1429 ldflags: ["-rdynamic"],
1430}
1431
1432cc_test {
1433 name: "cfi_test_helper2",
1434 host_supported: false,
1435 defaults: ["bionic_testlib_defaults"],
1436 srcs: ["cfi_test_helper2.cpp"],
1437 shared_libs: ["libcfi-test"],
1438 ldflags: ["-Wl,--rpath,${ORIGIN}/.."],
1439}
Elliott Hugheseb04ed52017-03-29 13:48:02 -07001440
1441cc_test {
1442 name: "preinit_getauxval_test_helper",
1443 host_supported: false,
1444 defaults: ["bionic_testlib_defaults"],
1445 srcs: ["preinit_getauxval_test_helper.cpp"],
1446}
1447
1448cc_test {
1449 name: "preinit_syscall_test_helper",
1450 host_supported: false,
1451 defaults: ["bionic_testlib_defaults"],
1452 srcs: ["preinit_syscall_test_helper.cpp"],
1453}
Jiyong Park02586a22017-05-20 01:01:24 +09001454
1455cc_test {
1456 name: "ld_preload_test_helper",
1457 host_supported: false,
1458 defaults: ["bionic_testlib_defaults"],
1459 srcs: ["ld_preload_test_helper.cpp"],
1460 shared_libs: ["ld_preload_test_helper_lib1"],
1461 ldflags: ["-Wl,--rpath,${ORIGIN}/.."],
1462}
1463
1464cc_test_library {
1465 name: "ld_preload_test_helper_lib1",
1466 host_supported: false,
1467 defaults: ["bionic_testlib_defaults"],
1468 srcs: ["ld_preload_test_helper_lib1.cpp"],
1469}
1470
1471cc_test_library {
1472 name: "ld_preload_test_helper_lib2",
1473 host_supported: false,
1474 defaults: ["bionic_testlib_defaults"],
1475 srcs: ["ld_preload_test_helper_lib2.cpp"],
1476}
1477
1478cc_test {
1479 name: "ld_config_test_helper",
1480 host_supported: false,
1481 defaults: ["bionic_testlib_defaults"],
1482 srcs: ["ld_config_test_helper.cpp"],
1483 shared_libs: ["ld_config_test_helper_lib1"],
1484 ldflags: ["-Wl,--rpath,${ORIGIN}/.."],
1485}
1486
1487cc_test_library {
1488 name: "ld_config_test_helper_lib1",
1489 host_supported: false,
1490 defaults: ["bionic_testlib_defaults"],
1491 srcs: ["ld_config_test_helper_lib1.cpp"],
1492 shared_libs: ["ld_config_test_helper_lib2"],
Nan Zhangdab0fd52017-11-07 11:05:24 -08001493 relative_install_path: "bionic-loader-test-libs/ns2",
Ryan Prichard058eb8f2020-12-17 22:59:04 -08001494 // Mark the library DF_1_GLOBAL so it is added to every linker namespace.
Elliott Hughes1eacc0e2024-01-19 19:05:36 +00001495 ldflags: ["-Wl,-z,global"],
Jiyong Park02586a22017-05-20 01:01:24 +09001496}
1497
1498cc_test_library {
1499 name: "ld_config_test_helper_lib2",
1500 host_supported: false,
1501 defaults: ["bionic_testlib_defaults"],
1502 srcs: ["ld_config_test_helper_lib2.cpp"],
Nan Zhangdab0fd52017-11-07 11:05:24 -08001503 relative_install_path: "bionic-loader-test-libs/ns2",
Jiyong Park02586a22017-05-20 01:01:24 +09001504}
1505
1506cc_test_library {
1507 name: "ld_config_test_helper_lib3",
1508 host_supported: false,
1509 defaults: ["bionic_testlib_defaults"],
1510 srcs: ["ld_config_test_helper_lib3.cpp"],
1511}
Ryan Prichard8f639a42018-10-01 23:10:05 -07001512
1513cc_test {
1514 name: "exec_linker_helper",
1515 host_supported: false,
1516 defaults: ["bionic_testlib_defaults"],
1517 srcs: ["exec_linker_helper.cpp"],
1518 shared_libs: ["exec_linker_helper_lib"],
1519 ldflags: ["-Wl,--rpath,${ORIGIN}/.."],
1520}
1521
1522cc_test_library {
1523 name: "exec_linker_helper_lib",
1524 host_supported: false,
1525 defaults: ["bionic_testlib_defaults"],
1526 srcs: ["exec_linker_helper_lib.cpp"],
1527}
Peter Collingbourneb39cb3c2019-03-01 13:12:49 -08001528
1529cc_test_library {
1530 name: "libsegment_gap_outer",
1531 host_supported: false,
1532 defaults: ["bionic_testlib_defaults"],
1533 srcs: ["segment_gap_outer.cpp"],
1534 ldflags: ["-Wl,-T,bionic/tests/libs/segment_gap_outer.lds"],
1535}
1536
1537cc_test_library {
1538 name: "libsegment_gap_inner",
1539 host_supported: false,
1540 defaults: ["bionic_testlib_defaults"],
1541 srcs: ["segment_gap_inner.cpp"],
1542}
Elliott Hughes6663f552020-01-24 14:36:10 -08001543
Elliott Hughes6663f552020-01-24 14:36:10 -08001544// -----------------------------------------------------------------------------
Elliott Hughes6dd1f582020-01-28 12:18:35 -08001545// Check that we support all kinds of relocations: regular, "relocation packer",
1546// and both the old and new SHT_RELR constants.
Elliott Hughes6663f552020-01-24 14:36:10 -08001547// -----------------------------------------------------------------------------
1548
Elliott Hughes6dd1f582020-01-28 12:18:35 -08001549// This is what got standardized for SHT_RELR.
Elliott Hughes6663f552020-01-24 14:36:10 -08001550cc_test_library {
Elliott Hughes6dd1f582020-01-28 12:18:35 -08001551 name: "librelocations-RELR",
1552 ldflags: [
1553 "-Wl,--pack-dyn-relocs=relr",
1554 "-Wl,--no-use-android-relr-tags",
1555 ],
Elliott Hughes6663f552020-01-24 14:36:10 -08001556 host_supported: false,
1557 defaults: ["bionic_testlib_defaults"],
Elliott Hughes6dd1f582020-01-28 12:18:35 -08001558 srcs: ["relocations.cpp"],
Elliott Hughes6663f552020-01-24 14:36:10 -08001559}
1560
Elliott Hughes6dd1f582020-01-28 12:18:35 -08001561// This is the same encoding as SHT_RELR, but using OS-specific constants.
Elliott Hughes6663f552020-01-24 14:36:10 -08001562cc_test_library {
Elliott Hughes6dd1f582020-01-28 12:18:35 -08001563 name: "librelocations-ANDROID_RELR",
1564 ldflags: [
1565 "-Wl,--pack-dyn-relocs=relr",
1566 "-Wl,--use-android-relr-tags",
1567 ],
Elliott Hughes6663f552020-01-24 14:36:10 -08001568 host_supported: false,
1569 defaults: ["bionic_testlib_defaults"],
Elliott Hughes6dd1f582020-01-28 12:18:35 -08001570 srcs: ["relocations.cpp"],
1571}
1572
1573// This is the old relocation packer encoding (DT_ANDROID_REL/DT_ANDROID_RELA).
1574cc_test_library {
1575 name: "librelocations-ANDROID_REL",
1576 ldflags: ["-Wl,--pack-dyn-relocs=android"],
1577 host_supported: false,
1578 defaults: ["bionic_testlib_defaults"],
1579 srcs: ["relocations.cpp"],
1580}
1581
1582// This is not packed at all.
1583cc_test_library {
1584 name: "librelocations-fat",
1585 ldflags: ["-Wl,--pack-dyn-relocs=none"],
1586 host_supported: false,
1587 defaults: ["bionic_testlib_defaults"],
1588 srcs: ["relocations.cpp"],
Elliott Hughes6663f552020-01-24 14:36:10 -08001589}
Evgenii Stepanov51741fb2021-01-06 16:03:15 -08001590
1591cc_defaults {
Elliott Hughes1eacc0e2024-01-19 19:05:36 +00001592 name: "bionic_targets_only",
1593 enabled: false,
1594 target: {
1595 android: {
1596 enabled: true,
1597 },
1598 linux_bionic: {
1599 enabled: true,
1600 },
1601 },
Evgenii Stepanov51741fb2021-01-06 16:03:15 -08001602}
1603
1604cc_test {
Elliott Hughes1eacc0e2024-01-19 19:05:36 +00001605 name: "heap_tagging_sync_helper",
1606 defaults: [
1607 "bionic_testlib_defaults",
1608 "bionic_targets_only",
1609 ],
1610 srcs: ["heap_tagging_helper.cpp"],
1611 sanitize: {
1612 memtag_heap: true,
1613 diag: {
1614 memtag_heap: true,
1615 },
1616 hwaddress: false,
1617 },
Evgenii Stepanov51741fb2021-01-06 16:03:15 -08001618}
1619
1620cc_test {
Elliott Hughes1eacc0e2024-01-19 19:05:36 +00001621 name: "heap_tagging_async_helper",
1622 defaults: [
1623 "bionic_testlib_defaults",
1624 "bionic_targets_only",
1625 ],
1626 srcs: ["heap_tagging_helper.cpp"],
1627 sanitize: {
1628 memtag_heap: true,
1629 diag: {
1630 memtag_heap: false,
1631 },
1632 hwaddress: false,
1633 },
Evgenii Stepanov51741fb2021-01-06 16:03:15 -08001634}
1635
1636cc_test {
Elliott Hughes1eacc0e2024-01-19 19:05:36 +00001637 name: "heap_tagging_disabled_helper",
1638 defaults: [
1639 "bionic_testlib_defaults",
1640 "bionic_targets_only",
1641 ],
1642 srcs: ["heap_tagging_helper.cpp"],
1643 sanitize: {
1644 memtag_heap: false,
1645 hwaddress: false,
1646 },
Evgenii Stepanov51741fb2021-01-06 16:03:15 -08001647}
1648
1649cc_test {
Elliott Hughes1eacc0e2024-01-19 19:05:36 +00001650 name: "heap_tagging_static_sync_helper",
1651 defaults: [
1652 "bionic_testlib_defaults",
1653 "bionic_targets_only",
1654 ],
1655 srcs: ["heap_tagging_helper.cpp"],
1656 static_executable: true,
1657 sanitize: {
1658 memtag_heap: true,
1659 diag: {
1660 memtag_heap: true,
1661 },
1662 hwaddress: false,
1663 },
Evgenii Stepanov51741fb2021-01-06 16:03:15 -08001664}
1665
1666cc_test {
Elliott Hughes1eacc0e2024-01-19 19:05:36 +00001667 name: "heap_tagging_static_async_helper",
1668 defaults: [
1669 "bionic_testlib_defaults",
1670 "bionic_targets_only",
1671 ],
1672 srcs: ["heap_tagging_helper.cpp"],
1673 static_executable: true,
1674 sanitize: {
1675 memtag_heap: true,
1676 diag: {
1677 memtag_heap: false,
1678 },
1679 hwaddress: false,
1680 },
Evgenii Stepanov51741fb2021-01-06 16:03:15 -08001681}
1682
1683cc_test {
Elliott Hughes1eacc0e2024-01-19 19:05:36 +00001684 name: "heap_tagging_static_disabled_helper",
1685 defaults: [
1686 "bionic_testlib_defaults",
1687 "bionic_targets_only",
1688 ],
1689 srcs: ["heap_tagging_helper.cpp"],
1690 static_executable: true,
1691 sanitize: {
1692 memtag_heap: false,
1693 hwaddress: false,
1694 },
Evgenii Stepanov51741fb2021-01-06 16:03:15 -08001695}
Colin Crossbadcb382021-09-24 17:49:58 -07001696
Florian Mayerc82d7fc2022-08-31 20:57:03 +00001697cc_test {
Elliott Hughes1eacc0e2024-01-19 19:05:36 +00001698 name: "stack_tagging_helper",
1699 defaults: [
1700 "bionic_testlib_defaults",
1701 "bionic_targets_only",
1702 ],
1703 srcs: ["stack_tagging_helper.cpp"],
1704 sanitize: {
1705 memtag_heap: true,
1706 memtag_stack: true,
1707 diag: {
1708 memtag_heap: true,
1709 },
1710 hwaddress: false,
1711 },
1712 header_libs: ["bionic_libc_platform_headers"],
1713 cflags: ["-fexceptions"],
Florian Mayerc82d7fc2022-08-31 20:57:03 +00001714}
1715
1716cc_test {
Elliott Hughes1eacc0e2024-01-19 19:05:36 +00001717 name: "stack_tagging_static_helper",
1718 defaults: [
1719 "bionic_testlib_defaults",
1720 "bionic_targets_only",
1721 ],
1722 srcs: ["stack_tagging_helper.cpp"],
1723 static_executable: true,
1724 sanitize: {
1725 memtag_heap: true,
1726 memtag_stack: true,
1727 diag: {
1728 memtag_heap: true,
1729 },
1730 hwaddress: false,
1731 },
1732 header_libs: ["bionic_libc_platform_headers"],
1733 cflags: ["-fexceptions"],
Florian Mayerc82d7fc2022-08-31 20:57:03 +00001734}
1735
Colin Crossbadcb382021-09-24 17:49:58 -07001736cc_genrule {
1737 name: "libdlext_test_zip_zipaligned",
Elliott Hughes1eacc0e2024-01-19 19:05:36 +00001738 out: ["bionic-loader-test-libs/libdlext_test_zip/libdlext_test_zip_zipaligned.zip"],
Colin Crossbadcb382021-09-24 17:49:58 -07001739 tools: [
1740 "soong_zip",
1741 "bionic_tests_zipalign",
1742 ],
1743 srcs: [
1744 ":libdlext_test_zip",
1745 ":libatest_simple_zip",
1746 ":exec_linker_helper",
1747 ":exec_linker_helper_lib",
1748 ],
1749 cmd: "mkdir -p $(genDir)/zipdir/libdir &&" +
1750 " cp $(in) $(genDir)/zipdir/libdir/ &&" +
1751 " touch $(genDir)/zipdir/empty_file.txt &&" +
1752 " $(location soong_zip) -o $(out).unaligned -L 0 -C $(genDir)/zipdir -D $(genDir)/zipdir &&" +
1753 " $(location bionic_tests_zipalign) 4096 $(out).unaligned $(out)",
1754
Colin Crossbadcb382021-09-24 17:49:58 -07001755}
1756
1757cc_genrule {
1758 name: "libdlext_test_runpath_zip_zipaligned",
1759 out: ["bionic-loader-test-libs/libdlext_test_runpath_zip/libdlext_test_runpath_zip_zipaligned.zip"],
1760 tools: [
1761 "soong_zip",
1762 "bionic_tests_zipalign",
1763 ],
1764 srcs: [
1765 ":libtest_dt_runpath_d_zip",
1766 ":libtest_dt_runpath_a",
1767 ":libtest_dt_runpath_b",
1768 ":libtest_dt_runpath_c",
1769 ":libtest_dt_runpath_x",
1770 ":libtest_dt_runpath_y",
1771 ],
1772 cmd: "mkdir -p $(genDir)/zipdir/libdir &&" +
1773 " if [[ \"$$CC_MULTILIB\" = lib32 ]]; then" +
1774 " PRIVATE_LIB_OR_LIB64=lib;" +
1775 " else" +
1776 " PRIVATE_LIB_OR_LIB64=lib64;" +
1777 " fi &&" +
1778 " if [[ -n \"$$CC_NATIVE_BRIDGE\" ]]; then" +
1779 " PRIVATE_LIB_OR_LIB64=$$PRIVATE_LIB_OR_LIB64/$$CC_NATIVE_BRIDGE;" +
1780 " fi &&" +
1781 " mkdir -p $(genDir)/zipdir/libdir/dt_runpath_a &&" +
1782 " mkdir -p $(genDir)/zipdir/libdir/dt_runpath_b_c_x &&" +
1783 " mkdir -p $(genDir)/zipdir/libdir/dt_runpath_y/$$PRIVATE_LIB_OR_LIB64 &&" +
1784 " cp $(location :libtest_dt_runpath_d_zip) $(genDir)/zipdir/libdir &&" +
1785 " cp $(location :libtest_dt_runpath_a) $(genDir)/zipdir/libdir/dt_runpath_a &&" +
1786 " cp $(location :libtest_dt_runpath_b) $(genDir)/zipdir/libdir/dt_runpath_b_c_x &&" +
1787 " cp $(location :libtest_dt_runpath_c) $(genDir)/zipdir/libdir/dt_runpath_b_c_x &&" +
1788 " cp $(location :libtest_dt_runpath_x) $(genDir)/zipdir/libdir/dt_runpath_b_c_x &&" +
1789 " cp $(location :libtest_dt_runpath_y) $(genDir)/zipdir/libdir/dt_runpath_y/$$PRIVATE_LIB_OR_LIB64 &&" +
1790 " touch $(genDir)/zipdir/empty_file.txt &&" +
1791 " $(location soong_zip) -o $(out).unaligned -L 0 -C $(genDir)/zipdir -D $(genDir)/zipdir &&" +
1792 " $(location bionic_tests_zipalign) 4096 $(out).unaligned $(out)",
Colin Crossbadcb382021-09-24 17:49:58 -07001793}