Printf within leon3 simulation

Hello,

we have a template leon3 design in a simulator and it is running a simple program:

#include <stdio.h>

int main() {
printf(“Hello world!\n”);
}

When the source code is prepared with:

/opt/sparc-elf-4.4.2/bin/sparc-elf-gcc -O2 -g -msoft-float hello.c -o hello.exe
/opt/sparc-elf-4.4.2/bin/sparc-elf-objcopy -O srec --gap-fill 0 hello.exe ram.srec

then the simulator console prints out “Hello world!” with no problems.

When the source code is prepared with:

/opt/bcc-2.2.2-gcc/bin/sparc-gaisler-elf-gcc -O2 -g -mcpu=leon3 -msoft-float hello.c -o hello.exe
/opt/bcc-2.2.2-gcc/bin/sparc-gaisler-elf-objcopy -O srec --gap-fill 0 hello.exe ram.srec

then the simulator console does not print anything. Waveform shows that apbuart is indefinitely checked and the software locked in an indefinite loop, like miscompatibility between the software and the actual hardware.

Did anybody encounter such a behaviour? Does anybody have a clue what to do to make the simulator console prints working with bcc-2.2.2?

Thanks and best regards,

Ludek