移植OpenHarmony,新建的linux kernel defcongfig 编译过程中出现如下错误`/tmp/vgettimeofday-72c2d7.s:4: Error: junk at end of line, first unrecognized character is ` 请问如何解决

xuxiyang 显示全部楼层 发表于 2024-3-28 16:01:44

[OHOS ERROR] UPD include/generated/asm-offsets.h [OHOS ERROR] CALL /home/young/harmony_ax650/out/AX650N_Demo/AX650N_Demo/kernel/linux-5.10/scripts/checksyscalls.sh [OHOS ERROR] CALL /home/young/harmony_ax650/out/AX650N_Demo/AX650N_Demo/kernel/linux-5.10/scripts/atomic/check-atomics.sh [OHOS ERROR] LDS arch/arm64/kernel/vdso/vdso.lds [OHOS ERROR] CC arch/arm64/kernel/vdso/vgettimeofday.o [OHOS ERROR] /tmp/vgettimeofday-72c2d7.s: Assembler messages: [OHOS ERROR] /tmp/vgettimeofday-72c2d7.s:3: Error: junk at end of line, first unrecognized character is "' [OHOS ERROR] /tmp/vgettimeofday-72c2d7.s:3: Error: file number less than one [OHOS ERROR] /tmp/vgettimeofday-72c2d7.s:4: Error: junk at end of line, first unrecognized character is"' [OHOS ERROR] /tmp/vgettimeofday-72c2d7.s:5: Error: junk at end of line, first unrecognized character is "' [OHOS ERROR] /tmp/vgettimeofday-72c2d7.s:6: Error: junk at end of line, first unrecognized character is"' [OHOS ERROR] /tmp/vgettimeofday-72c2d7.s:7: Error: junk at end of line, first unrecognized character is "' [OHOS ERROR] /tmp/vgettimeofday-72c2d7.s:13: Error: junk at end of line, first unrecognized character is"' [OHOS ERROR] /tmp/vgettimeofday-72c2d7.s:35: Error: junk at end of line, first unrecognized character is "' [OHOS ERROR] /tmp/vgettimeofday-72c2d7.s:142: Error: junk at end of line, first unrecognized character is"' [OHOS ERROR] /tmp/vgettimeofday-72c2d7.s:186: Error: junk at end of line, first unrecognized character is "' [OHOS ERROR] /tmp/vgettimeofday-72c2d7.s:233: Error: junk at end of line, first unrecognized character is"' [OHOS ERROR] /tmp/vgettimeofday-72c2d7.s:285: Error: junk at end of line, first unrecognized character is "' [OHOS ERROR] /tmp/vgettimeofday-72c2d7.s:1159: Error: junk at end of line, first unrecognized character is"' [OHOS ERROR] /tmp/vgettimeofday-72c2d7.s:1160: Error: junk at end of line, first unrecognized character is "' [OHOS ERROR] /tmp/vgettimeofday-72c2d7.s:1161: Error: junk at end of line, first unrecognized character is"' [OHOS ERROR] /tmp/vgettimeofday-72c2d7.s:1162: Error: junk at end of line, first unrecognized character is "' [OHOS ERROR] /tmp/vgettimeofday-72c2d7.s:1163: Error: junk at end of line, first unrecognized character is"' [OHOS ERROR] /tmp/vgettimeofday-72c2d7.s:1819: Error: junk at end of line, first unrecognized character is `"' [OHOS ERROR] clang-15: error: assembler command failed with exit code 1 (use -v to see invocation) [OHOS ERROR] make[3]: [/home/young/harmony_ax650/out/AX650N_Demo/AX650N_Demo/kernel/linux-5.10/scripts/Makefile.build:294: arch/arm64/kernel/vdso/vgettimeofday.o] Error 1 [OHOS ERROR] make[2]: [arch/arm64/Makefile:186: vdso_prepare] Error 2 [OHOS ERROR] make[2]: Leaving directory '/home/young/harmony_ax650/out/AX650N_Demo/AX650N_Demo/kernel/OBJ/linux-5.10' [OHOS ERROR] make[1]: [Makefile:185: __sub-make] Error 2 [OHOS ERROR] make[1]: Leaving directory '/home/young/harmony_ax650/out/AX650N_Demo/AX650N_Demo/kernel/linux-5.10' [OHOS ERROR] make: [kernel.mk:83: /home/young/harmony_ax650/out/AX650N_Demo/AX650N_Demo/kernel/linux-5.10/arch/arm64/boot/Image] Error 2 [OHOS ERROR] Traceback (most recent call last): [OHOS ERROR] File "/home/young/harmony_ax650/build/hb/services/ninja.py", line 49, in _execute_ninja_cmd [OHOS ERROR] SystemUtil.exec_command( [OHOS ERROR] File "/home/young/harmony_ax650/build/hb/util/system_util.py", line 63, in exec_command [OHOS ERROR] raise OHOSException( [OHOS ERROR] exceptions.ohos_exception.OHOSException: Please check build log in /home/young/harmony_ax650/out/AX650N_Demo/AX650N_Demo/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/young/harmony_ax650/build/hb/containers/status.py", line 47, in wrapper [OHOS ERROR] return func(*args, *kwargs) [OHOS ERROR] File "/home/young/harmony_ax650/build/hb/modules/ohos_build_module.py", line 67, in run [OHOS ERROR] raise exception [OHOS ERROR] File "/home/young/harmony_ax650/build/hb/modules/ohos_build_module.py", line 65, in run [OHOS ERROR] super().run() [OHOS ERROR] File "/home/young/harmony_ax650/build/hb/modules/interface/build_module_interface.py", line 72, in run [OHOS ERROR] raise exception [OHOS ERROR] File "/home/young/harmony_ax650/build/hb/modules/interface/build_module_interface.py", line 70, in run [OHOS ERROR] self._target_compilation() [OHOS ERROR] File "/home/young/harmony_ax650/build/hb/modules/ohos_build_module.py", line 103, in _target_compilation [OHOS ERROR] self.target_compiler.run() [OHOS ERROR] File "/home/young/harmony_ax650/build/hb/services/ninja.py", line 38, in run [OHOS ERROR] self._execute_ninja_cmd() [OHOS ERROR] File "/home/young/harmony_ax650/build/hb/services/ninja.py", line 52, 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] [OHOS ERROR] If you still cannot solve this problem, you could post this problem on: [OHOS ERROR] https://gitee.com/openharmony/build/issues

您尚未登录,无法参与评论,登录后可以:
参与开源共建问题交流
认同或收藏高质量问答
获取积分成为开源共建先驱

精彩评论3

论坛小助手 官方账号

沙发 发表于 2024-4-16 10:00:44
错误指出在/tmp/vgettimeofday-72c2d7.s文件中有多个行出现了“junk at end of line, first unrecognized character is '`”这样的错误信息,可能是汇编器(Assembler)在处理源代码时遇到了无法识别的字符或格式错误,建议检查以下

检查方向:
1. 检查源代码文件:打开arch/arm64/kernel/vdso/vgettimeofday.S(或相应的汇编源文件),检查报错行是否有语法错误或不恰当的字符。特别注意每行的末尾是否有多余的反引号(`)或其他特殊字符。
2. 清理构建环境:执行make clean或使用OpenHarmony提供的清理命令来清除之前的构建输出,然后重新尝试编译。
3. 检查构建系统配置:确认你的构建系统配置是否正确,包括工具链、内核配置等。如果使用了默认的defconfig或config文件,请确保它们适用于你的目标硬件平台。

xuxiyang

发表于 2024-4-25 11:16  IP属地: - 中国江苏省扬州市 中国电信IDC

回复 论坛小助手: 后面查明了原因是因为编译的时候是clang链接的时候是gcc 引起的

论坛小助手

发表于 2024-4-25 14:44  IP属地: 广东省广州市

回复 xuxiyang: 厉害👍

【2 条回复】

Copyright   ©2023  OpenHarmony开发者论坛  京ICP备2020036654号-3 |技术支持 Discuz!

返回顶部