[PATCH] D84127: Make LLVM_ENABLE_LTO function with multi-arch values for CMAKE_OSX_ARCHITECTURES

Daniel Sanders via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jul 24 17:41:36 PDT 2020


dsanders marked an inline comment as done.
dsanders added a comment.

In D84127#2173436 <https://reviews.llvm.org/D84127#2173436>, @beanz wrote:

> I was talking to @bogner about this. I think this patch is reasonable, but it is important to note that this patch (and the previous version) are both workarounds for a bug in clang. Anytime the clang driver is provided a flag to generate debug info and it is linking temporary object files, clang should insert a dsymutil step. Right now it only inserts the step if there is a compiler or assembler input to the compiler. I filed a bug to track it (https://bugs.llvm.org/show_bug.cgi?id=46841), and I will upload a patch to the clang driver to fix this issue.


Thanks. That makes sense to me, I thought it was pretty strange that output depended on whether it took 1 or >1 steps to get the result.
I also think the emit+move dance is a workaround to not being able to tell clang where to put them. I've posted D84572 <https://reviews.llvm.org/D84572> for that bit

> @dsanders, could you add a comment that this is a workaround for the bug in the clang driver and a link to the bug? That will allow us to track making this behavior conditional and maybe eventually removing it.

Sure



================
Comment at: llvm/cmake/modules/AddLLVM.cmake:1986-1996
+      set(output_name "$<TARGET_FILE_NAME:${name}>.${file_ext}")
+      set(output_path "${LLVM_EXTERNALIZE_DEBUGINFO_OUTPUT_DIR}/${output_name}")
+      add_custom_command(TARGET ${name} POST_BUILD
+        COMMAND ${CMAKE_COMMAND} -E make_directory "${LLVM_EXTERNALIZE_DEBUGINFO_OUTPUT_DIR}"
+        # Remove any old versions if present
+        COMMAND ${CMAKE_COMMAND} -E rm "-rf" "${output_path}"
+        # Move the dSYM clang emitted next to the output binary where we want it
----------------
I've posted https://reviews.llvm.org/D84572 which will (eventually) allow us to remove this emit+move dance by adding -external-dsym-dir=${LLVM_EXTERNALIZE_DEBUGINFO_OUTPUT_DIR} to the cflags/cxxflags in order to emit the dSYM in the desired location to begin with.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D84127





More information about the llvm-commits mailing list