From ea28e71e864156e6e3f1ddf5e1edf2c283535a23 Mon Sep 17 00:00:00 2001 From: Ed Maste Date: Sat, 29 Sep 2018 20:01:23 +0000 Subject: [PATCH] clang: allow ifunc resolvers to accept arguments Previously Clang required ifunc resolution functions to take no arguments, presumably because GCC documented ifunc resolvers as taking no arguments. However, GCC accepts resolvers accepting arguments, and our rtld passes CPU ID information (cpuid, hwcap, etc.) to ifunc resolvers. Just remove the check from the in-tree compiler for our in- tree compiler; a different (per-OS) approach may be required upstream. Reported by: mjg Approved by: re (rgrimes) MFC after: 1 week Relnotes: Yes Sponsored by: The FreeBSD Foundation --- contrib/llvm/tools/clang/lib/CodeGen/CodeGenModule.cpp | 2 -- lib/clang/freebsd_cc_version.h | 2 +- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/contrib/llvm/tools/clang/lib/CodeGen/CodeGenModule.cpp b/contrib/llvm/tools/clang/lib/CodeGen/CodeGenModule.cpp index 2172486682c..226dc193aed 100644 --- a/contrib/llvm/tools/clang/lib/CodeGen/CodeGenModule.cpp +++ b/contrib/llvm/tools/clang/lib/CodeGen/CodeGenModule.cpp @@ -321,8 +321,6 @@ void CodeGenModule::checkAliases() { assert(FTy); if (!FTy->getReturnType()->isPointerTy()) Diags.Report(Location, diag::err_ifunc_resolver_return); - if (FTy->getNumParams()) - Diags.Report(Location, diag::err_ifunc_resolver_params); } llvm::Constant *Aliasee = Alias->getIndirectSymbol(); diff --git a/lib/clang/freebsd_cc_version.h b/lib/clang/freebsd_cc_version.h index cb89cc37f12..9096dc913f1 100644 --- a/lib/clang/freebsd_cc_version.h +++ b/lib/clang/freebsd_cc_version.h @@ -1,3 +1,3 @@ /* $FreeBSD$ */ -#define FREEBSD_CC_VERSION 1200015 +#define FREEBSD_CC_VERSION 1200016