forked from qt-creator/qt-creator
CMake build: Deploy elfutils
Fixes: QTCREATORBUG-24131 Change-Id: Ibfe829492e86ce1563882cf3be6469f9e553812d Reviewed-by: Eike Ziller <eike.ziller@qt.io>
This commit is contained in:
@@ -97,8 +97,8 @@ def build_qtcreator(args, paths):
|
|||||||
prefix_paths = [paths.qt]
|
prefix_paths = [paths.qt]
|
||||||
if args.llvm_path:
|
if args.llvm_path:
|
||||||
prefix_paths += [args.llvm_path]
|
prefix_paths += [args.llvm_path]
|
||||||
if args.elfutils_path:
|
if paths.elfutils:
|
||||||
prefix_paths += [args.elfutils_path]
|
prefix_paths += [paths.elfutils]
|
||||||
build_type = 'Debug' if args.debug else 'Release'
|
build_type = 'Debug' if args.debug else 'Release'
|
||||||
with_docs_str = 'OFF' if args.no_docs else 'ON'
|
with_docs_str = 'OFF' if args.no_docs else 'ON'
|
||||||
cmake_args = ['cmake',
|
cmake_args = ['cmake',
|
||||||
@@ -200,9 +200,11 @@ def deploy_qt(args, paths):
|
|||||||
qt_imports, qt_qml],
|
qt_imports, qt_qml],
|
||||||
paths.build)
|
paths.build)
|
||||||
else:
|
else:
|
||||||
|
cmd_args = ['python', '-u', os.path.join(paths.src, 'scripts', 'deployqt.py'), '-i']
|
||||||
|
if paths.elfutils:
|
||||||
|
cmd_args.extend(['--elfutils-path', paths.elfutils])
|
||||||
exe = os.path.join(paths.install, 'bin', args.app_target)
|
exe = os.path.join(paths.install, 'bin', args.app_target)
|
||||||
common.check_print_call(['python', '-u', os.path.join(paths.src, 'scripts', 'deployqt.py'),
|
common.check_print_call(cmd_args + [exe, os.path.join(paths.qt, 'bin', 'qmake')],
|
||||||
'-i', exe, os.path.join(paths.qt, 'bin', 'qmake')],
|
|
||||||
paths.build)
|
paths.build)
|
||||||
|
|
||||||
def package_qtcreator(args, paths):
|
def package_qtcreator(args, paths):
|
||||||
@@ -237,7 +239,8 @@ def get_paths(args):
|
|||||||
Paths = collections.namedtuple('Paths',
|
Paths = collections.namedtuple('Paths',
|
||||||
['qt', 'src', 'build',
|
['qt', 'src', 'build',
|
||||||
'install', 'dev_install', 'wininterrupt_install',
|
'install', 'dev_install', 'wininterrupt_install',
|
||||||
'qtcreatorcdbext_install', 'result'])
|
'qtcreatorcdbext_install', 'result',
|
||||||
|
'elfutils'])
|
||||||
build_path = os.path.abspath(args.build)
|
build_path = os.path.abspath(args.build)
|
||||||
install_path = os.path.join(build_path, 'install')
|
install_path = os.path.join(build_path, 'install')
|
||||||
return Paths(qt=os.path.abspath(args.qt_path),
|
return Paths(qt=os.path.abspath(args.qt_path),
|
||||||
@@ -247,7 +250,8 @@ def get_paths(args):
|
|||||||
dev_install=os.path.join(install_path, 'qt-creator-dev'),
|
dev_install=os.path.join(install_path, 'qt-creator-dev'),
|
||||||
wininterrupt_install=os.path.join(install_path, 'wininterrupt'),
|
wininterrupt_install=os.path.join(install_path, 'wininterrupt'),
|
||||||
qtcreatorcdbext_install=os.path.join(install_path, 'qtcreatorcdbext'),
|
qtcreatorcdbext_install=os.path.join(install_path, 'qtcreatorcdbext'),
|
||||||
result=build_path)
|
result=build_path,
|
||||||
|
elfutils=os.path.abspath(args.elfutils_path) if args.elfutils_path else None)
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
args = get_arguments()
|
args = get_arguments()
|
||||||
|
@@ -45,6 +45,8 @@ def get_args():
|
|||||||
parser = argparse.ArgumentParser(description='Deploy Qt Creator dependencies for packaging')
|
parser = argparse.ArgumentParser(description='Deploy Qt Creator dependencies for packaging')
|
||||||
parser.add_argument('-i', '--ignore-errors', help='For backward compatibility',
|
parser.add_argument('-i', '--ignore-errors', help='For backward compatibility',
|
||||||
action='store_true', default=False)
|
action='store_true', default=False)
|
||||||
|
parser.add_argument('--elfutils-path',
|
||||||
|
help='Path to elfutils installation for use by perfprofiler (Windows, Linux)')
|
||||||
parser.add_argument('qtcreator_binary', help='Path to Qt Creator binary')
|
parser.add_argument('qtcreator_binary', help='Path to Qt Creator binary')
|
||||||
parser.add_argument('qmake_binary', help='Path to qmake binary')
|
parser.add_argument('qmake_binary', help='Path to qmake binary')
|
||||||
|
|
||||||
@@ -283,6 +285,47 @@ def deploy_libclang(install_dir, llvm_install_dir, chrpath_bin):
|
|||||||
shutil.rmtree(resourcetarget)
|
shutil.rmtree(resourcetarget)
|
||||||
common.copytree(resourcesource, resourcetarget, symlinks=True)
|
common.copytree(resourcesource, resourcetarget, symlinks=True)
|
||||||
|
|
||||||
|
def deploy_elfutils(qtc_install_dir, chrpath_bin, args):
|
||||||
|
if common.is_mac_platform():
|
||||||
|
return
|
||||||
|
|
||||||
|
def lib_name(name, version):
|
||||||
|
return ('lib' + name + '.so.' + version if common.is_linux_platform()
|
||||||
|
else name + '.dll')
|
||||||
|
|
||||||
|
version = '1'
|
||||||
|
libs = ['elf', 'dw']
|
||||||
|
elfutils_lib_path = os.path.join(args.elfutils_path, 'lib')
|
||||||
|
if common.is_linux_platform():
|
||||||
|
install_path = os.path.join(qtc_install_dir, 'lib', 'elfutils')
|
||||||
|
backends_install_path = install_path
|
||||||
|
elif common.is_windows_platform():
|
||||||
|
install_path = os.path.join(qtc_install_dir, 'bin')
|
||||||
|
backends_install_path = os.path.join(qtc_install_dir, 'lib', 'elfutils')
|
||||||
|
libs.append('eu_compat')
|
||||||
|
if not os.path.exists(install_path):
|
||||||
|
os.makedirs(install_path)
|
||||||
|
if not os.path.exists(backends_install_path):
|
||||||
|
os.makedirs(backends_install_path)
|
||||||
|
# copy main libs
|
||||||
|
libs = [os.path.join(elfutils_lib_path, lib_name(lib, version)) for lib in libs]
|
||||||
|
for lib in libs:
|
||||||
|
print(lib, '->', install_path)
|
||||||
|
shutil.copy(lib, install_path)
|
||||||
|
# fix rpath
|
||||||
|
if common.is_linux_platform():
|
||||||
|
relative_path = os.path.relpath(backends_install_path, install_path)
|
||||||
|
subprocess.check_call([chrpath_bin, '-r', os.path.join('$ORIGIN', relative_path),
|
||||||
|
os.path.join(install_path, lib_name('dw', version))])
|
||||||
|
# copy backend files
|
||||||
|
# only non-versioned, we never dlopen the versioned ones
|
||||||
|
files = glob(os.path.join(elfutils_lib_path, 'elfutils', '*ebl_*.*'))
|
||||||
|
versioned_files = glob(os.path.join(elfutils_lib_path, 'elfutils', '*ebl_*.*-*.*.*'))
|
||||||
|
unversioned_files = [file for file in files if file not in versioned_files]
|
||||||
|
for file in unversioned_files:
|
||||||
|
print(file, '->', backends_install_path)
|
||||||
|
shutil.copy(file, backends_install_path)
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
args = get_args()
|
args = get_args()
|
||||||
|
|
||||||
@@ -329,6 +372,8 @@ def main():
|
|||||||
if "LLVM_INSTALL_DIR" in os.environ:
|
if "LLVM_INSTALL_DIR" in os.environ:
|
||||||
deploy_libclang(install_dir, os.environ["LLVM_INSTALL_DIR"], chrpath_bin)
|
deploy_libclang(install_dir, os.environ["LLVM_INSTALL_DIR"], chrpath_bin)
|
||||||
|
|
||||||
|
if args.elfutils_path:
|
||||||
|
deploy_elfutils(install_dir, chrpath_bin, args)
|
||||||
if not common.is_windows_platform():
|
if not common.is_windows_platform():
|
||||||
print("fixing rpaths...")
|
print("fixing rpaths...")
|
||||||
common.fix_rpaths(install_dir, os.path.join(qt_deploy_prefix, 'lib'), qt_install_info, chrpath_bin)
|
common.fix_rpaths(install_dir, os.path.join(qt_deploy_prefix, 'lib'), qt_install_info, chrpath_bin)
|
||||||
|
Reference in New Issue
Block a user