[PATCH] D133717: [lld-macho][docs] Cosmetic changes
Jez Ng via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Mon Sep 12 10:59:56 PDT 2022
int3 created this revision.
int3 added reviewers: lld-macho, michaeleisel.
Herald added a subscriber: arphaman.
Herald added a reviewer: MaskRay.
Herald added a reviewer: ributzka.
Herald added projects: lld-macho, All.
int3 requested review of this revision.
Herald added subscribers: llvm-commits, StephenFan.
Herald added a project: LLVM.
1. Fixed rST hyperlink syntax
2. Renamed LD64 -> ld64
3. Moved up the `-no_deduplicate` section so it is right under the section talking about how our default dedup behavior differs; IMO it makes more sense to read them in that order
4. De-bullet-listed some other sections so we have less whitespace in the rendered page
5. Since the Mach-O LLD Port page has only one sub-page, don't render an entire toctree with just one item. Use a "See also" box instead.
Repository:
rG LLVM Github Monorepo
https://reviews.llvm.org/D133717
Files:
lld/docs/MachO/index.rst
lld/docs/MachO/ld64-vs-lld.rst
Index: lld/docs/MachO/ld64-vs-lld.rst
===================================================================
--- lld/docs/MachO/ld64-vs-lld.rst
+++ lld/docs/MachO/ld64-vs-lld.rst
@@ -1,37 +1,34 @@
-==================
-LD64 vs LLD-MACHO
-==================
+=================
+ld64 vs LLD-MachO
+=================
-This doc lists all significant deliberate differences in behavior between LD64 and LLD-MachO.
+This doc lists all significant deliberate differences in behavior between ld64 and LLD-MachO.
String Literal Deduplication
****************************
-LD64 always deduplicates string literals. LLD only does it when the ``--icf=``
+ld64 always deduplicates string literals. LLD only does it when the ``--icf=``
or the ``--deduplicate-literals`` flag is passed. Omitting deduplication by
default ensures that our link is as fast as possible. However, it may also break
some programs which have (incorrectly) relied on string deduplication always
occurring. In particular, programs which compare string literals via pointer
equality must be fixed to use value equality instead.
-String Alignment
-****************
-LLD is slightly less conservative about aligning cstrings, allowing it to pack
-them more compactly. This should not result in any meaningful semantic
-difference.
-
``-no_deduplicate`` Flag
************************
-- LD64:
- * This turns off ICF (deduplication pass) in the linker.
-- LLD
- * This turns off ICF and string merging in the linker.
+- ld64: This turns off ICF (deduplication pass) in the linker.
+- LLD: This turns off ICF and string merging in the linker.
+
+String Alignment
+****************
+LLD is `slightly less conservative about aligning cstrings
+<https://reviews.llvm.org/D121342>`_, allowing it to pack them more compactly.
+This should not result in any meaningful semantic difference.
ObjC Symbols Treatment
**********************
-There are differences in how LLD and LD64 handle ObjC symbols loaded from archives.
+There are differences in how LLD and ld64 handle ObjC symbols loaded from archives.
-- LD64:
- * Duplicate ObjC symbols from the same archives will not raise an error. LD64 will pick the first one.
- * Duplicate ObjC symbols from different archives will raise a "duplicate symbol" error.
-- LLD:
- * Duplicate symbols, regardless of which archives they are from, will raise errors.
+- ld64:
+ 1. Duplicate ObjC symbols from the same archives will not raise an error. ld64 will pick the first one.
+ 2. Duplicate ObjC symbols from different archives will raise a "duplicate symbol" error.
+- LLD: Duplicate symbols, regardless of which archives they are from, will raise errors.
Index: lld/docs/MachO/index.rst
===================================================================
--- lld/docs/MachO/index.rst
+++ lld/docs/MachO/index.rst
@@ -49,13 +49,17 @@
LLD can be used by adding ``-fuse-ld=/path/to/ld64.lld`` to the linker flags.
For Xcode, this can be done by adding it to "Other linker flags" in the build
settings. For Bazel, this can be done with ``--linkopt`` or with
-[rules_apple_linker](https://github.com/keith/rules_apple_linker).
+`rules_apple_linker <https://github.com/keith/rules_apple_linker>`_.
The user may also need to add ``-Wl,--deduplicate-literals`` in order
to match Apple's linker behavior more closely (otherwise problems
-can occur, for instance, in unit tests). For more info on
-the differences between the two, see "LD64 vs LLD-MACHO", mentioned below.
+can occur, for instance, in unit tests).
+
+.. seealso::
+
+ For more info on the differences between the two linkers, see
+ :doc:`ld64-vs-lld`.
.. toctree::
- :maxdepth: 1
+ :hidden:
ld64-vs-lld
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D133717.459521.patch
Type: text/x-patch
Size: 3704 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220912/49ff7bde/attachment.bin>
More information about the llvm-commits
mailing list