delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1996/07/11/05:14:32

Date: Thu, 11 Jul 1996 12:09:12 +0200 (IST)
From: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>
To: D C Haslam <dch AT sirius DOT demon DOT co DOT uk>
Cc: djgpp AT delorie DOT com
Subject: Re: Emacs 19.31 - LFN doesn't work
In-Reply-To: <199607101752.SAA00752@sirius.demon.co.uk>
Message-Id: <Pine.SUN.3.91.960711120121.7062A-100000@is>
Mime-Version: 1.0

On Wed, 10 Jul 1996, D C Haslam wrote:

> The reason emacs.exe has _crt0_startup_flags preset with 0xC00 is
> because it is generated by temacs dumping itself.
> At the time of the build LFN=n, and so temacs will have the 
> _CRT0_FLAG_NO_LFN flag set. This gets copied into the emacs executable.
> 
> I have now unpacked and built again using LFN=y and LFN is now 
> working fine.

Thanks for debugging this.  However, I think that telling people to build 
with LFN=y is not the best way to solve the problem, because it will 
prevent an executable that was built on MSDOS to run correctly on Win95.  
So please try to build Emacs with the patches below and see if LFN works 
even if you build Emacs with LFN=n.  I cannot test this on Win95, but if 
you tell me it works, I will make sure that this patch gets into the next 
release of GNU Emacs.

> I unpacked and built emacs using LFN=n as the (ambiguous) emacs INSTALL
> file suggested this was the best way.

Please tell me what are the ambiguous or unclear parts of INSTALL and 
I'll see to it that they will be corrected in the next release.

*** src/unexec.c~0	Wed Apr 10 04:15:06 1996
--- src/unexec.c	Thu Jul 11 10:42:58 1996
*************** int need_coff_header = 1;
*** 178,183 ****
--- 178,185 ----
  #ifdef MSDOS
  #if __DJGPP__ > 1
  #include <fcntl.h>  /* for O_RDONLY, O_RDWR */
+ #include <crt0.h>   /* for _crt0_startup_flags and its bits */
+ static int save_djgpp_startup_flags;
  #endif
  #include <coff.h>
  #define filehdr external_filehdr
*************** copy_text_and_data (new, a_out)
*** 884,889 ****
--- 886,896 ----
    /* Dump the original table of exception handlers, not the one
       where our exception hooks are registered.  */
    __djgpp_exception_toggle ();
+ 
+   /* Switch off startup flags that might have been set at runtime
+      and which might change the way that dumped Emacs works.  */
+   save_djgpp_startup_flags = _crt0_startup_flags;
+   _crt0_startup_flags &= ~(_CRT0_FLAG_NO_LFN | _CRT0_FLAG_NEARPTR);
  #endif
  #endif
  
*************** copy_text_and_data (new, a_out)
*** 905,910 ****
--- 912,920 ----
  #if __DJGPP__ >= 2
    /* Restore our exception hooks.  */
    __djgpp_exception_toggle ();
+ 
+   /* Restore the startup flags.  */
+   _crt0_startup_flags = save_djgpp_startup_flags;
  #endif
  #endif
  

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019