Squeak VM for Darwin/X11R6 for PPC?
Dave Hylands
dhylands at broadcom.com
Wed Apr 10 22:46:09 UTC 2002
If you're using a gcc based compiler you can do the following to determine
the "built-in" defines:
Create an empty file:
touch empty.c
gcc -E -Wp,-dM empty.c
Note that there is NO space between the comma and the -dM
This will display a list of all of the #defines that gcc sets up when it
calls the pre-processor.
Dave Hylands
> -----Original Message-----
> From: John M McIntosh [mailto:johnmci at smalltalkconsulting.com]
> Sent: Wednesday, April 10, 2002 3:31 PM
> To: squeak-dev at lists.squeakfoundation.org
> Subject: Re: Squeak VM for Darwin/X11R6 for PPC?
>
>
> >At 12:52 PM -0700 4/10/02, John M McIntosh wrote:
> >>
> >>If you look in sqGnu.h you'll see
> >>
> >>#if defined(PPC) || defined(_POWER) || defined(_IBMR2) ||
> defined (__APPLE__)
> >>
> >>
> >>I'd bet the compiler under Darwin isn't defining one of
> those above. Thus the
> >>#define for SP_REG never happens and then we think SP_REG
> is a variable.
> >>
> >>Maybe it defines _POWER_?
> >>
> >
> >Is there anyplace that documents all these variables and which
> >environments define which ones? I haven't been able to find such a
> >thing. It sure would make it easier to track down problems in this
> >area if there were somewhere in the SourceForge checkout you could
> >look and see a comment that listed a table of these variables for
> >all platforms. Maybe in sq.h, or at least a comment in the
> >sqPlatformSpecific.h for each platform.
> >
> >-Martin
>
> Well these ones are the responsibility of the compiler! Somewhere I'd
> think there is a table that explains what they are. That or you need
> a -DPPC in the make file.
>
> So like looking in Apple's gcc source tree for darwin
> gcc/config/rs6000/macos.h
>
> I see
> #define CPP_PREDEFINES "-D__ppc__ -D__NATURAL_ALIGNMENT__ -D_POWER
> -D__BIG_ENDIAN__ -D__APPLE__ -Asystem(MacOS) -Acp
> u(powerpc) -Amachine(powerpc)"
>
>
> but it seems the macosx.h has
>
> #ifdef MAC_OS_X_SERVER_1_0
> #define CPP_PREDEFINES "-Dppc -DNATURAL_ALIGNMENT -DNeXT -Dunix
> -D__MACH__ -D__BIG_ENDIAN__ -D__ARCHITECTURE__=\"ppc
> \" -D__APPLE__"
> #elif defined (MACOSX) || defined (RC_RELEASE_Flask)
> #define CPP_PREDEFINES "-D__ppc__ -D__NATURAL_ALIGNMENT__ -D__MACH__
> -D__BIG_ENDIAN__ -D__APPLE__"
> #else /* predefined macros in Mac OS X Server 1.1 */
> #define CPP_PREDEFINES "-Dppc -D__NATURAL_ALIGNMENT__ -D__MACH__
> -D__BIG_ENDIAN__ -D__ARCHITECTURE__=\"ppc\" -D__APPLE__"
> #endif
>
> So you'll notice the missing -D_POWER, which is why I added
> the __APPLE__
>
> I wonder if there is some magic compiler flag that will dump the
> current defines.
>
> But you are right there are a few defines in Squeak that
> should be documented.
>
> --
> --
> ==============================================================
> =============
> John M. McIntosh <johnmci at smalltalkconsulting.com> 1-800-477-2659
> Corporate Smalltalk Consulting Ltd.
http://www.smalltalkconsulting.com
===========================================================================
More information about the Squeak-dev
mailing list
|