[glib: 2/3] tests: Mark compiled resource file as not having an executable stack




commit 9cde484b9f35a3dc2149f354194d3b8b58feb306
Author: Philip Withnall <pwithnall endlessos org>
Date:   Wed Jan 26 14:28:46 2022 +0000

    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>

 gio/tests/meson.build | 2 ++
 1 file changed, 2 insertions(+)
---
diff --git a/gio/tests/meson.build b/gio/tests/meson.build
index b2f79daaf..017749c1c 100644
--- a/gio/tests/meson.build
+++ b/gio/tests/meson.build
@@ -737,6 +737,7 @@ if not meson.is_cross_build() or meson.has_exe_wrapper()
       input : test_gresource_binary,
       output : 'test_resources.o',
       command : [ld,
+                 '-z', 'noexecstack',
                  '-r',
                  '-b','binary',
                  '@INPUT@',
@@ -752,6 +753,7 @@ if not meson.is_cross_build() or meson.has_exe_wrapper()
       input : test_resources_binary,
       output : 'test_resources2.o',
       command : [objcopy,
+                 '--strip-all',
                  '--add-symbol', underscore + '_g_binary_test1_resource_data=.data:0',
                  '@INPUT@',
                  '@OUTPUT@'])


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]