• Khem Raj's avatar
    riscv: Use -mno-relax when using lld linker · ec3a5cb6
    Khem Raj authored
    lld does not implement the RISCV relaxation optimizations like GNU ld
    therefore disable it when building with lld, Also pass it to
    assembler when using external GNU assembler ( LLVM_IAS != 1 ), this
    ensures that relevant assembler option is also enabled along. if these
    options are not used then we see following relocations in objects
    
    0000000000000000 R_RISCV_ALIGN     *ABS*+0x0000000000000002
    
    These are then rejected by lld
    ld.lld: error: capability.c:(.fixup+0x0): relocation R_RISCV_ALIGN requires unimplemented linker relaxation; recompile with -mno-relax but the .o is already compiled with -mno-relax
    Signed-off-by: default avatarKhem Raj <raj.khem@gmail.com>
    Reviewed-by: default avatarNathan Chancellor <nathan@kernel.org>
    Signed-off-by: default avatarPalmer Dabbelt <palmerdabbelt@google.com>
    ec3a5cb6
Makefile 3.64 KB