undefined reference to .Llabel

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

undefined reference to .Llabel

Ryan M. Lefever
I have been working on a compilation process that involves steps such as
passing an application through transforms that I've written and
combining the application with support code that I've written.  When I
compile an application using my compilation process without debugging,
(i.e., "llvm-gcc -g"), everything works fine.  However, when I compile
an application using my compilation process with debugging, (i.e.,
"llvm-gcc -g"), I get linking errors that complain about undefined
references to .LlableX, where X is some number.

Let me explain how my compilation process works.  Let's say that an
application is made of x.c and y.c and that the application is normally
compiled as follows:

------------------------------
gcc -c -o x.o x.c
gcc -c -o y.o y.c
gcc -o exe x.o y.o
------------------------------

In my compilation process, that would be translated to something along
the following lines:

------------------------------
// First we create the individual bc files
1: llvm-gcc -c -emit-llvm x.bc x.c
2: llvm-gcc -c -emit-llvm y.bc y.c

// Second we link the individual bc files into 1 combined bc file
llvm-link -o exe.comb.bc x.bc y.bc

// Next we run several steps that involve:
//   - linking the combined bc file with support code
//   - running the combined bc file through a transform of mine
// For example:
3: llvm-link -o exe.comb.support1.bc exe.comb.bc support1.bc
4: opt -load=mytransformlib.so -mytransform1 -o
     exe.comb.support1.transform1.bc exe.comb.support1.bc
...

// After performing those steps, we link the result and form a
// native executable
5: llvm-ld -native -o exe exe.comb.support1.transform1.bc
------------------------------

My problem is that if I use the -g option in lines 1 and 2, then when I
run llvm-ld in line 5, it complains that there are undefined references
to .LlableX.

Does anyone have any insight about why this may be happening or how I
could go about diagnosing/fixing the problem?  If you need more details,
please ask.

Thanks you very much in advance,
Ryan
_______________________________________________
LLVM Developers mailing list
[hidden email]         http://llvm.cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
Reply | Threaded
Open this post in threaded view
|

Re: undefined reference to .Llabel

Eli Friedman-2
On Tue, Jun 24, 2008 at 2:03 AM, Ryan M. Lefever <[hidden email]> wrote:
> My problem is that if I use the -g option in lines 1 and 2, then when I
> run llvm-ld in line 5, it complains that there are undefined references
> to .LlableX.

-g + optimization is unsupported at the moment.  Off the top of my
head, I know that global DCE and inlining break debug info; probably
other also cause issues.

-Eli
_______________________________________________
LLVM Developers mailing list
[hidden email]         http://llvm.cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
Reply | Threaded
Open this post in threaded view
|

Re: undefined reference to .Llabel

Ryan M. Lefever
Thanks.  I'm guessing that a combination of my transforms and the LLVM
transforms are breaking the debug info.

Regards,
Ryan

Eli Friedman wrote:

> On Tue, Jun 24, 2008 at 2:03 AM, Ryan M. Lefever <[hidden email]> wrote:
>> My problem is that if I use the -g option in lines 1 and 2, then when I
>> run llvm-ld in line 5, it complains that there are undefined references
>> to .LlableX.
>
> -g + optimization is unsupported at the moment.  Off the top of my
> head, I know that global DCE and inlining break debug info; probably
> other also cause issues.
>
> -Eli
> _______________________________________________
> LLVM Developers mailing list
> [hidden email]         http://llvm.cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
_______________________________________________
LLVM Developers mailing list
[hidden email]         http://llvm.cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev