[MLton-user] experimental release 20051109

Matthew Fluet fluet@cs.cornell.edu
Mon, 14 Nov 2005 22:26:03 -0500 (EST)


> There are actually two DeclareProfileLabel macros; one in include/main.h and 
> one in include/c-chunk.h.  They both need to agree on what to call the label 
> from assembly.  Then, because we are extern importing the symbol, C won't 
> attempt to make the symbol visible outside the single object file. So, we can 
> use the .globl trick from the __APPLE_CC__ branch.  So, the following appears 
> to work:
>
> #define DeclareProfileLabel(l)                                  \
>        extern void l () asm (#l "_internal")
>
> #define ProfileLabel(l)                                 \
>        __asm__ __volatile__ (".globl " #l "_internal\n" #l "_internal :" : : 
> )
>
> Note that the DeclareProfileLabel macro needs to appear both in main.h and 
> c-chunk.h.

Sorry, Wesley's email reminds me that the DeclareProfileLabel macro in 
main.h must import the label as a weak reference:

#define DeclareProfileLabel(l)                                  \
         extern void l () asm (#l "_internal") __attribute__ ((weak))