[cfe-dev] Weak aliases on OSX

Martin Whitaker mailing-list at martin-whitaker.me.uk
Sun Sep 25 03:15:45 PDT 2011


Hi,

On another open source project I work on, one of our users is trying to build 
the code for OSX 10.7 using clang. This is failing on the following piece of code:

PLI_INT32 tf_getlongtime(PLI_INT32 *high)
{
       return tf_igetlongtime(high, 0);
}

PLI_INT32 tf_getlongsimtime(PLI_INT32 *high) \
       __attribute__ ((weak, alias ("tf_getlongtime")));

clang gives the following error:

getsimtime.c:88:29: error: only weak aliases are supported on darwin
__attribute__ ((weak, alias ("tf_getlongtime")));
^

Looking at the clang source code, it appears to reject any form of alias when 
targeting darwin. So is the error message wrong, or is there an alternative 
way to create a weak alias that works for darwin?


Martin



More information about the cfe-dev mailing list