================ @@ -376,6 +378,41 @@ ToolChain::getMultilibFlags(const llvm::opt::ArgList &Args) const { else Result.push_back("-fexceptions"); + // A difference of relocation model (absolutely addressed data, PIC, Arm + // ROPI/RWPI) is likely to change whether a particular multilib variant is + // compatible with a given link. Determine the relocation model of the + // current link, and add appropriate + { + RegisterEffectiveTriple TripleRAII( + *this, llvm::Triple(ComputeEffectiveClangTriple(Args))); + + auto [RelocationModel, PICLevel, IsPIE] = tools::ParsePICArgs(*this, Args); + + // ROPI and RWPI are only meaningful on Arm, so for other architectures, we + // expect never to find out they're enabled. But it seems confusing to add + // -fno-ropi and -fno-rwpi unconditionally to every other architecture's + // multilib flags, so instead we leave them out completely. + if (IsARM) { ---------------- vhscampos wrote:
Is there any way to move this Arm-only segment into `getARMMultilibFlags`? In theory, that function handles everything that is only relevant to Arm. So it's a more natural place to host this segment here. https://github.com/llvm/llvm-project/pull/149132 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits