smuehlst / circle-stdlib

Standard C and C++ Library Support for Circle
GNU General Public License v3.0
90 stars 17 forks source link

No output from printf() in samples/02-stdio-hello with v16.3 #35

Closed swausd closed 5 months ago

swausd commented 5 months ago

With the current release v16.3 I get no output on hdmi screen from printf() in kernel.cpp, line 36, when running samples/02-stdio-hello. Output from fprintf() from line 37 is ok. I get output as expected when using v16.2.

Using Raspi Zero 2 W, gcc 12.2.Rel1, 32 bit. Am I missing some new configurations with circle step 46?

smuehlst commented 5 months ago

Hmm, that is interesting, but I won't be able to look into this before the weekend.

smuehlst commented 5 months ago

Reproduced the problem as described with a Raspberry Pi Zero:

smuehlst commented 5 months ago

Also reproducible with a 64-bit build under QEMU.

smuehlst commented 5 months ago

The problem is that stdout is for some reason no longer line-buffered. Adding a fflush(stdout) after printf(...) makes the text appear on the screen.

smuehlst commented 5 months ago

@swausd I committed a fix directly to the master branch and I will create a bugfix release later today. If you want to test the fix, please make sure that you also update the circle-newlib submodule where the fix was actually implemented.

swausd commented 5 months ago

Looks OK for me. Thank you for the super quick fix!