讨论广场 问答详情
OH5.0 编译alsa 异常
Juusi 2024-12-18 11:40:53
266 评论 分享

重新参考https://laval.csdn.net/64eef49d6ffa502025762163.html 发现在打开这些后5.0编译有报错,这个是否会影响到alsa使用

具体为打开"drivers_peripheral_audio_feature_alsa_lib = true",后编译报错

[OHOS ERROR] The target //drivers/peripheral/audio/hdi_service/supportlibs:audio_render_adapter

[OHOS ERROR] generates two object files with the same name:

[OHOS ERROR]   obj/device/board/hihope/rk3568/audio_alsa/audio_render_adapter/vendor_render.o

问题点应该是这个

 

[OHOS ERROR] ERROR at //build/config/BUILDCONFIG.gn:1039:5: Duplicate object file

[OHOS ERROR]     target(_target_type, target_name) {

[OHOS ERROR]     ^----------------------------------

[OHOS ERROR] The target //drivers/peripheral/audio/hdi_service/supportlibs:audio_render_adapter

[OHOS ERROR] generates two object files with the same name:

[OHOS ERROR]   obj/device/board/hihope/rk3568/audio_alsa/audio_render_adapter/vendor_render.o

[OHOS ERROR] 

[OHOS ERROR] It could be you accidentally have a file listed twice in the

[OHOS ERROR] sources. Or, depending on how your toolchain maps sources to

[OHOS ERROR] object files, two source files with the same name in different

[OHOS ERROR] directories could map to the same object file.

[OHOS ERROR] 

[OHOS ERROR] In the latter case, either rename one of the files or move one of

[OHOS ERROR] the sources to a separate source_set to avoid them both being in

[OHOS ERROR] the same target.

[OHOS ERROR] cmd ['/home/cx/os/v5.0_rk3568/third_party/openssl/make_openssl_build_all_generated.sh', '/home/cx/os/v5.0_rk3568/third_party/openssl', '/home/cx/os/v5.0_rk3568/out/rk3568/obj/third_party/openssl/build_all_generated', 'linux-armv4'] start

[OHOS ERROR] result.returncode = 0

[OHOS ERROR] result.stdout = /home/cx/os/v5.0_rk3568/out/rk3568

[OHOS ERROR] ~/os/v5.0_rk3568/out/rk3568/obj/third_party/openssl/build_all_generated/linux-armv4 ~/os/v5.0_rk3568/out/rk3568

[OHOS ERROR] /home/cx/os/v5.0_rk3568/third_party/openssl/Configure linux-armv4 no-shared no-module no-filenames

[OHOS ERROR] Configuring OpenSSL version 3.0.9 for target linux-armv4

[OHOS ERROR] Using os-specific seed configuration

[OHOS ERROR] Created configdata.pm

[OHOS ERROR] Running configdata.pm

[OHOS ERROR] Created Makefile.in

[OHOS ERROR] Created Makefile

[OHOS ERROR] Created include/openssl/configuration.h

[OHOS ERROR] 

[OHOS ERROR] **********************************************************************

[OHOS ERROR] ***                                                                ***

[OHOS ERROR] ***   OpenSSL has been successfully configured                     ***

[OHOS ERROR] ***                                                                ***

[OHOS ERROR] ***   If you encounter a problem while building, please open an    ***

[OHOS ERROR] ***   issue on GitHub <https://github.com/openssl/openssl/issues>  ***

[OHOS ERROR] ***   and include the output from the following command:           ***

[OHOS ERROR] ***                                                                ***

[OHOS ERROR] ***       perl configdata.pm --dump                                ***

[OHOS ERROR] ***                                                                ***

[OHOS ERROR] ***   (If you are new to OpenSSL, you might want to consult the    ***

[OHOS ERROR] ***   'Troubleshooting' section in the INSTALL.md file first)      ***

[OHOS ERROR] ***                                                                ***

[OHOS ERROR] **********************************************************************

[OHOS ERROR] ~/os/v5.0_rk3568/out/rk3568

[OHOS ERROR] 

[OHOS ERROR] cmd ['/home/cx/os/v5.0_rk3568/third_party/openssl/make_openssl_build_all_generated.sh', '/home/cx/os/v5.0_rk3568/third_party/openssl', '/home/cx/os/v5.0_rk3568/out/rk3568/obj/third_party/openssl/build_all_generated', 'linux-armv4'] ok

[OHOS ERROR] 

[OHOS ERROR] cmd ['/home/cx/os/v5.0_rk3568/third_party/openssl/make_openssl_build_all_generated.sh', '/home/cx/os/v5.0_rk3568/third_party/openssl', '/home/cx/os/v5.0_rk3568/out/rk3568/clang_x64/obj/third_party/openssl/build_all_generated', 'linux-x86_64'] start

[OHOS ERROR] result.returncode = 0

[OHOS ERROR] result.stdout = /home/cx/os/v5.0_rk3568/out/rk3568

[OHOS ERROR] ~/os/v5.0_rk3568/out/rk3568/clang_x64/obj/third_party/openssl/build_all_generated/linux-x86_64 ~/os/v5.0_rk3568/out/rk3568

[OHOS ERROR] Traceback (most recent call last):
[OHOS ERROR]   File "/home/cx/os/v5.0_rk3568/build/hb/containers/status.py", line 47, in wrapper
[OHOS ERROR]     return func(*args, **kwargs)
[OHOS ERROR]            ^^^^^^^^^^^^^^^^^^^^^
[OHOS ERROR]   File "/home/cx/os/v5.0_rk3568/build/hb/services/gn.py", line 128, in _execute_gn_gen_cmd
[OHOS ERROR]     SystemUtil.exec_command(gn_gen_cmd, self.config.log_path)
[OHOS ERROR]   File "/home/cx/os/v5.0_rk3568/build/hb/util/system_util.py", line 75, in exec_command
[OHOS ERROR]     LogUtil.get_failed_log(log_path)
[OHOS ERROR]   File "/home/cx/os/v5.0_rk3568/build/hb/util/log_util.py", line 191, in get_failed_log
[OHOS ERROR]     LogUtil.get_gn_failed_log(log_path)
[OHOS ERROR]   File "/home/cx/os/v5.0_rk3568/build/hb/util/log_util.py", line 137, in get_gn_failed_log
[OHOS ERROR]     raise OHOSException(
[OHOS ERROR] exceptions.ohos_exception.OHOSException: GN Failed! Please check error in /home/cx/os/v5.0_rk3568/out/rk3568/error.log, and for more build information in /home/cx/os/v5.0_rk3568/out/rk3568/build.log
[OHOS ERROR] 

[OHOS ERROR] Code:        3000
[OHOS ERROR] 
[OHOS ERROR] Reason:      GN Failed! Please check error in /home/cx/os/v5.0_rk3568/out/rk3568/error.log, and for more build information in /home/cx/os/v5.0_rk3568/out/rk3568/build.log
[OHOS ERROR] 
[OHOS ERROR] Error Type:  UNKNOWN
[OHOS ERROR] 
[OHOS ERROR] Description: An unknown error occurred while executing 'gn gen'.
[OHOS ERROR] 
[OHOS ERROR] Solution:    There is no solution available. You can check the 'gn_error.log' in the output directory for more information
[OHOS ERROR] 
=====build  error=====

关闭selinux 后也是会报这个错误

266 评论 分享
写回答
全部评论(4)
2 楼
 

diff --git a/audio/hdi_service/supportlibs/BUILD.gn b/audio/hdi_service/supportlibs/BUILD.gn

index 080713fca..0600677fe 100644

--- a/audio/hdi_service/supportlibs/BUILD.gn

+++ b/audio/hdi_service/supportlibs/BUILD.gn

@@ -154,7 +154,6 @@ if (defined(ohos_lite)) {

"$hdf_audio_path/supportlibs/alsa_adapter/src/alsa_lib_render.c",

"$hdf_audio_path/supportlibs/alsa_adapter/src/alsa_snd_render.c",

"$hdf_audio_path/supportlibs/alsa_adapter/src/alsa_soundcard.c",

- "//device/board/${product_company}/${device_name}/audio_alsa/vendor_render.c",

"//third_party/cJSON/cJSON.c",

]

2024-12-18 12:40:52

是在GN(Generate Ninja)构建脚本中发生的。错误指出在构建过程中发现了一个问题:同一个目标(target)生成了两个同名的对象文件(object file)。

  1. 目标(target)//drivers/peripheral/audio/hdi_service/supportlibs:audio_render_adapter
  2. 问题:该目标生成了两个名为 obj/device/board/hihope/rk3568/audio_alsa/audio_render_adapter/vendor_render.o 的对象文件。
2024-12-18 14:26:05

关闭selinux  setenforce 0

2024-12-18 14:11:42
1 楼

有个编译问题,需要解决下就行

2024-12-18 12:38:36