Confusing "Only weak aliases are supported on darwin" error message.


I stumbled across a confusing error message that clang (3.9) gives
when it asked to compile this program

void g() {}
void f() __attribute__((weak, alias("g")));

Note this is a minor a variant of an existing test case [1].

When I try to compile the above program I see

clang -target x86_64-apple-darwin -emit-llvm -S attr-alias.c -o -
attr-alias.c:2:31: error: only weak aliases are supported on darwin
void f() __attribute__((weak, alias("g")));
1 error generated.

This error message is really confusing to me. Surely f() is a weak
alias for g() because is has __attribute__((weak, alias("g")))) ?

CC'ing Rafael because it looks like r121137 is responsible for this.