From 17d2fbc5cc9a9e7aa8937e2aab4cf6da91b47742 Mon Sep 17 00:00:00 2001 From: Rafael Kitover Date: Thu, 19 Dec 2019 02:57:03 +0000 Subject: [PATCH] builder: mingw 32 bit updates. Fix cross building glib with meson for 32 bit Windows, set cpu_family correctly in the cross file. Do not build ffmpeg for 32 bit Windows because it is not compatible with Windows XP and it's better to have a smaller 32 bit binary. Turn off LTO for 32 bit Windows because it is now broken too, in a different way than for 64 bit Windows. Signed-off-by: Rafael Kitover --- tools/builder/core.sh | 17 +++++++++++------ tools/builder/mingw-cross.sh | 4 +++- 2 files changed, 14 insertions(+), 7 deletions(-) diff --git a/tools/builder/core.sh b/tools/builder/core.sh index 9300675b..a4e4676e 100644 --- a/tools/builder/core.sh +++ b/tools/builder/core.sh @@ -210,7 +210,6 @@ DISTS=$DISTS' ffmpeg https://ffmpeg.org/releases/ffmpeg-4.2.1.tar.bz2 lib/libavformat.a ' -# for now we don't build ffmpeg because game recording is broken BUILD_FFMPEG=1 FFMPEG_DISTS=' @@ -479,6 +478,9 @@ pre_build_all() { setup() { detect_os + target_os=${CROSS_OS:-$os} + target_bits=${target_bits:-$bits} + mkdir -p "$BUILD_ROOT/tmp" rm -rf "$BUILD_ROOT/tmp/"* @@ -506,6 +508,12 @@ setup() { cd "$OPWD" + # Don't use ffmpeg for 32 bit windows builds for XP compat and to make the + # binary smaller. + if [ "$target_os" = windows ] && [ "$target_bits" -eq 32 ]; then + BUILD_FFMPEG= + fi + if [ -z "$BUILD_FFMPEG" ]; then for dist in $FFMPEG_DISTS; do table_line_remove DISTS $dist @@ -2636,9 +2644,6 @@ die() { build_project() { puts "${NL}Building project: $CHECKOUT${NL}${NL}" - target_os=${CROSS_OS:-$os} - target_bits=${target_bits:-$bits} - dist_pre_build project mkdir -p "$BUILD_ROOT/project" @@ -2648,8 +2653,8 @@ build_project() { lto=ON - # FIXME: LTO still broken on 64 bit mingw - if [ "$target_os" = windows ] && [ "$target_bits" = 64 ]; then + # FIXME: LTO still broken on 64 bit mingw, and now 32 bit mingw too + if [ "$target_os" = windows ]; then lto=OFF fi diff --git a/tools/builder/mingw-cross.sh b/tools/builder/mingw-cross.sh index a35fc4c1..393cd6f2 100644 --- a/tools/builder/mingw-cross.sh +++ b/tools/builder/mingw-cross.sh @@ -3,6 +3,7 @@ set -e target_bits=64 +target_cpu_family=x86_64 target_cpu=x86_64 lib_suffix=64 target_endian=little @@ -13,6 +14,7 @@ case "$1" in ;; -32) target_bits=32 + target_cpu_family=x86 target_cpu=i686 lib_suffix= shift @@ -71,7 +73,7 @@ meson() { cat >$BUILD_ROOT/tmp/meson_cross_$$.txt <