diff --git a/cross/ownstdlib.txt b/cross/ownstdlib.txt new file mode 100644 index 000000000..46e99f7a6 --- /dev/null +++ b/cross/ownstdlib.txt @@ -0,0 +1,13 @@ +# This is a setup for compiling a program that runs natively +# but uses a custom std lib. This test will only work on +# x86_64. + +[target_machine] +system = 'linux' +cpu_family = 'x86_64' +cpu = 'x86_64' +endian = 'little' + +[properties] + +c_stdlib = ['mylibc', 'mylibc_dep'] # Subproject name, dependency name diff --git a/test cases/ownstdlib/1 libc/meson.build b/manual tests/9 nostdlib/meson.build similarity index 50% rename from test cases/ownstdlib/1 libc/meson.build rename to manual tests/9 nostdlib/meson.build index 1151926ea..ad5b7b9ba 100644 --- a/test cases/ownstdlib/1 libc/meson.build +++ b/manual tests/9 nostdlib/meson.build @@ -2,17 +2,13 @@ project('own libc', 'c') # A simple project that uses its own libc. -# Start with manual flags to compile, then add platform support. - -libc = static_library('c', 'libc.c', 'stubstart.s', - c_args : '-nostdlib', - link_args : '-nostdlib', -) +libc_proj = subproject('mylibc') +libc_dep = libc_proj.get_variable('mylibc_dep') exe = executable('selfcontained', 'prog.c', c_args : '-nostdlib', link_args : '-nostdlib', - link_with : libc, + dependencies : libc_dep, ) test('standalone test', exe) diff --git a/test cases/ownstdlib/1 libc/prog.c b/manual tests/9 nostdlib/prog.c similarity index 100% rename from test cases/ownstdlib/1 libc/prog.c rename to manual tests/9 nostdlib/prog.c diff --git a/test cases/ownstdlib/1 libc/libc.c b/manual tests/9 nostdlib/subprojects/mylibc/libc.c similarity index 100% rename from test cases/ownstdlib/1 libc/libc.c rename to manual tests/9 nostdlib/subprojects/mylibc/libc.c diff --git a/manual tests/9 nostdlib/subprojects/mylibc/meson.build b/manual tests/9 nostdlib/subprojects/mylibc/meson.build new file mode 100644 index 000000000..9d1fed8cf --- /dev/null +++ b/manual tests/9 nostdlib/subprojects/mylibc/meson.build @@ -0,0 +1,12 @@ +project('own libc', 'c') + +# A very simple libc implementation + +# Start with manual flags to compile, then add platform support. + +libc = static_library('c', 'libc.c', 'stubstart.s', +) + +mylibc_dep = declare_dependency(link_with : libc, + include_directories : include_directories('.') +) diff --git a/test cases/ownstdlib/1 libc/stdio.h b/manual tests/9 nostdlib/subprojects/mylibc/stdio.h similarity index 100% rename from test cases/ownstdlib/1 libc/stdio.h rename to manual tests/9 nostdlib/subprojects/mylibc/stdio.h diff --git a/test cases/ownstdlib/1 libc/stubstart.s b/manual tests/9 nostdlib/subprojects/mylibc/stubstart.s similarity index 100% rename from test cases/ownstdlib/1 libc/stubstart.s rename to manual tests/9 nostdlib/subprojects/mylibc/stubstart.s