Open vervaekejonathan opened 7 years ago
from my experience with newlibnano in NintendoDS, you need to add SOFT VP support somehow. (I didn't care to recompile newlib nano through make config package, I recompiled everything, so it would fit my toolchain, ToolchainGenericDS)
Variadic functions is one thing (multiple arguments), to test if it works correctly, try something pretty simple as:
printf("test:%x - %x",0x1234,0x5678)
, if you see "test:0x1234 - 0x5678" then variadic functions are working.
Then after you tested that, you need to add support for: VFP IEEE-754 compliant 64bit double / float :
https://github.com/cotodevel/newlib-nano-2/commit/cc82224b5e2ae5e463c430ab7c52370116051df4
I just tailored newlib nano for ToolchainGenericDS, so it may not be what you want, but gives an insight as of why that happens.
Also, when linking libmath, make sure the library supports your processor. I failed to run any variadic-like function from ARM7, using newlibnano (printf, sprintf failed) and that was due to that. So I had to recompile libmath, newlib nano for each processor (ARM7 and ARM9)
Please note you should noto sue %lld bit the macro from stdint.h Luke
printf("%" PRIu64 "\n", ram);
When I use:
uint64_t nr = 123;
printf("%llu", nr);
without the newlib-nano, it shows correctly
123
but when I enable newlib-nano, it showslu
Am I missing a linker/compiler option or is this not supported in newlib-nano?