Skip to content

Commit

Permalink
Build the vdso with a custom target
Browse files Browse the repository at this point in the history
This allows compiling the project but not the vdso with things like asan or afl.
  • Loading branch information
tbodt committed Oct 13, 2017
1 parent 605f923 commit a80c109
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
3 changes: 3 additions & 0 deletions meson_options.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,5 @@
option('log', type: 'string', value: '')
option('nolog', type: 'string', value: '')

option('vdso_cc', type: 'string', value: 'cc')
option('vdso_c_args', type: 'string', value: '')
10 changes: 7 additions & 3 deletions vdso/meson.build
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
# the vdso
vdso = shared_library('vdso', ['vdso.S', 'vdso.c', 'note.S'], c_args: ['-m32'],
link_args: ['-m32', '-nostdlib', '-Wl,-T,../vdso/vdso.lds'],
link_depends: ['vdso.lds'])
# I can't use shared_library for this because then I have to use the same
# compiler and options as the rest of the project which prevents me from using
# sanitizers and afl
vdso = custom_target('vdso', input: ['vdso.S', 'vdso.c'], output: 'libvdso.so',
command: [get_option('vdso_cc'), '-o', '@OUTPUT@', '@INPUT@',
'-m32', '-nostdlib', '-Wl,-T,../vdso/vdso.lds', '-shared', '-fPIC']
+ get_option('vdso_c_args').split())

0 comments on commit a80c109

Please sign in to comment.