GNU bug report logs - #17176
24.3.50; Problem with manifests on cygw32 build with new binutils

Previous Next

Package: emacs;

Reported by: Ken Brown <kbrown <at> cornell.edu>

Date: Wed, 2 Apr 2014 19:08:01 UTC

Severity: important

Found in version 24.3.50

Fixed in version 24.4

Done: Ken Brown <kbrown <at> cornell.edu>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 17176 in the body.
You can then email your comments to 17176 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#17176; Package emacs. (Wed, 02 Apr 2014 19:08:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Ken Brown <kbrown <at> cornell.edu>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Wed, 02 Apr 2014 19:08:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Ken Brown <kbrown <at> cornell.edu>
To: bug-gnu-emacs <at> gnu.org
Subject: 24.3.50; Problem with manifests on cygw32 build with new binutils
Date: Wed, 02 Apr 2014 15:07:23 -0400
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.  The following patch fixes 
this and does some related manifest-related cleanup:

=== modified file 'configure.ac'
--- configure.ac        2014-03-27 21:29:32 +0000
+++ configure.ac        2014-04-02 17:47:41 +0000
@@ -1834,11 +1834,6 @@
   W32_OBJ="w32fns.o w32menu.o w32reg.o w32font.o w32term.o"
   W32_OBJ="$W32_OBJ w32xfns.o w32select.o w32uniscribe.o"
   EMACSRES="emacs.res"
-  case "$canonical" in
-    x86_64-*-*) EMACS_MANIFEST="emacs-x64.manifest" ;;
-    *) EMACS_MANIFEST="emacs-x86.manifest" ;;
-  esac
-  UPDATE_MANIFEST=update-game-score.exe.manifest
   if test "${opsys}" = "cygwin"; then
     W32_LIBS="$W32_LIBS -lkernel32 -luser32 -lgdi32 -lole32 -lcomdlg32"
     W32_LIBS="$W32_LIBS -lusp10 -lcomctl32 -lwinspool"
@@ -1846,6 +1841,11 @@
     # the rc file), not a linker script.
     W32_RES_LINK="-Wl,emacs.res"
   else
+    case "$canonical" in
+      x86_64-*-*) EMACS_MANIFEST="emacs-x64.manifest" ;;
+      *) EMACS_MANIFEST="emacs-x86.manifest" ;;
+    esac
+    UPDATE_MANIFEST=update-game-score.exe.manifest
     W32_OBJ="$W32_OBJ w32.o w32console.o w32heap.o w32inevt.o w32proc.o"
     W32_LIBS="$W32_LIBS -lwinmm -lgdi32 -lcomdlg32"
     W32_LIBS="$W32_LIBS -lmpr -lwinspool -lole32 -lcomctl32 -lusp10"

=== modified file 'nt/emacs.rc'
--- nt/emacs.rc 2014-03-21 10:12:53 +0000
+++ nt/emacs.rc 2014-04-02 18:30:53 +0000
@@ -1,10 +1,12 @@
 Emacs ICON   icons/emacs.ico
 32649 CURSOR icons/hand.cur
-#if defined (WIN64) || defined (__x86_64__)
+#ifndef __CYGWIN__
+#ifdef WIN64
 1 24 "emacs-x64.manifest"
 #else
 1 24 "emacs-x86.manifest"
 #endif
+#endif

 #ifndef VS_VERSION_INFO
 #define VS_VERSION_INFO 1

=== modified file 'src/Makefile.in'
--- src/Makefile.in     2014-01-12 17:27:17 +0000
+++ src/Makefile.in     2014-04-02 18:29:50 +0000
@@ -259,7 +259,7 @@

 ## emacs.res if HAVE_W32
 EMACSRES = @EMACSRES@
-## emacs-*.manifest if HAVE_W32
+## emacs-*.manifest if WINDOWSNT
 EMACS_MANIFEST = @EMACS_MANIFEST@
 ## If HAVE_W32, compiler arguments for including
 ## the resource file in the binary.


OK to apply to the emacs-24 branch?

Ken




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#17176; Package emacs. (Wed, 02 Apr 2014 19:40:01 GMT) Full text and rfc822 format available.

Message #8 received at 17176 <at> debbugs.gnu.org (full text, mbox):

From: Daniel Colascione <dancol <at> dancol.org>
To: Ken Brown <kbrown <at> cornell.edu>, 17176 <at> debbugs.gnu.org
Subject: Re: bug#17176: 24.3.50; Problem with manifests on cygw32 build with
 new binutils
Date: Wed, 02 Apr 2014 12:38:57 -0700
[Message part 1 (text/plain, inline)]
On 04/02/2014 12:07 PM, Ken Brown wrote:
> 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.  The following patch fixes
> this and does some related manifest-related cleanup:

Looks good to me. Thanks.

[signature.asc (application/pgp-signature, attachment)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#17176; Package emacs. (Wed, 02 Apr 2014 20:30:02 GMT) Full text and rfc822 format available.

Message #11 received at 17176 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Ken Brown <kbrown <at> cornell.edu>
Cc: 17176 <at> debbugs.gnu.org
Subject: Re: bug#17176: 24.3.50;
 Problem with manifests on cygw32 build with new binutils
Date: Wed, 02 Apr 2014 23:29:35 +0300
> Date: Wed, 02 Apr 2014 15:07:23 -0400
> From: Ken Brown <kbrown <at> cornell.edu>
> 
> 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?  If so, can you explain how stripping
makes this problem rear its head?  What do you see in the .rsrc
section in the unstripped and in stripped emacs.exe?




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#17176; Package emacs. (Wed, 02 Apr 2014 20:59:04 GMT) Full text and rfc822 format available.

Message #14 received at 17176 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: kbrown <at> cornell.edu
Cc: 17176 <at> debbugs.gnu.org
Subject: Re: bug#17176: 24.3.50;
 Problem with manifests on cygw32 build with new binutils
Date: Wed, 02 Apr 2014 23:59:07 +0300
> Date: Wed, 02 Apr 2014 23:29:35 +0300
> From: Eli Zaretskii <eliz <at> gnu.org>
> Cc: 17176 <at> debbugs.gnu.org
> 
> > Date: Wed, 02 Apr 2014 15:07:23 -0400
> > From: Ken Brown <kbrown <at> cornell.edu>
> > 
> > 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?  If so, can you explain how stripping
> makes this problem rear its head?  What do you see in the .rsrc
> section in the unstripped and in stripped emacs.exe?

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

And are you sure the Cygwin manifest does everything our manifest
does?

If there's a linker switch to disable this automatic embedding of
Cygwin manifest, I'd suggest to use it, at least for emacs-24 branch.
That sounds like a better short-run solution.

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




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#17176; Package emacs. (Wed, 02 Apr 2014 22:20:02 GMT) Full text and rfc822 format available.

Message #17 received at 17176 <at> debbugs.gnu.org (full text, mbox):

From: Ken Brown <kbrown <at> cornell.edu>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 17176 <at> debbugs.gnu.org, Daniel Colascione <dancol <at> dancol.org>
Subject: Re: bug#17176: 24.3.50;	Problem with manifests on cygw32 build with
 new binutils
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 <eliz <at> gnu.org>
>> Cc: 17176 <at> debbugs.gnu.org
>>
>>> Date: Wed, 02 Apr 2014 15:07:23 -0400
>>> From: Ken Brown <kbrown <at> cornell.edu>
>>>
>>> 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





Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#17176; Package emacs. (Thu, 03 Apr 2014 02:49:02 GMT) Full text and rfc822 format available.

Message #20 received at 17176 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Ken Brown <kbrown <at> cornell.edu>
Cc: 17176 <at> debbugs.gnu.org, dancol <at> dancol.org
Subject: Re: bug#17176: 24.3.50;
 Problem with manifests on cygw32 build with new binutils
Date: Thu, 03 Apr 2014 05:48:22 +0300
> Date: Wed, 02 Apr 2014 18:19:34 -0400
> From: Ken Brown <kbrown <at> cornell.edu>
> CC: 17176 <at> debbugs.gnu.org, Daniel Colascione <dancol <at> dancol.org>
> 
> > 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.

The set of names that trigger UAC prompts is not documented anywhere.
We only know some names that people discovered and reported, but not
the whole list.

Besides, the Emacs manifest has recently got an addition that is
important on Windows 8.1 and later, which has nothing to do with UAC.

> 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.

Having a manifest is a system recommendation, not an Emacs invention.

> 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.

I think this is a mistake, but I don't use Cygwin, so it's your call.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#17176; Package emacs. (Thu, 03 Apr 2014 12:51:02 GMT) Full text and rfc822 format available.

Message #23 received at 17176 <at> debbugs.gnu.org (full text, mbox):

From: Ken Brown <kbrown <at> cornell.edu>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 17176 <at> debbugs.gnu.org, dancol <at> dancol.org
Subject: Re: bug#17176: 24.3.50;	Problem with manifests on cygw32 build with
 new binutils
Date: Thu, 03 Apr 2014 08:50:26 -0400
On 4/2/2014 10:48 PM, Eli Zaretskii wrote:
> Having a manifest is a system recommendation, not an Emacs invention.

I understand that, but I see no reason for the cygw32 build of emacs to 
be treated specially (and even differently from the X11 and noX builds 
on Cygwin).  With my patch, Cygwin users who build emacs with an old 
Binutils will have no manifest, like almost all other Cygwin 
applications, while those who use the new Binutils will get the new 
"standard" Cygwin manifest (which includes compatibility with Windows 8.1).

Ken




Reply sent to Ken Brown <kbrown <at> cornell.edu>:
You have taken responsibility. (Thu, 03 Apr 2014 19:13:02 GMT) Full text and rfc822 format available.

Notification sent to Ken Brown <kbrown <at> cornell.edu>:
bug acknowledged by developer. (Thu, 03 Apr 2014 19:13:03 GMT) Full text and rfc822 format available.

Message #28 received at 17176-done <at> debbugs.gnu.org (full text, mbox):

From: Ken Brown <kbrown <at> cornell.edu>
To: 17176-done <at> debbugs.gnu.org
Subject: Re: bug#17176: 24.3.50; Problem with manifests on cygw32 build with
 new binutils
Date: Thu, 03 Apr 2014 15:12:38 -0400
Version: 24.4

Patch applied as rev 116901 on the emacs-24 branch.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#17176; Package emacs. (Wed, 09 Apr 2014 21:22:01 GMT) Full text and rfc822 format available.

Message #31 received at 17176 <at> debbugs.gnu.org (full text, mbox):

From: Ken Brown <kbrown <at> cornell.edu>
To: Angelo Graziosi <angelo.graziosi <at> alice.it>, Eli Zaretskii <eliz <at> gnu.org>
Cc: 17176 <at> debbugs.gnu.org, emacs-devel <at> gnu.org
Subject: Re: Wrong scroll bar in cygw32 build of emacs-24?
Date: Wed, 09 Apr 2014 17:21:37 -0400
I've reverted most of my "fix" of Bug#17176 (r116930 on the emacs-24 
branch).  The entire problem that led to the bug report was a binutils 
bug (problems merging Windows resources), not an emacs bug.

Ken




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Thu, 08 May 2014 11:24:04 GMT) Full text and rfc822 format available.

This bug report was last modified 11 years and 49 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.