Merge pull request #79 from Miepee/master

Add Windows optimized workflow
This commit is contained in:
Alcaro
2024-05-30 15:23:30 +02:00
committed by GitHub
2 changed files with 49 additions and 3 deletions

View File

@@ -13,10 +13,21 @@ jobs:
run: dnf install -y gtk3-devel zip
- name: Build
run: ./make-linux.sh
- name: Zip to Archive
run: zip -9 ./linux-x64.zip ./flips
- name: Upload Artifacts
uses: actions/upload-artifact@v4.3.1
with:
name: linux-x64-gui.zip
path: ./linux-x64.zip
path: ./flips
windows:
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
- name: Build
run: bash ./make-windows.sh
- name: Upload Artifacts
uses: actions/upload-artifact@v4.3.1
with:
name: windows-x64-gui.zip
path: ./flips.exe

35
make-windows.sh Normal file
View File

@@ -0,0 +1,35 @@
#!/bin/sh
# For whatever reason, Windows sometimes has LANG unset. This breaks grep at the end, so setting this manually.
export LANG=C.UTF-8
echo "This script creates a heavily optimized Windows binary. For debugging you're better off using the Makefile directly."
# Set GCC specific optimization flags. These may need to be revisited when the project is build using MVSC.
FLAGS='-Wall -O3 -flto -fuse-linker-plugin -fomit-frame-pointer -fmerge-all-constants -fvisibility=hidden'
FLAGS=$FLAGS' -fno-exceptions -fno-unwind-tables -fno-asynchronous-unwind-tables'
FLAGS=$FLAGS' -ffunction-sections -fdata-sections -Wl,--gc-sections -fprofile-dir=obj/'
rm floating.zip
rm -r obj/* || true
#if trying to make a 32bit Flips, add -Wl,--large-address-aware
echo 'Windows (1/3)'
rm -r obj/* flips.exe; make CFLAGS="$FLAGS -fprofile-generate -lgcov"
[ -e flips.exe ] || exit
echo 'Windows (2/3)'
./flips.exe --create --bps-delta profile/firefox-10.0esr.tar profile/firefox-17.0esr.tar /dev/null
./flips.exe --create --bps-delta-moremem profile/firefox-10.0esr.tar profile/firefox-17.0esr.tar /dev/null
echo 'Windows (3/3)'
rm flips.exe; make CFLAGS="$FLAGS -fprofile-use -s"
#verify that there are no unexpected dependencies
objdump -p flips.exe | grep 'DLL Name' | \
grep -Pvi '(msvcrt|advapi32|comctl32|comdlg32|gdi32|kernel32|shell32|user32|api-ms-win-crt)' && \
echo "Invalid dependency" && exit 1
exit 0