tests: Mark compiled resource file as not having an executable stack

As with the previous commit, this isn’t needed for GLib’s tests to work
correctly, but is probably needed in other projects which might be
tempted to copy and paste the Meson tooling from GLib.

Inspired by https://gitlab.gnome.org/GNOME/gtk/-/merge_requests/4330

Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
This commit is contained in:
Philip Withnall 2022-01-26 14:28:46 +00:00
parent 55fa866cc8
commit 9cde484b9f

View File

@ -737,6 +737,7 @@ if not meson.is_cross_build() or meson.has_exe_wrapper()
input : test_gresource_binary, input : test_gresource_binary,
output : 'test_resources.o', output : 'test_resources.o',
command : [ld, command : [ld,
'-z', 'noexecstack',
'-r', '-r',
'-b','binary', '-b','binary',
'@INPUT@', '@INPUT@',
@ -752,6 +753,7 @@ if not meson.is_cross_build() or meson.has_exe_wrapper()
input : test_resources_binary, input : test_resources_binary,
output : 'test_resources2.o', output : 'test_resources2.o',
command : [objcopy, command : [objcopy,
'--strip-all',
'--add-symbol', underscore + '_g_binary_test1_resource_data=.data:0', '--add-symbol', underscore + '_g_binary_test1_resource_data=.data:0',
'@INPUT@', '@INPUT@',
'@OUTPUT@']) '@OUTPUT@'])