aboutsummaryrefslogtreecommitdiff
path: root/lib/mlibc/tests/rtdl/meson.build
diff options
context:
space:
mode:
authorIan Moffett <ian@osmora.org>2024-03-07 17:28:00 -0500
committerIan Moffett <ian@osmora.org>2024-03-07 17:28:32 -0500
commitbd5969fc876a10b18613302db7087ef3c40f18e1 (patch)
tree7c2b8619afe902abf99570df2873fbdf40a4d1a1 /lib/mlibc/tests/rtdl/meson.build
parenta95b38b1b92b172e6cc4e8e56a88a30cc65907b0 (diff)
lib: Add mlibc
Signed-off-by: Ian Moffett <ian@osmora.org>
Diffstat (limited to 'lib/mlibc/tests/rtdl/meson.build')
-rw-r--r--lib/mlibc/tests/rtdl/meson.build56
1 files changed, 56 insertions, 0 deletions
diff --git a/lib/mlibc/tests/rtdl/meson.build b/lib/mlibc/tests/rtdl/meson.build
new file mode 100644
index 0000000..1331899
--- /dev/null
+++ b/lib/mlibc/tests/rtdl/meson.build
@@ -0,0 +1,56 @@
+rtdl_test_cases = [
+ 'dl_iterate_phdr',
+ 'dladdr_local',
+ 'ld_library_path',
+ 'noload-promote',
+ 'rtld_next',
+ 'soname',
+ 'preinit',
+ 'scope1',
+ 'scope2',
+ 'scope3',
+ 'scope4',
+ 'scope5',
+ 'tls_align',
+]
+
+foreach test_name : rtdl_test_cases
+ test_rpath = meson.build_root() / 'tests' / 'rtdl' / test_name / ''
+ test_rpath += ':$ORIGIN/' # Workaround old and buggy qemu-user on CI
+
+ test_env = []
+ test_link_with = []
+ test_depends = []
+ test_native_env = []
+ test_native_link_with = []
+ test_native_depends = []
+ test_additional_link_args = []
+
+ # Build the needed DSOs for the test. This sets the variables above.
+ subdir(test_name)
+
+ exec = executable('rtdl-' + test_name, [test_name / 'test.c', test_sources],
+ link_with: test_link_with,
+ dependencies: libc_dep,
+ build_rpath: test_rpath,
+ override_options: test_override_options,
+ c_args: test_c_args,
+ link_args: test_link_args + test_additional_link_args,
+ )
+ test(test_name, exec, env: test_env, suite: 'rtdl', depends: test_depends)
+
+ if build_tests_host_libc and not host_libc_excluded_test_cases.contains(test_name)
+ exec = executable('host-libc-' + test_name, test_name / 'test.c',
+ link_with: test_native_link_with,
+ dependencies: rtlib_deps,
+ build_rpath: test_rpath,
+ # Don't use ASan here, due to a bug that breaks dlopen() + DT_RUNPATH:
+ # https://bugzilla.redhat.com/show_bug.cgi?id=1449604
+ override_options: 'b_sanitize=undefined',
+ c_args: ['-D_GNU_SOURCE', '-DUSE_HOST_LIBC'],
+ link_args: ['-ldl'] + test_additional_link_args,
+ native: true,
+ )
+ test(test_name, exec, env: test_native_env, suite: ['host-libc', 'rtdl'], depends: test_native_depends)
+ endif
+endforeach