This is the mail archive of the cygwin@sourceware.cygnus.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Fix to allow attempted run of non-Win32 EXEs


Hi,

I have been trying to get RTEMS an embedded RTOS to build cleanly with
Cygwin. I ran into a nasty problem. When RTEMS is configuring itself for the
target processor it uses the standard autoconf process to test to see if the
compiler it has been asked to use works and is a cross compiler.

This test involves building a small EXE with the compiler and, if that
succeeds, attempting to run it. If the program runs then the compiler is
native(the normal route for most programs) if it fails to run then it is a
cross-compiler. Unfortunately due to the "flexibility" of NT's process
loader this causes interesting results when you try to load say a m68k
program... What happens is that NT figures out that it is not a PE, NE or
standard DOS EXE and concludes that it is a .COM and just loads the first
64K into memory and runs it. If you are lucky you get the "This program has
executed and invalid instruction" dialog...if you are unlucky it just hangs
in an infinte loop.

Of course on a unix/Linux box the OS is smart enough to reject the EXE.

Having tried the latest snapshot to see if that fixed it I have ended up
hacking the 20.1 source for cygwin so that it checks for the magic 'MZ' at
the start of each program passed to CreateProcess(). This assumes that each
EXE has a DOS stub. It is bound to slow down cygwin but it does allow RTEMS
to build properly.

I don't suppose that this(or a variant) could make it into the official
version... Even if the behaviour had to be turned on with CYGWIN= flag it
would be really useful.

thanks,
Dave

cygwin-hack-19990902.diff

--
Want to unsubscribe from this list?
Send a message to cygwin-unsubscribe@sourceware.cygnus.com

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]