Set executable stack flag when linking

This is required on some modern hardneded Linux systems to allow
to dlopen executable objects (load plugins).

https://discourse.ardour.org/t/tls-1295-lea-so-linux-vers-doesnt-work/111778/20?u=x42
This commit is contained in:
Robin Gareus 2025-05-11 15:58:00 +02:00
parent 1c0882ba56
commit ec5b06e63d
No known key found for this signature in database
GPG key ID: A090BCE02CF57F04
6 changed files with 42 additions and 12 deletions

View file

@ -25,6 +25,7 @@ def build_ardour_util(bld, util):
obj.source = ['common.cc', util + '.cc' ]
obj.target = pgmprefix + '-' + util
obj.includes = ['.']
obj.linkflags= ''
obj.use = [ 'libpbd',
'libardour',
'libardour_cp',
@ -56,13 +57,18 @@ def build_ardour_util(bld, util):
if sys.platform == 'darwin':
obj.uselib += ' AUDIOUNITS OSX'
obj.use += ' libappleutility'
elif bld.env['build_target'] == 'mingw':
obj.linkflags += ' -mwindows'
else:
obj.linkflags += ' -zexecstack'
obj.includes += ['../libs']
if bld.env['build_target'] == 'mingw':
obj.install_path = bld.env['BINDIR']
if bld.is_defined('NEED_INTL'):
obj.linkflags = ' -lintl'
obj.linkflags += ' -lintl'
def build(bld):
# session-utils depend on the dummy backend