[cfe-dev] Issue with cross compiling
satanasyan at mips.com
Sat Jun 2 02:40:09 PDT 2012
On Sat, Jun 2, 2012 at 12:01 AM, ryan baird <ryanrbaird at gmail.com> wrote:
> #include "..." search starts here:
> #include <...> search starts here:
> End of search list.
> hello.c:4:3: warning: implicitly declaring library function 'printf' with
> 'int (const char *, ...)'
> hello.c:4:3: note: please include the header <stdio.h> or explicitly provide
> declaration for 'printf'
> 1 warning generated.
> This successfully generates the code, but it indicates that it did not
> correctly include <stdio.h> when compiling; even though the first line of my
> file is #include <stdio.h>, it tells me to include the header <stdio.h>.
> This is a sign that something is still not working. Any ideas?
The stdio.h from compiler-rt/SDKs does not include "printf" definition
at all because compiler-rt is not a replacement for libc. That's why
you get the last warning.
On my 32-bit debian system I just run the following command and it
works without any errors and warnings:
$ clang -target mipsel-linux-gnu test.c -mfloat-abi=hard -S -emit-llvm
If you work on 64-bit OS you have to install gcc multilib for your
distribution to get gnu/stubs-32.h. An alternative way is to install
any MIPS toolchain and points sysroot to it.
More information about the cfe-dev