Default enable linker relaxation and add -mrelax, -mno-relax flags
I think we should define both -mrelax and -mno-relax flags
If we add both mrelax and mno-relax flags, we need to update this logic...
// -mrelax is default, unless -mno-relax is specified.
if(A->getOption().matches(options::OPT_mno_relax)) Relax = false;
Sorry, I misread D444886. Still, we should do Features.push_back("-relax") at least in the case where -mno-relax is given explicitly, meaning we don't have to rely on the backend default.
Thanks Kito. -mrelax and -mno-relax currently only affect the backend. For completeness, I think this patch needs to pass the appropriate flag to the linker depending on relax/no-relax.
Hi Alex. RISCVToolChain class does not define yet, so we can't pass --no-relax in RISCV::Linker::ConstructJob. Should we passing --no-relax when we introduce RISCVToolchain? Or there is another place we could implement passing RISCV linker flags?