[PATCH] D82733: [clang][docs] Add note about using `-flto` with `-g` on macOS

Jonas Devlieghere via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Jun 30 09:45:27 PDT 2020


This revision was automatically updated to reflect the committed changes.
Closed by commit rGa1f4e48c4aca: [clang][docs] Add note about using `-flto` with `-g` on macOS (authored by phil-blain, committed by JDevlieghere).

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D82733/new/

https://reviews.llvm.org/D82733

Files:
  clang/docs/CommandGuide/clang.rst


Index: clang/docs/CommandGuide/clang.rst
===================================================================
--- clang/docs/CommandGuide/clang.rst
+++ clang/docs/CommandGuide/clang.rst
@@ -474,6 +474,16 @@
   optimization. With "thin", :doc:`ThinLTO <../ThinLTO>`
   compilation is invoked instead.
 
+  .. note::
+
+     On Darwin, when using :option:`-flto` along with :option:`-g` and
+     compiling and linking in separate steps, you also need to pass
+     ``-Wl,-object_path_lto,<lto-filename>.o`` at the linking step to instruct the
+     ld64 linker not to delete the temporary object file generated during Link
+     Time Optimization (this flag is automatically passed to the linker by Clang
+     if compilation and linking are done in a single step). This allows debugging
+     the executable as well as generating the ``.dSYM`` bundle using :manpage:`dsymutil(1)`.
+
 Driver Options
 ~~~~~~~~~~~~~~
 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D82733.274523.patch
Type: text/x-patch
Size: 916 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20200630/bc43964a/attachment-0001.bin>


More information about the cfe-commits mailing list