mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2025-01-31 20:51:52 +01:00
[IR] Reserve/define the purpose for the "Linker Options" metadata flags.
llvm-svn: 172681
This commit is contained in:
parent
937caf3fb2
commit
4ea84b0026
@ -2610,6 +2610,40 @@ Some important flag interactions:
|
||||
- A module with ``Objective-C Garbage Collection`` set to 0 cannot be
|
||||
merged with a module with ``Objective-C GC Only`` set to 6.
|
||||
|
||||
Automatic Linker Flags Module Flags Metadata
|
||||
--------------------------------------------
|
||||
|
||||
Some targets support embedding flags to the linker inside individual object
|
||||
files. Typically this is used in conjunction with language extensions which
|
||||
allow source files to explicitly declare the libraries they depend on, and have
|
||||
these automatically be transmitted to the linker via object files.
|
||||
|
||||
These flags are encoded in the IR using metadata in the module flags section,
|
||||
using the ``Linker Options`` key. The merge behavior for this flag is required
|
||||
to be ``AppendUnique``, and the value for the key is expected to be a metadata
|
||||
node which should be a list of other metadata nodes, each of which should be a
|
||||
list of metadata strings defining linker options.
|
||||
|
||||
For example, the following metadata section specifies two separate sets of
|
||||
linker options, presumably to link against ``libz`` and the ``Cocoa``
|
||||
framework::
|
||||
|
||||
!0 = metadata !{ i32 6, "Linker Options",
|
||||
metadata !{
|
||||
!metadata { metadata !"-lz" },
|
||||
!metadata { metadata !"-framework", metadata !"Cocoa" } } }
|
||||
!llvm.module.flags = !{ !0 }
|
||||
|
||||
The metadata encoding as lists of lists of options, as opposed to a collapsed
|
||||
list of options, is chosen so that the IR encoding can use multiple option
|
||||
strings to specify e.g., a single library, while still having that specifier be
|
||||
preserved as an atomic element that can be recognized by a target specific
|
||||
assembly writer or object file emitter.
|
||||
|
||||
Each individual option is required to be either a valid option for the target's
|
||||
linker, or an option that is reserved by the target specific assembly writer or
|
||||
object file emitter. No other aspect of these options is defined by the IR.
|
||||
|
||||
Intrinsic Global Variables
|
||||
==========================
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user