Skip to content

ld: -shared not supported #3

@ardeal

Description

@ardeal

Hi,

my envrionment:
ubuntu 20.04,
toolchain: riscv32-elf-ubuntu-20.04-nightly-2022.12.17-nightly.tar.gz
riscv-linux link: https://github.com/CSL-KU/riscv-linux

I would like to build riscv-linux and then run it on embedded RISCV MCU. I am experiencing the following issue

I searched the issue in Google, and found out a few links that are very similar with my issue:

riscv-collab/riscv-gnu-toolchain#335
riscv-collab/riscv-gnu-toolchain#803
larkmjc/busybear-linux#5

according to those above links, the most possible solution may be change a new toolchain. My question is: which toolchain I should use?

in the above 335 link, the answer is:
You have to use a linux toolchain instead of an elf toolchain to build the kernel.
it asks me to use a linux toolchain, where is it?
I am going to run the compiled linux on riscv, could I use the PC Linux toolchain? I got confused!!!

  CALL    scripts/checksyscalls.sh
  CHK     scripts/mod/devicetable-offsets.h
  CHK     include/generated/compile.h
  VDSOLD  arch/riscv/kernel/vdso/vdso.so.dbg
/opt/riscv/lib/gcc/riscv32-unknown-elf/12.2.0/../../../../riscv32-unknown-elf/bin/ld: -shared not supported
collect2: error: ld returned 1 exit status
  OBJCOPY arch/riscv/kernel/vdso/vdso.so
riscv32-unknown-elf-objcopy: 'arch/riscv/kernel/vdso/vdso.so.dbg': No such file
make[2]: *** [arch/riscv/kernel/vdso/Makefile:48: arch/riscv/kernel/vdso/vdso.so] Error 1
make[1]: *** [scripts/Makefile.build:575: arch/riscv/kernel/vdso] Error 2
make: *** [Makefile:1018: arch/riscv/kernel] Error 2

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions