【求助】clang18适配oh clang15编译报错
背景: 1.克隆oh 的llvm代码然后预下载,然后先编译生成arm版本的目标,然后把clang18替换clang15,在clang18的基础上同步oh clang15的修改。结果编译third_party/musl的时候,报不识别编译选项,结果如下: 摘要: [OHOS ERROR] clang: error: unsupported option '-mfloat-abi=' for ta
背景:
1.克隆oh 的llvm代码然后预下载,然后先编译生成arm版本的目标,然后把clang18替换clang15,在clang18的基础上同步oh clang15的修改。结果编译third_party/musl的时候,报不识别编译选项,结果如下:
摘要:
[OHOS ERROR] clang: error: unsupported option '-mfloat-abi=' for target 'x86_64-unknown-linux-gnu'
具体如下:
-- Build files have been written to: /home/water/llvm/out/lib/clangrt-arm-linux-ohos
INFO:__main__:check_call:10:34:17 /home/water/llvm/prebuilts/cmake/bin/ninja
[398/398] Linking CXX static library lib/arm-linux-ohos/libclang_rt.fuzzer_no_main.a
INFO:__main__:check_call:10:34:31 /home/water/llvm/prebuilts/cmake/bin/ninja install
[0/1] Install the project...
-- Install configuration: "Release"
-- Up-to-date: /home/water/llvm/out/llvm-install/lib/clang/18.0.0/include/sanitizer/memprof_interface.h
-- Up-to-date: /home/water/llvm/out/llvm-install/lib/clang/18.0.0/include/profile/InstrProfData.inc
-- Installing: /home/water/llvm/out/llvm-install/lib/clang/18.0.0/lib/arm-linux-ohos/libclang_rt.builtins.a
-- Installing: /home/water/llvm/out/llvm-install/lib/clang/18.0.0/lib/arm-linux-ohos/libclang_rt.profile.a
-- Installing: /home/water/llvm/out/llvm-install/lib/clang/18.0.0/lib/arm-linux-ohos/libclang_rt.fuzzer.a
-- Installing: /home/water/llvm/out/llvm-install/lib/clang/18.0.0/lib/arm-linux-ohos/libclang_rt.fuzzer_no_main.a
-- Installing: /home/water/llvm/out/llvm-install/lib/clang/18.0.0/lib/arm-linux-ohos/libclang_rt.fuzzer_interceptors.a
INFO:__main__:run a7 product-name llvm_build target-name soft_musl_libs
INFO:__main__:run product-name llvm_build target-cpu arm target-name soft_musl_libs gn-args arm_float_abi=soft board_cpu=cortex-a7 musl_target_multilib=a7_soft
[OHOS INFO] loader args:['platforms_config_file="/home/water/llvm/out/preloader/llvm_build/platforms.build"', 'subsystem_config_file="/home/water/llvm/out/preloader/llvm_build/subsystem_config.json"', 'example_subsystem_file=""', 'exclusion_modules_config_file="/home/water/llvm/out/preloader/llvm_build/exclusion_modules.json"', 'source_root_dir="/home/water/llvm/"', 'gn_root_out_dir="out/llvm_build"', 'build_platform_name=phone', 'build_xts=False', 'load_test_config=True', 'target_os=ohos', 'target_cpu=arm', 'os_level=standard', "ignore_api_check=['xts', 'common', 'testfwk']", 'scalable_build=False', 'skip_partlist_check=False']
[OHOS INFO] Excuting gn command: /home/water/llvm/prebuilts/build-tools/linux-x86/bin/gn gen --args="product_name=\"llvm_build\" product_path=\"/home/water/llvm/toolchain/llvm-project/llvm_products\" product_config_path=\"/home/water/llvm/toolchain/llvm-project/llvm_products\" device_name=\"llvm_build\" device_path=\"/home/water/llvm/device/board/ohos/llvm_build\" device_company=\"ohos\" device_config_path=\"/home/water/llvm/device/board/ohos/llvm_build\" target_cpu=\"arm\" is_standard_system=true ohos_build_compiler_specified=\"\" ohos_build_time=1704220471568 ohos_build_datetime=\"2024-01-03 10:34:31\" ohos_build_enable_ccache=true ohos_build_type=\"debug\" device_type=\"default\" build_variant=\"root\" is_llvm_build=true startup_init_with_param_base=true use_thin_lto=false arm_float_abi=\"soft\" board_cpu=\"cortex-a7\" musl_target_multilib=\"a7_soft\" root_perf_main=\"main\" runtime_mode=\"release\"" /home/water/llvm/out/llvm_build
[OHOS INFO] Excuting ninja command: /home/water/llvm/prebuilts/build-tools/linux-x86/bin/ninja -w dupbuild=warn -C /home/water/llvm/out/llvm_build soft_musl_libs
[OHOS ERROR] [8/1494] CC obj/third_party/musl/porting/linux/user/src/hook/soft_musl_hook/memory_trace.o
[OHOS ERROR] FAILED: obj/third_party/musl/porting/linux/user/src/hook/soft_musl_hook/memory_trace.o
[OHOS ERROR] /usr/bin/ccache ../llvm-install/bin/clang -MMD -MF obj/third_party/musl/porting/linux/user/src/hook/soft_musl_hook/memory_trace.o.d -DV8_DEPRECATION_WARNINGS -DNDEBUG -DNVALGRIND -DDYNAMIC_ANNOTATIONS_ENABLED=0 -D_GNU_SOURCE -DHAVE_SYS_UIO_H -D__MUSL__ -D_LIBCPP_HAS_MUSL_LIBC -D__BUILD_LINUX_WITH_CLANG -D__GNU_SOURCE=1 -DCHROMIUM_CXX_TWEAK_INLINES -DHOOK_ENABLE -DOHOS_SOCKET_HOOK_ENABLE -DCOMPONENT_BUILD -Iobj/third_party/musl/usr/include/arm-linux-ohos -mllvm --target=arm-linux-ohos -march=armv7-a -mfloat-abi=soft -mtune=generic-armv7-a --param=ssp-buffer-size=4 -fstack-protector-strong -fPIC --sysroot=obj/third_party/musl -c ../../third_party/musl/porting/linux/user/src/hook/memory_trace.c -o obj/third_party/musl/porting/linux/user/src/hook/soft_musl_hook/memory_trace.o
[OHOS ERROR] clang: error: unsupported option '-mfloat-abi=' for target 'x86_64-unknown-linux-gnu'
[OHOS ERROR] [9/1494] CC obj/third_party/musl/porting/linux/user/src/hook/soft_musl_hook/musl_preinit_common.o
[OHOS ERROR] FAILED: obj/third_party/musl/porting/linux/user/src/hook/soft_musl_hook/musl_preinit_common.o
[OHOS ERROR] /usr/bin/ccache ../llvm-install/bin/clang -MMD -MF obj/third_party/musl/porting/linux/user/src/hook/soft_musl_hook/musl_preinit_common.o.d -DV8_DEPRECATION_WARNINGS -DNDEBUG -DNVALGRIND -DDYNAMIC_ANNOTATIONS_ENABLED=0 -D_GNU_SOURCE -DHAVE_SYS_UIO_H -D__MUSL__ -D_LIBCPP_HAS_MUSL_LIBC -D__BUILD_LINUX_WITH_CLANG -D__GNU_SOURCE=1 -DCHROMIUM_CXX_TWEAK_INLINES -DHOOK_ENABLE -DOHOS_SOCKET_HOOK_ENABLE -DCOMPONENT_BUILD -Iobj/third_party/musl/usr/include/arm-linux-ohos -mllvm --target=arm-linux-ohos -march=armv7-a -mfloat-abi=soft -mtune=generic-armv7-a --param=ssp-buffer-size=4 -fstack-protector-strong -fPIC --sysroot=obj/third_party/musl -c ../../third_party/musl/porting/linux/user/src/hook/musl_preinit_common.c -o obj/third_party/musl/porting/linux/user/src/hook/soft_musl_hook/musl_preinit_common.o
[OHOS ERROR] clang: error: unsupported option '-mfloat-abi=' for target 'x86_64-unknown-linux-gnu'
[OHOS ERROR] [10/1494] CC obj/third_party/musl/porting/linux/user/src/hook/soft_musl_hook/musl_preinit.o
[OHOS ERROR] FAILED: obj/third_party/musl/porting/linux/user/src/hook/soft_musl_hook/musl_preinit.o
[OHOS ERROR] /usr/bin/ccache ../llvm-install/bin/clang -MMD -MF obj/third_party/musl/porting/linux/user/src/hook/soft_musl_hook/musl_preinit.o.d -DV8_DEPRECATION_WARNINGS -DNDEBUG -DNVALGRIND -DDYNAMIC_ANNOTATIONS_ENABLED=0 -D_GNU_SOURCE -DHAVE_SYS_UIO_H -D__MUSL__ -D_LIBCPP_HAS_MUSL_LIBC -D__BUILD_LINUX_WITH_CLANG -D__GNU_SOURCE=1 -DCHROMIUM_CXX_TWEAK_INLINES -DHOOK_ENABLE -DOHOS_SOCKET_HOOK_ENABLE -DCOMPONENT_BUILD -Iobj/third_party/musl/usr/include/arm-linux-ohos -mllvm --target=arm-linux-ohos -march=armv7-a -mfloat-abi=soft -mtune=generic-armv7-a --param=ssp-buffer-size=4 -fstack-protector-strong -fPIC --sysroot=obj/third_party/musl -c ../../third_party/musl/porting/linux/user/src/hook/musl_preinit.c -o obj/third_party/musl/porting/linux/user/src/hook/soft_musl_hook/musl_preinit.o
[OHOS ERROR] clang: error: unsupported option '-mfloat-abi=' for target 'x86_64-unknown-linux-gnu'
[OHOS ERROR] [11/1494] CC obj/third_party/musl/porting/linux/user/src/hook/soft_musl_hook/malloc_common.o
[OHOS ERROR] FAILED: obj/third_party/musl/porting/linux/user/src/hook/soft_musl_hook/malloc_common.o
[OHOS ERROR] /usr/bin/ccache ../llvm-install/bin/clang -MMD -MF obj/third_party/musl/porting/linux/user/src/hook/soft_musl_hook/malloc_common.o.d -DV8_DEPRECATION_WARNINGS -DNDEBUG -DNVALGRIND -DDYNAMIC_ANNOTATIONS_ENABLED=0 -D_GNU_SOURCE -DHAVE_SYS_UIO_H -D__MUSL__ -D_LIBCPP_HAS_MUSL_LIBC -D__BUILD_LINUX_WITH_CLANG -D__GNU_SOURCE=1 -DCHROMIUM_CXX_TWEAK_INLINES -DHOOK_ENABLE -DOHOS_SOCKET_HOOK_ENABLE -DCOMPONENT_BUILD -Iobj/third_party/musl/usr/include/arm-linux-ohos -mllvm --target=arm-linux-ohos -march=armv7-a -mfloat-abi=soft -mtune=generic-armv7-a --param=ssp-buffer-size=4 -fstack-protector-strong -fPIC --sysroot=obj/third_party/musl -c ../../third_party/musl/porting/linux/user/src/hook/malloc_common.c -o obj/third_party/musl/porting/linux/user/src/hook/soft_musl_hook/malloc_common.o
[OHOS ERROR] clang: error: unsupported option '-mfloat-abi=' for target 'x86_64-unknown-linux-gnu'
[OHOS ERROR] [13/1494] CC obj/third_party/musl/porting/linux/user/src/hook/soft_musl_hook/musl_socket_preinit.o
[OHOS ERROR] FAILED: obj/third_party/musl/porting/linux/user/src/hook/soft_musl_hook/musl_socket_preinit.o
[OHOS ERROR] /usr/bin/ccache ../llvm-install/bin/clang -MMD -MF obj/third_party/musl/porting/linux/user/src/hook/soft_musl_hook/musl_socket_preinit.o.d -DV8_DEPRECATION_WARNINGS -DNDEBUG -DNVALGRIND -DDYNAMIC_ANNOTATIONS_ENABLED=0 -D_GNU_SOURCE -DHAVE_SYS_UIO_H -D__MUSL__ -D_LIBCPP_HAS_MUSL_LIBC -D__BUILD_LINUX_WITH_CLANG -D__GNU_SOURCE=1 -DCHROMIUM_CXX_TWEAK_INLINES -DHOOK_ENABLE -DOHOS_SOCKET_HOOK_ENABLE -DCOMPONENT_BUILD -Iobj/third_party/musl/usr/include/arm-linux-ohos -mllvm --target=arm-linux-ohos -march=armv7-a -mfloat-abi=soft -mtune=generic-armv7-a --param=ssp-buffer-size=4 -fstack-protector-strong -fPIC --sysroot=obj/third_party/musl -c ../../third_party/musl/porting/linux/user/src/hook/musl_socket_preinit.c -o obj/third_party/musl/porting/linux/user/src/hook/soft_musl_hook/musl_socket_preinit.o
[OHOS ERROR] clang: error: unsupported option '-mfloat-abi=' for target 'x86_64-unknown-linux-gnu'
[OHOS ERROR] Traceback (most recent call last):
[OHOS ERROR] File "/home/water/llvm/build/hb/services/ninja.py", line 70, in _execute_ninja_cmd
[OHOS ERROR] SystemUtil.exec_command(
[OHOS ERROR] File "/home/water/llvm/build/hb/util/system_util.py", line 64, in exec_command
[OHOS ERROR] raise OHOSException(
[OHOS ERROR] exceptions.ohos_exception.OHOSException: Please check build log in /home/water/llvm/out/llvm_build/build.log
[OHOS ERROR]
[OHOS ERROR] During handling of the above exception, another exception occurred:
[OHOS ERROR]
[OHOS ERROR] Traceback (most recent call last):
[OHOS ERROR] File "/home/water/llvm/build/hb/containers/status.py", line 47, in wrapper
[OHOS ERROR] return func(*args, **kwargs)
[OHOS ERROR] File "/home/water/llvm/build/hb/modules/ohos_build_module.py", line 67, in run
[OHOS ERROR] raise exception
[OHOS ERROR] File "/home/water/llvm/build/hb/modules/ohos_build_module.py", line 65, in run
[OHOS ERROR] super().run()
[OHOS ERROR] File "/home/water/llvm/build/hb/modules/interface/build_module_interface.py", line 72, in run
[OHOS ERROR] raise exception
[OHOS ERROR] File "/home/water/llvm/build/hb/modules/interface/build_module_interface.py", line 70, in run
[OHOS ERROR] self._target_compilation()
[OHOS ERROR] File "/home/water/llvm/build/hb/modules/ohos_build_module.py", line 103, in _target_compilation
[OHOS ERROR] self.target_compiler.run()
[OHOS ERROR] File "/home/water/llvm/build/hb/services/ninja.py", line 38, in run
[OHOS ERROR] self._execute_ninja_cmd()
[OHOS ERROR] File "/home/water/llvm/build/hb/services/ninja.py", line 77, in _execute_ninja_cmd
[OHOS ERROR] raise OHOSException('ninja phase failed', '4000')
[OHOS ERROR] exceptions.ohos_exception.OHOSException: ninja phase failed
[OHOS ERROR]
[OHOS ERROR] Code: 4000
[OHOS ERROR]
[OHOS ERROR] Reason: ninja phase failed
[OHOS ERROR]
[OHOS ERROR] Solution: Please check the compile log at out/{compiling product}/build.log, If you could analyze build logs.
[OHOS ERROR] Or you can try the following steps to solve this problem:
[OHOS ERROR] 1. cd to OHOS root path
[OHOS ERROR] 2. run 'hb clean --all' or 'rm -rf out build/resources/args/*.json'.
[OHOS ERROR] 3. repo sync
[OHOS ERROR] 4. repo forall -c 'git lfs pull'
[OHOS ERROR] 5. bash build/prebuilts_download.sh
[OHOS ERROR] 6. rebuild your product or component
[OHOS ERROR] 7. check if any environment variables required by the building process are not set in build/compile_env_allowlist.json
[OHOS ERROR]
[OHOS ERROR] If you still cannot solve this problem, you could post this problem on:
[OHOS ERROR] https://gitee.com/openharmony/build/issues
[OHOS ERROR]
INFO:__main__:shutil rmtree /home/water/llvm/out/sysroot/arm-linux-ohos/usr/lib/a7_soft
INFO:__main__:copytree /home/water/llvm/out/llvm_build/obj/third_party/musl/usr/lib/arm-linux-ohos/a7_soft /home/water/llvm/out/sysroot/arm-linux-ohos/usr/lib/a7_soft
INFO:__main__:copy /home/water/llvm/out/llvm_build/obj/out/llvm_build/obj/third_party/musl/intermidiates/linux/musl_src_ported/crt/soft_musl_crt/crtplus.o /home/water/llvm/out/sysroot/arm-linux-ohos/usr/lib/a7_soft
INFO:__main__:run a7 product-name llvm_build target-name soft_musl_libs
INFO:__main__:run product-name llvm_build target-cpu arm target-name soft_musl_libs gn-args arm_fpu=neon-vfpv4 arm_float_abi=softfp board_cpu=cortex-a7 musl_target_multilib=a7_softfp_neon-vfpv4
[OHOS INFO] loader args:['platforms_config_file="/home/water/llvm/out/preloader/llvm_build/platforms.build"', 'subsystem_config_file="/home/water/llvm/out/preloader/llvm_build/subsystem_config.json"', 'example_subsystem_file=""', 'exclusion_modules_config_file="/home/water/llvm/out/preloader/llvm_build/exclusion_modules.json"', 'source_root_dir="/home/water/llvm/"', 'gn_root_out_dir="out/llvm_build"', 'build_platform_name=phone', 'build_xts=False', 'load_test_config=True', 'target_os=ohos', 'target_cpu=arm', 'os_level=standard', "ignore_api_check=['xts', 'common', 'testfwk']", 'scalable_build=False', 'skip_partlist_check=False']
[OHOS INFO] Excuting gn command: /home/water/llvm/prebuilts/build-tools/linux-x86/bin/gn gen --args="product_name=\"llvm_build\" product_path=\"/home/water/llvm/toolchain/llvm-project/llvm_products\" product_config_path=\"/home/water/llvm/toolchain/llvm-project/llvm_products\" device_name=\"llvm_build\" device_path=\"/home/water/llvm/device/board/ohos/llvm_build\" device_company=\"ohos\" device_config_path=\"/home/water/llvm/device/board/ohos/llvm_build\" target_cpu=\"arm\" is_standard_system=true ohos_build_compiler_specified=\"\" ohos_build_time=1704220473630 ohos_build_datetime=\"2024-01-03 10:34:33\" ohos_build_enable_ccache=true ohos_build_type=\"debug\" device_type=\"default\" build_variant=\"root\" is_llvm_build=true startup_init_with_param_base=true use_thin_lto=false arm_fpu=\"neon-vfpv4\" arm_float_abi=\"softfp\" board_cpu=\"cortex-a7\" musl_target_multilib=\"a7_softfp_neon-vfpv4\" root_perf_main=\"main\" runtime_mode=\"release\"" /home/water/llvm/out/llvm_build
[OHOS INFO] Excuting ninja command: /home/water/llvm/prebuilts/build-tools/linux-x86/bin/ninja -w dupbuild=warn -C /home/water/llvm/out/llvm_build soft_musl_libs
[OHOS ERROR] [7/1494] CC obj/third_party/musl/porting/linux/user/src/hook/soft_musl_hook/malloc_common.o
[OHOS ERROR] FAILED: obj/third_party/musl/porting/linux/user/src/hook/soft_musl_hook/malloc_common.o
[OHOS ERROR] /usr/bin/ccache ../llvm-install/bin/clang -MMD -MF obj/third_party/musl/porting/linux/user/src/hook/soft_musl_hook/malloc_common.o.d -DV8_DEPRECATION_WARNINGS -DNDEBUG -DNVALGRIND -DDYNAMIC_ANNOTATIONS_ENABLED=0 -D_GNU_SOURCE -DHAVE_SYS_UIO_H -D__MUSL__ -D_LIBCPP_HAS_MUSL_LIBC -D__BUILD_LINUX_WITH_CLANG -D__GNU_SOURCE=1 -DCHROMIUM_CXX_TWEAK_INLINES -DHOOK_ENABLE -DOHOS_SOCKET_HOOK_ENABLE -DCOMPONENT_BUILD -Iobj/third_party/musl/usr/include/arm-linux-ohos -mllvm --target=arm-linux-ohos -march=armv7-a -mfloat-abi=softfp -mtune=generic-armv7-a --param=ssp-buffer-size=4 -fstack-protector-strong -fPIC --sysroot=obj/third_party/musl -c ../../third_party/musl/porting/linux/user/src/hook/malloc_common.c -o obj/third_party/musl/porting/linux/user/src/hook/soft_musl_hook/malloc_common.o
[OHOS ERROR] clang: error: unsupported option '-mfloat-abi=' for target 'x86_64-unknown-linux-gnu'
[OHOS ERROR] [8/1494] CC obj/third_party/musl/porting/linux/user/src/hook/soft_musl_hook/musl_preinit.o
[OHOS ERROR] FAILED: obj/third_party/musl/porting/linux/user/src/hook/soft_musl_hook/musl_preinit.o
[OHOS ERROR] /usr/bin/ccache ../llvm-install/bin/clang -MMD -MF obj/third_party/musl/porting/linux/user/src/hook/soft_musl_hook/musl_preinit.o.d -DV8_DEPRECATION_WARNINGS -DNDEBUG -DNVALGRIND -DDYNAMIC_ANNOTATIONS_ENABLED=0 -D_GNU_SOURCE -DHAVE_SYS_UIO_H -D__MUSL__ -D_LIBCPP_HAS_MUSL_LIBC -D__BUILD_LINUX_WITH_CLANG -D__GNU_SOURCE=1 -DCHROMIUM_CXX_TWEAK_INLINES -DHOOK_ENABLE -DOHOS_SOCKET_HOOK_ENABLE -DCOMPONENT_BUILD -Iobj/third_party/musl/usr/include/arm-linux-ohos -mllvm --target=arm-linux-ohos -march=armv7-a -mfloat-abi=softfp -mtune=generic-armv7-a --param=ssp-buffer-size=4 -fstack-protector-strong -fPIC --sysroot=obj/third_party/musl -c ../../third_party/musl/porting/linux/user/src/hook/musl_preinit.c -o obj/third_party/musl/porting/linux/user/src/hook/soft_musl_hook/musl_preinit.o
[OHOS ERROR] clang: error: unsupported option '-mfloat-abi=' for target 'x86_64-unknown-linux-gnu'
[OHOS ERROR] [9/1494] CC obj/third_party/musl/porting/linux/user/src/hook/soft_musl_hook/memory_trace.o
[OHOS ERROR] FAILED: obj/third_party/musl/porting/linux/user/src/hook/soft_musl_hook/memory_trace.o
[OHOS ERROR] /usr/bin/ccache ../llvm-install/bin/clang -MMD -MF obj/third_party/musl/porting/linux/user/src/hook/soft_musl_hook/memory_trace.o.d -DV8_DEPRECATION_WARNINGS -DNDEBUG -DNVALGRIND -DDYNAMIC_ANNOTATIONS_ENABLED=0 -D_GNU_SOURCE -DHAVE_SYS_UIO_H -D__MUSL__ -D_LIBCPP_HAS_MUSL_LIBC -D__BUILD_LINUX_WITH_CLANG -D__GNU_SOURCE=1 -DCHROMIUM_CXX_TWEAK_INLINES -DHOOK_ENABLE -DOHOS_SOCKET_HOOK_ENABLE -DCOMPONENT_BUILD -Iobj/third_party/musl/usr/include/arm-linux-ohos -mllvm --target=arm-linux-ohos -march=armv7-a -mfloat-abi=softfp -mtune=generic-armv7-a --param=ssp-buffer-size=4 -fstack-protector-strong -fPIC --sysroot=obj/third_party/musl -c ../../third_party/musl/porting/linux/user/src/hook/memory_trace.c -o obj/third_party/musl/porting/linux/user/src/hook/soft_musl_hook/memory_trace.o
[OHOS ERROR] clang: error: unsupported option '-mfloat-abi=' for target 'x86_64-unknown-linux-gnu'
[OHOS ERROR] [10/1494] CC obj/third_party/musl/porting/linux/user/src/hook/soft_musl_hook/musl_preinit_common.o
[OHOS ERROR] FAILED: obj/third_party/musl/porting/linux/user/src/hook/soft_musl_hook/musl_preinit_common.o
[OHOS ERROR] /usr/bin/ccache ../llvm-install/bin/clang -MMD -MF obj/third_party/musl/porting/linux/user/src/hook/soft_musl_hook/musl_preinit_common.o.d -DV8_DEPRECATION_WARNINGS -DNDEBUG -DNVALGRIND -DDYNAMIC_ANNOTATIONS_ENABLED=0 -D_GNU_SOURCE -DHAVE_SYS_UIO_H -D__MUSL__ -D_LIBCPP_HAS_MUSL_LIBC -D__BUILD_LINUX_WITH_CLANG -D__GNU_SOURCE=1 -DCHROMIUM_CXX_TWEAK_INLINES -DHOOK_ENABLE -DOHOS_SOCKET_HOOK_ENABLE -DCOMPONENT_BUILD -Iobj/third_party/musl/usr/include/arm-linux-ohos -mllvm --target=arm-linux-ohos -march=armv7-a -mfloat-abi=softfp -mtune=generic-armv7-a --param=ssp-buffer-size=4 -fstack-protector-strong -fPIC --sysroot=obj/third_party/musl -c ../../third_party/musl/porting/linux/user/src/hook/musl_preinit_common.c -o obj/third_party/musl/porting/linux/user/src/hook/soft_musl_hook/musl_preinit_common.o
[OHOS ERROR] clang: error: unsupported option '-mfloat-abi=' for target 'x86_64-unknown-linux-gnu'
[OHOS ERROR] [12/1494] CC obj/third_party/musl/porting/linux/user/src/hook/soft_musl_hook/musl_socket_preinit.o
[OHOS ERROR] FAILED: obj/third_party/musl/porting/linux/user/src/hook/soft_musl_hook/musl_socket_preinit.o
[OHOS ERROR] /usr/bin/ccache ../llvm-install/bin/clang -MMD -MF obj/third_party/musl/porting/linux/user/src/hook/soft_musl_hook/musl_socket_preinit.o.d -DV8_DEPRECATION_WARNINGS -DNDEBUG -DNVALGRIND -DDYNAMIC_ANNOTATIONS_ENABLED=0 -D_GNU_SOURCE -DHAVE_SYS_UIO_H -D__MUSL__ -D_LIBCPP_HAS_MUSL_LIBC -D__BUILD_LINUX_WITH_CLANG -D__GNU_SOURCE=1 -DCHROMIUM_CXX_TWEAK_INLINES -DHOOK_ENABLE -DOHOS_SOCKET_HOOK_ENABLE -DCOMPONENT_BUILD -Iobj/third_party/musl/usr/include/arm-linux-ohos -mllvm --target=arm-linux-ohos -march=armv7-a -mfloat-abi=softfp -mtune=generic-armv7-a --param=ssp-buffer-size=4 -fstack-protector-strong -fPIC --sysroot=obj/third_party/musl -c ../../third_party/musl/porting/linux/user/src/hook/musl_socket_preinit.c -o obj/third_party/musl/porting/linux/user/src/hook/soft_musl_hook/musl_socket_preinit.o
[OHOS ERROR] clang: error: unsupported option '-mfloat-abi=' for target 'x86_64-unknown-linux-gnu'
[OHOS ERROR] Traceback (most recent call last):
[OHOS ERROR] File "/home/water/llvm/build/hb/services/ninja.py", line 70, in _execute_ninja_cmd
[OHOS ERROR] SystemUtil.exec_command(
[OHOS ERROR] File "/home/water/llvm/build/hb/util/system_util.py", line 64, in exec_command
[OHOS ERROR] raise OHOSException(
[OHOS ERROR] exceptions.ohos_exception.OHOSException: Please check build log in /home/water/llvm/out/llvm_build/build.log
[OHOS ERROR]
[OHOS ERROR] During handling of the above exception, another exception occurred:
[OHOS ERROR]
[OHOS ERROR] Traceback (most recent call last):
[OHOS ERROR] File "/home/water/llvm/build/hb/containers/status.py", line 47, in wrapper
[OHOS ERROR] return func(*args, **kwargs)
[OHOS ERROR] File "/home/water/llvm/build/hb/modules/ohos_build_module.py", line 67, in run
[OHOS ERROR] raise exception
[OHOS ERROR] File "/home/water/llvm/build/hb/modules/ohos_build_module.py", line 65, in run
[OHOS ERROR] super().run()
[OHOS ERROR] File "/home/water/llvm/build/hb/modules/interface/build_module_interface.py", line 72, in run
[OHOS ERROR] raise exception
[OHOS ERROR] File "/home/water/llvm/build/hb/modules/interface/build_module_interface.py", line 70, in run
[OHOS ERROR] self._target_compilation()
[OHOS ERROR] File "/home/water/llvm/build/hb/modules/ohos_build_module.py", line 103, in _target_compilation
[OHOS ERROR] self.target_compiler.run()
[OHOS ERROR] File "/home/water/llvm/build/hb/services/ninja.py", line 38, in run
[OHOS ERROR] self._execute_ninja_cmd()
[OHOS ERROR] File "/home/water/llvm/build/hb/services/ninja.py", line 77, in _execute_ninja_cmd
[OHOS ERROR] raise OHOSException('ninja phase failed', '4000')
[OHOS ERROR] exceptions.ohos_exception.OHOSException: ninja phase failed
[OHOS ERROR]
[OHOS ERROR] Code: 4000
[OHOS ERROR]
[OHOS ERROR] Reason: ninja phase failed
[OHOS ERROR]
[OHOS ERROR] Solution: Please check the compile log at out/{compiling product}/build.log, If you could analyze build logs.
[OHOS ERROR] Or you can try the following steps to solve this problem:
[OHOS ERROR] 1. cd to OHOS root path
[OHOS ERROR] 2. run 'hb clean --all' or 'rm -rf out build/resources/args/*.json'.
[OHOS ERROR] 3. repo sync
[OHOS ERROR] 4. repo forall -c 'git lfs pull'
[OHOS ERROR] 5. bash build/prebuilts_download.sh
[OHOS ERROR] 6. rebuild your product or component
[OHOS ERROR] 7. check if any environment variables required by the building process are not set in build/compile_env_allowlist.json
[OHOS ERROR]
[OHOS ERROR] If you still cannot solve this problem, you could post this problem on:
[OHOS ERROR] https://gitee.com/openharmony/build/issues
[OHOS ERROR]
INFO:__main__:shutil rmtree /home/water/llvm/out/sysroot/arm-linux-ohos/usr/lib/a7_softfp_neon-vfpv4
INFO:__main__:copytree /home/water/llvm/out/llvm_build/obj/third_party/musl/usr/lib/arm-linux-ohos/a7_softfp_neon-vfpv4 /home/water/llvm/out/sysroot/arm-linux-ohos/usr/lib/a7_softfp_neon-vfpv4
INFO:__main__:copy /home/water/llvm/out/llvm_build/obj/out/llvm_build/obj/third_party/musl/intermidiates/linux/musl_src_ported/crt/soft_musl_crt/crtplus.o /home/water/llvm/out/sysroot/arm-linux-ohos/usr/lib/a7_softfp_neon-vfpv4
INFO:__main__:run a7 product-name llvm_build target-name soft_musl_libs
INFO:__main__:run product-name llvm_build target-cpu arm target-name soft_musl_libs gn-args arm_fpu=neon-vfpv4 arm_float_abi=hard board_cpu=cortex-a7 musl_target_multilib=a7_hard_neon-vfpv4
[OHOS INFO] loader args:['platforms_config_file="/home/water/llvm/out/preloader/llvm_build/platforms.build"', 'subsystem_config_file="/home/water/llvm/out/preloader/llvm_build/subsystem_config.json"', 'example_subsystem_file=""', 'exclusion_modules_config_file="/home/water/llvm/out/preloader/llvm_build/exclusion_modules.json"', 'source_root_dir="/home/water/llvm/"', 'gn_root_out_dir="out/llvm_build"', 'build_platform_name=phone', 'build_xts=False', 'load_test_config=True', 'target_os=ohos', 'target_cpu=arm', 'os_level=standard', "ignore_api_check=['xts', 'common', 'testfwk']", 'scalable_build=False', 'skip_partlist_check=False']
[OHOS INFO] Excuting gn command: /home/water/llvm/prebuilts/build-tools/linux-x86/bin/gn gen --args="product_name=\"llvm_build\" product_path=\"/home/water/llvm/toolchain/llvm-project/llvm_products\" product_config_path=\"/home/water/llvm/toolchain/llvm-project/llvm_products\" device_name=\"llvm_build\" device_path=\"/home/water/llvm/device/board/ohos/llvm_build\" device_company=\"ohos\" device_config_path=\"/home/water/llvm/device/board/ohos/llvm_build\" target_cpu=\"arm\" is_standard_system=true ohos_build_compiler_specified=\"\" ohos_build_time=1704220475670 ohos_build_datetime=\"2024-01-03 10:34:35\" ohos_build_enable_ccache=true ohos_build_type=\"debug\" device_type=\"default\" build_variant=\"root\" is_llvm_build=true startup_init_with_param_base=true use_thin_lto=false arm_fpu=\"neon-vfpv4\" arm_float_abi=\"hard\" board_cpu=\"cortex-a7\" musl_target_multilib=\"a7_hard_neon-vfpv4\" root_perf_main=\"main\" runtime_mode=\"release\"" /home/water/llvm/out/llvm_build
[OHOS INFO] Excuting ninja command: /home/water/llvm/prebuilts/build-tools/linux-x86/bin/ninja -w dupbuild=warn -C /home/water/llvm/out/llvm_build soft_musl_libs
[OHOS ERROR] [15/1502] CC obj/third_party/musl/porting/linux/user/src/hook/soft_musl_hook/memory_trace.o
[OHOS ERROR] FAILED: obj/third_party/musl/porting/linux/user/src/hook/soft_musl_hook/memory_trace.o
[OHOS ERROR] /usr/bin/ccache ../llvm-install/bin/clang -MMD -MF obj/third_party/musl/porting/linux/user/src/hook/soft_musl_hook/memory_trace.o.d -DV8_DEPRECATION_WARNINGS -DNDEBUG -DNVALGRIND -DDYNAMIC_ANNOTATIONS_ENABLED=0 -D_GNU_SOURCE -DHAVE_SYS_UIO_H -D__MUSL__ -D_LIBCPP_HAS_MUSL_LIBC -D__BUILD_LINUX_WITH_CLANG -D__GNU_SOURCE=1 -DCHROMIUM_CXX_TWEAK_INLINES -DHOOK_ENABLE -DOHOS_SOCKET_HOOK_ENABLE -DCOMPONENT_BUILD -Iobj/third_party/musl/usr/include/arm-linux-ohos -mllvm --target=arm-linux-ohos -march=armv7-a -mfloat-abi=hard -mtune=generic-armv7-a --param=ssp-buffer-size=4 -fstack-protector-strong -fPIC --sysroot=obj/third_party/musl -c ../../third_party/musl/porting/linux/user/src/hook/memory_trace.c -o obj/third_party/musl/porting/linux/user/src/hook/soft_musl_hook/memory_trace.o
[OHOS ERROR] clang: error: unsupported option '-mfloat-abi=' for target 'x86_64-unknown-linux-gnu'
[OHOS ERROR] [16/1502] CC obj/third_party/musl/porting/linux/user/src/hook/soft_musl_hook/malloc_common.o
[OHOS ERROR] FAILED: obj/third_party/musl/porting/linux/user/src/hook/soft_musl_hook/malloc_common.o
[OHOS ERROR] /usr/bin/ccache ../llvm-install/bin/clang -MMD -MF obj/third_party/musl/porting/linux/user/src/hook/soft_musl_hook/malloc_common.o.d -DV8_DEPRECATION_WARNINGS -DNDEBUG -DNVALGRIND -DDYNAMIC_ANNOTATIONS_ENABLED=0 -D_GNU_SOURCE -DHAVE_SYS_UIO_H -D__MUSL__ -D_LIBCPP_HAS_MUSL_LIBC -D__BUILD_LINUX_WITH_CLANG -D__GNU_SOURCE=1 -DCHROMIUM_CXX_TWEAK_INLINES -DHOOK_ENABLE -DOHOS_SOCKET_HOOK_ENABLE -DCOMPONENT_BUILD -Iobj/third_party/musl/usr/include/arm-linux-ohos -mllvm --target=arm-linux-ohos -march=armv7-a -mfloat-abi=hard -mtune=generic-armv7-a --param=ssp-buffer-size=4 -fstack-protector-strong -fPIC --sysroot=obj/third_party/musl -c ../../third_party/musl/porting/linux/user/src/hook/malloc_common.c -o obj/third_party/musl/porting/linux/user/src/hook/soft_musl_hook/malloc_common.o
[OHOS ERROR] clang: error: unsupported option '-mfloat-abi=' for target 'x86_64-unknown-linux-gnu'
[OHOS ERROR] [18/1502] CC obj/third_party/musl/porting/linux/user/src/hook/soft_musl_hook/musl_preinit.o
[OHOS ERROR] FAILED: obj/third_party/musl/porting/linux/user/src/hook/soft_musl_hook/musl_preinit.o
[OHOS ERROR] /usr/bin/ccache ../llvm-install/bin/clang -MMD -MF obj/third_party/musl/porting/linux/user/src/hook/soft_musl_hook/musl_preinit.o.d -DV8_DEPRECATION_WARNINGS -DNDEBUG -DNVALGRIND -DDYNAMIC_ANNOTATIONS_ENABLED=0 -D_GNU_SOURCE -DHAVE_SYS_UIO_H -D__MUSL__ -D_LIBCPP_HAS_MUSL_LIBC -D__BUILD_LINUX_WITH_CLANG -D__GNU_SOURCE=1 -DCHROMIUM_CXX_TWEAK_INLINES -DHOOK_ENABLE -DOHOS_SOCKET_HOOK_ENABLE -DCOMPONENT_BUILD -Iobj/third_party/musl/usr/include/arm-linux-ohos -mllvm --target=arm-linux-ohos -march=armv7-a -mfloat-abi=hard -mtune=generic-armv7-a --param=ssp-buffer-size=4 -fstack-protector-strong -fPIC --sysroot=obj/third_party/musl -c ../../third_party/musl/porting/linux/user/src/hook/musl_preinit.c -o obj/third_party/musl/porting/linux/user/src/hook/soft_musl_hook/musl_preinit.o
[OHOS ERROR] clang: error: unsupported option '-mfloat-abi=' for target 'x86_64-unknown-linux-gnu'
[OHOS ERROR] [19/1502] CC obj/third_party/musl/porting/linux/user/src/hook/soft_musl_hook/musl_preinit_common.o
[OHOS ERROR] FAILED: obj/third_party/musl/porting/linux/user/src/hook/soft_musl_hook/musl_preinit_common.o
[OHOS ERROR] /usr/bin/ccache ../llvm-install/bin/clang -MMD -MF obj/third_party/musl/porting/linux/user/src/hook/soft_musl_hook/musl_preinit_common.o.d -DV8_DEPRECATION_WARNINGS -DNDEBUG -DNVALGRIND -DDYNAMIC_ANNOTATIONS_ENABLED=0 -D_GNU_SOURCE -DHAVE_SYS_UIO_H -D__MUSL__ -D_LIBCPP_HAS_MUSL_LIBC -D__BUILD_LINUX_WITH_CLANG -D__GNU_SOURCE=1 -DCHROMIUM_CXX_TWEAK_INLINES -DHOOK_ENABLE -DOHOS_SOCKET_HOOK_ENABLE -DCOMPONENT_BUILD -Iobj/third_party/musl/usr/include/arm-linux-ohos -mllvm --target=arm-linux-ohos -march=armv7-a -mfloat-abi=hard -mtune=generic-armv7-a --param=ssp-buffer-size=4 -fstack-protector-strong -fPIC --sysroot=obj/third_party/musl -c ../../third_party/musl/porting/linux/user/src/hook/musl_preinit_common.c -o obj/third_party/musl/porting/linux/user/src/hook/soft_musl_hook/musl_preinit_common.o
[OHOS ERROR] clang: error: unsupported option '-mfloat-abi=' for target 'x86_64-unknown-linux-gnu'
[OHOS ERROR] [20/1502] CC obj/third_party/musl/porting/linux/user/src/hook/soft_musl_hook/musl_socket_preinit.o
[OHOS ERROR] FAILED: obj/third_party/musl/porting/linux/user/src/hook/soft_musl_hook/musl_socket_preinit.o
[OHOS ERROR] /usr/bin/ccache ../llvm-install/bin/clang -MMD -MF obj/third_party/musl/porting/linux/user/src/hook/soft_musl_hook/musl_socket_preinit.o.d -DV8_DEPRECATION_WARNINGS -DNDEBUG -DNVALGRIND -DDYNAMIC_ANNOTATIONS_ENABLED=0 -D_GNU_SOURCE -DHAVE_SYS_UIO_H -D__MUSL__ -D_LIBCPP_HAS_MUSL_LIBC -D__BUILD_LINUX_WITH_CLANG -D__GNU_SOURCE=1 -DCHROMIUM_CXX_TWEAK_INLINES -DHOOK_ENABLE -DOHOS_SOCKET_HOOK_ENABLE -DCOMPONENT_BUILD -Iobj/third_party/musl/usr/include/arm-linux-ohos -mllvm --target=arm-linux-ohos -march=armv7-a -mfloat-abi=hard -mtune=generic-armv7-a --param=ssp-buffer-size=4 -fstack-protector-strong -fPIC --sysroot=obj/third_party/musl -c ../../third_party/musl/porting/linux/user/src/hook/musl_socket_preinit.c -o obj/third_party/musl/porting/linux/user/src/hook/soft_musl_hook/musl_socket_preinit.o
[OHOS ERROR] clang: error: unsupported option '-mfloat-abi=' for target 'x86_64-unknown-linux-gnu'
[OHOS ERROR] Traceback (most recent call last):
[OHOS ERROR] File "/home/water/llvm/build/hb/services/ninja.py", line 70, in _execute_ninja_cmd
[OHOS ERROR] SystemUtil.exec_command(
[OHOS ERROR] File "/home/water/llvm/build/hb/util/system_util.py", line 64, in exec_command
[OHOS ERROR] raise OHOSException(
[OHOS ERROR] exceptions.ohos_exception.OHOSException: Please check build log in /home/water/llvm/out/llvm_build/build.log
[OHOS ERROR]
[OHOS ERROR] During handling of the above exception, another exception occurred:
[OHOS ERROR]
[OHOS ERROR] Traceback (most recent call last):
[OHOS ERROR] File "/home/water/llvm/build/hb/containers/status.py", line 47, in wrapper
[OHOS ERROR] return func(*args, **kwargs)
[OHOS ERROR] File "/home/water/llvm/build/hb/modules/ohos_build_module.py", line 67, in run
[OHOS ERROR] raise exception
[OHOS ERROR] File "/home/water/llvm/build/hb/modules/ohos_build_module.py", line 65, in run
[OHOS ERROR] super().run()
[OHOS ERROR] File "/home/water/llvm/build/hb/modules/interface/build_module_interface.py", line 72, in run
[OHOS ERROR] raise exception
[OHOS ERROR] File "/home/water/llvm/build/hb/modules/interface/build_module_interface.py", line 70, in run
[OHOS ERROR] self._target_compilation()
[OHOS ERROR] File "/home/water/llvm/build/hb/modules/ohos_build_module.py", line 103, in _target_compilation
[OHOS ERROR] self.target_compiler.run()
[OHOS ERROR] File "/home/water/llvm/build/hb/services/ninja.py", line 38, in run
[OHOS ERROR] self._execute_ninja_cmd()
[OHOS ERROR] File "/home/water/llvm/build/hb/services/ninja.py", line 77, in _execute_ninja_cmd
[OHOS ERROR] raise OHOSException('ninja phase failed', '4000')
[OHOS ERROR] exceptions.ohos_exception.OHOSException: ninja phase failed
[OHOS ERROR]
[OHOS ERROR] Code: 4000
[OHOS ERROR]
[OHOS ERROR] Reason: ninja phase failed
[OHOS ERROR]
[OHOS ERROR] Solution: Please check the compile log at out/{compiling product}/build.log, If you could analyze build logs.
[OHOS ERROR] Or you can try the following steps to solve this problem:
[OHOS ERROR] 1. cd to OHOS root path
[OHOS ERROR] 2. run 'hb clean --all' or 'rm -rf out build/resources/args/*.json'.
[OHOS ERROR] 3. repo sync
[OHOS ERROR] 4. repo forall -c 'git lfs pull'
[OHOS ERROR] 5. bash build/prebuilts_download.sh
[OHOS ERROR] 6. rebuild your product or component
[OHOS ERROR] 7. check if any environment variables required by the building process are not set in build/compile_env_allowlist.json
[OHOS ERROR]
[OHOS ERROR] If you still cannot solve this problem, you could post this problem on:
[OHOS ERROR] https://gitee.com/openharmony/build/issues
[OHOS ERROR]
INFO:__main__:copytree /home/water/llvm/out/llvm_build/obj/third_party/musl/usr/lib/arm-linux-ohos/a7_hard_neon-vfpv4 /home/water/llvm/out/sysroot/arm-linux-ohos/usr/lib/a7_hard_neon-vfpv4
INFO:__main__:copy /home/water/llvm/out/llvm_build/obj/out/llvm_build/obj/third_party/musl/intermidiates/linux/musl_src_ported/crt/soft_musl_crt/crtplus.o /home/water/llvm/out/sysroot/arm-linux-ohos/usr/lib/a7_hard_neon-vfpv4
INFO:__main__:run product-name llvm_build target-name musl_headers
INFO:__main__:run product-name llvm_build target-cpu arm64 target-name musl_headers gn-args
[OHOS INFO] loader args:['platforms_config_file="/home/water/llvm/out/preloader/llvm_build/platforms.build"', 'subsystem_config_file="/home/water/llvm/out/preloader/llvm_build/subsystem_config.json"', 'example_subsystem_file=""', 'exclusion_modules_config_file="/home/water/llvm/out/preloader/llvm_build/exclusion_modules.json"', 'source_root_dir="/home/water/llvm/"', 'gn_root_out_dir="out/llvm_build"', 'build_platform_name=phone', 'build_xts=False', 'load_test_config=True', 'target_os=ohos', 'target_cpu=arm64', 'os_level=standard', "ignore_api_check=['xts', 'common', 'testfwk']", 'scalable_build=False', 'skip_partlist_check=False']
[OHOS INFO] Excuting gn command: /home/water/llvm/prebuilts/build-tools/linux-x86/bin/gn gen --args="product_name=\"llvm_build\" product_path=\"/home/water/llvm/toolchain/llvm-project/llvm_products\" product_config_path=\"/home/water/llvm/toolchain/llvm-project/llvm_products\" device_name=\"llvm_build\" device_path=\"/home/water/llvm/device/board/ohos/llvm_build\" device_company=\"ohos\" device_config_path=\"/home/water/llvm/device/board/ohos/llvm_build\" target_cpu=\"arm64\" is_standard_system=true ohos_build_compiler_specified=\"\" ohos_build_time=1704220477740 ohos_build_datetime=\"2024-01-03 10:34:37\" ohos_build_enable_ccache=true ohos_build_type=\"debug\" device_type=\"default\" build_variant=\"root\" is_llvm_build=true startup_init_with_param_base=true use_thin_lto=false root_perf_main=\"main\" runtime_mode=\"release\"" /home/water/llvm/out/llvm_build
[OHOS INFO] Excuting ninja command: /home/water/llvm/prebuilts/build-tools/linux-x86/bin/ninja -w dupbuild=warn -C /home/water/llvm/out/llvm_build musl_headers
更多推荐
所有评论(0)