Subject: bug#17176: 24.3.50; Problem with manifests on cygw32 build with new binutils

From: Ken Brown <[email-masked]>
Date: Wed, 02 Apr 2014 18:19:34 -0400

On 4/2/2014 4:59 PM, Eli Zaretskii wrote:
>> Date: Wed, 02 Apr 2014 23:29:35 +0300
>> From: Eli Zaretskii <[email-masked]>
>> Cc: [email-masked]
>>
>>> Date: Wed, 02 Apr 2014 15:07:23 -0400
>>> From: Ken Brown <[email-masked]>
>>>
>>> binutils has changed so that, on Cygwin, executables have a manifest
>>> built in by default.  A consequence is that the cygw32 build of emacs
>>> produces an emacs.exe which, after it is stripped, won't run:
>>>
>>> $ ./emacs-stripped.exe
>>> -bash: ./emacs-stripped.exe: cannot execute binary file
>>>
>>> This is presumably caused by the fact that the cygw32 build already
>>> incorporates a manifest via nt/emacs.res.
>>
>> Are you sure this is the cause?

No, but I don't think it matters.  I think the patch is correct anyway, 
for reasons I'll explain below.

> Also, what about those Cygwin users who didn't yet upgrade to this new
> version of Binutils? they will be left with no manifest.

They don't need one.  Cygwin binaries generally have no manifest (prior 
to the Binutils change).  The only exceptions are for programs that need 
a manifest to avoid UAC problems because their names happen to contain 
"update" or "patch", for instance.  Not that Binutils has changed, 
people doing builds on Cygwin never have to think about manifests even 
in these exceptional cases.

The fact that the cygw32 build of emacs uses a manifest is a consequence 
(probably unintended, but only Daniel could say for sure) of the fact 
that emacs.res is linked in.  And the only reason for linking in 
emacs.res is to get the emacs icon into the cygw32 build.

> Failing that, a configure-time test for this version of Binutils will
> be needed, I think.

This isn't necessary.  The old Binutils works fine after the patch.  The 
only difference is that there's no manifest but, as I said above, none 
is needed.

Ken