Hahnfeld created this revision. Hahnfeld added reviewers: v.g.vassilev, sgraenitz, lhames, StephenFan. Herald added subscribers: VincentWu, vkmr, luismarques, sameer.abuasal, s.egerton, Jim, PkmX, rogfer01, shiva0217, kito-cheng, simoncook, arichardson. Herald added a project: All. Hahnfeld requested review of this revision. Herald added a project: clang. Herald added a subscriber: cfe-commits.
JITLink for RISC-V does not implement linker relaxation and until now only ignored the related alignment relocations. However, the logic has a flaw and it is actually not valid to ignore them. Just disable the feature to have less problems. Repository: rG LLVM Github Monorepo https://reviews.llvm.org/D149551 Files: clang/lib/Interpreter/IncrementalExecutor.cpp Index: clang/lib/Interpreter/IncrementalExecutor.cpp =================================================================== --- clang/lib/Interpreter/IncrementalExecutor.cpp +++ clang/lib/Interpreter/IncrementalExecutor.cpp @@ -43,7 +43,12 @@ llvm::ErrorAsOutParameter EAO(&Err); auto JTMB = JITTargetMachineBuilder(TI.getTriple()); - JTMB.addFeatures(TI.getTargetOpts().Features); + for (const auto &F : TI.getTargetOpts().Features) { + if (F == "+relax") + continue; + JTMB.getFeatures().AddFeature(F); + } + LLJITBuilder Builder; Builder.setJITTargetMachineBuilder(JTMB); // Enable debugging of JIT'd code (only works on JITLink for ELF and MachO).
Index: clang/lib/Interpreter/IncrementalExecutor.cpp =================================================================== --- clang/lib/Interpreter/IncrementalExecutor.cpp +++ clang/lib/Interpreter/IncrementalExecutor.cpp @@ -43,7 +43,12 @@ llvm::ErrorAsOutParameter EAO(&Err); auto JTMB = JITTargetMachineBuilder(TI.getTriple()); - JTMB.addFeatures(TI.getTargetOpts().Features); + for (const auto &F : TI.getTargetOpts().Features) { + if (F == "+relax") + continue; + JTMB.getFeatures().AddFeature(F); + } + LLJITBuilder Builder; Builder.setJITTargetMachineBuilder(JTMB); // Enable debugging of JIT'd code (only works on JITLink for ELF and MachO).
_______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits