问题描述
内核编译时报错
ld.lld: error: target emulation unknown: -m or at least one .o file required
../scripts/Makefile.build:423: recipe for target ‘drivers/gpu/drm/built-in.o’ failed
make[4]: *** [drivers/gpu/drm/built-in.o] Error 1
../scripts/Makefile.build:489: recipe for target ‘drivers/gpu/drm’ failed
make[3]: *** [drivers/gpu/drm] Error 2
复现环境
Ubuntu18.04
内核源码https://github.com/android-linux-stable/op5
clang源码https://github.com/kdrag0n/proton-clang
编译命令
#build.sh
#!/bin/bash
clang_path=“${HOME}/prebuilts/clang/host/linux-x86/clang-proton/bin”
args="-j$(nproc –all) \
O=out \
ARCH=arm64 \
SUBARCH=arm64 \
CC=${clang_path}/clang \
CLANG_TRIPLE=aarch64-linux-gnu- \
LLVM_AR=${clang_path}/llvm-ar \
LLVM_NM=${clang_path}/llvm-nm \
LD=${clang_path}/ld.lld \
OBJCOPY=${clang_path}/llvm-objcopy \
OBJDUMP=${clang_path}/llvm-objdump \
STRIP=${clang_path}/llvm-strip \
CROSS_COMPILE=${clang_path}/aarch64-linux-gnu-"
make ${args} lineage_oneplus5_defconfig
make ${args}
错误日志
ld.lld: error: target emulation unknown: -m or at least one .o file required
../scripts/Makefile.build:423: recipe for target ‘drivers/gpu/drm/built-in.o’ failed
make[4]: *** [drivers/gpu/drm/built-in.o] Error 1
../scripts/Makefile.build:489: recipe for target ‘drivers/gpu/drm’ failed
make[3]: *** [drivers/gpu/drm] Error 2
PS:不知道标题这样行不行