riscv-software-src / riscv-isa-sim

Spike, a RISC-V ISA Simulator
Other
2.44k stars 857 forks source link

Spike not working with helloworld MacOSx #471

Closed yunusdawji closed 4 years ago

yunusdawji commented 4 years ago

When I launch $ spike pk hello

I get the following error

Assertion failed: (IS_ELF32(eh64) || IS_ELF64(eh64)), function load_elf, file ../fesvr/elfloader.cc, line 33.

Would you tell me why this could be?

aswaterman commented 4 years ago

Probably unrelated to MacOS.

Sounds like your “hello” is not a valid ELF.

On Fri, May 22, 2020 at 8:44 PM Yunus Dawji notifications@github.com wrote:

When I launch $ spike pk hello

I get the following error

Assertion failed: (IS_ELF32(eh64) || IS_ELF64(eh64)), function load_elf, file ../fesvr/elfloader.cc, line 33.

Would you tell me why this could be?

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/riscv/riscv-isa-sim/issues/471, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAH3XQUOGC4WPGGYZF4S3NTRS5BC5ANCNFSM4NIIVJBQ .

yunusdawji commented 4 years ago

I had a working setup before and I was able to run binary at rtl level. Now, something is missing.

I am using the toolchain installed via homebrew. And i compile a simple helloworld. Do you know where the issue could be or what checks should i perform?

yunusdawji commented 4 years ago

Solved! There was a file name pk in that folder. And I guess that makes that it was complaining about invalid ELF for "pk" (not for "hello"). It would be good if the program throws the file name to avoid confusion.