unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* Re: Cygwin patches
@ 2009-11-20 23:40 Angelo Graziosi
  2009-11-21  4:50 ` Chong Yidong
  0 siblings, 1 reply; 24+ messages in thread
From: Angelo Graziosi @ 2009-11-20 23:40 UTC (permalink / raw)
  To: Emacs

Ken Brown wrote:
> could you please apply the cygwin patches

I have applied those patches for a long time without problems, but now, 
as I suspected, they have been applied in wrong manner. Indeed now 
building Emacs on Cygwin fails:

[...]
gcc -Wl,--image-base,DATA_SEG_BITS   -Wl,--enable-auto-import 
-Wl,--enable-runtime-pseudo-reloc   -o temacs ecrt0.o dispnew.o frame.o 
scroll.o xdisp.o menu.o xmenu.o window.o charset.o coding.o category.o 
ccl.o character.o chartab.o cm.o term.o terminal.o xfaces.o xterm.o 
xfns.o xselect.o xrdb.o fontset.o xsmfns.o fringe.o image.o xsettings.o 
gtkutil.o dbusbind.o emacs.o keyboard.o macros.o keymap.o sysdep.o 
buffer.o filelock.o insdel.o marker.o minibuf.o fileio.o dired.o 
filemode.o cmds.o casetab.o casefiddle.o indent.o search.o regex.o 
undo.o alloc.o data.o doc.o editfns.o callint.o eval.o floatfns.o fns.o 
font.o print.o lread.o syntax.o unexcw.o bytecode.o process.o callproc.o 
region-cache.o sound.o atimer.o doprnt.o strftime.o intervals.o 
textprop.o composite.o md5.o   sheap.o xfont.o ftfont.o xftfont.o 
ftxfont.o terminfo.o gmalloc.o ralloc.o lastfile.o vm-limit.o 
getloadavg.o     -lgtk-x11-2.0 -lgdk-x11-2.0 -latk-1.0 -lgdk_pixbuf-2.0 
-lpangocairo-1.0 -lgio-2.0 -lXinerama -lXi -lXrandr -lXcursor 
-lXcomposite -lXdamage -lpangoft2-1.0 -lXext -lXfixes -lcairo -lpixman-1 
-lglitz -lpng12 -lxcb-render-util -lXrender -lxcb-render -lX11 -lxcb 
-lXau -lXdmcp -lpango-1.0 -lm -lfontconfig -lexpat -lfreetype -lz 
-lgobject-2.0 -lgmodule-2.0 -lglib-2.0 -lintl -liconv -lpthread -lSM 
-lICE -ltiff -ljpeg -lpng -lz -lm -lgif -lXpm -lX11 -lXft -lXrender 
-lfontconfig -lexpat -liconv -lfreetype -lz -lX11 -lxcb -lXau -lXdmcp 
-ldbus-1 -lpthread -lcurses -lg  -lgconf-2 -lORBit-2 -lm -ldbus-1 
-lpthread -lgmodule-2.0 -lgthread-2.0 -lgobject-2.0 -lglib-2.0 -lintl 
-liconv `gcc -print-libgcc-file-name` -lm -lc `gcc -print-libgcc-file-name`
/usr/lib/gcc/i686-pc-cygwin/4.3.4/../../../../i686-pc-cygwin/bin/ld: 
invalid hex number for PE parameter 'DATA_SEG_BITS'
collect2: ld returned 1 exit status
make[2]: *** [temacs.exe] Error 1
make[2]: Leaving directory `/tmp/emacs/build/src'
make[1]: *** [src] Error 2
make[1]: Leaving directory `/tmp/emacs/build'
make: *** [bootstrap] Error 2

The applied patches for browse-url, PROBLEMS and cygwin.h are different 
from those that Ken have proposed and that work fine since many months.


Ciao,
Angelo.





^ permalink raw reply	[flat|nested] 24+ messages in thread
* Cygwin patches
@ 2009-11-20 20:00 Ken Brown
  2009-11-20 21:50 ` Chong Yidong
  0 siblings, 1 reply; 24+ messages in thread
From: Ken Brown @ 2009-11-20 20:00 UTC (permalink / raw)
  To: Emacs

[-- Attachment #1: Type: text/plain, Size: 800 bytes --]

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

[-- Attachment #2: browse-url.el.patch --]
[-- Type: text/plain, Size: 1389 bytes --]

--- 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: "))

[-- Attachment #3: PROBLEMS.patch --]
[-- Type: text/plain, Size: 2993 bytes --]

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

[-- Attachment #4: cygwin.h.patch --]
[-- Type: text/plain, Size: 606 bytes --]

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

^ permalink raw reply	[flat|nested] 24+ messages in thread

end of thread, other threads:[~2009-11-23 20:59 UTC | newest]

Thread overview: 24+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-11-20 23:40 Cygwin patches Angelo Graziosi
2009-11-21  4:50 ` Chong Yidong
  -- strict thread matches above, loose matches on Subject: below --
2009-11-20 20:00 Ken Brown
2009-11-20 21:50 ` Chong Yidong
2009-11-20 21:59   ` Lennart Borgman
2009-11-20 22:26   ` Ken Brown
2009-11-20 23:54     ` Lennart Borgman
2009-11-21  8:12     ` Eli Zaretskii
2009-11-21 12:12       ` Ken Brown
2009-11-21 12:16         ` Lennart Borgman
2009-11-21 12:42         ` Eli Zaretskii
2009-11-21 21:21           ` Ken Brown
2009-11-21 21:48             ` Eli Zaretskii
2009-11-22  5:25             ` Davis Herring
2009-11-22 12:59               ` Ken Brown
2009-11-22 23:03                 ` Chong Yidong
2009-11-22 23:23                   ` Ken Brown
2009-11-22 23:30                     ` Lennart Borgman
2009-11-23  1:37                       ` Ken Brown
2009-11-23  1:42                         ` Lennart Borgman
2009-11-23  1:50                         ` Chong Yidong
2009-11-23  2:09                           ` Ken Brown
2009-11-23 19:50                             ` Ken Brown
2009-11-23 20:59                               ` Chong Yidong

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).