Hi ,
I want to create a bc file by llvm-gcc, and need to pass a input file when create this file,
how can i do it?I saw options in "llvm-gcc [options] filename" but it could not help me.
I have an another problem too. my program contains some C file , that main function use those, but i don’t know how create bc file with regard to other file.
tanks,
Hi ,
I want to create a bc file by llvm-gcc, and need to pass a input file when create this file,
how can i do it?I saw options in "llvm-gcc [options] filename" but it could not help me.
llvm-gcc -emit-llvm -c foo.c -o foo.bc
I have an another problem too. my program contains some C file , that main function use those, but i don’t know how create bc file with regard to other file.
llvm-gcc -emit-llvm -c main.c foo.c -combine -o main.bc
Do you mean this?
Tanks for reply 
llvm-gcc -emit-llvm -c foo.c -o foo.bc
I want to pass a input file to foo.c that contains a picture. how can do it?
I want to pass a input file to foo.c that contains a picture. how can do it?
llvm-gcc -emit-llvm -c foo.c -o foo.bc
I think you would want to do this with objcopy... something like :
objcopy -I binary -O elf32-i386 -B i386 yourimage.jpg yourimage.o
Where the -O and -B options are set correctly for your architecture. That will create an object file containing the image data and will define the symbols:
_binary_yourimage_jpg_start
_binary_yourimage_jpg_end
_binary_yourimage_jpg_size
You should then be able to pass the .o file in along with your C file and reference it using the above symbols defined as externs of the proper type.
-Gordon Keiser
Arxan Technologies