Skip to content

Commit

Permalink
Use llvm-objcopy to package Windows binaries
Browse files Browse the repository at this point in the history
Fixes #793.
  • Loading branch information
triplef committed Aug 16, 2023
1 parent 86198bb commit be881d3
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/cpp-packaging.yml
Original file line number Diff line number Diff line change
Expand Up @@ -561,8 +561,8 @@ jobs:
# MacOS: use LLVM binutils for both X64 and ARM64
additional_flags+=(-L)
elif [[ "${{ matrix.sdk_platform }}" == "windows" && "${variant}" == *"/x64/"* ]]; then
# Windows x64: force input and output target format
additional_flags+=(-f pe-x86-64,pe-bigobj-x86-64)
# Windows x64: force input and output target format and use LLVM binutils for correct objcopy (issue #793)
additional_flags+=(-f pe-x86-64,pe-bigobj-x86-64 -L)
elif [[ "${{ matrix.sdk_platform }}" == "windows" && "${variant}" == *"/x86/"* ]]; then
# Windows x86: force input and output target format
additional_flags+=(-f pe-i386,pe-bigobj-i386)
Expand Down
11 changes: 10 additions & 1 deletion scripts/gha/install_prereqs_desktop.py
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -80,9 +80,18 @@ def main():
# sudo apt install clang-format
utils.run_command(['apt', 'install', '-y','clang-format'], as_root=True)
elif utils.is_mac_os():
# brew install protobuf
# brew install clang-format
utils.run_command(['brew', 'install', 'clang-format'])

# Install llvm on linux/mac if its not installed already
if not utils.is_command_installed('llvm-objcopy'):
if utils.is_linux_os():
# sudo apt install llvm
utils.run_command(['apt', 'install', '-y','llvm'], as_root=True)
elif utils.is_mac_os():
# brew install llvm
utils.run_command(['brew', 'install', 'llvm'])

# On Linux, if gcc-10 isn't installed install it. Then make it the default.
if utils.is_linux_os():
# Check if we have gcc 9 or gcc 10 as the default, if not, set gcc 10.
Expand Down

0 comments on commit be881d3

Please sign in to comment.