ChampSim
applocal Namespace Reference

Classes

class  GlobalConfig
 

Functions

def run_and_get_output (popen_args)
 
def get_dependencies (filename)
 
def is_qt_plugin (filename)
 
def is_qt_lib (filename)
 
def is_loader_path_lib (filename)
 
def normalize_qtplugin_name (filename)
 
def normalize_qtlib_name (filename)
 
def normalize_loaderpath_name (filename)
 
def fix_dependency (binary, dep)
 
def fix_binary (binary)
 
def fix_main_binaries ()
 
def main ()
 

Variables

string QTLIB_NAME_REGEX = r'^(?:@executable_path)?/.*/(Qt[a-zA-Z]*).framework/(?:Versions/\d/)?\1$'
 
string QTLIB_NORMALIZED = r'$prefix/Frameworks/$qtlib.framework/Versions/$qtversion/$qtlib'
 
string QTPLUGIN_NAME_REGEX = r'^(?:@executable_path)?/.*/[pP]lug[iI]ns/(.*)/(.*).dylib$'
 
string QTPLUGIN_NORMALIZED = r'$prefix/PlugIns/$plugintype/$pluginname.dylib'
 
string LOADERPATH_REGEX = r'^@[a-z_]+path/(.*)'
 
string LOADERPATH_NORMALIZED = r'$prefix/Frameworks/$loaderpathlib'
 

Function Documentation

◆ fix_binary()

def applocal.fix_binary (   binary)
    input:
      binary: relative or absolute path (no @executable_path syntax)
    process:
    - first fix the rpath for the qt libs on which 'binary' depend
    - copy into the bundle of exepath the eventual libraries that are missing
    - (create the soft links) needed ?
    - do the same for all qt dependencies of binary (recursive)

◆ fix_dependency()

def applocal.fix_dependency (   binary,
  dep 
)
fix 'dep' dependency of 'binary'. 'dep' is a qt library

◆ fix_main_binaries()

def applocal.fix_main_binaries ( )
    list the main binaries of the app bundle and fix them

◆ get_dependencies()

def applocal.get_dependencies (   filename)
input: filename must be an absolute path
Should call `otool` and returns the list of dependencies, unsorted,
unmodified, just the raw list so then we could eventually re-use in other
more specialized functions

◆ is_loader_path_lib()

def applocal.is_loader_path_lib (   filename)
Checks if a given file is loaded via @loader_path or @rpath

◆ is_qt_lib()

def applocal.is_qt_lib (   filename)
Checks if a given file is a qt library.
Accepts absolute path as well as path containing @executable_path

◆ is_qt_plugin()

def applocal.is_qt_plugin (   filename)
Checks if a given file is a qt plugin.
Accepts absolute path as well as path containing @executable_path

◆ main()

def applocal.main ( )

◆ normalize_loaderpath_name()

def applocal.normalize_loaderpath_name (   filename)
input: a path to a loaderpath library, as returned by otool, that can have this form :
        - an relative path @loaderpath/yyy
output:
    a tuple (loaderpathlib, abspath, rpath) where:
        - loaderpathlib is the name of the loaderpath lib
        - abspath is the absolute path of the qt lib inside the app bundle of exepath
        - relpath is the correct rpath to a qt lib inside the app bundle

◆ normalize_qtlib_name()

def applocal.normalize_qtlib_name (   filename)
input: a path to a qt library, as returned by otool, that can have this form :
        - an absolute path /lib/xxx/yyy
        - @executable_path/../Frameworks/QtSerialPort.framework/Versions/5/QtSerialPort
output:
    a tuple (qtlib, abspath, rpath) where:
        - qtlib is the name of the qtlib (QtCore, QtWidgets, etc.)
        - abspath is the absolute path of the qt lib inside the app bundle of exepath
        - relpath is the correct rpath to a qt lib inside the app bundle

◆ normalize_qtplugin_name()

def applocal.normalize_qtplugin_name (   filename)
input: a path to a qt plugin, as returned by otool, that can have this form :
        - an absolute path /../plugins/PLUGINTYPE/PLUGINNAME.dylib
        - @executable_path/../plugins/PLUGINTYPE/PLUGINNAME.dylib
output:
    a tuple (qtlib, abspath, rpath) where:
        - qtname is the name of the plugin (libqcocoa.dylib, etc.)
        - abspath is the absolute path of the qt lib inside the app bundle of exepath
        - relpath is the correct rpath to a qt lib inside the app bundle

◆ run_and_get_output()

def applocal.run_and_get_output (   popen_args)
Run process and get all output

Variable Documentation

◆ LOADERPATH_NORMALIZED

string applocal.LOADERPATH_NORMALIZED = r'$prefix/Frameworks/$loaderpathlib'

◆ LOADERPATH_REGEX

string applocal.LOADERPATH_REGEX = r'^@[a-z_]+path/(.*)'

◆ QTLIB_NAME_REGEX

string applocal.QTLIB_NAME_REGEX = r'^(?:@executable_path)?/.*/(Qt[a-zA-Z]*).framework/(?:Versions/\d/)?\1$'

◆ QTLIB_NORMALIZED

string applocal.QTLIB_NORMALIZED = r'$prefix/Frameworks/$qtlib.framework/Versions/$qtversion/$qtlib'

◆ QTPLUGIN_NAME_REGEX

string applocal.QTPLUGIN_NAME_REGEX = r'^(?:@executable_path)?/.*/[pP]lug[iI]ns/(.*)/(.*).dylib$'

◆ QTPLUGIN_NORMALIZED

string applocal.QTPLUGIN_NORMALIZED = r'$prefix/PlugIns/$plugintype/$pluginname.dylib'