www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp-workers/1998/07/02/02:06:39

Sender: nate AT cartsys DOT com
Message-ID: <359B2300.2387E7DA@cartsys.com>
Date: Wed, 01 Jul 1998 23:04:48 -0700
From: Nate Eldredge <nate AT cartsys DOT com>
MIME-Version: 1.0
To: djgpp-workers AT delorie DOT com, dj AT delorie DOT com
Subject: Cross-compiling djlsr

I haven't looked at 980628 much yet, but I experimented with trying to
cross-compile it on my Linux machine, and immediately encountered some
problems.  One major, one tiny but irritating.

1.  If none of the macros __STRICT_ANSI__, _POSIX_SOURCE, etc. were
defined by the source, the system headers take it upon themselves to
define _POSIX_SOURCE.  This leads to problems when compiling things like
djasm, since DJGPP's coff.h only defines the important stuff ifndef
_POSIX_SOURCE.  It seems that Linux's headers think of these macros
inclusively.  For instance, _GNU_SOURCE allows all GNU extensions but
also defines _POSIX_SOURCE, which they consider a subset.  DJGPP, OTOH,
uses them *ex*clusively-- _POSIX_SOURCE turns off everything not allowed
by POSIX.  I wonder who is right?

(This is also the case with glibc2 aka Linux libc6, btw).

2.  When cross-compiling, everything uses misc.exe.  That's fine, but it
caused the following gotcha.  After failing in my attempt to
cross-compile, I loaded dosemu, and thought I'd try compiling that way. 
So I did a `make clean' to get rid of all the Linux stuff.  Oops!  It
uses `misc rm', and misc.exe is a Linux ELF binary!  dosemu crashes, and
I spend several minutes thinking it's a bug in it.

I guess there's not really any way around this, other than to have
separate makefiles for DOS and Unix, or to require that fileutils be
installed.
-- 

Nate Eldredge
nate AT cartsys DOT com

- Raw text -


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