cvs.gedasymbols.org/archives/browse.cgi   search  
Mail Archives: djgpp-workers/1998/07/02/06:52:58

Date: Thu, 2 Jul 1998 13:52:28 +0300 (IDT)
From: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>
To: Nate Eldredge <nate AT cartsys DOT com>
cc: djgpp-workers AT delorie DOT com, dj AT delorie DOT com
Subject: Re: Cross-compiling djlsr
In-Reply-To: <359B2300.2387E7DA@cartsys.com>
Message-ID: <Pine.SUN.3.91.980702134233.17177G-100000@is>
MIME-Version: 1.0

On Wed, 1 Jul 1998, Nate Eldredge wrote:

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

I know nothing about DJGPP cross-compile setup, but why do you need to 
mix DJGPP and local headers to compile djasm?  It is IMHO a very bad 
idea, and the problem you've described might as well be the tip of an 
iceberg.

Doesn't Linux have coff.h?

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

I think both are right.  You just shouldn't mix headers from different 
libraries, that's all.

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

"make clean" should be done in the same environment where the 
files-to-be-cleaned were built.

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

That's too extreme, IMHO.  Since the only problem is with DOSEmu (and 
other DOSsish environment)--Unix will refuse to run something whose 
format is not recognized--you could make misc depend on a small program 
which tests whether it is a v2-style executable.  There's a function in 
v2.02 library to test that (_check_v2_prog).

- Raw text -


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