[U-Boot] ref:fail to include stdio.h

Hi, all,
I have a simple question to ask. Any information from you would be helpful.
I am using U-BOOT 1.3.3 with the cross tool chain arm-linux-gcc-3.3.2 on a Xscale platform. Basically it works fine.
The problem is: When I want to add any one of std header files anywhere on my architecture (pxa270), the compiler complains: stdio.h: No such file or directory.
I doubted if it is the tool chain problem. However, with a simple hellow.c file with #include <stdio.h>, I can build with arm-linux-gcc -o hellow hellow.c without any error.
I am confused.
Regards and thanks in advance.
Paul Wang

Dear Paul,
In message FE00509E242C6145AA57855D449BE2182A19D4@server.Tectonica.local you wrote:
The problem is: When I want to add any one of std header files anywhere on my architecture (pxa270), the compiler complains: stdio.h: No such file or directory.
U-Boot is not a standard application that runs under control of a general purpose OS, but it's a boot loader that lives in a very restricted, simple environment. As such, we cannot use the standard C library (glibc). Instead, U-Boot is self-contained and includes everything it needs, and nothing more.
<stdio.h> is a header file that is provided by glibc - it cannot be used with U-Boot as U-Boot doesn't provide the context needed for such a complex library like glibc.
I'm not sure why you would want to include <stdio.h> - it is not needed in U-Boot context. Please look around in the existing code how things are set up in U-Boot. This is NOT like developing a user space application under Linux. It is even more restricted than programming Linux kernel code (and in Linux kernel code you cannot include <stdio.h> either).
Best regards,
Wolfgang Denk

Hi, Wolfgang, I am trying to port some code of xyssl to u-boot in order to do the digital signature verification. Unfortunately, xyssl uses some stdlib functions, which are related to file operations, strings, malloc and free (I worry these most). The existing SHA1 features work fine with xscale. The main issue of digital signature verification on u-boot is the large integer operations.
Regards.
Paul Wang.
-----Original Message----- From: Wolfgang Denk [mailto:wd@denx.de] Sent: Thursday, February 26, 2009 7:15 PM To: Paul Wang Cc: u-boot@lists.denx.de Subject: Re: [U-Boot] ref:fail to include stdio.h
Dear Paul,
In message FE00509E242C6145AA57855D449BE2182A19D4@server.Tectonica.local you wrote:
The problem is: When I want to add any one of std header files
anywhere
on my architecture (pxa270), the compiler complains: stdio.h: No such file or directory.
U-Boot is not a standard application that runs under control of a general purpose OS, but it's a boot loader that lives in a very restricted, simple environment. As such, we cannot use the standard C library (glibc). Instead, U-Boot is self-contained and includes everything it needs, and nothing more.
<stdio.h> is a header file that is provided by glibc - it cannot be used with U-Boot as U-Boot doesn't provide the context needed for such a complex library like glibc.
I'm not sure why you would want to include <stdio.h> - it is not needed in U-Boot context. Please look around in the existing code how things are set up in U-Boot. This is NOT like developing a user space application under Linux. It is even more restricted than programming Linux kernel code (and in Linux kernel code you cannot include <stdio.h> either).
Best regards,
Wolfgang Denk
participants (2)
-
Paul Wang
-
Wolfgang Denk