llvm.org GIT mirror llvm / 362b368
Update this to reflect llvm-config usage git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30094 91177308-0d34-0410-b5e6-96231b3b80d8 Chris Lattner 13 years ago
1 changed file(s) with 10 addition(s) and 24 deletion(s). Raw diff Collapse all Expand all
296296


                  
                
297297 LIBRARYNAME := MyMod
298298 LOADABLE_MODULE := 1
299 USEDLIBS := LLVMSupport.a LLVMSystem.a
299 LINK_COMPONENTS := support system
300300
301301

Use of the LOADABLE_MODULE facility implies several things:

302302
322322


                  
                
323323 TOOLNAME = mytool
324324 USEDLIBS = mylib
325 LLVMLIBS = LLVMSupport.a LLVMSystem.a
325 LINK_COMPONENTS = support system
326326
327327

says that we are to build a tool name mytool and that it requires

328328 three libraries: mylib, LLVMSupport.a and
351351
352352
353353
354

Many tools will want to use the JIT features of LLVM. However, getting the

355 right set of libraries to link with is tedious, platform specific, and error
356 prone. Additionally, the JIT has special linker switch options that it needs.
357 Consequently, to make it easier to build tools that use the JIT, you can
358 use a special value for the LLVMLIBS variable:

354

Many tools will want to use the JIT features of LLVM. To do this, you

355 simply specify that you want an execution 'engine', and the makefiles will
356 automatically link in the appropriate JIT for the host or an interpreter
357 if none is available:

359358


                  
                
360359 TOOLNAME = my_jit_tool
361360 USEDLIBS = mylib
362 LLVMLIBS = JIT
361 LINK_COMPONENTS = engine
363362
364

Using a value of JIT for LLVMLIBS tells the makefile

365 system to construct a special value for LLVMLIBS that gives the program all
366 the LLVM libraries needed to run the JIT. Any additional libraries needed can
367 still be specified with USEDLIBS. To get a full understanding of how
368 this changes the linker command, it is recommended that you:

363

Of course, any additional libraries may be listed as other components. To

364 get a full understanding of how this changes the linker command, it is
365 recommended that you:

369366


                  
                
370367 cd examples/Fibonacci
371368 make VERBOSE=1
372369
373

By default, using LLVMLIBS=JIT will link in enough to support JIT

374 code generation for the architecture on which the tool is linked. If you need
375 additional target architectures linked in, you may specify them on the command
376 line or in your Makefile. For example:

377


                  
                
378 ENABLE_X86_JIT=1
379 ENABLE_SPARCV9_JIT=1
380 ENALBE_PPC_JIT=1
381
382

will cause the tool to be able to generate code for all three platforms.

383

384370
385371
386372