Quuxplusone / LLVMBugzillaTest

0 stars 0 forks source link

Weak aliases are not supported on MacOS X #11300

Open Quuxplusone opened 12 years ago

Quuxplusone commented 12 years ago
Bugzilla Link PR11116
Status NEW
Importance P normal
Reported by Martin Whitaker (llvm@martin-whitaker.me.uk)
Reported on 2011-10-12 04:15:27 -0700
Last modified on 2020-02-03 22:43:53 -0800
Version trunk
Hardware Macintosh MacOS X
CC efriedma@quicinc.com, llvm-bugs@lists.llvm.org, rising.lambda@gmail.com
Fixed by commit(s)
Attachments
Blocks
Blocked by
See also
When compiling the following (simplified) code fragment:

  int get_value(int *value)
  {
    return *value;
  }

  int get_value_alias(int *high) __attribute__ ((weak, alias ("get_value")));

for MacOS X, clang reports the following error:

  % clang -ccc-host-triple i386-apple-darwin -c -o bug.o bug.c
  bug.c:6:54: error: only weak aliases are supported on darwin
  int get_value_alias(int *high) __attribute__ ((weak, alias ("get_value")));

It would appear that clang does not support weak aliases on MacOS X (I asked on
the cfe-dev list, but nobody suggested a solution). If it is not possible to
support weak aliases for this target, I suggest changing the error message to
indicate this fact.
Quuxplusone commented 12 years ago

I'm pretty sure what the error in question is trying to say is that we support weakref, but not any other kind of alias, due to limitations of MachO. It might be worth clarifying the error a bit.