cnlohr / mini-rv32ima

A tiny C header-only risc-v emulator.
MIT License
1.69k stars 137 forks source link

"make everything" fails with 'elf2flt: ERROR: text=0x72698 overlaps data=0x698a0' #13

Closed Sfinx closed 1 year ago

Sfinx commented 1 year ago
../../buildroot/output/host/bin/riscv32-buildroot-linux-uclibc-gcc duktape-2.7.0/src-noline/duktape.c duktape-2.7.0/examples/cmdline/duk_cmdline.c duktape-2.7.0/extras/console/duk_console.c -Wall -O2 -Iduktape-2.7.0/src-noline -DDUK_CMDLINE_CONSOLE_SUPPORT -Iduktape-2.7.0/extras/console -Wl,-elf2flt="-r -s 196608" -o duktapetest
~/mini-rv32ima/buildroot/output/host/riscv32-buildroot-linux-uclibc/bin/elf2flt: ERROR: text=0x72698 overlaps data=0x698a0 ?
collect2: error: ld returned 1 exit status
make[1]: *** [Makefile:21: duktapetest] Error 1
make[1]: Leaving directory '~/mini-rv32ima/packages/duktapetest'
make: *** [Makefile:16: everything] Error 2
cnlohr commented 1 year ago

I have never seen that error. Can you see if modifying the above line to read -Wl,-elf2flt="-r -s 65536" instead of -Wl,-elf2flt="-r -s 196608" fixes anything?

Sfinx commented 1 year ago

Changed packages/duktapetest/Makefile LDFLAGS to '-Wl,-elf2flt="-r -s 65536"', result below:

../../buildroot/output/host/bin/riscv32-buildroot-linux-uclibc-gcc duktape-2.7.0/src-noline/duktape.c duktape-2.7.0/examples/cmdline/duk_cmdline.c duktape-2.7.0/extras/console/duk_console.c -Wall -O2 -Iduktape-2.7.0/src-noline -DDUK_CMDLINE_CONSOLE_SUPPORT -Iduktape-2.7.0/extras/console -Wl,-elf2flt="-r -s 65536" -o duktapetest
/home/rus/mini-rv32ima/buildroot/output/host/riscv32-buildroot-linux-uclibc/bin/elf2flt: ERROR: text=0x72698 overlaps data=0x698a0 ?
Sfinx commented 1 year ago

BTW: trying this at stock "22.04.1 LTS (Jammy Jellyfish)" with gcc-12 as default one

Sfinx commented 1 year ago

I had CFLAGS="-Wall -O2" in env. Removing it fixes the issue (?!)