mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-08-18 12:29:21 +00:00
Clarified the extension to shared library objects.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10978 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
6b15340ba5
commit
f9c78655be
@ -51,16 +51,16 @@ language.
|
|||||||
Quiet mode. With this option, analysis pass names are not printed.
|
Quiet mode. With this option, analysis pass names are not printed.
|
||||||
<p>
|
<p>
|
||||||
|
|
||||||
<li> -load <plugin.so>
|
<li> -load <plugin>
|
||||||
<br>
|
<br>
|
||||||
Load the specified dynamic object with name plugin.so. This file
|
Load the specified dynamic object with name <tt>plugin</tt>. This file
|
||||||
should contain additional analysis passes that register themselves with
|
should contain additional analysis passes that register themselves with
|
||||||
the <tt>analyze</tt> program after being loaded.
|
the <tt>analyze</tt> program after being loaded.
|
||||||
<p>
|
<p>
|
||||||
|
|
||||||
After being loaded, additional command line options are made available
|
After being loaded, additional command line options are made available
|
||||||
for running the passes made available by plugin.so. Use
|
for running the passes made available by <tt>plugin</tt>. Use
|
||||||
'<tt><tt>analyze</tt> -load <plugin.so> -help</tt>' to see the new
|
'<tt><tt>analyze</tt> -load <plugin> -help</tt>' to see the new
|
||||||
list of available analysis passes.
|
list of available analysis passes.
|
||||||
<p>
|
<p>
|
||||||
</ul>
|
</ul>
|
||||||
|
@ -158,8 +158,8 @@ non-obvious ways. Here are some hints and tips:<p>
|
|||||||
<h3>OPTIONS</h3>
|
<h3>OPTIONS</h3>
|
||||||
|
|
||||||
<ul>
|
<ul>
|
||||||
<li><tt>-additional-so <library.so></tt><br>
|
<li><tt>-additional-so <library></tt><br>
|
||||||
Load <tt><library.so></tt> into the test program whenever it is run.
|
Load <tt><library></tt> into the test program whenever it is run.
|
||||||
This is useful if you are debugging programs which depend on non-LLVM
|
This is useful if you are debugging programs which depend on non-LLVM
|
||||||
libraries (such as the X or curses libraries) to run.<p>
|
libraries (such as the X or curses libraries) to run.<p>
|
||||||
|
|
||||||
@ -189,14 +189,14 @@ non-obvious ways. Here are some hints and tips:<p>
|
|||||||
test program, whenever it runs, to come from that file.
|
test program, whenever it runs, to come from that file.
|
||||||
<p>
|
<p>
|
||||||
|
|
||||||
<a name="opt_load"><li> <tt>-load <plugin.so></tt><br>
|
<a name="opt_load"><li> <tt>-load <plugin></tt><br>
|
||||||
Load the dynamic object <tt><plugin.so></tt> into <tt>bugpoint</tt>
|
Load the dynamic object <tt><plugin></tt> into <tt>bugpoint</tt>
|
||||||
itself. This object should register new
|
itself. This object should register new
|
||||||
optimization passes. Once loaded, the object will add new command line
|
optimization passes. Once loaded, the object will add new command line
|
||||||
options to enable various optimizations. To see the new complete list
|
options to enable various optimizations. To see the new complete list
|
||||||
of optimizations, use the -help and -load options together:
|
of optimizations, use the -help and -load options together:
|
||||||
<p>
|
<p>
|
||||||
<tt>bugpoint -load <plugin.so> -help</tt>
|
<tt>bugpoint -load <plugin> -help</tt>
|
||||||
<p>
|
<p>
|
||||||
|
|
||||||
<a name="opt_output"><li><tt>-output <filename></tt><br>
|
<a name="opt_output"><li><tt>-output <filename></tt><br>
|
||||||
|
@ -32,24 +32,35 @@ optimizations on the program.
|
|||||||
|
|
||||||
<h4>Search Order</h4>
|
<h4>Search Order</h4>
|
||||||
|
|
||||||
|
<p>
|
||||||
When looking for objects specified on the command line, <tt>gccld</tt> will
|
When looking for objects specified on the command line, <tt>gccld</tt> will
|
||||||
search for the object first in the current directory and then in the directory
|
search for the object first in the current directory and then in the directory
|
||||||
specified by the <tt>LLVM_LIB_SEARCH_PATH</tt> environment variable. If it
|
specified by the <tt>LLVM_LIB_SEARCH_PATH</tt> environment variable. If it
|
||||||
cannot find the object, it fails.
|
cannot find the object, it fails.
|
||||||
<p>
|
</p>
|
||||||
|
|
||||||
|
<p>
|
||||||
When looking for a library specified with the -l option, <tt>gccld</tt> first
|
When looking for a library specified with the -l option, <tt>gccld</tt> first
|
||||||
attempts to load a file with that name from the current directory. If that
|
attempts to load a file with that name from the current directory. If that
|
||||||
fails, it looks for lib<library>.bc, lib<library>.a, or
|
fails, it looks for lib<library>.bc, lib<library>.a, or
|
||||||
lib<library>.so, in that order, in each directory added to the library
|
lib<library>.<shared library extension>, in that order, in each
|
||||||
search path with the -L option. These directories are searched in order they
|
directory added to the library search path with the -L option. These
|
||||||
|
directories are searched in the order they
|
||||||
were specified. If the library cannot be located, then <tt>gccld</tt> looks in
|
were specified. If the library cannot be located, then <tt>gccld</tt> looks in
|
||||||
the directory specified by the <tt>LLVM_LIB_SEARCH_PATH</tt> environment
|
the directory specified by the <tt>LLVM_LIB_SEARCH_PATH</tt> environment
|
||||||
variable. If it does not find lib<library>.[bc | a | so] there, it fails.
|
variable. If it does not find a library there, it fails.
|
||||||
|
</p>
|
||||||
|
|
||||||
|
<p>
|
||||||
|
The shared library extension is usually <tt>.so</tt>, but it may differ
|
||||||
|
depending upon the system.
|
||||||
|
</p>
|
||||||
|
|
||||||
|
<p>
|
||||||
The -L option is global. It does not matter where it is specified in the list
|
The -L option is global. It does not matter where it is specified in the list
|
||||||
of command line arguments; the directory is simply added to the search path and
|
of command line arguments; the directory is simply added to the search path and
|
||||||
is applied to all libraries, preceding or succeeding, in the command line.
|
is applied to all libraries, preceding or succeeding, in the command line.
|
||||||
|
</p>
|
||||||
|
|
||||||
<h4>Link order</h4>
|
<h4>Link order</h4>
|
||||||
|
|
||||||
@ -131,9 +142,9 @@ using the -native option.
|
|||||||
<br>
|
<br>
|
||||||
Specify libraries to include when linking the output file. When
|
Specify libraries to include when linking the output file. When
|
||||||
linking, <tt>gccld</tt> will first attempt to load a file with the
|
linking, <tt>gccld</tt> will first attempt to load a file with the
|
||||||
pathname library. If that fails, it will then attempt to load
|
pathname <tt>library</tt>. If that fails, it will then attempt to load
|
||||||
lib<library>.bc, lib<library>.a, and lib<library>.so,
|
lib<library>.bc, lib<library>.a, and
|
||||||
in that order.
|
lib<library>.<shared library extension>, in that order.
|
||||||
<p>
|
<p>
|
||||||
|
|
||||||
<li> -link-as-library
|
<li> -link-as-library
|
||||||
|
@ -88,14 +88,14 @@ writes its output to the standard output.
|
|||||||
Quiet mode. Do not print messages on whether the program was modified.
|
Quiet mode. Do not print messages on whether the program was modified.
|
||||||
<p>
|
<p>
|
||||||
|
|
||||||
<li> -load <plugin.so>
|
<li> -load <plugin>
|
||||||
<br>
|
<br>
|
||||||
Load the dynamic object <plugin.so>. This object should register new
|
Load the dynamic object <plugin>. This object should register new
|
||||||
optimization passes. Once loaded, the object will add new command line
|
optimization passes. Once loaded, the object will add new command line
|
||||||
options to enable various optimizations. To see the new complete list
|
options to enable various optimizations. To see the new complete list
|
||||||
of optimizations, use the -help and -load options together:
|
of optimizations, use the -help and -load options together:
|
||||||
<p>
|
<p>
|
||||||
<tt>opt -load <plugin.so> -help</tt>
|
<tt>opt -load <plugin> -help</tt>
|
||||||
<p>
|
<p>
|
||||||
|
|
||||||
<li> -p
|
<li> -p
|
||||||
|
@ -173,6 +173,11 @@ directory are to be compiled and linked together into a
|
|||||||
<tt>lib/Debug/libhello.so</tt> shared object that can be dynamically loaded by
|
<tt>lib/Debug/libhello.so</tt> shared object that can be dynamically loaded by
|
||||||
the <tt>opt</tt> or <tt>analyze</tt> tools.</p>
|
the <tt>opt</tt> or <tt>analyze</tt> tools.</p>
|
||||||
|
|
||||||
|
<p>
|
||||||
|
Note that the suffix of the shared library may differ from the example above if
|
||||||
|
your system uses a different suffix by default.
|
||||||
|
</p>
|
||||||
|
|
||||||
<p>Now that we have the build scripts set up, we just need to write the code for
|
<p>Now that we have the build scripts set up, we just need to write the code for
|
||||||
the pass itself.</p>
|
the pass itself.</p>
|
||||||
|
|
||||||
@ -282,7 +287,7 @@ them) to be useful.</p>
|
|||||||
|
|
||||||
<div class="doc_text">
|
<div class="doc_text">
|
||||||
|
|
||||||
<p>Now that you have a brand new shiny <tt>.so</tt> file, we can use the
|
<p>Now that you have a brand new shiny shared object file, we can use the
|
||||||
<tt>opt</tt> command to run an LLVM program through your pass. Because you
|
<tt>opt</tt> command to run an LLVM program through your pass. Because you
|
||||||
registered your pass with the <tt>RegisterOpt</tt> template, you will be able to
|
registered your pass with the <tt>RegisterOpt</tt> template, you will be able to
|
||||||
use the <tt>opt</tt> tool to access it, once loaded.</p>
|
use the <tt>opt</tt> tool to access it, once loaded.</p>
|
||||||
|
Loading…
Reference in New Issue
Block a user