diff --git a/build/BUILD.gn b/build/BUILD.gn index fb44404ea460d06a56db9d1f51edbf861b2e2626..895f5bf3ff930f207604a241c915fc1bf1a23a91 100644 --- a/build/BUILD.gn +++ b/build/BUILD.gn @@ -50,7 +50,7 @@ if (!defined(board_configed_sysroot) || board_configed_sysroot == "") { arch_cflags = string_join(" ", target_arch_cflags) command = "make TOPDIR=$ohos_root_path SYSROOTDIR=$sysroot_path TARGETS=$targets -f $makefile" command += " ARCH=$arch TARGET=$target_triple ARCH_CFLAGS=\"$arch_cflags\"" - command += " BUILD_DEBUG=false BUILD_ALL_MULTILIB=false" + command += " BUILD_DEBUG=false BUILD_ALL_MULTILIB=false CLANG=$ohos_current_cc_command" # copy standard libraries libc.so and libc++.so to lib out dir libcpp = "\$($ohos_current_cxx_command --target=$target_triple --sysroot=$sysroot_path $arch_cflags -print-file-name=libc++.so)" diff --git a/build/Makefile b/build/Makefile index 58e0e3b86b9857a001039171c45a28d480ac116a..22db07b2ed9109c3f2ce276f84e6639f83e49982 100644 --- a/build/Makefile +++ b/build/Makefile @@ -29,8 +29,9 @@ ARCH = arm TARGET = $(ARCH)-liteos -CROSS_COMPILE = llvm- -CC = clang --target=$(TARGET) $(ARCH_CFLAGS) +CLANG ?= clang +CROSS_COMPILE = $(CLANG:%clang=%)llvm- +CC = $(CLANG) --target=$(TARGET) $(ARCH_CFLAGS) MULTILIB = $(patsubst $(shell $(CC) -print-file-name=)%/,%,$(dir $(shell $(CC) -print-libgcc-file-name))) MUSLBUILDDIR = build_$(ARCH)$(subst $(eval) ,,$(patsubst -%,_%,$(sort $(ARCH_CFLAGS)))) HIDE = @