Skip to content

Commit ce9189b

Browse files
authored
Utilities/bootstrap: fix ignored --clang-path option (#5894)
`Utilities/bootstrap` has `--clang-path`, which currently is parsed, but not propagated anywhere. Ignoring this option caused issues on certain Linux distributions, where the process of bringing up clang is convoluted and `bootstrap` ended up using GCC, which caused build failures. `args.clang_path` value is now passed to CMake as `-DCMAKE_C_COMPILER`.
1 parent ef2934d commit ce9189b

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

Utilities/bootstrap

+4-2
Original file line numberDiff line numberDiff line change
@@ -503,6 +503,7 @@ def build_with_cmake(args, cmake_args, ninja_args, source_path, build_dir):
503503
"-DCMAKE_BUILD_TYPE:=Debug",
504504
"-DCMAKE_Swift_FLAGS='%s'" % swift_flags,
505505
"-DCMAKE_Swift_COMPILER:=%s" % (args.swiftc_path),
506+
"-DCMAKE_C_COMPILER:=%s" % (args.clang_path),
506507
] + cmake_args + [source_path]
507508

508509
if args.verbose:
@@ -534,8 +535,8 @@ def build_llbuild(args):
534535
call(["touch", "codemodel-v2"], cwd=api_dir, verbose=args.verbose)
535536

536537
flags = [
537-
"-DCMAKE_C_COMPILER:=clang",
538-
"-DCMAKE_CXX_COMPILER:=clang++",
538+
"-DCMAKE_C_COMPILER:=%s" % (args.clang_path),
539+
"-DCMAKE_CXX_COMPILER:=%s" % (args.clang_path),
539540
"-DLLBUILD_SUPPORT_BINDINGS:=Swift",
540541
]
541542

@@ -621,6 +622,7 @@ def build_swiftpm_with_swiftpm(args, integrated_swift_driver):
621622
swiftpm_args = [
622623
"SWIFT_EXEC=" + args.swiftc_path,
623624
"SWIFT_DRIVER_SWIFT_EXEC=" + args.swiftc_path,
625+
"CC=" + args.clang_path
624626
]
625627

626628
if args.bootstrap:

0 commit comments

Comments
 (0)