# llvm-gcc

**URL:** https://discourse.llvm.org/t/llvm-gcc/21559
**Category:** LLVM Dev List Archives
**Created:** [December 2, 2011, 8:07am UTC](https://discourse.llvm.org/t/llvm-gcc/21559 "2011-12-02T08:07:57Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![Rahil\_Rahimian](https://avatars.discourse-cdn.com/v4/letter/r/8edcca/32.png) [@Rahil\_Rahimian](https://discourse.llvm.org/u/Rahil_Rahimian)
#### Post date: [December 2, 2011, 8:07am UTC](https://discourse.llvm.org/t/llvm-gcc/21559/1 "2011-12-02T08:07:57Z")

</div>

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,_

---

<div class="post-metadata">

### Author: ![Zuyu\_Zhang](https://avatars.discourse-cdn.com/v4/letter/z/f475e1/32.png) [@Zuyu\_Zhang](https://discourse.llvm.org/u/Zuyu_Zhang)
#### Post date: [December 2, 2011, 10:11am UTC](https://discourse.llvm.org/t/llvm-gcc/21559/2 "2011-12-02T10:11:14Z")

</div>

> 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?

---

<div class="post-metadata">

### Author: ![Rahil\_Rahimian](https://avatars.discourse-cdn.com/v4/letter/r/8edcca/32.png) [@Rahil\_Rahimian](https://discourse.llvm.org/u/Rahil_Rahimian)
#### Post date: [December 2, 2011, 11:50am UTC](https://discourse.llvm.org/t/llvm-gcc/21559/3 "2011-12-02T11:50:29Z")

</div>

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?

---

<div class="post-metadata">

### Author: ![Rahil\_Rahimian](https://avatars.discourse-cdn.com/v4/letter/r/8edcca/32.png) [@Rahil\_Rahimian](https://discourse.llvm.org/u/Rahil_Rahimian)
#### Post date: [December 2, 2011, 6:53pm UTC](https://discourse.llvm.org/t/llvm-gcc/21559/4 "2011-12-02T18:53:49Z")

</div>

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

---

<div class="post-metadata">

### Author: ![Gordon\_Keiser](https://avatars.discourse-cdn.com/v4/letter/g/f1d935/32.png) [@Gordon\_Keiser](https://discourse.llvm.org/u/Gordon_Keiser)
#### Post date: [December 2, 2011, 11:05pm UTC](https://discourse.llvm.org/t/llvm-gcc/21559/5 "2011-12-02T23:05:15Z")

</div>

I think you would want to do this with objcopy... something like :

&nbsp;&nbsp;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:  
&nbsp;&nbsp;\_binary\_yourimage\_jpg\_start  
&nbsp;&nbsp;\_binary\_yourimage\_jpg\_end  
&nbsp;&nbsp;\_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
