demos: Make our stack noexec

This is similar to https://gitlab.gnome.org/GNOME/gtk/-/merge_requests/4330
and https://gitlab.gnome.org/GNOME/gtk/-/merge_requests/4334, which fixed
the main library but missed the demos.
This commit is contained in:
Jan Alexander Steffens (heftig) 2022-02-03 19:14:36 +00:00
parent 06ec4ec148
commit d8befc612f
2 changed files with 8 additions and 0 deletions

View File

@ -170,6 +170,7 @@ if build_machine.system() == 'linux' and objcopy.found() and objcopy_supports_ad
depfile : 'gtkdemo.gresource.d', depfile : 'gtkdemo.gresource.d',
command : [glib_compile_resources, command : [glib_compile_resources,
'--generate', '--generate',
'--internal',
'--target=@OUTPUT@', '--target=@OUTPUT@',
'--dependency-file=@DEPFILE@', '--dependency-file=@DEPFILE@',
'--sourcedir=' + meson.current_source_dir(), '--sourcedir=' + meson.current_source_dir(),
@ -183,6 +184,7 @@ if build_machine.system() == 'linux' and objcopy.found() and objcopy_supports_ad
depfile : 'gtkdemo_resources.c.d', depfile : 'gtkdemo_resources.c.d',
command : [glib_compile_resources, command : [glib_compile_resources,
'--generate-source', '--generate-source',
'--internal',
'--target=@OUTPUT@', '--target=@OUTPUT@',
'--dependency-file=@DEPFILE@', '--dependency-file=@DEPFILE@',
'--sourcedir=' + meson.current_source_dir(), '--sourcedir=' + meson.current_source_dir(),
@ -196,6 +198,7 @@ if build_machine.system() == 'linux' and objcopy.found() and objcopy_supports_ad
input : gtkdemo_gresource, input : gtkdemo_gresource,
output : 'gtkdemo_resources.o', output : 'gtkdemo_resources.o',
command : [ld, command : [ld,
'-z', 'noexecstack',
'-r', '-r',
'-b','binary', '-b','binary',
'@INPUT@', '@INPUT@',
@ -206,6 +209,7 @@ if build_machine.system() == 'linux' and objcopy.found() and objcopy_supports_ad
input : gtkdemo_resources_binary, input : gtkdemo_resources_binary,
output : 'gtkdemo_resources2.o', output : 'gtkdemo_resources2.o',
command : [objcopy, command : [objcopy,
'--strip-all',
'--add-symbol','_g_binary_gtkdemo_resource_data=.data:0', '--add-symbol','_g_binary_gtkdemo_resource_data=.data:0',
'@INPUT@', '@INPUT@',
'@OUTPUT@']) '@OUTPUT@'])

View File

@ -18,6 +18,7 @@ if build_machine.system() == 'linux' and objcopy.found() and objcopy_supports_ad
depfile: 'widgetfactory.gresource.d', depfile: 'widgetfactory.gresource.d',
command : [glib_compile_resources, command : [glib_compile_resources,
'--generate', '--generate',
'--internal',
'--target=@OUTPUT@', '--target=@OUTPUT@',
'--dependency-file=@DEPFILE@', '--dependency-file=@DEPFILE@',
'--sourcedir=' + meson.current_source_dir(), '--sourcedir=' + meson.current_source_dir(),
@ -31,6 +32,7 @@ if build_machine.system() == 'linux' and objcopy.found() and objcopy_supports_ad
depfile: 'widgetfactory_resources.c.d', depfile: 'widgetfactory_resources.c.d',
command : [glib_compile_resources, command : [glib_compile_resources,
'--generate-source', '--generate-source',
'--internal',
'--target=@OUTPUT@', '--target=@OUTPUT@',
'--dependency-file=@DEPFILE@', '--dependency-file=@DEPFILE@',
'--sourcedir=' + meson.current_source_dir(), '--sourcedir=' + meson.current_source_dir(),
@ -44,6 +46,7 @@ if build_machine.system() == 'linux' and objcopy.found() and objcopy_supports_ad
input : widgetfactory_gresource, input : widgetfactory_gresource,
output : 'widgetfactory_resources.o', output : 'widgetfactory_resources.o',
command : [ld, command : [ld,
'-z', 'noexecstack',
'-r', '-r',
'-b','binary', '-b','binary',
'@INPUT@', '@INPUT@',
@ -54,6 +57,7 @@ if build_machine.system() == 'linux' and objcopy.found() and objcopy_supports_ad
input : widgetfactory_resources_binary, input : widgetfactory_resources_binary,
output : 'widgetfactory_resources2.o', output : 'widgetfactory_resources2.o',
command : [objcopy, command : [objcopy,
'--strip-all',
'--add-symbol','_g_binary_widgetfactory_resource_data=.data:0', '--add-symbol','_g_binary_widgetfactory_resource_data=.data:0',
'@INPUT@', '@INPUT@',
'@OUTPUT@']) '@OUTPUT@'])