[MLton-user] experimental release 20051109

Matthew Fluet fluet@cs.cornell.edu
Sun, 13 Nov 2005 20:17:07 -0500 (EST)


> Note that it is now an error if the alias symbol is not defined in the same 
> translation unit.  We define the profile label with inline assembly, which 
> apparently is not accepted as a definition of the label:
>
> #define ProfileLabel(l)                                 \
>        __asm__ __volatile__ (#l "_internal:" : : )
>
>
> Unfortunately, I now see that we don't follow these definition when 
> __APPLE_CC__ is defined (which is presumably the case on MacOSX), so this may 
> be a separate  gcc 4.0.1 incompatibility.

With regards to our declaration/definition of profile labels, an option is 
to change

#define DeclareProfileLabel(l)                                  \
         void l() __attribute__ ((alias (#l "_internal")))

to

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

which has essentially the same effect: the uses of the profile labels in C 
code, (namely, to populate the sourceLabels array) will appear in the 
assembly with the "_internal" suffix.  The advantage of the asm label 
approach is that we can label it extern and gcc won't look for it in the 
current compilation unit.

Under this change, I once again reproduce John's errors, since the inline 
assembly is duplicated.