Giter Site home page Giter Site logo

Comments (3)

codelec avatar codelec commented on May 16, 2024

Compile the compiler with following config

./configure --prefix=$RISCV --enable-multilib
make -j4

You will have riscv64-unknown-elf-gcc installed to which if you pass -march=rv32i -mabi=ilp32 will generate a binary complying to rv32i or for other options you can refer to https://www.sifive.com/blog/2017/08/14/all-aboard-part-1-compiler-args/ blog post

from chipyard.

nnamenoname avatar nnamenoname commented on May 16, 2024

I fix the issue, thanks.

from chipyard.

aignacio avatar aignacio commented on May 16, 2024

Hello @codelec,

Seems that this issue persists even with --enable-multilib.....

/home/aignacio/riscv_multilib/bin/riscv64-unknown-elf-gcc -march=rv32imac -mabi=ilp32 -mcmodel=medany -std=gnu99 -O2 -fno-common -fno-builtin-printf -Wall -save-temps=obj -Iinc -c src/rocc_ha.c -o obj/rocc_ha.o
Linking...output/mm.baremetal
/home/aignacio/riscv_multilib/bin/riscv64-unknown-elf-gcc -Tld/link.ld -static -nostdlib -nostartfiles -lgcc -march=rv32imac -mabi=ilp32 -mcmodel=medany -std=gnu99 -O2 -fno-common -fno-builtin-printf -Wall -Iinc obj/crt.o obj/syscalls.o obj/mm.o obj/rocc_ha.o -o output/mm.baremetal
/home/aignacio/riscv_multilib/lib/gcc/riscv64-unknown-elf/8.2.0/../../../../riscv64-unknown-elf/bin/ld: obj/syscalls.o: in function `.L48':
syscalls.c:(.text+0x102): undefined reference to `__umoddi3'
/home/aignacio/riscv_multilib/lib/gcc/riscv64-unknown-elf/8.2.0/../../../../riscv64-unknown-elf/bin/ld: obj/syscalls.o: in function `.L59':
syscalls.c:(.text+0x122): undefined reference to `__udivdi3'
/home/aignacio/riscv_multilib/lib/gcc/riscv64-unknown-elf/8.2.0/../../../../riscv64-unknown-elf/bin/ld: syscalls.c:(.text+0x132): undefined reference to `__umoddi3'
collect2: error: ld returned 1 exit status
Makefile:32: recipe for target 'output/mm.baremetal' failed
make: *** [output/mm.baremetal] Error 1

Update: It was a silly error in makefiles, I forgot to put LDFLAGS after the compiled objects, so it now finds the correspondent functions.

from chipyard.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.