From b752b3319e0b2c2fe56642455e765341c1515f2e Mon Sep 17 00:00:00 2001 From: John Maguire Date: Fri, 17 Apr 2026 14:09:15 +0100 Subject: [PATCH] Revert "Switch to 64-bit" This reverts commit dc40b529b6aeaa5ea9e488b90c4793c73e10af7e. --- Toolchain-mingw32.cmake | 6 +- windows.Dockerfile | 6 +- windows/Makefile | 26 ++--- windows/config/liboil.site | 2 - windows/patches/liboil-1-fixes.patch | 162 --------------------------- 5 files changed, 17 insertions(+), 185 deletions(-) delete mode 100644 windows/config/liboil.site delete mode 100644 windows/patches/liboil-1-fixes.patch diff --git a/Toolchain-mingw32.cmake b/Toolchain-mingw32.cmake index b2403d2..77ee9a1 100644 --- a/Toolchain-mingw32.cmake +++ b/Toolchain-mingw32.cmake @@ -2,9 +2,9 @@ SET(CMAKE_SYSTEM_NAME Windows) # which compilers to use for C and C++ -SET(CMAKE_C_COMPILER x86_64-w64-mingw32-gcc) -SET(CMAKE_CXX_COMPILER x86_64-w64-mingw32-g++) -SET(CMAKE_RC_COMPILER x86_64-w64-mingw32-windres) +SET(CMAKE_C_COMPILER i686-w64-mingw32-gcc) +SET(CMAKE_CXX_COMPILER i686-w64-mingw32-g++) +SET(CMAKE_RC_COMPILER i686-w64-mingw32-windres) # here is the target environment located SET(CMAKE_FIND_ROOT_PATH /target ) diff --git a/windows.Dockerfile b/windows.Dockerfile index 9f8eb74..d706b02 100644 --- a/windows.Dockerfile +++ b/windows.Dockerfile @@ -43,8 +43,8 @@ RUN apt-get update && apt-get install -y -q \ xz-utils \ yasm -RUN update-alternatives --set x86_64-w64-mingw32-gcc /usr/bin/x86_64-w64-mingw32-gcc-posix -RUN update-alternatives --set x86_64-w64-mingw32-g++ /usr/bin/x86_64-w64-mingw32-g++-posix +RUN update-alternatives --set i686-w64-mingw32-gcc /usr/bin/i686-w64-mingw32-gcc-posix +RUN update-alternatives --set i686-w64-mingw32-g++ /usr/bin/i686-w64-mingw32-g++-posix RUN mkdir -p /src RUN mkdir -p /target/stow @@ -55,5 +55,5 @@ WORKDIR /src/windows # Separate this step to cache it before any build failures. RUN make all-downloads -# RUN make +RUN make diff --git a/windows/Makefile b/windows/Makefile index 5c57fd0..22539c2 100644 --- a/windows/Makefile +++ b/windows/Makefile @@ -1,11 +1,11 @@ # Target compiler -host=x86_64-w64-mingw32 +host=i686-w64-mingw32 cc=$(host)-gcc cxx=$(host)-g++ ranlib=$(host)-ranlib # Local compiler -build=x86_64-linux-gnu +build=i486-linux-gnu # How many source files to build in parallel within each package jobs=-j8 @@ -22,7 +22,7 @@ include ../makefile.common clementine_dlls=glew32.dll \ libcdio-19.dll \ libchromaprint.dll \ - libcrypto-1_1-x64.dll \ + libcrypto-1_1.dll \ libfaad-2.dll \ libffi-7.dll \ libfftw3-3.dll \ @@ -34,7 +34,7 @@ clementine_dlls=glew32.dll \ libgmp-10.dll \ libgnutls-30.dll \ libgobject-2.0-0.dll \ - libgpg-error6-0.dll \ + libgpg-error-0.dll \ libgpod.dll \ libgstapp-1.0-0.dll \ libgstaudio-1.0-0.dll \ @@ -67,7 +67,7 @@ clementine_dlls=glew32.dll \ libplist.dll \ libprotobuf-17.dll \ libpsl-5.dll \ - libssl-1_1-x64.dll \ + libssl-1_1.dll \ libsoup-2.4-1.dll \ libspeex-1.dll \ libspotify.dll \ @@ -149,7 +149,7 @@ pkgconfig=PKG_CONFIG_LIBDIR=$(prefix)/lib/pkgconfig autoconf=ACLOCAL_PATH=$(prefix)/share/aclocal:/usr/share/aclocal ldflags=-L$(prefix)/lib -lpthread # -O2 is required to work around link errors in gettext -cflags=-I$(prefix)/include -O2 -D__USE_MINGW_ANSI_STDIO -m64 +cflags=-I$(prefix)/include -O2 -D__USE_MINGW_ANSI_STDIO cxxflags=$(cflags) configure=$(pkgconfig) LDFLAGS="$(ldflags)" CFLAGS="$(cflags)" CXXFLAGS="$(cxxflags)" ./configure --host=$(host) --build=$(build) --prefix=$(prefix) cmake=$(pkgconfig) cmake .. -DCMAKE_TOOLCHAIN_FILE=$(src)/Toolchain-mingw32.cmake -DCMAKE_INSTALL_PREFIX=$(prefix) -DCMAKE_C_FLAGS="$(cflags)" -DCMAKE_CXX_FLAGS="$(cxxflags)" @@ -203,7 +203,7 @@ clementine-deps: clementine-build-deps clementine-gst-plugins openssl glibnetwor cp -v $(prefix)/lib/gio/modules/libgiognutls.dll clementine-deps/gio-modules/ cp -vr /usr/lib/gcc/$(host)/*-posix/libstdc++-6.dll clementine-deps/ - cp -vr /usr/lib/gcc/$(host)/*-posix/libgcc_s_seh-1.dll clementine-deps/ + cp -vr /usr/lib/gcc/$(host)/*-posix/libgcc_s_dw2-1.dll clementine-deps/ cp -vr /usr/$(host)/lib/libwinpthread-1.dll clementine-deps/ # openSUSE @@ -279,7 +279,7 @@ clementine-deps: clementine-build-deps clementine-gst-plugins openssl glibnetwor .done-gmp: rm -f $(prefix)/share/info/dir $(call extractpkg,$(gmptgz)) - cd $(gmp) && CC_FOR_BUILD=$(build)-gcc $(configure) --enable-shared --disable-static + cd $(gmp) && $(configure) --enable-shared --disable-static cd $(gmp) && $(make) $(call installpkg,$(gmp)) @@ -448,11 +448,7 @@ clementine-deps: clementine-build-deps clementine-gst-plugins openssl glibnetwor $(call installpkg,$(gstugly)) .done-oil: - $(call extractpkg,$(oiltgz)) - cd $(oil) && patch -p1 < ../patches/liboil-1-fixes.patch - cd $(oil) && CONFIG_SITE=../config/liboil.site $(configure) - cd $(oil) && $(make) - $(call installpkg,$(oil)) + $(call extractandbuild,$(oiltgz),$(oil)) .done-id3tag: $(call extractpkg,$(id3tagtgz)) @@ -556,7 +552,7 @@ clementine-deps: clementine-build-deps clementine-gst-plugins openssl glibnetwor -I/target/include \ -release \ -xplatform win32-g++ \ - -device-option CROSS_COMPILE=/usr/bin/x86_64-w64-mingw32- \ + -device-option CROSS_COMPILE=/usr/bin/i686-w64-mingw32- \ -prefix $(stow)/$(qt) \ -confirm-license \ -opensource \ @@ -670,7 +666,7 @@ clementine-deps: clementine-build-deps clementine-gst-plugins openssl glibnetwor --cross-compile-prefix="$(host)-" \ --prefix=$(stow)/$(openssl) \ --shared \ - mingw64 \ + mingw \ LDFLAGS="-L/target/bin $(ldflags)" CFLAGS="$(cflags)" cd $(openssl) && make cd $(openssl) && make install diff --git a/windows/config/liboil.site b/windows/config/liboil.site deleted file mode 100644 index de01519..0000000 --- a/windows/config/liboil.site +++ /dev/null @@ -1,2 +0,0 @@ -as_cv_unaligned_access=yes -lt_cv_deplibs_check_method=pass_all diff --git a/windows/patches/liboil-1-fixes.patch b/windows/patches/liboil-1-fixes.patch deleted file mode 100644 index 379a9c0..0000000 --- a/windows/patches/liboil-1-fixes.patch +++ /dev/null @@ -1,162 +0,0 @@ -This file is part of MXE. See LICENSE.md for licensing information. - -Contains ad hoc patches for cross building. - -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: David Schleef -Date: Tue, 20 Jul 2010 14:05:26 -0700 -Subject: [PATCH 1/2] x86: Fix cpuid function on x86-64 - -Taken from: -http://cgit.freedesktop.org/liboil/commit/?id=705916007fba0a845229a02dc6474cb523eff150 - -diff --git a/liboil/liboilcpu-x86.c b/liboil/liboilcpu-x86.c -index 1111111..2222222 100644 ---- a/liboil/liboilcpu-x86.c -+++ b/liboil/liboilcpu-x86.c -@@ -162,13 +162,10 @@ get_cpuid (uint32_t op, uint32_t *a, uint32_t *b, uint32_t *c, uint32_t *d) - static void - get_cpuid (uint32_t op, uint32_t *a, uint32_t *b, uint32_t *c, uint32_t *d) - { -+ *a = op; - __asm__ ( -- " pushq %%rbx\n" - " cpuid\n" -- " mov %%ebx, %%esi\n" -- " popq %%rbx\n" -- : "=a" (*a), "=S" (*b), "=c" (*c), "=d" (*d) -- : "0" (op)); -+ : "+a" (*a), "=b" (*b), "=c" (*c), "=d" (*d)); - } - #endif - -@@ -185,7 +182,7 @@ oil_cpu_detect_cpuid (void) - { - uint32_t eax, ebx, ecx, edx; - uint32_t level; -- char vendor[13] = { 0 }; -+ char vendor[13+4] = { 0 }; - int ret; - - oil_fault_check_enable (); - -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Tony Theodore -Date: Sat, 9 Jan 2016 11:21:30 +1100 -Subject: [PATCH 2/2] Win64 Support - -Taken from: -https://bugs.freedesktop.org/show_bug.cgi?id=26651 - -diff --git a/liboil/amd64/wavelet.c b/liboil/amd64/wavelet.c -index 1111111..2222222 100644 ---- a/liboil/amd64/wavelet.c -+++ b/liboil/amd64/wavelet.c -@@ -2,7 +2,7 @@ - #include - #include - #include -- -+#include - - void - deinterleave2_asm (int16_t *d1, int16_t *d2, int16_t *s_2xn, int n) -@@ -1409,7 +1409,7 @@ multiply_and_acc_12xn_s16_u8_mmx (int16_t *i1, int is1, int16_t *s1, - " jnz 1b\n" - " emms\n" - : "+r" (i1), "+r" (s1), "+r" (s2), "+r" (n) -- : "r" ((long)is1), "r" ((long)ss1), "r" ((long)ss2) -+ : "r" ((intptr_t)is1), "r" ((intptr_t)ss1), "r" ((intptr_t)ss2) - ); - } - OIL_DEFINE_IMPL_FULL (multiply_and_acc_12xn_s16_u8_mmx, -@@ -1596,7 +1596,7 @@ mas4_across_add_s16_mmx (int16_t *d, int16_t *s1, int16_t *s2_nx4, int sstr2, - [s2_nx4_off] "+r" (s2_nx4_off), - [n] "+m" (n), - [s1] "+r" (s1) -- : [sstr] "r" ((long)(sstr2)) -+ : [sstr] "r" ((intptr_t)(sstr2)) - ); - } - OIL_DEFINE_IMPL_FULL (mas4_across_add_s16_mmx, mas4_across_add_s16, -@@ -1753,8 +1753,8 @@ mas8_across_add_s16_mmx (int16_t *d, int16_t *s1, int16_t *s2_nx8, int sstr2, - [s3_8] "+r" (s3_8), - [d] "+r" (d), - [n] "+m" (n), -- [s1] "+r" ((long)(s1)) -- : [sstr] "r" ((long)(sstr2)) -+ [s1] "+r" ((intptr_t)(s1)) -+ : [sstr] "r" ((intptr_t)(sstr2)) - ); - } - OIL_DEFINE_IMPL_FULL (mas8_across_add_s16_mmx, mas8_across_add_s16, -diff --git a/liboil/i386_amd64/mas.c b/liboil/i386_amd64/mas.c -index 1111111..2222222 100644 ---- a/liboil/i386_amd64/mas.c -+++ b/liboil/i386_amd64/mas.c -@@ -1,7 +1,7 @@ - - #include - #include -- -+#include - - void - mas10_u8_mmx (uint8_t *d, const uint8_t *s1_np9, const int16_t *s2_10, -@@ -1106,7 +1106,7 @@ mas8_across_u8_mmx_3 (uint8_t *d, const uint8_t *s1_nx8, int ss1, - " packuswb %%mm2, %%mm2\n" - " movd %%mm2, 0(%[d])\n" - : [p] "+r" (p) -- : [d] "r" (d), [ss1] "r" ((long)ss1)); -+ : [d] "r" (d), [ss1] "r" ((intptr_t)ss1)); - d+=4; - s1_nx8+=4; - n--; -diff --git a/liboil/i386_amd64/multiply_and_acc.c b/liboil/i386_amd64/multiply_and_acc.c -index 1111111..2222222 100644 ---- a/liboil/i386_amd64/multiply_and_acc.c -+++ b/liboil/i386_amd64/multiply_and_acc.c -@@ -1,6 +1,7 @@ - - #include - #include -+#include - - void - multiply_and_acc_6xn_s16_u8_mmx (int16_t *i1, int is1, int16_t *s1, -@@ -32,7 +33,7 @@ multiply_and_acc_6xn_s16_u8_mmx (int16_t *i1, int is1, int16_t *s1, - #ifdef __i386__ - : "m" (is1), "m" (ss1), "m" (ss2) - #else -- : "r" ((long)is1), "r" ((long)ss1), "r" ((long)ss2) -+ : "r" ((intptr_t)is1), "r" ((intptr_t)ss1), "r" ((intptr_t)ss2) - #endif - ); - } -@@ -68,7 +69,7 @@ multiply_and_acc_8xn_s16_u8_mmx (int16_t *i1, int is1, int16_t *s1, - #ifdef __i386__ - : "m" (is1), "m" (ss1), "m" (ss2) - #else -- : "r" ((long)is1), "r" ((long)ss1), "r" ((long)ss2) -+ : "r" ((intptr_t)is1), "r" ((intptr_t)ss1), "r" ((intptr_t)ss2) - #endif - ); - } -@@ -114,7 +115,7 @@ multiply_and_acc_16xn_s16_u8_mmx (int16_t *i1, int is1, int16_t *s1, - #ifdef __i386__ - : "m" (is1), "m" (ss1), "m" (ss2) - #else -- : "r" ((long)is1), "r" ((long)ss1), "r" ((long)ss2) -+ : "r" ((intptr_t)is1), "r" ((intptr_t)ss1), "r" ((intptr_t)ss2) - #endif - ); - } -@@ -170,7 +171,7 @@ multiply_and_acc_24xn_s16_u8_mmx (int16_t *i1, int is1, int16_t *s1, - #ifdef __i386__ - : "m" (is1), "m" (ss1), "m" (ss2) - #else -- : "r" ((long)is1), "r" ((long)ss1), "r" ((long)ss2) -+ : "r" ((intptr_t)is1), "r" ((intptr_t)ss1), "r" ((intptr_t)ss2) - #endif - ); - }