Index: lib/Driver/ToolChains/CommonArgs.cpp =================================================================== --- lib/Driver/ToolChains/CommonArgs.cpp +++ lib/Driver/ToolChains/CommonArgs.cpp @@ -706,9 +706,9 @@ return !StaticRuntimes.empty() || !NonWholeStaticRuntimes.empty(); } -bool tools::addXRayRuntime(const ToolChain&TC, const ArgList &Args, ArgStringList &CmdArgs) { - if (Args.hasArg(options::OPT_shared)) - return false; +bool tools::addXRayRuntime(const ToolChain &TC, const ArgList &Args, + ArgStringList &CmdArgs) { + if (Args.hasArg(options::OPT_shared)) return false; if (TC.getXRayArgs().needsXRayRt()) { CmdArgs.push_back("-whole-archive"); @@ -716,6 +716,10 @@ for (const auto &Mode : TC.getXRayArgs().modeList()) CmdArgs.push_back(TC.getCompilerRTArgString(Args, Mode, false)); CmdArgs.push_back("-no-whole-archive"); + + SmallString<128> XRay(TC.getCompilerRT(Args, "xray")); + CmdArgs.push_back(Args.MakeArgString("--dynamic-list=" + XRay + ".syms")); + CmdArgs.push_back(Args.MakeArgString("--version-script=" + XRay + ".vers")); return true; }