无法编译.so, ld.bfd: -shared not supported



  • 你的Toolchain类型和版本

    出现的问题描述

    编译器不能支持 -share 命令

    CC lib/efi_loader/helloworld.o
    AS lib/efi_loader/efi_crt0.o
    CC lib/efi_loader/efi_reloc.o
    CC lib/efi_loader/efi_freestanding.o
    LD lib/efi_loader/helloworld_efi.so
    riscv64-unknown-elf-ld.bfd: warning: -z nocombreloc ignored
    riscv64-unknown-elf-ld.bfd: -shared not supported
    scripts/Makefile.lib:419: recipe for target 'lib/efi_loader/helloworld_efi.so' failed
    make[2]: *** [lib/efi_loader/helloworld_efi.so] Error 1
    scripts/Makefile.build:419: recipe for target 'lib/efi_loader' failed
    make[1]: *** [lib/efi_loader] Error 2
    Makefile:1796: recipe for target 'lib' failed
    make: *** [lib] Error 2

    复现方法

    riscv64-unknown-elf-ld.bfd -shared