This is the mail archive of the binutils@sources.redhat.com mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: nm chooses a.out instead of a.exe on cygwin platform


"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


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