Skip to content

Commit be881d3

Browse files
committed
Use llvm-objcopy to package Windows binaries
Fixes #793.
1 parent 86198bb commit be881d3

File tree

2 files changed

+12
-3
lines changed

2 files changed

+12
-3
lines changed

.github/workflows/cpp-packaging.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -561,8 +561,8 @@ jobs:
561561
# MacOS: use LLVM binutils for both X64 and ARM64
562562
additional_flags+=(-L)
563563
elif [[ "${{ matrix.sdk_platform }}" == "windows" && "${variant}" == *"/x64/"* ]]; then
564-
# Windows x64: force input and output target format
565-
additional_flags+=(-f pe-x86-64,pe-bigobj-x86-64)
564+
# Windows x64: force input and output target format and use LLVM binutils for correct objcopy (issue #793)
565+
additional_flags+=(-f pe-x86-64,pe-bigobj-x86-64 -L)
566566
elif [[ "${{ matrix.sdk_platform }}" == "windows" && "${variant}" == *"/x86/"* ]]; then
567567
# Windows x86: force input and output target format
568568
additional_flags+=(-f pe-i386,pe-bigobj-i386)

scripts/gha/install_prereqs_desktop.py

100644100755
+10-1
Original file line numberDiff line numberDiff line change
@@ -80,9 +80,18 @@ def main():
8080
# sudo apt install clang-format
8181
utils.run_command(['apt', 'install', '-y','clang-format'], as_root=True)
8282
elif utils.is_mac_os():
83-
# brew install protobuf
83+
# brew install clang-format
8484
utils.run_command(['brew', 'install', 'clang-format'])
8585

86+
# Install llvm on linux/mac if its not installed already
87+
if not utils.is_command_installed('llvm-objcopy'):
88+
if utils.is_linux_os():
89+
# sudo apt install llvm
90+
utils.run_command(['apt', 'install', '-y','llvm'], as_root=True)
91+
elif utils.is_mac_os():
92+
# brew install llvm
93+
utils.run_command(['brew', 'install', 'llvm'])
94+
8695
# On Linux, if gcc-10 isn't installed install it. Then make it the default.
8796
if utils.is_linux_os():
8897
# Check if we have gcc 9 or gcc 10 as the default, if not, set gcc 10.

0 commit comments

Comments
 (0)