This is an archive of the discontinued LLVM Phabricator instance.

[AIX][compiler-rt] Pick the right form of COMPILER_RT_ALIAS for AIX
ClosedPublic

Authored by daltenty on Jun 3 2020, 2:52 PM.

Details

Summary

we use the alias attribute, similar to what is done for ELF.

Diff Detail

Event Timeline

daltenty created this revision.Jun 3 2020, 2:52 PM
Herald added a project: Restricted Project. · View Herald TranscriptJun 3 2020, 2:52 PM
Herald added subscribers: Restricted Project, mstorsjo, aheejin, dberris. · View Herald Transcript
This revision is now accepted and ready to land.Jun 10 2020, 12:16 PM

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")));

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")));

Do we know whether the macro is used on variables?

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")));

Do we know whether the macro is used on 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.

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.

This revision was automatically updated to reflect the committed changes.