Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fallback to append if objcopy is not available on Linux #5991

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
5 changes: 3 additions & 2 deletions PyInstaller/building/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -676,16 +676,17 @@ def assemble(self):
# NOTE: Do not look up for bootloader file in the cache because it might
# get corrupted by UPX when UPX is available. See #1863 for details.

objcopy_bin = shutil.which('objcopy')
if not self.append_pkg:
logger.info("Copying bootloader exe to %s", self.name)
self._copyfile(exe, self.name)
logger.info("Copying archive to %s", self.pkgname)
self._copyfile(self.pkg.name, self.pkgname)
elif is_linux:
elif is_linux and objcopy_bin:
self._copyfile(exe, self.name)
logger.info("Appending archive to ELF section in EXE %s", self.name)
retcode, stdout, stderr = exec_command_all(
'objcopy', '--add-section', 'pydata=%s' % self.pkg.name,
objcopy_bin, '--add-section', 'pydata=%s' % self.pkg.name,
self.name)
logger.debug("objcopy returned %i", retcode)
if stdout:
Expand Down