[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: GCC predefines



Joel Baker <lucifer@lightbearer.com> writes:

> Not sure at all why it would define 'unix' on m68k and not i386...

Unfortunately, the gcc public CVS does not answer this question: it
goes back only to 11-Aug-97, at which time m68k/netbsd.h was created
(in the then-egcs CVS); in that version, it reads


/* Names to predefine in the preprocessor for this target machine.  */

#define CPP_PREDEFINES "-Dunix -Dm68k -Dmc68000 -Dmc68020 -D__NetBSD__
 -Asystem(unix) -Asystem(NetBSD) -Acpu(m68k) -Amachine(m68k)"

Interestingly enough, at that time, i386/netbsd.h, still did define
unix. That went away in i386/netbsd.h, which has the changelog entry

date: 2002/05/29 17:57:55;  author: thorpej;  state: Exp;  lines: +11 -4
* config/i386/netbsd-elf.h (TARGET_OS_CPP_BUILTINS): Define.
(CPP_PREDEFINES): Remove.
(SUBTARGET_EXTRA_SPECS): Define.
(CPP_SPEC): Use %(netbsd_cpp_spec).
* config/i386/netbsd.h (TARGET_OS_CPP_BUILTINS): Define.
(CPP_PREDEFINES): Remove.
(SUBTARGET_EXTRA_SPECS): Define.
(CPP_SPEC): Use %(netbsd_cpp_spec).
* config/i386/netbsd64.h (TARGET_OS_CPP_BUILTINS): Define.
(CPP_PREDEFINES, CPP_LP64_SPEC, CPP_SUBTARGET_SPEC): Remove.
(SUBTARGET_EXTRA_SPECS): Remove cpp_lp64 and cpp_subtarget.
Add netbsd_cpp_spec.
(CPP_SPEC): Remove %(cpp_subtarget), add %(netbsd_cpp_spec).

Given that gcc *did* define unix on NetBSD until 3.1, according to the
CVS log, it's surprising that your gcc 2.95 installation does not
define it. However, the configuration netbsd-elf was added to gcc only
in 2001, after the 2.95 release.

Assuming that NetBSD maintainers had been using a modified GCC all
along, it appears that gcc, on NetBSD, had never defined unix (that
FSF GCC defines it for m68k does not matter - it just means that Jason
Thorpe hasn't updated that configuration to the netbsd_cpp_spec
mechanism).

Regards,
Martin



Reply to: