diff --git a/configs/components/libffi.rb b/configs/components/libffi.rb index d0d75024..5fcee132 100644 --- a/configs/components/libffi.rb +++ b/configs/components/libffi.rb @@ -13,7 +13,6 @@ pkg.environment 'MACOSX_DEPLOYMENT_TARGET', settings[:deployment_target] elsif platform.is_windows? pkg.environment 'PATH', "$(shell cygpath -u #{settings[:gcc_bindir]}):$(PATH)" - pkg.apply_patch 'resources/patches/libffi/revert_clang_32bit.patch' if platform.architecture == 'x86' end pkg.build_requires "runtime-#{settings[:runtime_project]}" diff --git a/configs/components/openssl-3.0.rb b/configs/components/openssl-3.0.rb index d320c769..bff40dd8 100644 --- a/configs/components/openssl-3.0.rb +++ b/configs/components/openssl-3.0.rb @@ -28,7 +28,7 @@ pkg.environment 'CYGWIN', settings[:cygwin] pkg.environment 'MAKE', platform[:make] - target = platform.architecture == 'x64' ? 'mingw64' : 'mingw' + target = 'mingw64' elsif platform.is_macos? pkg.environment 'PATH', '$(PATH):/opt/homebrew/bin:/usr/local/bin' pkg.environment 'CC', settings[:cc] @@ -111,17 +111,6 @@ build_commands = [] - if platform.is_windows? && platform.architecture == 'x86' - # mingw-w32 5.2.0 has a bug in include/winnt.h that declares GetCurrentFiber - # with __CRT_INLINE, which results in the function not being inlined and - # generates a linker error: undefined reference to `GetCurrentFiber'. - # This only affects 32-bit builds - # See https://github.com/openssl/openssl/issues/513 - # See https://github.com/mingw-w64/mingw-w64/commit/8da1aae7a7ff5bf996878dc8fe30a0e01e210e5a - pkg.add_source('file://resources/patches/windows/FORCEINLINE-i686-w64-mingw32-winnt.h') - build_commands << "#{platform.patch} --dir #{settings[:gcc_root]}/#{settings[:platform_triple]} --strip=2 --fuzz=0 --ignore-whitespace --no-backup-if-mismatch < ../FORCEINLINE-i686-w64-mingw32-winnt.h" - end - build_commands << "#{platform[:make]} depend" build_commands << platform[:make] diff --git a/resources/patches/libffi/revert_clang_32bit.patch b/resources/patches/libffi/revert_clang_32bit.patch deleted file mode 100644 index 1e03e65e..00000000 --- a/resources/patches/libffi/revert_clang_32bit.patch +++ /dev/null @@ -1,23 +0,0 @@ -commit a70ab2d397bfbdb10ab3ba1f98321763105bc017 -Author: Josh Cooper -Date: Tue Feb 7 17:33:09 2023 -0800 - - Revert "Allow to build with mingw-clang (#579)" - - This reverts commit 8cc8f446f5aac13e107161dffbc15d1ee1a58878. - -diff --git a/src/x86/sysv.S b/src/x86/sysv.S -index c7a0fb5..26e7fea 100644 ---- a/src/x86/sysv.S -+++ b/src/x86/sysv.S -@@ -56,8 +56,8 @@ - - /* Handle win32 fastcall name mangling. */ - #ifdef X86_WIN32 --# define ffi_call_i386 "@ffi_call_i386@8" --# define ffi_closure_inner "@ffi_closure_inner@8" -+# define ffi_call_i386 @ffi_call_i386@8 -+# define ffi_closure_inner @ffi_closure_inner@8 - #else - # define ffi_call_i386 C(ffi_call_i386) - # define ffi_closure_inner C(ffi_closure_inner) diff --git a/resources/patches/openssl/openssl-mingw-do-not-build-applink.patch b/resources/patches/openssl/openssl-mingw-do-not-build-applink.patch deleted file mode 100644 index 628216b0..00000000 --- a/resources/patches/openssl/openssl-mingw-do-not-build-applink.patch +++ /dev/null @@ -1,12 +0,0 @@ -diff -u --recursive a/Configure b/Configure ---- a/Configure 2015-07-09 04:57:15.000000000 -0700 -+++ b/Configure 2015-12-15 13:15:12.377660400 -0800 -@@ -591,7 +591,7 @@ - "BC-32","bcc32::::WIN32::BN_LLONG DES_PTR RC4_INDEX EXPORT_VAR_AS_FN:${no_asm}:win32", - - # MinGW --"mingw", "gcc:-mno-cygwin -DL_ENDIAN -DWIN32_LEAN_AND_MEAN -fomit-frame-pointer -O3 -march=i486 -Wall::-D_MT:MINGW32:-lws2_32 -lgdi32 -lcrypt32:BN_LLONG ${x86_gcc_des} ${x86_gcc_opts} EXPORT_VAR_AS_FN:${x86_asm}:coff:win32:cygwin-shared:-D_WINDLL -DOPENSSL_USE_APPLINK:-mno-cygwin:.dll.a", -+"mingw", "gcc:-mno-cygwin -DL_ENDIAN -DWIN32_LEAN_AND_MEAN -fomit-frame-pointer -O3 -march=i486 -Wall::-D_MT:MINGW32:-lws2_32 -lgdi32 -lcrypt32:BN_LLONG ${x86_gcc_des} ${x86_gcc_opts} EXPORT_VAR_AS_FN:${x86_asm}:coff:win32:cygwin-shared:-D_WINDLL:-mno-cygwin:.dll.a", - # As for OPENSSL_USE_APPLINK. Applink makes it possible to use .dll - # compiled with one compiler with application compiled with another - # compiler. It's possible to engage Applink support in mingw64 build, diff --git a/resources/patches/windows/FORCEINLINE-i686-w64-mingw32-winnt.h b/resources/patches/windows/FORCEINLINE-i686-w64-mingw32-winnt.h deleted file mode 100644 index 081dde25..00000000 --- a/resources/patches/windows/FORCEINLINE-i686-w64-mingw32-winnt.h +++ /dev/null @@ -1,70 +0,0 @@ -From 8da1aae7a7ff5bf996878dc8fe30a0e01e210e5a Mon Sep 17 00:00:00 2001 -From: Corinna Vinschen -Date: Tue, 25 Aug 2015 13:51:02 +0200 -Subject: [PATCH] winnt.h: FORCELINLINE inline-only definitions - -The following test application fails to build on i686 when building -without optimization: - - $ cat foo.c - #include - - int - main () - { - MEMORY_BASIC_INFORMATION m; - NT_TIB *tib = (NT_TIB *) NtCurrentTeb (); - VirtualQuery (tib, &m, sizeof m); - } - $ gcc -g -O foo.c -o foo - $ gcc -g foo.c -o foo - /tmp/ccnnAEl3.o: In function `main': - /home/corinna/foo.c:7: undefined reference to `NtCurrentTeb' - collect2: error: ld returned 1 exit status - -There's no way around that, except for building with optimization, which -is often not prudent when debugging. - -In winnt.h, NtCurrentTeb is using __CRT_INLINE which, depending on C -standard, expandes into - - extern inline __attribute__((__gnu_inline__)) - -or - - extern __inline__ - -However, that's not sufficient for NtCurrentTeb, nor for GetCurrentFiber, -nor for GetFiberData, since these are inline-only functions not backed by -non-inlined library versions. - -This patch fixes that by using FORCEINLINE in place of __CRT_INLINE. - -Signed-off-by: Corinna Vinschen ---- - mingw-w64-headers/include/winnt.h | 6 +++--- - 1 file changed, 3 insertions(+), 3 deletions(-) - -diff --git a/mingw-w64-headers/include/winnt.h b/mingw-w64-headers/include/winnt.h -index 8d8bd0d18..56d663df5 100644 ---- a/mingw-w64-headers/include/winnt.h -+++ b/mingw-w64-headers/include/winnt.h -@@ -1995,15 +1995,15 @@ __buildmemorybarrier() - - #define DbgRaiseAssertionFailure __int2c - -- __CRT_INLINE struct _TEB *NtCurrentTeb(void) -+ FORCEINLINE struct _TEB *NtCurrentTeb(void) - { - return (struct _TEB *)__readfsdword(PcTeb); - } -- __CRT_INLINE PVOID GetCurrentFiber(void) -+ FORCEINLINE PVOID GetCurrentFiber(void) - { - return(PVOID)__readfsdword(0x10); - } -- __CRT_INLINE PVOID GetFiberData(void) -+ FORCEINLINE PVOID GetFiberData(void) - { - return *(PVOID *)GetCurrentFiber(); - }