we use the alias attribute, similar to what is done for ELF.
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Unit Tests
Event Timeline
Sorry... it does not seem to work with every compiler on AIX though. Does that mean we want to specify compiler macro along with system macro?
This is the case I tried:
int oldname = 1;
extern int newname attribute((alias("oldname")));
xlclang alias.c -c
alias.c:2:35: warning: 1540-2990 The attribute " attribute((alias("oldname")))" is not supported. The attribute is ignored.
extern int newname attribute((alias("oldname")));
As far as I can see, COMPILER_RT_ALIAS is only used for function aliases, for which __attribute__((__alias__)) seems to be supported by XL. Given that COMPILER_RT_ABI currently expands to calling convention attributes, I think it's probably safe to conclude this macro isn't intended for use with variables.
As far as I can see, COMPILER_RT_ALIAS is only used for function aliases, for which attribute((alias)) seems to be supported by XL. Given that COMPILER_RT_ABI currently expands to calling convention attributes, I think it's probably safe to conclude this macro isn't intended for use with variables.
Thanks. In that case, this still LGTM.