xpack-dev-tools/riscv-none-elf-gcc-xpack

Use the C++ nano libraries with nano.specs

ilg-ul opened this issue · 3 comments

Update newlib/ibgloss/riscv/nano.specs to also replace the C++ libraries with the nano versions.

Add code at run-time to patch libgloss/riscv/nano.specs and replace

%(nano_link) %:replace-outfile(-lc -lc_nano) %:replace-outfile(-lg -lg_nano) %:replace-outfile(-lm -lm_nano)

with:

%(nano_link) %:replace-outfile(-lc -lc_nano) %:replace-outfile(-lg -lg_nano) %:replace-outfile(-lm -lm_nano) %:replace-outfile(-lstdc++ -lstdc++_nano) %:replace-outfile(-lsupc++ -lsupc++_nano)

Then test if the file includes -lstdc++_nano and -lsupc++_nano.

Fixed.