From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 14E013858C53; Tue, 28 Feb 2023 21:11:14 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 14E013858C53 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1677618674; bh=Vic6oKlKJ/0A7Oq3cneKzkFmtG3tuQ9p2MIhZ/xTrbs=; h=From:To:Subject:Date:In-Reply-To:References:From; b=LMwpo3ss6X8FdSIqzKyrUZBrfHCdhGdV6RFuVlQb5yRD38h91tVWq53DI2GoJuxD/ Z+qq6bIzD+ZWvMAmHk8EKFUYPAZdecYokQYNTspa5YVQV420RwKxh/yOkTnbPnfPam UPyoeR7cAsvAzZihXHjvEs0hEmucRUicCszncOMM= From: "costas.argyris at gmail dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug driver/108865] gcc on Windows fails with Unicode path to source file Date: Tue, 28 Feb 2023 21:11:13 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: driver X-Bugzilla-Version: unknown X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: costas.argyris at gmail dot com X-Bugzilla-Status: NEW X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 List-Id: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D108865 --- Comment #7 from Costas Argyris --- I think the problem is that the embedding of the manifest into the executab= le is a very low-level process that depends on ms specifics that mt.exe (or VS) knows about and windres + link doesn't. For example, by inspecting an executable patched with mt.exe through a hex editor, one can see that there is some padding involved. This is mention= ed here: http://www.vbaccelerator.com/home/VB/Code/Libraries/XP_Visual_Styles/Using_= XP_Visual_Styles_in_VB/article.asp "For some bizarre reason, you must also ensure that the resulting XML file = is an even multiple of 4 bytes long. So for example, if your file is actually = 597 bytes you need to add padding spaces to make up the file size to 600 bytes before compiling." However, even after doing that I wasn't able to get it to work. I think = the proper ms way does more to the binary than just embed the manifest and pad, which is not done by the windres + link approach. I couldn't find examples online for doing this. There are examples of compiling and linking resource files in general using GNU tools, but not a resource file that just references a manifest xml file. So unless someone has some deeper knowledge on how to do this, I seem to be blocked atm.=