diff --git a/config.py b/config.py index 09a3d4d27c840415420d9fc65857f77afdbc7c08..ddda7e9b3ce43ade03c85a12c7cd8f09331ff55c 100755 --- a/config.py +++ b/config.py @@ -176,12 +176,11 @@ class Compile(): 'install compiler\nYou can visit {} for more' ' infomation'.format(cls.compiler_path, config.quickstart)) - return True - - if 'OHOS' not in ret: - raise Exception('Error: {} is not OHOS compiler, please install' - ' compiler\nYou can visit {} for more infomation'. - format(cls.compiler_path, config.quickstart)) + else: + if 'OHOS' not in ret: + raise Exception('Error: {} is not OHOS compiler, please install' + ' compiler\nYou can visit {} for more infomation'. + format(cls.compiler_path, config.quickstart)) compiler_path = os.path.join(os.path.dirname(cls.compiler_path), os.pardir) diff --git a/toolchain/BUILD.gn b/toolchain/BUILD.gn index c56078f65a361df6a6f95b3f48850967a3870403..9ccc5d329ea4232b4d9398bed18dee5aaeb7f52f 100755 --- a/toolchain/BUILD.gn +++ b/toolchain/BUILD.gn @@ -16,9 +16,9 @@ import("//build/lite/toolchain/${ohos_build_compiler}.gni") if (ohos_build_compiler == "gcc") { gcc_toolchain("linux_x86_64_riscv32_gcc") { ohos_build_compiler_prefix = "riscv32-unknown-elf" - cc = "${ohos_build_compiler_prefix}-gcc" - cxx = "${ohos_build_compiler_prefix}-g++" - ar = "${ohos_build_compiler_prefix}-ar" + cc = "$ohos_build_compiler_dir/bin/${ohos_build_compiler_prefix}-gcc" + cxx = "$ohos_build_compiler_dir/bin/${ohos_build_compiler_prefix}-g++" + ar = "$ohos_build_compiler_dir/bin/${ohos_build_compiler_prefix}-ar" ld = cc if (ohos_build_type == "release") { strip = "$ohos_build_compiler_prefix-strip --strip-unneeded" diff --git a/toolchain/clang.gni b/toolchain/clang.gni index 9e514847e9cb1b74fa01164fa578aced574f09d9..01c9475d03d0b12963afd92534c93a78f63cdea6 100755 --- a/toolchain/clang.gni +++ b/toolchain/clang.gni @@ -38,7 +38,7 @@ template("clang_toolchain") { command = "$cc {{defines}} {{include_dirs}} {{cflags}} {{cflags_c}} -c {{source}} -o {{output}}" description = "clang {{output}}" outputs = [ - "{{source_out_dir}}/{{source_name_part}}.o", + "{{source_out_dir}}/{{label_name}}.{{source_name_part}}.o", ] } tool("cxx") { @@ -46,7 +46,7 @@ template("clang_toolchain") { command = "$cxx {{defines}} {{include_dirs}} {{cflags_cc}} -c {{source}} -o {{output}}" description = "clang++ {{output}}" outputs = [ - "{{source_out_dir}}/{{source_name_part}}.o", + "{{source_out_dir}}/{{label_name}}.{{source_name_part}}.o", ] } tool("asm") { @@ -117,4 +117,4 @@ template("clang_toolchain") { description = "COPY {{source}} {{output}}" } } -} \ No newline at end of file +}