riscv-software-src / riscv-software-src/opensbi

ld.bfd: unrecognized option --exclude-libs

Open
#343 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
C
Stars
1.5k
Forks
712
PR merge metrics
No merged PRs in 30d

Description

CROSS_COMPILE=riscv64-elf- make -C build/opensbi PLATFORM=generic FW_TEXT_START=0x40000000 FW_OPTIONS=0
 ELF       platform/generic/firmware/payloads/test.elf
/usr/lib/gcc/riscv64-elf/12.2.0/../../../../riscv64-elf/bin/ld.bfd: unrecognized option '--exclude-libs'
/usr/lib/gcc/riscv64-elf/12.2.0/../../../../riscv64-elf/bin/ld.bfd: use the --help option for usage information
collect2: error: ld returned 1 exit status

Is this because the toolchain is for bare-metal?
Should the toolchain be checked before --exclude-libs is added to ELFFLAGS?

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the failure with the reported CROSS_COMPILE and make command, then trace where --exclude-libs is added to ELFFLAGS. Check how the bare-metal linker handles that option and verify the build succeeds or the unsupported-toolchain behavior is clearly handled.

Written by the indexing model from the issue text.

Assessment

Tech stack
c
Domain
build-system
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.