Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ld: -shared not supported #1

Open
ardeal opened this issue Jan 12, 2023 · 1 comment
Open

ld: -shared not supported #1

ardeal opened this issue Jan 12, 2023 · 1 comment

Comments

@ardeal
Copy link

ardeal commented Jan 12, 2023

Dear @jim-wilson,

I saw your answer at: riscv-collab/riscv-gnu-toolchain#335
your answer is:
You have to use a linux toolchain instead of an elf toolchain to build the kernel.
as the above link has been closed, I coundn't ask any more questions. Forthermore, I could find your email or contact, so I ask the question here:


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

according to your answer:
You have to use a linux toolchain instead of an elf toolchain to build the kernel.
where is the linux toolchain you mentioned?

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
@jim-wilson
Copy link
Owner

You need a riscv32-linux toolchain instead of the riscv32-elf toolchain. I don't know where you got the riscv32-elf toolchain. You can grab toolchain sources and try building a riscv32-linux toolchain.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants