summaryrefslogtreecommitdiffstats
path: root/clang/docs/LanguageExtensions.rst
diff options
context:
space:
mode:
authorSaleem Abdulrasool <compnerd@compnerd.org>2018-02-07 01:46:46 +0000
committerSaleem Abdulrasool <compnerd@compnerd.org>2018-02-07 01:46:46 +0000
commitfd4db5331e512d23d2d1c832065acbe226e7616d (patch)
treef82cc74b81c57e0ea53130d3e4891725d5e667bc /clang/docs/LanguageExtensions.rst
parentfd443e9b6cd0559f2dd6e51ae40eb54542fccbf0 (diff)
downloadbcm5719-llvm-fd4db5331e512d23d2d1c832065acbe226e7616d.tar.gz
bcm5719-llvm-fd4db5331e512d23d2d1c832065acbe226e7616d.zip
Support `#pragma comment(lib, "name")` in the frontend for ELF
This adds the frontend support required to support the use of the comment pragma to enable auto linking on ELFish targets. This is a generic ELF extension supported by LLVM. We need to change the handling for the "dependentlib" in order to accommodate the previously discussed encoding for the dependent library descriptor. Without the custom handling of the PCK_Lib directive, the -l prefixed option would be encoded into the resulting object (which is treated as a frontend error). llvm-svn: 324438
Diffstat (limited to 'clang/docs/LanguageExtensions.rst')
-rw-r--r--clang/docs/LanguageExtensions.rst8
1 files changed, 8 insertions, 0 deletions
diff --git a/clang/docs/LanguageExtensions.rst b/clang/docs/LanguageExtensions.rst
index 41f161302f2..6d9bbcbd3a5 100644
--- a/clang/docs/LanguageExtensions.rst
+++ b/clang/docs/LanguageExtensions.rst
@@ -2725,3 +2725,11 @@ The ``#pragma clang section`` directive obeys the following rules:
* The decision about which section-kind applies to each global is taken in the back-end.
Once the section-kind is known, appropriate section name, as specified by the user using
``#pragma clang section`` directive, is applied to that global.
+
+Specifying Linker Options on ELF Targets
+========================================
+
+The ``#pragma comment(lib, ...)`` directive is supported on all ELF targets.
+The second parameter is the library name (without the traditional Unix prefix of
+``lib``). This allows you to provide an implicit link of dependent libraries.
+
OpenPOWER on IntegriCloud