[LLVMdev] striping of stdio information in llvm-gcc and clang

Eli Friedman eli.friedman at gmail.com
Thu Dec 15 20:43:01 PST 2011


On Thu, Dec 15, 2011 at 6:08 PM, Linlin Cheng <linlin at caltech.edu> wrote:
> Hi,
>
> I have the following test code print.c:
>
> #include <stdio.h>
>
> int main(){
>        fprintf(stderr, "Error!\n");
>        return 0;
> }
>
> I did the following on linux to cross-compile it for Sparc architecture:
> clang -m32 -c print.c -emit-llvm -o print.bc

This step is encoding platform-specific information into print.bc; you
can't just use llc to generate output for an arbitrary architecture
and expect it to work.

clang's cross-compilation support isn't really mature; you might be
able to get away with specifying "-ccc-host-triple sparc-sun-solaris
-nostdinc -I /path/to/sparc/headers/".

-Eli




More information about the llvm-dev mailing list