mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-07 07:14:56 +01:00
Make execstack optional, and check clang's variant with space
see also ec5b06e63d
and https://discourse.ardour.org/t/fyi-ardour-9-doesnt-build-on-linux-using-clang/111896
This commit is contained in:
parent
949585f746
commit
877f603d92
7 changed files with 18 additions and 19 deletions
|
|
@ -655,7 +655,7 @@ def build(bld):
|
||||||
'LOCALEDIR="' + os.path.normpath(bld.env['LOCALEDIR']) + '"',
|
'LOCALEDIR="' + os.path.normpath(bld.env['LOCALEDIR']) + '"',
|
||||||
]
|
]
|
||||||
obj.install_path = bld.env['DLLDIR']
|
obj.install_path = bld.env['DLLDIR']
|
||||||
obj.linkflags = ''
|
obj.linkflags = bld.env['compiler_flags_dict']['execstack']
|
||||||
obj.uselib = 'UUID FLAC FONTCONFIG GTHREAD OGG PANGOMM CURL DL CANVAS FFTW3F LO TAGLIB XML LILV RUBBERBAND AUBIO LRDF ARCHIVE VAMPSDK VAMPHOSTSDK'
|
obj.uselib = 'UUID FLAC FONTCONFIG GTHREAD OGG PANGOMM CURL DL CANVAS FFTW3F LO TAGLIB XML LILV RUBBERBAND AUBIO LRDF ARCHIVE VAMPSDK VAMPHOSTSDK'
|
||||||
|
|
||||||
if bld.is_defined('YTK'):
|
if bld.is_defined('YTK'):
|
||||||
|
|
@ -679,7 +679,6 @@ def build(bld):
|
||||||
obj.source += [ 'bundle_env_mingw.cc' ]
|
obj.source += [ 'bundle_env_mingw.cc' ]
|
||||||
obj.source += [ 'windows_icon.rc' ]
|
obj.source += [ 'windows_icon.rc' ]
|
||||||
else:
|
else:
|
||||||
obj.linkflags += ' -zexecstack'
|
|
||||||
obj.source += [ 'bundle_env_linux.cc' ]
|
obj.source += [ 'bundle_env_linux.cc' ]
|
||||||
obj.use += [ 'X11' ]
|
obj.use += [ 'X11' ]
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -21,7 +21,7 @@ def build(bld):
|
||||||
obj.source = hardour_sources
|
obj.source = hardour_sources
|
||||||
obj.target = 'hardour-' + bld.env['VERSION']
|
obj.target = 'hardour-' + bld.env['VERSION']
|
||||||
obj.includes = ['.']
|
obj.includes = ['.']
|
||||||
obj.linkflags= ''
|
obj.linkflags= bld.env['compiler_flags_dict']['execstack']
|
||||||
obj.use = [ 'libpbd',
|
obj.use = [ 'libpbd',
|
||||||
'libardour',
|
'libardour',
|
||||||
'libardour_cp',
|
'libardour_cp',
|
||||||
|
|
@ -55,8 +55,6 @@ def build(bld):
|
||||||
elif bld.env['build_target'] == 'mingw':
|
elif bld.env['build_target'] == 'mingw':
|
||||||
if bld.env['DEBUG'] == False:
|
if bld.env['DEBUG'] == False:
|
||||||
obj.linkflags += ' -mwindows'
|
obj.linkflags += ' -mwindows'
|
||||||
else:
|
|
||||||
obj.linkflags += ' -zexecstack'
|
|
||||||
|
|
||||||
obj.includes += ['../libs']
|
obj.includes += ['../libs']
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -19,7 +19,7 @@ def build(bld):
|
||||||
obj.source = 'vst3-scanner.cc'
|
obj.source = 'vst3-scanner.cc'
|
||||||
obj.target = 'ardour-vst3-scanner'
|
obj.target = 'ardour-vst3-scanner'
|
||||||
obj.includes = [ '../pbd/', '../ardour/', '../vst3/', '..' ]
|
obj.includes = [ '../pbd/', '../ardour/', '../vst3/', '..' ]
|
||||||
obj.linkflags = ''
|
obj.linkflags = bld.env['compiler_flags_dict']['execstack']
|
||||||
obj.defines = [
|
obj.defines = [
|
||||||
'VST3_SCANNER_APP',
|
'VST3_SCANNER_APP',
|
||||||
'VERSIONSTRING="' + bld.env['VERSION'] + '"',
|
'VERSIONSTRING="' + bld.env['VERSION'] + '"',
|
||||||
|
|
@ -38,8 +38,6 @@ def build(bld):
|
||||||
elif bld.env['build_target'] == 'mingw':
|
elif bld.env['build_target'] == 'mingw':
|
||||||
obj.uselib += ' GDI32'
|
obj.uselib += ' GDI32'
|
||||||
obj.linkflags += ' -mwindows'
|
obj.linkflags += ' -mwindows'
|
||||||
else:
|
|
||||||
obj.linkflags += ' -zexecstack'
|
|
||||||
|
|
||||||
if re.search ("bsd", sys.platform) != None:
|
if re.search ("bsd", sys.platform) != None:
|
||||||
obj.defines.append('_POSIX_C_SOURCE=200809L')
|
obj.defines.append('_POSIX_C_SOURCE=200809L')
|
||||||
|
|
|
||||||
|
|
@ -16,12 +16,8 @@ def build(bld):
|
||||||
obj.source = 'exec_wrapper.c'
|
obj.source = 'exec_wrapper.c'
|
||||||
obj.target = 'ardour-exec-wrapper'
|
obj.target = 'ardour-exec-wrapper'
|
||||||
obj.install_path = os.path.join(bld.env['LIBDIR'])
|
obj.install_path = os.path.join(bld.env['LIBDIR'])
|
||||||
|
obj.linkflags = bld.env['compiler_flags_dict']['execstack']
|
||||||
obj.defines = [
|
obj.defines = [
|
||||||
'_POSIX_SOURCE',
|
'_POSIX_SOURCE',
|
||||||
'_XOPEN_SOURCE=500',
|
'_XOPEN_SOURCE=500',
|
||||||
]
|
]
|
||||||
|
|
||||||
if sys.platform == 'darwin':
|
|
||||||
pass
|
|
||||||
else:
|
|
||||||
obj.linkflags = ' -zexecstack'
|
|
||||||
|
|
|
||||||
|
|
@ -34,7 +34,7 @@ def build(bld):
|
||||||
obj.source = 'luasession.cc'
|
obj.source = 'luasession.cc'
|
||||||
obj.target = 'luasession'
|
obj.target = 'luasession'
|
||||||
obj.includes = ['../libs']
|
obj.includes = ['../libs']
|
||||||
obj.linkflags = ''
|
obj.linkflags = bld.env['compiler_flags_dict']['execstack']
|
||||||
obj.use = ['liblua',
|
obj.use = ['liblua',
|
||||||
'libpbd',
|
'libpbd',
|
||||||
'libardour',
|
'libardour',
|
||||||
|
|
@ -69,8 +69,6 @@ def build(bld):
|
||||||
obj.use += ' libappleutility'
|
obj.use += ' libappleutility'
|
||||||
elif bld.env['build_target'] == 'mingw':
|
elif bld.env['build_target'] == 'mingw':
|
||||||
obj.linkflags += ' -mwindows'
|
obj.linkflags += ' -mwindows'
|
||||||
else:
|
|
||||||
obj.linkflags += ' -zexecstack'
|
|
||||||
|
|
||||||
if bld.is_defined('NEED_INTL'):
|
if bld.is_defined('NEED_INTL'):
|
||||||
obj.linkflags += ' -lintl'
|
obj.linkflags += ' -lintl'
|
||||||
|
|
|
||||||
|
|
@ -25,7 +25,7 @@ def build_ardour_util(bld, util):
|
||||||
obj.source = ['common.cc', util + '.cc' ]
|
obj.source = ['common.cc', util + '.cc' ]
|
||||||
obj.target = pgmprefix + '-' + util
|
obj.target = pgmprefix + '-' + util
|
||||||
obj.includes = ['.']
|
obj.includes = ['.']
|
||||||
obj.linkflags= ''
|
obj.linkflags= bld.env['compiler_flags_dict']['execstack']
|
||||||
obj.use = [ 'libpbd',
|
obj.use = [ 'libpbd',
|
||||||
'libardour',
|
'libardour',
|
||||||
'libardour_cp',
|
'libardour_cp',
|
||||||
|
|
@ -59,8 +59,6 @@ def build_ardour_util(bld, util):
|
||||||
obj.use += ' libappleutility'
|
obj.use += ' libappleutility'
|
||||||
elif bld.env['build_target'] == 'mingw':
|
elif bld.env['build_target'] == 'mingw':
|
||||||
obj.linkflags += ' -mwindows'
|
obj.linkflags += ' -mwindows'
|
||||||
else:
|
|
||||||
obj.linkflags += ' -zexecstack'
|
|
||||||
|
|
||||||
obj.includes += ['../libs']
|
obj.includes += ['../libs']
|
||||||
|
|
||||||
|
|
|
||||||
12
wscript
12
wscript
|
|
@ -80,6 +80,8 @@ compiler_flags_dictionaries= {
|
||||||
'pic': '-fPIC',
|
'pic': '-fPIC',
|
||||||
# Flags required to compile C code with anonymous unions (only part of C11)
|
# Flags required to compile C code with anonymous unions (only part of C11)
|
||||||
'c-anonymous-union': '-fms-extensions',
|
'c-anonymous-union': '-fms-extensions',
|
||||||
|
# optional -zexecstack linkflag
|
||||||
|
'execstack': '',
|
||||||
},
|
},
|
||||||
'msvc' : {
|
'msvc' : {
|
||||||
'debuggable' : ['/DDEBUG', '/Od', '/Zi', '/MDd', '/Gd', '/EHsc'],
|
'debuggable' : ['/DDEBUG', '/Od', '/Zi', '/MDd', '/Gd', '/EHsc'],
|
||||||
|
|
@ -113,6 +115,7 @@ compiler_flags_dictionaries= {
|
||||||
'neon': '',
|
'neon': '',
|
||||||
'pic': '',
|
'pic': '',
|
||||||
'c-anonymous-union': '',
|
'c-anonymous-union': '',
|
||||||
|
'execstack': '',
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -755,6 +758,13 @@ int main() { return 0; }''',
|
||||||
# Do not use Boost.System library
|
# Do not use Boost.System library
|
||||||
cxx_flags.append('-DBOOST_ERROR_CODE_HEADER_ONLY')
|
cxx_flags.append('-DBOOST_ERROR_CODE_HEADER_ONLY')
|
||||||
|
|
||||||
|
if platform == 'linux' and not conf.options.no_execstack:
|
||||||
|
if conf.check_cxx(linkflags=["-zexecstack"], mandatory = False, execute = False, msg = 'Checking for gcc/lld-style -zexecstack'):
|
||||||
|
flags_dict['execstack'] = "-zexecstack"
|
||||||
|
elif conf.check_cxx(linkflags=["-z execstack"], mandatory = False, execute = False, msg = 'Checking for clang execstack'):
|
||||||
|
flags_dict['execstack'] = "-z execstack"
|
||||||
|
|
||||||
|
|
||||||
# use sparingly, prefer runtime profile
|
# use sparingly, prefer runtime profile
|
||||||
if Options.options.program_name.lower().startswith('mixbus'):
|
if Options.options.program_name.lower().startswith('mixbus'):
|
||||||
compiler_flags.append ('-DMIXBUS')
|
compiler_flags.append ('-DMIXBUS')
|
||||||
|
|
@ -912,6 +922,8 @@ def options(opt):
|
||||||
help='Enable support to import PTS/PTF/PTX sessions')
|
help='Enable support to import PTS/PTF/PTX sessions')
|
||||||
opt.add_option('--no-threaded-waveviews', action='store_true', default=False, dest='no_threaded_waveviews',
|
opt.add_option('--no-threaded-waveviews', action='store_true', default=False, dest='no_threaded_waveviews',
|
||||||
help='Disable threaded waveview rendering')
|
help='Disable threaded waveview rendering')
|
||||||
|
opt.add_option('--no-execstack', action='store_true', default=False, dest='no_execstack',
|
||||||
|
help='Disable executable stack (may break some plugins)')
|
||||||
opt.add_option('--no-futex-semaphore', action='store_true', default=False, dest='no_futex_semaphore',
|
opt.add_option('--no-futex-semaphore', action='store_true', default=False, dest='no_futex_semaphore',
|
||||||
help='Disable use of futex for semaphores (Linux only)')
|
help='Disable use of futex for semaphores (Linux only)')
|
||||||
opt.add_option(
|
opt.add_option(
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue