55 lines
1.1 KiB
Meson
55 lines
1.1 KiB
Meson
vdso_c_args = [
|
|
'-ffreestanding',
|
|
'-fno-stack-protector',
|
|
'-fno-omit-frame-pointer',
|
|
'-fPIE',
|
|
'-fPIC',
|
|
'-nostdinc',
|
|
'-DIN_VDSO',
|
|
]
|
|
|
|
vdso_lds = meson.current_source_dir() / 'vdso.ld'
|
|
|
|
vdso_link_args = [
|
|
'-ffreestanding',
|
|
'-nostdlib',
|
|
'-static',
|
|
'-T' + vdso_lds,
|
|
]
|
|
|
|
# Build a shared library, which we are going to embed next.
|
|
# TODO: We need to ensure there are no relocations inside the vDSO.
|
|
real_vdso = shared_library(
|
|
'zinnia-vdso',
|
|
name_prefix: '',
|
|
c_args: vdso_c_args,
|
|
include_directories: [
|
|
common_includes,
|
|
kernel_includes,
|
|
],
|
|
link_args: vdso_link_args,
|
|
link_depends: vdso_lds,
|
|
sources: [
|
|
'archctl.c',
|
|
'channel.c',
|
|
'data.c',
|
|
'futex.c',
|
|
'handle.c',
|
|
'mem.c',
|
|
'namespace.c',
|
|
'random.c',
|
|
'status.c',
|
|
'system.c',
|
|
'thread.c',
|
|
],
|
|
)
|
|
|
|
vdso = custom_target(
|
|
command: [find_program('cp'), '@INPUT@', '@OUTPUT@'],
|
|
input: real_vdso,
|
|
output: 'vdso.bin',
|
|
)
|
|
|
|
# Tell the kernel where the built binary lives so we can #embed it.
|
|
kernel_c_args += ['-DVDSO_PATH="' + vdso.full_path() + '"']
|