[cfe-dev] Issue with cross compiling

ryan baird ryanrbaird at gmail.com
Fri Jun 1 13:01:49 PDT 2012

> On Fri, Jun 01, 2012 at 12:54:57PM -0600, ryan baird wrote:
> >
> > I trid to run clang with the following arguments, which I was previously
> > using on a machine that already had the llvm environment:
> >  clang -v
> >
> > -mfloat-abi=hard -ccc-host-triple mipsel-unknown-linux -ccc-clang-archs
> > mipsel -S -emit-llvm $1 -o "$NAME.ll"
> Try using --sysroot
> Joerg

I tried adding the configuration options you suggested, and it gave me this

clang version 3.1 (tags/RELEASE_31/final 157818)
Target: mipsel-unknown-linux
Thread model: posix
 "/home/ryan/llvm/build/R31/Debug+Asserts/bin/clang" -cc1 -triple
mipsel-unknown-linux -emit-llvm -disable-free -main-file-name hello.c
-mrelocation-model static -mdisable-fp-elim -mconstructor-aliases
-target-cpu mips32 -target-abi o32 -mfloat-abi hard -target-linker-version -momit-leaf-frame-pointer -v -coverage-file hello.ll
-resource-dir /home/ryan/llvm/build/R31/Debug+Asserts/bin/../lib/clang/3.1
-isysroot /home/ryan/llvm/src/R31/final/projects/compiler-rt/SDKs/linux
-fmodule-cache-path /var/tmp/clang-module-cache -internal-isystem
-fno-dwarf-directory-asm -fdebug-compilation-dir /home/ryan -ferror-limit
19 -fmessage-length 80 -mstackrealign -fgnu-runtime -fobjc-runtime-has-arc
-fobjc-runtime-has-weak -fobjc-fragile-abi -fdiagnostics-show-option
-fcolor-diagnostics -o hello.ll -x c hello.c
clang -cc1 version 3.1 based upon LLVM 3.1 default target
ignoring nonexistent directory
ignoring nonexistent directory
ignoring duplicate directory
  as it is a non-system directory that duplicates a system directory
#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 a
      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?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20120601/c2991ccf/attachment.html>

More information about the cfe-dev mailing list