2024-03-15 19:04:10 +01:00
|
|
|
--- a/uwsgiconfig.py
|
|
|
|
+++ b/uwsgiconfig.py
|
|
|
|
@@ -535,7 +535,7 @@ def build_uwsgi(uc, print_only=False, gc
|
2022-05-20 12:37:39 +02:00
|
|
|
gcc_list.append('%s/%s' % (path, cfile))
|
|
|
|
for bfile in up.get('BINARY_LIST', []):
|
|
|
|
try:
|
|
|
|
- binary_link_cmd = "ld -r -b binary -o %s/%s.o %s/%s" % (path, bfile[1], path, bfile[1])
|
|
|
|
+ binary_link_cmd = "ld -z noexecstack -r -b binary -o %s/%s.o %s/%s" % (path, bfile[1], path, bfile[1])
|
|
|
|
print(binary_link_cmd)
|
2023-01-07 19:41:26 +01:00
|
|
|
if subprocess.call(binary_link_cmd, shell=True) != 0:
|
2022-05-20 12:37:39 +02:00
|
|
|
raise Exception('unable to link binary file')
|
2024-03-15 19:04:10 +01:00
|
|
|
@@ -1150,7 +1150,7 @@ class uConf(object):
|
2022-05-20 12:37:39 +02:00
|
|
|
if not self.embed_config:
|
|
|
|
self.embed_config = self.get('embed_config')
|
|
|
|
if self.embed_config:
|
|
|
|
- binary_link_cmd = "ld -r -b binary -o %s.o %s" % (binarize(self.embed_config), self.embed_config)
|
|
|
|
+ binary_link_cmd = "ld -z noexecstack -r -b binary -o %s.o %s" % (binarize(self.embed_config), self.embed_config)
|
|
|
|
print(binary_link_cmd)
|
2023-01-07 19:41:26 +01:00
|
|
|
subprocess.call(binary_link_cmd, shell=True)
|
2022-05-20 12:37:39 +02:00
|
|
|
self.cflags.append("-DUWSGI_EMBED_CONFIG=_binary_%s_start" % binarize(self.embed_config))
|
2024-03-15 19:04:10 +01:00
|
|
|
@@ -1169,7 +1169,7 @@ class uConf(object):
|
2022-05-20 12:37:39 +02:00
|
|
|
for directory, directories, files in os.walk(ef):
|
|
|
|
for f in files:
|
|
|
|
fname = "%s/%s" % (directory, f)
|
|
|
|
- binary_link_cmd = "ld -r -b binary -o %s.o %s" % (binarize(fname), fname)
|
|
|
|
+ binary_link_cmd = "ld -z noexecstack -r -b binary -o %s.o %s" % (binarize(fname), fname)
|
|
|
|
print(binary_link_cmd)
|
2023-01-07 19:41:26 +01:00
|
|
|
subprocess.call(binary_link_cmd, shell=True)
|
2022-05-20 12:37:39 +02:00
|
|
|
if symbase:
|
2024-03-15 19:04:10 +01:00
|
|
|
@@ -1179,7 +1179,7 @@ class uConf(object):
|
2023-01-07 19:41:26 +01:00
|
|
|
subprocess.call(objcopy_cmd, shell=True)
|
2022-05-20 12:37:39 +02:00
|
|
|
binary_list.append(binarize(fname))
|
|
|
|
else:
|
|
|
|
- binary_link_cmd = "ld -r -b binary -o %s.o %s" % (binarize(ef), ef)
|
|
|
|
+ binary_link_cmd = "ld -z noexecstack -r -b binary -o %s.o %s" % (binarize(ef), ef)
|
|
|
|
print(binary_link_cmd)
|
2023-01-07 19:41:26 +01:00
|
|
|
subprocess.call(binary_link_cmd, shell=True)
|
2022-05-20 12:37:39 +02:00
|
|
|
binary_list.append(binarize(ef))
|
2024-03-15 19:04:10 +01:00
|
|
|
@@ -1464,7 +1464,7 @@ def build_plugin(path, uc, cflags, ldfla
|
2022-05-20 12:37:39 +02:00
|
|
|
gcc_list.append(path + '/' + cfile)
|
|
|
|
for bfile in up.get('BINARY_LIST', []):
|
|
|
|
try:
|
|
|
|
- binary_link_cmd = "ld -r -b binary -o %s/%s.o %s/%s" % (path, bfile[1], path, bfile[1])
|
|
|
|
+ binary_link_cmd = "ld -z noexecstack -r -b binary -o %s/%s.o %s/%s" % (path, bfile[1], path, bfile[1])
|
|
|
|
print(binary_link_cmd)
|
2023-01-07 19:41:26 +01:00
|
|
|
if subprocess.call(binary_link_cmd, shell=True) != 0:
|
2022-05-20 12:37:39 +02:00
|
|
|
raise Exception('unable to link binary file')
|