From 52ee370730eb5c222c9e6538648721d21716ce35 Mon Sep 17 00:00:00 2001 From: Caoruihong Date: Thu, 1 Jul 2021 21:40:05 +0800 Subject: [PATCH] chore: support ccache scenario clang with ccache cause toolchain prefix with blank char, so it is better quote toolchain pathes with quotes Signed-off-by: Caoruihong Change-Id: I617aa00c9558dcdcd9f25213cd5d9f30536dcced --- build/BUILD.gn | 2 +- build/Makefile | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/build/BUILD.gn b/build/BUILD.gn index 895f5bf..0457cf6 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 CLANG=$ohos_current_cc_command" + 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 22db07b..8295b51 100644 --- a/build/Makefile +++ b/build/Makefile @@ -127,7 +127,7 @@ musl_install_for_linux_user: TARGET = $(ARCH)-linux-ohosmusl musl_install_for_linux_user: musl_patch_for_linux_user $(HIDE) cd musl_copy_for_linux_user && mkdir -p $(MUSLBUILDDIR) && cd $(MUSLBUILDDIR) && \ ../configure --prefix=/usr --target=$(TARGET) --includedir=/usr/include/$(TARGET) --libdir=/usr/$(MULTILIB) \ - CC="$(CC)" CROSS_COMPILE=$(CROSS_COMPILE) CFLAGS="$(CFLAGS)" >/dev/null && \ + CC="$(CC)" CROSS_COMPILE="$(CROSS_COMPILE)" CFLAGS="$(CFLAGS)" >/dev/null && \ sed 's, -m 644 , -m 444 ,g' Makefile | make -f- -sj install-headers install-libs DESTDIR=$(SYSROOTDIR) $(HIDE) cp -rfp linux_header_install_for_linux_user/include/* $(SYSROOTDIR)/usr/include/$(TARGET) @@ -141,7 +141,7 @@ musl_install_for_liteos_a_user: musl_patch_for_liteos_a_user $(HIDE) cd musl_copy_for_liteos_a_user && mkdir -p $(MUSLBUILDDIR) && cd $(MUSLBUILDDIR) && \ ../configure --prefix=/usr --target=$(TARGET) --includedir=/usr/include/$(TARGET) --libdir=/usr/$(MULTILIB) \ $(if $(LDFLAGS),LDFLAGS="$(LDFLAGS)",) \ - CC="$(CC)" CROSS_COMPILE=$(CROSS_COMPILE) CFLAGS="$(CFLAGS)" >/dev/null && \ + CC="$(CC)" CROSS_COMPILE="$(CROSS_COMPILE)" CFLAGS="$(CFLAGS)" >/dev/null && \ sed 's, -m 644 , -m 444 ,g' Makefile | make -f- -sj install-headers install-libs DESTDIR=$(SYSROOTDIR) ifeq ($(ARCH),arm) @@ -164,7 +164,7 @@ musl_install_for_linux_user$(1): override ARCH_CFLAGS = $$($(2)) musl_install_for_linux_user$(1): musl_install_for_linux_user $$(HIDE) cd musl_copy_for_linux_user && mkdir -p $$(MUSLBUILDDIR) && cd $$(MUSLBUILDDIR) && \ ../configure --prefix=/usr --target=$$(TARGET) --libdir=/usr/$$(MULTILIB) \ - CC="$$(CC)" CROSS_COMPILE=$$(CROSS_COMPILE) CFLAGS="$$(CFLAGS)" >/dev/null && \ + CC="$$(CC)" CROSS_COMPILE="$$(CROSS_COMPILE)" CFLAGS="$$(CFLAGS)" >/dev/null && \ sed 's, -m 644 , -m 444 ,g' Makefile | make -f- -sj install-libs DESTDIR=$$(SYSROOTDIR) ifeq ($$(BUILD_DEBUG),true) @@ -177,7 +177,7 @@ musl_install_for_liteos_a_user$(1): musl_install_for_liteos_a_user $$(HIDE) cd musl_copy_for_liteos_a_user && mkdir -p $$(MUSLBUILDDIR) && cd $$(MUSLBUILDDIR) && \ ../configure --prefix=/usr --target=$$(TARGET) --libdir=/usr/$$(MULTILIB) \ $$(if $$(LDFLAGS),LDFLAGS="$$(LDFLAGS)",) \ - CC="$$(CC)" CROSS_COMPILE=$$(CROSS_COMPILE) CFLAGS="$$(CFLAGS)" >/dev/null && \ + CC="$$(CC)" CROSS_COMPILE="$$(CROSS_COMPILE)" CFLAGS="$$(CFLAGS)" >/dev/null && \ sed 's, -m 644 , -m 444 ,g' Makefile | make -f- -sj install-libs DESTDIR=$$(SYSROOTDIR) endif -- GitLab