Made cstdlib a subproject.

pull/542/head
Jussi Pakkanen 9 years ago
parent 0e469426dd
commit 695aa0b8c2
  1. 13
      cross/ownstdlib.txt
  2. 10
      manual tests/9 nostdlib/meson.build
  3. 0
      manual tests/9 nostdlib/prog.c
  4. 0
      manual tests/9 nostdlib/subprojects/mylibc/libc.c
  5. 12
      manual tests/9 nostdlib/subprojects/mylibc/meson.build
  6. 0
      manual tests/9 nostdlib/subprojects/mylibc/stdio.h
  7. 0
      manual tests/9 nostdlib/subprojects/mylibc/stubstart.s

@ -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

@ -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)

@ -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('.')
)
Loading…
Cancel
Save