[PATCH] D109979: [Clang] [Fix] Clang build fails when build directory contains space character

Shivam Gupta via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Sep 17 09:55:06 PDT 2021


xgupta created this revision.
xgupta added reviewers: aaron.ballman, t.p.northover.
Herald added a subscriber: mgorny.
xgupta requested review of this revision.
Herald added a project: clang.
Herald added a subscriber: cfe-commits.

Clang build fails when build directory contains space character.

Error messages:

[ 95%] Linking CXX executable ../../../../bin/clang
clang: error: no such file or directory: 'Space/Net/llvm/Build/tools/clang/tools/driver/Info.plist'
make[2]: *** [bin/clang-14] Error 1
make[1]: *** [tools/clang/tools/driver/CMakeFiles/clang.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....

The path name is actually:

  'Dev Space/Net/llvm/Build/tools/clang/tools/driver/Info.plist'

Bugzilla issue - https://bugs.llvm.org/show_bug.cgi?id=51884
Reporter and patch author - Brain Swift <bsp2bsp-llvm at yahoo.com>


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D109979

Files:
  clang/tools/driver/CMakeLists.txt


Index: clang/tools/driver/CMakeLists.txt
===================================================================
--- clang/tools/driver/CMakeLists.txt
+++ clang/tools/driver/CMakeLists.txt
@@ -82,7 +82,7 @@
   set(TOOL_INFO_PLIST_OUT "${CMAKE_CURRENT_BINARY_DIR}/${TOOL_INFO_PLIST}")
   target_link_libraries(clang
     PRIVATE
-    "-Wl,-sectcreate,__TEXT,__info_plist,${TOOL_INFO_PLIST_OUT}")
+    "-Wl,-sectcreate,__TEXT,__info_plist,\"${TOOL_INFO_PLIST_OUT}\"")
   configure_file("${TOOL_INFO_PLIST}.in" "${TOOL_INFO_PLIST_OUT}" @ONLY)
 
   set(TOOL_INFO_UTI)


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D109979.373259.patch
Type: text/x-patch
Size: 560 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20210917/1444ce1a/attachment-0001.bin>


More information about the cfe-commits mailing list