]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
Build system: Avoid executable stack.
authorJaco Kroon <jaco@uls.co.za>
Mon, 7 Nov 2022 15:30:00 +0000 (17:30 +0200)
committerFriendly Automation <jenkins2@gerrit.asterisk.org>
Mon, 21 Nov 2022 14:52:49 +0000 (08:52 -0600)
Found in res_geolocation, but I believe others may have similar issues,
thus not linking to a specific issue.

Essentially gcc doesn't mark the stack for being non-executable unless
it's compiling the source, this informs ld via gcc to mark the object as
not requiring an executable stack (which a binary blob obviously
doesn't).

ASTERISK-30321

Change-Id: I71bcc2fd1fe0c82a28b3257405d6f2b566fd9bfc
Signed-off-by: Jaco Kroon <jaco@uls.co.za>
Makefile.rules

index e6b6589cc7c51e34e8e514bc2ae368ed3fe208a7..7b508e6ab2cd292cc2ec25f7d79a982941b3c020 100644 (file)
@@ -213,10 +213,10 @@ endif
 # extern const size_t _binary_abc_def_xml_size;
 %.o: %.xml
        $(ECHO_PREFIX) echo "   [LD] $^ -> $@"
-       $(CMD_PREFIX) $(CC) -g -nostartfiles  -nodefaultlibs -nostdlib -r -Wl,-b,binary -o $@ $^
+       $(CMD_PREFIX) $(CC) -g -Wl,-znoexecstack -nostartfiles  -nodefaultlibs -nostdlib -r -Wl,-b,binary -o $@ $^
 
 %.o: %.xslt
        $(ECHO_PREFIX) echo "   [LD] $^ -> $@"
-       $(CMD_PREFIX) $(CC) -g -nostartfiles  -nodefaultlibs -nostdlib -r -Wl,-b,binary -o $@ $^
+       $(CMD_PREFIX) $(CC) -g -Wl,-znoexecstack -nostartfiles  -nodefaultlibs -nostdlib -r -Wl,-b,binary -o $@ $^
 
 dist-clean:: clean