You can pass the stdlib argument either as -stdlib and --stdlib - the previous regex did not account for this however - which caused the build to fail, as a --stdlib argument would be replaced with a single dash, causing clang to assume reading from stdin and the build to fail: clang++: error: -E or -x required when input is from standard input clang++: error: cannot specify -o when generating multiple output files The files [libcxxabi/CMakeLists.txt](bf6986f9f0/libcxxabi/CMakeLists.txt (L261)) and [libunwind/CMakeLists.txt](bf6986f9f0/libunwind/CMakeLists.txt (L257)) account for this by removing --stdlib first. Co-authored-by: Vitaly Buka <vitalybuka@google.com>