From nobody Wed Nov 01 12:33:12 2023 X-Original-To: dev-commits-ports-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4SL5yJ6yk3z50Nnc; Wed, 1 Nov 2023 12:33:12 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4SL5yJ6SKSz4GHx; Wed, 1 Nov 2023 12:33:12 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1698841992; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=2J1lxL0ZeSwGDBTJ5nGri1i1dU03AUtaIpHcRG4/l1s=; b=vDePUhXlcoX6cZCeSpXwRGKK4ZHifPPBw9g/IwoA/fiOIefPJdMQ2li/r+YuINzoDVKAWK Eq//LVc6IDwUwtsa3IJtonbHG/teFx+sPseY+YXyKLVK7PenDeClV/2ygvZlr/C5XCoNkR k9jvq8cSUlAyzQMfvuyk3+kqwni7+AhcmlsdqBMBXdoBR064qBmRRu56kQL/LeQZaabNzD dSAYz7XKlXm7wzw3OKeYXPNflx1avUnSGlbKT4odMHa2u3vjv0DjKKm5ex3je22lNy01Rw W+kJVBt2g/Hl+jMwwr9wnPNusdcSven6t972EeJ71sJXK5aUuTv8y54hZ+rbyA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1698841992; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=2J1lxL0ZeSwGDBTJ5nGri1i1dU03AUtaIpHcRG4/l1s=; b=YSsJYA3KLRBdNftiBjjgSc2KjATGLQKMjVUrcjUCKABsdkm7zkdSNawerEUKqiVcMl5F6G 4MvQZQBY6aw+m+IRfBvnCU8MUlQlRDWavuSaW7Rc7FpK5MNCJDZprdf9vaaOt86Zrsgd2I EYnHPw3qmzpAhSCiFQ9FFQRtKvZtBfD400zKNNr5p1EWAG2b9VtFxtKDa0xrxhv1Mwjq/b GvhMd3oG5DmHRWcPEbmwL07qY1iTgGXx//fg77lrL9tHRKHsTi4Son2koQ+AtVeSaEfaM/ GWIiTZL7R470lU84LkDRMsCuw6diyuwUi0egu5NtmsFkLMGPuTwoCxTw/7tkpQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1698841992; a=rsa-sha256; cv=none; b=wNTJM0EGKXAxdq6yqqJwgT7ZCO2In/rMDaHiM7PZ4N0ilL/FDd7Xr9eFh36uVzTBT8WCpJ JtIojClBOY4ioY0hdTOfYrFRRF+kXp8qac8VS8hCk1dDIrvtFyjS9dm1vgEUfLZhDCGWiy uXa9MFGJsrrWeQ4vwrKD46KK/A7i1+CJkp7iWuNq2nnNlPQ91VI+iks5QlJrMbKBxdrQZ/ d34sK4pzWS2M7LrTkVx8GpAp8AlqVNCy0iDtL8Qm+R/KCvOJPq5tD/G21E0Kj5in7x4SbB 3fxYxrChIa4hETBwXerDgj1NfInIrdp/c98IDM7SKjtKXbR804Zw3VrHow4Ecg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4SL5yJ5VLpzmbR; Wed, 1 Nov 2023 12:33:12 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 3A1CXCi3016137; Wed, 1 Nov 2023 12:33:12 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 3A1CXCND016134; Wed, 1 Nov 2023 12:33:12 GMT (envelope-from git) Date: Wed, 1 Nov 2023 12:33:12 GMT Message-Id: <202311011233.3A1CXCND016134@gitrepo.freebsd.org> To: ports-committers@FreeBSD.org, dev-commits-ports-all@FreeBSD.org, dev-commits-ports-main@FreeBSD.org From: Gerald Pfeifer Subject: git: a9a707cc8f11 - main - emulators/wine-devel: Unbreak on i386 List-Id: Commit messages for all branches of the ports repository List-Archive: https://lists.freebsd.org/archives/dev-commits-ports-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-ports-all@freebsd.org X-BeenThere: dev-commits-ports-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: gerald X-Git-Repository: ports X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: a9a707cc8f112c79b6d8cbf9ab0f75bd99294cfa Auto-Submitted: auto-generated The branch main has been updated by gerald: URL: https://cgit.FreeBSD.org/ports/commit/?id=a9a707cc8f112c79b6d8cbf9ab0f75bd99294cfa commit a9a707cc8f112c79b6d8cbf9ab0f75bd99294cfa Author: Gerald Pfeifer AuthorDate: 2023-11-01 12:17:22 +0000 Commit: Gerald Pfeifer CommitDate: 2023-11-01 12:32:50 +0000 emulators/wine-devel: Unbreak on i386 Revert an upstream change to tools/winebuild/res32.c that exposed resource contraints for clang on i386 (cf. the upstream reports at https://github.com/llvm/llvm-project/issues/62339 and https://bugs.winehq.org/show_bug.cgi?id=54889 ). Apply this patch only on i386 to minimize divergence and risk on 64-bit x86. PR: 273987 [1], 271201 [2] Bi-sected by: Damjan Jovanovic [2] Motivated by: scf [1] --- emulators/wine-devel/Makefile | 2 +- .../files/extra-patch-tools-winebuild-res32 | 95 ++++++++++++++++++++++ 2 files changed, 96 insertions(+), 1 deletion(-) diff --git a/emulators/wine-devel/Makefile b/emulators/wine-devel/Makefile index a3659db22d33..11a96abed229 100644 --- a/emulators/wine-devel/Makefile +++ b/emulators/wine-devel/Makefile @@ -14,7 +14,6 @@ LICENSE_COMB= dual LICENSE_FILE= ${WRKSRC}/LICENSE ONLY_FOR_ARCHS= amd64 i386 -BROKEN_i386= fails to build: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=271201\#c6 BUILD_DEPENDS= ${LOCALBASE}/bin/flex:textproc/flex llvm${_LLVM_VERSION}>=0:devel/llvm${_LLVM_VERSION} @@ -147,6 +146,7 @@ post-patch: ${REINPLACE_CMD} '/Exec/s|wine|wine64|g' ${WRKSRC}/loader/wine.desktop .else +EXTRA_PATCHES+= files/extra-patch-tools-winebuild-res32 PLIST_SUB+= WINE32="" WINE64="@comment " WINEARCH="i386" .endif diff --git a/emulators/wine-devel/files/extra-patch-tools-winebuild-res32 b/emulators/wine-devel/files/extra-patch-tools-winebuild-res32 new file mode 100644 index 000000000000..7c6c62b9fe58 --- /dev/null +++ b/emulators/wine-devel/files/extra-patch-tools-winebuild-res32 @@ -0,0 +1,95 @@ +The upstream change + + commit 0b3f90ab1485d5bd32bd72d41c7fd8213b3b95b9 + Author: RĂ©mi Bernon + Date: Sat Feb 11 11:05:22 2023 +0100 + + winebuild: Use .incbin instead of printf for resource data. + +apparently causes some (not completely reproducible) build +issues on i386 due to resource exhaustion by the compiler, +cf. https://bugs.winehq.org/show_bug.cgi?id=54889 . + +https://github.com/llvm/llvm-project/issues/62339 tracks this on +the LLVM side, alas has not really seen progress since April 2003. +So for now this reverts the upstream commit (alas on i386 only as +to minimize divergence and risk on 64-bit x86). + + +--- tools/winebuild/res32.c ++++ 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.balign 4\n" ); + 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())