Bug 61366 - oprofilejit should be included in the list of LLVM components required
Summary: oprofilejit should be included in the list of LLVM components required
Status: RESOLVED FIXED
Alias: None
Product: Mesa
Classification: Unclassified
Component: Other (show other bugs)
Version: 9.0
Hardware: x86-64 (AMD64) Linux (All)
: medium minor
Assignee: mesa-dev
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-02-23 20:13 UTC by Adam Sampson
Modified: 2013-02-28 15:38 UTC (History)
0 users

See Also:
i915 platform:
i915 features:


Attachments
My patch (868 bytes, patch)
2013-02-23 20:13 UTC, Adam Sampson
Details | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Adam Sampson 2013-02-23 20:13:05 UTC
Created attachment 75423 [details] [review]
My patch

I'm using Mesa 9.0.3 on Linux, built with automake.

llvmpipe uses llvm::JITEventListener::createOProfileJITEventListener if LLVM    
was compiled with OProfile support, so it needs to link with                    
libLLVMOProfileJIT -- i.e. include oprofilejit in the list of LLVM components required in configure.ac, if it exists.

There's already a similar test for mcjit; duplicating this for oprofilejit works for me. Patch to this effect attached, but you may prefer a different fix.

Without this, I get the following link error:

gmake[5]: Entering directory `/src/x11/mesa/work/Mesa-9.0.3/src/gallium/drivers/llvmpipe'
g++ -Wl,-O2 -Wl,--as-needed -Wl,-O2 -Wl,--as-needed -L/gar/packages/llvm-3.2/lib  -lbfd -lpthread -ldl -lm  -lopagent -L/gar/lib/oprofile -Wl,-rpath,/gar/lib/oprofile lp_test_format.o lp_test_main.o -o lp_test_format -Wl,--start-group  -L../../auxiliary/ -lgallium libllvmpipe.a -lLLVMMCJIT -lLLVMBitWriter -lLLVMX86Disassembler -lLLVMX86CodeGen -lLLVMSelectionDAG -lLLVMAsmPrinter -lLLVMX86AsmParser -lLLVMMCParser -lLLVMX86Desc -lLLVMX86Info -lLLVMX86AsmPrinter -lLLVMX86Utils -lLLVMJIT -lLLVMRuntimeDyld -lLLVMExecutionEngine -lLLVMCodeGen -lLLVMScalarOpts -lLLVMInstCombine -lLLVMTransformUtils -lLLVMipa -lLLVMAnalysis -lLLVMTarget -lLLVMMC -lLLVMObject -lLLVMCore -lLLVMSupport -L/gar/lib -lXext -lXdamage -lXfixes -lX11-xcb -lX11 -lxcb-glx -lxcb -lXxf86vm  -L/gar/lib -ldrm  -lm -lpthread -ldl -Wl,--end-group
../../auxiliary//libgallium.a(lp_bld_misc.o): In function `lp_register_oprofile_jit_event_listener':
lp_bld_misc.cpp:(.text+0x1c): undefined reference to `llvm::JITEventListener::createOProfileJITEventListener()'
collect2: error: ld returned 1 exit status
gmake[5]: *** [lp_test_format] Error 1
gmake[5]: Leaving directory `/src/x11/mesa/work/Mesa-9.0.3/src/gallium/drivers/llvmpipe'

I guess this error doesn't show up for people who've got LLVM built as one large library, which isn't the default configuration.
Comment 1 Jose Fonseca 2013-02-28 15:38:09 UTC
Commited. Thanks.

commit 2506b035031d6022fec0465bffac8eedd43de0f9
Author: Adam Sampson <ats-fd@offog.org>
Date:   Thu Feb 28 15:35:11 2013 +0000

    autotools: oprofilejit should be included in the list of LLVM components required
    
    NOTE: This is a candidate for the stable branch.
    
    Signed-off-by: José Fonseca <jfonseca@vmware.com>


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.