This is an archive of the discontinued LLVM Phabricator instance.

Allow ifunc resolvers to accept arguments
ClosedPublic

Authored by emaste on Sep 30 2018, 8:29 AM.

Details

Summary

When ifunc support was added to Clang (in rC265917) it did not allow resolvers to take function arguments. This was based on GCC's documentation, which states resolvers return a pointer and take no arguments.

However, GCC actually allows it, and glibc (on non-x86 platforms) and FreeBSD (on x86 and arm64) pass CPU identification information as arguments to ifunc resolvers. I believe GCC's documentation is simply incorrect / out-of-date.

We've removed the prohibition in FreeBSD's in-tree Clang: https://svnweb.freebsd.org/changeset/base/339019.

Diff Detail

Event Timeline

emaste created this revision.Sep 30 2018, 8:29 AM
emaste added subscribers: dim, markj.Sep 30 2018, 8:45 AM
emaste added a subscriber: echristo.Oct 1 2018, 7:12 AM
emaste added a subscriber: jyknight.Oct 1 2018, 6:14 PM
jyknight accepted this revision.Oct 9 2018, 7:56 AM

Given that there's no technical reason for the compiler to prohibit this (it was just clang trying to diagnose a probable user-error, which turns out to not be as probable as ), this seems like the right solution to me.

This revision is now accepted and ready to land.Oct 9 2018, 7:56 AM
This revision was automatically updated to reflect the committed changes.