9 B<llvm-ld> <options> <files>
13 The B<llvm-ld> command is similar to the common Unix utility, C<ld>. It
14 links together bytecode modules to produce an executable program.
18 =head2 Input/Output Options
22 =item B<-o> F<filename>
24 This overrides the default output file and specifies the name of the file that
25 should be generated by the linker. By default, B<llvm-ld> generates a file named
26 F<a.out> for compatibility with B<ld>. The output will be written to
31 This option specifies the F<name> of a library to search when resolving symbols
32 for the program. Only the base name should be specified as F<name>, without a
33 F<lib> prefix or any suffix.
37 This option tells B<llvm-ld> to look in F<Path> to find any library subsequently
38 specified with the B<-l> option. The paths will be searched in the order in
39 which they are specified on the command line. If the library is still not found,
40 a small set of system specific directories will also be searched. Note that
41 libraries specified with the B<-l> option that occur I<before> any B<-L> options
42 will not search the paths given by the B<-L> options following it.
44 =item B<-link-as-library>
46 Link the bytecode files together as a library, not an executable. In this mode,
47 undefined symbols will be permitted.
51 An alias for -link-as-library.
53 =item B<-march=>C<target>
55 Specifies the kind of machine for which code or assembly should be generated.
59 Generate a native binary instead of a shell script that runs the JIT from
64 Generate a native binary with the C back end and compilation with GCC.
66 =item B<-disable-compression>
68 Do not compress bytecode files.
72 =head2 Optimization Options
78 An alias for the -O1 option.
82 Optimize for linking speed, not execution speed. The optimizer will attempt to
83 reduce the size of the linked program to reduce I/O but will not otherwise
84 perform any link-time optimizations.
88 Perform only the minimal or required set of scalar optimizations.
92 An alias for the -O2 option.
96 Perform the standard link time inter-procedural optimizations. This will
97 attempt to optimize the program taking the entire program into consideration.
101 Perform aggressive link time optimizations. This is the same as -O4 but works
102 more aggressively to optimize the program.
104 =item B<-disable-inlining>
106 Do not run the inlining pass. Functions will not be inlined into other
109 =item B<-disable-opt>
111 Completely disable optimization. The various B<-On> options will be ignored and
112 no link time optimization passes will be run.
114 =item B<-disable-internalize>
116 Do not mark all symbols as internal.
120 Run the verification pass after each of the passes to verify intermediate
125 Strip symbol info from the executable to make it smaller.
127 =item B<-export-dynamic>
129 An alias for -disable-internalize
131 =item B<-load> F<module>
133 Load an optimization module, F<module>, which is expected to be a dynamic
134 library that provides the function name C<RunOptimizations>. This function will
135 be passed the PassManager, and the optimization level (values 0-5 based on the
136 B<-On> option). This function may add passes to the PassManager that should be
137 run. This feature allows the optimization passes of B<llvm-ld> to be extended.
141 =head2 Miscellaneous Options
145 Specifies verbose mode. In this mode the linker will print additional
146 information about the actions it takes, programs it executes, etc.
150 If B<llvm-ld> succeeds, it will exit with 0 return code. If an error occurs,
151 it will exit with a non-zero return code.
159 Maintained by the LLVM Team (L<http://llvm.cs.uiuc.edu>).