[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [MiNT] [GCC] Undefined __mc68000__ and __M68000_ with -m68020
Le Fri, 22 Apr 2005 18:48:37 +0200 (CEST)
Frank Naumann <fnaumann@boerde.de> a écrit:
> > I had some problems compiling software (newlib and SDL) with -m68020
> > and -m68020-60. The fact is that gcc for MiNT is configured to not
> > add -D__mc68000__ -D__M68000_ when configured to compile for 020 or
> > higher.
>
> Is this different from other m68k platforms?
Yes. I checked with gcc-4.0.0:
gcc/config/m68k/netbsd-elf.h defines __m68k__.
gcc/config/m68k/rtemself.h defines mc68000.
gcc/config/m68k/uclinux.h (68000, no mmu) defines mc68000.
gcc/config/m68k/linux.h (68020+, with mmu) defines mc68000 and mc68020.
gcc/config/m68k/m68k.h (default value for m68k target) defines __m68k__
and mc68000. If targetting higher than m68000, it adds the needed
definitions. For example, for TARGET_68060, it will add mc68020,
mc68030, mc68040, mc68060.
Note: I think a gcc macro will generate -D__mc68040__ if mc68040 defined
in the OS specific header file, right ?
> > newlib and SDL rely on the defines to check for a generic m68k
> > platform, and so fail to detect it, as only -D__M68020__
> > -D__mc68020__ is defined.
> >
> > Well, I don't know for other m68k platforms, but I think that
> > -D__mc68000__ -D__M68000_ should be defined in all cases, and 020+
> > defines added if needed.
>
> The define is processor specific so I don't it's a good idea to define
> both if compiling for 68020-60.
Well, not being able to compile 68000 code when targetting 020-60 is a
problem, isn't it ? Also, we should drop -D__M68000__ and -D__M68020__,
as they seem to be only used in MiNT, not for other targets.
--
Patrice Mandin
WWW: http://membres.lycos.fr/pmandin/
Programmeur Linux, Atari
Spécialité: Développement, jeux