summaryrefslogtreecommitdiffstats
path: root/compiler-rt/cmake/Modules
diff options
context:
space:
mode:
authorHans Wennborg <hans@hanshq.net>2019-09-19 11:28:32 +0000
committerHans Wennborg <hans@hanshq.net>2019-09-19 11:28:32 +0000
commitec841cf36ca1cb6a154393d7e9f48e8723a38966 (patch)
tree0ad3ada134c34a32008ac8d7251e016d65dab43a /compiler-rt/cmake/Modules
parentaa03c14827fab3caba6306fc2e5d7f1757230f73 (diff)
downloadbcm5719-llvm-ec841cf36ca1cb6a154393d7e9f48e8723a38966.tar.gz
bcm5719-llvm-ec841cf36ca1cb6a154393d7e9f48e8723a38966.zip
[cmake] Strip quotes in try_compile_only
After r372209, the compile command can end up including an argument with quotes in it, e.g. -fprofile-instr-use="/foo/bar.profdata" when invoking the compiler with execute_process, the compiler ends up getting that argument with quotes and all, and fails to open the file. This all seems horribly broken, but one way of working around it is to simply strip the quotes from the string here. If they were there to protect a path that's got spaces in it, that wasn't going to work anyway because the string is later split by spaces. llvm-svn: 372312
Diffstat (limited to 'compiler-rt/cmake/Modules')
-rw-r--r--compiler-rt/cmake/Modules/BuiltinTests.cmake6
1 files changed, 6 insertions, 0 deletions
diff --git a/compiler-rt/cmake/Modules/BuiltinTests.cmake b/compiler-rt/cmake/Modules/BuiltinTests.cmake
index eee77ad0200..4a123638c8b 100644
--- a/compiler-rt/cmake/Modules/BuiltinTests.cmake
+++ b/compiler-rt/cmake/Modules/BuiltinTests.cmake
@@ -72,6 +72,12 @@ function(try_compile_only output)
endif()
endforeach()
+ # Strip quotes from the compile command, as the compiler is not expecting
+ # quoted arguments (see discussion on D62063 for when this can come up). If
+ # the quotes were there for arugments with spaces in them, the quotes were
+ # not going to help since the string gets split on spaces below.
+ string(REPLACE "\"" "" test_compile_command "${test_compile_command}")
+
string(REPLACE " " ";" test_compile_command "${test_compile_command}")
execute_process(
OpenPOWER on IntegriCloud