This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
Re: nm chooses a.out instead of a.exe on cygwin platform
- From: Ian Lance Taylor <ian at airs dot com>
- To: "Manik, Raina \(IE10\)" <Manik dot Raina at honeywell dot com>
- Cc: binutils at sources dot redhat dot com
- Date: 24 Nov 2002 21:58:33 -0800
- Subject: Re: nm chooses a.out instead of a.exe on cygwin platform
- References: <CDDB93E84A8DD411B01900D0B78278400C51AAF8@IE10-SAHARA>
"Manik, Raina \(IE10\)" <Manik.Raina@honeywell.com> writes:
> Problem:
>
> On the cygwin platform , nm chooses a.out by default
> even though the default executable built by GNU CC
> is a.exe.
>
> The diffs attached fix the problem. I am aware that
>
> 1) other utilities have the same problem and need
> to be fixed as well.
> 2) this might not be the best way to fix this problem
> and i know #ifdef __CYGWIN__ is ugly, what's the best
> way you guys will like
>
> a) put PLAT_CYGWIN in config.h
> b) check if the "cygwin" word exists in
> TARGET as defined in config.h
#ifdef __CYGWIN__ is not merely ugly, it's wrong. The default
executable is selected based on the target. Checking #ifdef
__CYGWIN__ tests the host. Consider a cross compiler hosted on
cygwin.
I don't see PLAT anywhere else, so that doesn't seem appropriate. I
would suggest simply defining the default executable name in config.h,
and overriding it for *-*-cygwin*, *-*-mingw*, etc.
Ian