From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Ken Brown Newsgroups: gmane.emacs.devel Subject: Cygwin patches Date: Fri, 20 Nov 2009 15:00:34 -0500 Message-ID: <4B06F562.8060504@cornell.edu> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="------------040901040501090502000703" X-Trace: ger.gmane.org 1258747259 23952 80.91.229.12 (20 Nov 2009 20:00:59 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 20 Nov 2009 20:00:59 +0000 (UTC) To: Emacs Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Nov 20 21:00:51 2009 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1NBZet-0005Cd-G3 for ged-emacs-devel@m.gmane.org; Fri, 20 Nov 2009 21:00:43 +0100 Original-Received: from localhost ([127.0.0.1]:48247 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NBZet-0005CF-5d for ged-emacs-devel@m.gmane.org; Fri, 20 Nov 2009 15:00:43 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NBZeo-0005C2-77 for emacs-devel@gnu.org; Fri, 20 Nov 2009 15:00:38 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1NBZej-0005BL-Jm for emacs-devel@gnu.org; Fri, 20 Nov 2009 15:00:37 -0500 Original-Received: from [199.232.76.173] (port=34453 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NBZej-0005BI-EG for emacs-devel@gnu.org; Fri, 20 Nov 2009 15:00:33 -0500 Original-Received: from granite1.mail.cornell.edu ([128.253.83.141]:41160 helo=authusersmtp.mail.cornell.edu) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1NBZei-0006uO-Ro for emacs-devel@gnu.org; Fri, 20 Nov 2009 15:00:33 -0500 Original-Received: from [128.84.234.191] (markov.math.cornell.edu [128.84.234.191]) (authenticated bits=0) by authusersmtp.mail.cornell.edu (8.13.1/8.12.10) with ESMTP id nAKK0VNb027856 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT) for ; Fri, 20 Nov 2009 15:00:31 -0500 (EST) User-Agent: Thunderbird 2.0.0.23 (Windows/20090812) X-detected-operating-system: by monty-python.gnu.org: Solaris 9 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:117376 Archived-At: This is a multi-part message in MIME format. --------------040901040501090502000703 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Now that you're preparing for emacs 23.2, could you please apply the cygwin patches that I submitted last June? http://lists.gnu.org/archive/html/emacs-devel/2009-06/msg00041.html http://lists.gnu.org/archive/html/emacs-devel/2009-06/msg00330.html For your convenience, I've remade the patches against the current CVS source and attached them to this message. I don't want to repeat the rationale for the patches that was already made in the threads cited above, but let me just add two comments: 1. The patches to browse-url.el and cygwin.h fix cygwin problems and should have no impact on other systems. 2. I built the official cygwin emacs-23.1 package with these patches, and there have been no reported problems after several months of use. Thanks for your consideration. Ken --------------040901040501090502000703 Content-Type: text/plain; name="browse-url.el.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="browse-url.el.patch" --- origsrc/lisp/net/browse-url.el 2009-11-20 11:34:25.000000000 -0500 +++ src/lisp/net/browse-url.el 2009-11-20 11:35:28.000000000 -0500 @@ -693,7 +693,9 @@ (cond ((not (buffer-modified-p))) (browse-url-save-file (save-buffer)) (t (message "%s modified since last save" file)))))) - (browse-url (browse-url-file-url file)) + (if (eq system-type 'cygwin) + (shell-command (concat "cygstart " (shell-quote-argument file))) + (browse-url (browse-url-file-url file))) (run-hooks 'browse-url-of-file-hook)) (defun browse-url-file-url (file) @@ -830,11 +832,13 @@ (defun browse-url-default-windows-browser (url &optional new-window) (interactive (browse-url-interactive-arg "URL: ")) - (if (eq system-type 'ms-dos) - (if dos-windows-version - (shell-command (concat "start " (shell-quote-argument url))) - (error "Browsing URLs is not supported on this system")) - (w32-shell-execute "open" url))) + (cond ((eq system-type 'ms-dos) + (if dos-windows-version + (shell-command (concat "start " (shell-quote-argument url))) + (error "Browsing URLs is not supported on this system"))) + ((eq system-type 'cygwin) + (shell-command (concat "cygstart " (shell-quote-argument url)))) + (t (w32-shell-execute "open" url)))) (defun browse-url-default-macosx-browser (url &optional new-window) (interactive (browse-url-interactive-arg "URL: ")) --------------040901040501090502000703 Content-Type: text/plain; name="PROBLEMS.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="PROBLEMS.patch" --- origsrc/etc/PROBLEMS 2009-11-20 11:34:12.000000000 -0500 +++ src/etc/PROBLEMS 2009-11-20 11:34:46.000000000 -0500 @@ -255,6 +255,18 @@ Cygwin malloc, the Cygwin memalign always returns ENOSYS. A fix for this problem would be welcome. +A workaround is to set G_SLICE=always-malloc before starting emacs. +For example, in bash, + + G_SLICE=always-malloc emacs + +or put + + export G_SLICE=always-malloc + +in one of the bash startup files. This also has to be done before +building emacs on Cygwin with Gtk+. + * General runtime problems ** Lisp problems @@ -2207,34 +2219,6 @@ changes the keyboard layout depends on your Windows version; for XP, in the Languages tab, click "Details" and then "Key Settings".) -** Cygwin build of Emacs hangs after rebasing Cygwin DLLs - -Usually, on Cygwin, one needs to rebase the DLLs if an application -aborts with a message like this: - - C:\cygwin\bin\python.exe: *** unable to remap C:\cygwin\bin\cygssl.dll to - same address as parent(0xDF0000) != 0xE00000 - -However, since Cygwin DLL 1.5.17 was released, after such rebasing, -Emacs hangs. - -This was reported to happen for Emacs 21.2 and also for the pretest of -Emacs 22.1 on Cygwin. - -To work around this, build Emacs like this: - - LDFLAGS='-Wl,--enable-auto-import -Wl,--enable-auto-image-base' ./configure - make LD='$(CC)' - make LD='$(CC)' install - -This produces an Emacs binary that is independent of rebasing. - -Note that you _must_ use LD='$(CC)' in the last two commands above, to -prevent GCC from passing the "--image-base 0x20000000" option to the -linker, which is what it does by default. That option produces an -Emacs binary with the base address 0x20000000, which will cause Emacs -to hang after Cygwin DLLs are rebased. - ** Interrupting Cygwin port of Bash from Emacs doesn't work. Cygwin 1.x builds of the ported Bash cannot be interrupted from the @@ -2481,17 +2465,12 @@ (using the location of the 32-bit X libraries on your system). -*** Building the Cygwin port for MS-Windows can fail with some GCC versions +*** Building the Cygwin port of emacs requires GCC 4 -Building Emacs 22 with Cygwin builds of GCC 3.4.4-1 and 3.4.4-2 is -reported to either fail or cause Emacs to segfault at run time. In -addition, the Cygwin GCC 3.4.4-2 has problems with generating debug -info. Cygwin users are advised not to use these versions of GCC for -compiling Emacs. GCC versions 4.0.3, 4.0.4, 4.1.1, and 4.1.2 -reportedly build a working Cygwin binary of Emacs, so we recommend -these GCC versions. Note that these versions of GCC, 4.0.3, 4.0.4, -4.1.1, and 4.1.2, are currently the _only_ versions known to succeed -in building Emacs (as of v22.1). +As of Emacs 22.1, there have been problems with Cygwin builds of Emacs +using GCC 3. Cygwin users are advised to use GCC 4. As far as we +know, there have been no problems with Cygwin builds of Emacs using +GCC 4. *** Building the native MS-Windows port with Cygwin GCC can fail. --------------040901040501090502000703 Content-Type: text/plain; name="cygwin.h.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="cygwin.h.patch" --- origsrc/src/s/cygwin.h 2009-06-21 00:38:20.000000000 -0400 +++ src/src/s/cygwin.h 2009-11-20 11:41:27.281250000 -0500 @@ -105,11 +105,7 @@ #define SYSV_SYSTEM_DIR 1 #define UNEXEC unexcw.o #define POSIX_SIGNALS 1 -/* force the emacs image to start high in memory, so dll relocation - can put things in low memory without causing all sorts of grief for - emacs lisp pointers */ -#define DATA_SEG_BITS 0x20000000 -#define LINKER $(CC) -Wl,--image-base,DATA_SEG_BITS +#define LINKER $(CC) /* Use terminfo instead of termcap. Fewer environment variables to go wrong, more terminal types. */ --------------040901040501090502000703--