Skip to content

Commit

Permalink
[Interposer] Look for architecture specific file
Browse files Browse the repository at this point in the history
  • Loading branch information
set-soft committed Oct 23, 2023
1 parent 6fa2ed2 commit 68378c1
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
9 changes: 6 additions & 3 deletions kiauto/interposer.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,15 +33,18 @@

def check_interposer(args, logger, cfg):
# Name of the interposer library
interposer_lib = os.path.abspath(os.path.join(os.path.dirname(__file__), 'interposer', 'libinterposer.so'))
machine = platform.machine().lower()
extra_name = '' if machine == 'x86_64' else '_'+machine
interposer_lib = os.path.abspath(os.path.join(os.path.dirname(__file__), 'interposer', f'libinterposer{extra_name}.so'))
logger.debug(f'Looking for interposer lib: {interposer_lib}')
if (not os.path.isfile(interposer_lib) or # The lib isn't there
args.disable_interposer or # The user disabled it
os.environ.get('KIAUTO_INTERPOSER_DISABLE') or # The user disabled it using the environment
platform.system() != 'Linux' or 'x86_64' not in platform.platform()): # Not Linux 64 bits x86
platform.system() != 'Linux'): # Not Linux
interposer_lib = None
else:
os.environ['LD_PRELOAD'] = interposer_lib
logger.debug('** Using interposer: '+interposer_lib)
logger.debug('** Interposer lib found')
cfg.use_interposer = interposer_lib
cfg.enable_interposer = interposer_lib or args.interposer_sniff
cfg.logger = logger
Expand Down
1 change: 1 addition & 0 deletions kiauto/misc.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ def hide_stderr():

class Config(object):
def __init__(self, logger, input_file=None, args=None, is_pcbnew=False):
logger.debug(f'KiAuto v{__version__}')
self.export_format = 'pdf'
self.is_pcbnew = is_pcbnew
if input_file:
Expand Down

0 comments on commit 68378c1

Please sign in to comment.