OpenHarmony开发者论坛

标题: 请问哪位大佬使用aarch64-linux-ohos编译成功libdrm吗 [打印本页]

作者: 欢乐马_FB7PK    时间: 2024-9-8 11:14
标题: 请问哪位大佬使用aarch64-linux-ohos编译成功libdrm吗
[md]### 【问题描述】

1. 介绍问题现象和发生的背景
   使用http://download.ci.openharmony.c ... hos-sdk-full.tar.gz
   中的aarch64-linux-ohos编译libdrm
2. 相关的代码(请勿使用截图)

   1. 使用meson编译libdrm,其中cross_file.txt中指定OpenHarmony的交叉编译器
   2. meson setup --cross-file=cross_file.txt
   3. cross_file.txt:

   [binaries]
   c = '/ohos-sdk/linux/native/llvm/bin/clang'
   cpp = '/ohos-sdk/linux/native/llvm/bin/clang++'
   ar = '/ohos-sdk/linux/native/llvm/bin/llvm-ar'
   strip = '/ohos-sdk/linux/native/llvm/bin/llvm-strip'
   ld = '/ohos-sdk/linux/native/llvm/bin/ld.lld'

   [host_machine]
   system = 'linux'
   cpu_family = 'aarch64'
   cpu = 'aarch64'
   endian = 'little'

   [paths]
   prefix = '/lib'
   libdir = 'clang/15.0.4/lib/aarch64-linux-ohos'

   [env]
   CC = '/ohos-sdk/linux/native/llvm/bin/clang --target=aarch64-linux-ohos'
   CXX = '/ohos-sdk/linux/native/llvm/bin/clang++ --target=aarch64-linux-ohos'
   AR = '/ohos-sdk/linux/native/llvm/bin/llvm-ar'
   RANLIB = '/ohos-sdk/linux/native/llvm/bin/llvm-ranlib'
   LD = '/ohos-sdk/linux/native/llvm/bin/ld.lld'
3. 运行结果、错误截图
   编译libdrm报错如下,

   /usr/bin/ld: cannot find Scrt1.o: No such file or directory
   /usr/bin/ld: cannot find crti.o: No such file or directory
   /usr/bin/ld: cannot find crtbeginS.o: No such file or directory
   /usr/bin/ld: cannot find -lgcc
   /usr/bin/ld: cannot find -lgcc_s
4. 我尝试过的解决方法和结果

   我认为是编译时没有使用ohos-sdk/linux/native/llvm/bin/ld.lld
5. 我想要达到的结果

使用OenHarmony中的aarch64-linux-ohos编译成功libdrm

### 【运行环境】

硬件:
ROM版本:
DevEvoStudio版本:
SDK版本:version-Master\_Version-OpenHarmony\_4.0.10.3-20230817\_130047
[/md]
作者: 润开鸿_贾佳豪    时间: 2024-9-9 11:48
可以参考这个
https://forums.openharmony.cn/fo ... thread&tid=2119




欢迎光临 OpenHarmony开发者论坛 (https://forums.openharmony.cn/) Powered by Discuz! X3.5