Commit a3e6652b authored by Vitaly Lipatov's avatar Vitaly Lipatov

update spec to new build 8.2 (with rpmrb script)

parent ec018132
From: Vitaly Lipatov <lav@etersoft.ru>
Date: Wed, 12 Jul 2023 03:52:05 +0300
Subject: [PATCH] fix build on 32 bit systems with llvm
(https://bugs.winehq.org/show_bug.cgi?id=54889)
To: wine-devel <wine-devel@winehq.org>
Revert "winebuild: Use .incbin instead of printf for resource data."
This reverts commit 0b3f90ab1485d5bd32bd72d41c7fd8213b3b95b9.
---
tools/winebuild/res32.c | 33 +++++++++++++++++++++++++--------
1 file changed, 25 insertions(+), 8 deletions(-)
diff --git a/tools/winebuild/res32.c b/tools/winebuild/res32.c
index 676693e178d..1299730fe62 100644
--- a/tools/winebuild/res32.c
+++ b/tools/winebuild/res32.c
@@ -44,8 +44,6 @@ struct resource
{
struct string_id type;
struct string_id name;
- const char *input_name;
- unsigned int input_offset;
const void *data;
unsigned int data_size;
unsigned int data_offset;
@@ -158,6 +156,28 @@ static void put_string( const struct string_id *str )
}
}
+static void dump_res_data( const struct resource *res )
+{
+ unsigned int i = 0;
+ unsigned int size = (res->data_size + 3) & ~3;
+
+ if (!size) return;
+
+ input_buffer = res->data;
+ input_buffer_pos = 0;
+ input_buffer_size = size;
+
+ output( "\t.long " );
+ while (size > 4)
+ {
+ if ((i++ % 16) == 15) output( "0x%08x\n\t.long ", get_dword() );
+ else output( "0x%08x,", get_dword() );
+ size -= 4;
+ }
+ output( "0x%08x\n", get_dword() );
+ assert( input_buffer_pos == input_buffer_size );
+}
+
/* check the file header */
/* all values must be zero except header size */
static int check_header(void)
@@ -179,7 +199,7 @@ static int check_header(void)
}
/* load the next resource from the current file */
-static void load_next_resource( DLLSPEC *spec, const char *name )
+static void load_next_resource( DLLSPEC *spec )
{
unsigned int hdr_size;
struct resource *res = add_resource( spec );
@@ -189,9 +209,6 @@ static void load_next_resource( DLLSPEC *spec, const char *name )
if (hdr_size & 3) fatal_error( "%s header size not aligned\n", input_buffer_filename );
if (hdr_size < 32) fatal_error( "%s invalid header size %u\n", input_buffer_filename, hdr_size );
- res->input_name = xstrdup( name );
- res->input_offset = input_buffer_pos - 2*sizeof(unsigned int) + hdr_size;
-
res->data = input_buffer + input_buffer_pos - 2*sizeof(unsigned int) + hdr_size;
if ((const unsigned char *)res->data < input_buffer ||
(const unsigned char *)res->data >= input_buffer + input_buffer_size)
@@ -220,7 +237,7 @@ int load_res32_file( const char *name, DLLSPEC *spec )
if ((ret = check_header()))
{
- while (input_buffer_pos < input_buffer_size) load_next_resource( spec, name );
+ while (input_buffer_pos < input_buffer_size) load_next_resource( spec );
}
return ret;
}
@@ -473,7 +490,7 @@ void output_resources( DLLSPEC *spec )
{
output( "\n\t.align %d\n", get_alignment(4) );
output( ".L__wine_spec_res_%d:\n", i );
- output( "\t.incbin \"%s\",%d,%d\n", res->input_name, res->input_offset, res->data_size );
+ dump_res_data( res );
}
if (!is_pe())
--
2.33.8
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
%define winetricks_version 20220617 %define winetricks_version 20220617
%define basemajor 8.x %define basemajor 8.x
%define major 8.1 %define major 8.2
%define rel %nil %define rel %nil
%define conflictbase wine %define conflictbase wine
...@@ -45,7 +45,7 @@ ...@@ -45,7 +45,7 @@
%def_with opencl %def_with opencl
%endif %endif
%if_feature pcap 1.2.1 %if_feature pcap 1.10.3
%def_with pcap %def_with pcap
%else %else
%def_without pcap %def_without pcap
...@@ -87,6 +87,7 @@ Source6: %name-%version-bin-scripts.tar ...@@ -87,6 +87,7 @@ Source6: %name-%version-bin-scripts.tar
#Source10: %name-patches-%version.tar #Source10: %name-patches-%version.tar
Patch1: 0011-build-fake-binary-makes-autoreq-happy.patch Patch1: 0011-build-fake-binary-makes-autoreq-happy.patch
Patch2: 0102-fix-build-on-32-bit-systems-with-llvm-https-bugs.win.patch
AutoReq: yes, noperl, nomingw32 AutoReq: yes, noperl, nomingw32
...@@ -99,6 +100,13 @@ ExclusiveArch: %ix86 x86_64 aarch64 ...@@ -99,6 +100,13 @@ ExclusiveArch: %ix86 x86_64 aarch64
%define optflags_lto -flto=thin %define optflags_lto -flto=thin
%endif %endif
# minimalize memory using
%ifarch %ix86 armh
%define optflags_debug -g0
%define optflags_lto %nil
%endif
# disable LTO: link error in particular, and unverified in general # disable LTO: link error in particular, and unverified in general
#x86_64-alt-linux-gcc -m64 -o loader/wine64-preloader loader/preloader.o loader/preloader_mac.o -static -nostartfiles -nodefaultlibs \ #x86_64-alt-linux-gcc -m64 -o loader/wine64-preloader loader/preloader.o loader/preloader_mac.o -static -nostartfiles -nodefaultlibs \
# -Wl,-Ttext=0x7d400000 # -Wl,-Ttext=0x7d400000
...@@ -152,7 +160,6 @@ ExclusiveArch: %ix86 x86_64 aarch64 ...@@ -152,7 +160,6 @@ ExclusiveArch: %ix86 x86_64 aarch64
%add_verify_elf_skiplist %winebindir/* %add_verify_elf_skiplist %winebindir/*
%endif %endif
# TODO: remove it for mingw build (when there will no any dll.so files) # TODO: remove it for mingw build (when there will no any dll.so files)
%add_verify_elf_skiplist %libwinedir/%winesodir/*.*.so %add_verify_elf_skiplist %libwinedir/%winesodir/*.*.so
%add_findreq_skiplist %libwinedir/%winepedir/* %add_findreq_skiplist %libwinedir/%winepedir/*
...@@ -442,6 +449,7 @@ develop programs using %name. ...@@ -442,6 +449,7 @@ develop programs using %name.
%prep %prep
%setup %setup
%patch1 -p1 %patch1 -p1
%patch2 -p1
# Apply local patches # Apply local patches
#name-patches/patchapply.sh #name-patches/patchapply.sh
...@@ -814,6 +822,12 @@ fi ...@@ -814,6 +822,12 @@ fi
%libwinedir/%winesodir/lib*.a %libwinedir/%winesodir/lib*.a
%changelog %changelog
* Thu Mar 09 2023 Vitaly Lipatov <lav@altlinux.ru> 1:8.2-alt1
- new version 8.2 (with rpmrb script)
- upgrade libpcap require to 1.10.3 (due pcap_init())
- use -g0 for 32 bit systems (minimize memory)
- fix build on 32 bit systems with llvm
* Thu Mar 09 2023 Vitaly Lipatov <lav@altlinux.ru> 1:8.1-alt1 * Thu Mar 09 2023 Vitaly Lipatov <lav@altlinux.ru> 1:8.1-alt1
- new version 8.1 (with rpmrb script) - new version 8.1 (with rpmrb script)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment