libogc icon indicating copy to clipboard operation
libogc copied to clipboard

kprintf is GPL

Open magcius opened this issue 5 years ago • 6 comments
trafficstars

libogc includes a copy of kprintf, which was distributed under the GPL, despite libogc having a license most closely matching MIT.

https://github.com/devkitPro/libogc/blob/master/libogc/kprintf.c

magcius avatar Feb 14 '20 00:02 magcius

This could easily be rectified by just removing kvsprintf and using vsprintf instead, since that's in newlib

endrift avatar Feb 14 '20 00:02 endrift

I seem to be having memory corruption issues using printf rather than kprintf, but that's probably something else.

magcius avatar Feb 14 '20 00:02 magcius

fwiw, kprintf is here for low footprint debug usage. It wasn't intended as a general print function and shouldn't be linked under normal use. Can have a look at replacing with newlib function but it was rather intended to avoid linking in a lot of newlib machinery in particular scenarios so I'd prefer a lightweight replacement.

WinterMute avatar Mar 03 '20 13:03 WinterMute

You might be able to replace it with nano-vfprintf from newlib then: https://github.com/devkitPro/newlib/blob/e928275566ab8168c078eadee2043a002bd9352d/newlib/libc/stdio/nano-vfprintf.c

endrift avatar Nov 29 '20 22:11 endrift

Been a while since this was discussed, but has anyone considered mpaland's implementation? It's MIT licensed, doesn't depend on floating point, and seems very lightweight (only 600 LOC and intended for embedded systems).

htv04 avatar Jul 16 '23 18:07 htv04

Been a while since this was discussed, but has anyone considered mpaland's implementation? It's MIT licensed, doesn't depend on floating point, and seems very lightweight (only 600 LOC and intended for embedded systems).

i took a look at this, and its more active fork @ https://github.com/eyalroz/printf, and in essence it looks good but my problem with this is that it looks to be more complex and exports the functions as printf which we already have thanks to newlib and would cause some conflicts. however, it is +/- what we need. a printf implementation that is simple, stand alone and can work even if the whole program has crashed/caused an exception as this is where kprintf is used.

DacoTaco avatar Apr 21 '24 08:04 DacoTaco