安装CUDA显卡驱动之后导致Android编译不过

主要在kernel编译报错如下

n file included from xxx/kernel-4.19/init/version.c:9:
./include/generated/compile.h:7:24: warning: missing terminating '"' character [-Winvalid-pp-token]
#define LINUX_COMPILER "Android (6443078 based on r383902) clang version 11.0.1 (https://android.googlesource.com/toolchain/llvm-project b397f81060ce6d701042b782172ed13bee898b79)
                       ^
./include/generated/compile.h:8:1: error: unknown type name 'Found'
Found CUDA installation: /usr/local/cuda, version 7.0, LLD 11.0.1 (/buildbot/tmp/tmp6_m7QH b397f81060ce6d701042b782172ed13bee898b79)"
^
./include/generated/compile.h:8:11: error: expected ';' after top level declarator
Found CUDA installation: /usr/local/cuda, version 7.0, LLD 11.0.1 (/buildbot/tmp/tmp6_m7QH b397f81060ce6d701042b782172ed13bee898b79)"
          ^
          ;
./include/generated/compile.h:8:133: warning: missing terminating '"' character [-Winvalid-pp-token]
Found CUDA installation: /usr/local/cuda, version 7.0, LLD 11.0.1 (/buildbot/tmp/tmp6_m7QH b397f81060ce6d701042b782172ed13bee898b79)"

。。。。。。

xxx/kernel-4.19/include/asm-generic/int-ll64.h:16:9: error: unknown type name '__s8'; did you mean '__u8'?
typedef __s8  s8;
        ^~~~
        __u8
xxx/kernel-4.19/include/uapi/asm-generic/int-ll64.h:21:23: note: '__u8' declared here
typedef unsigned char __u8;
                      ^
  AS      usr/initramfs_data.o
  AR      usr/built-in.a
  CC      arch/arm64/kernel/probes/kprobes.o
xxx/kernel-4.19/init/version.c:47:26: error: expected ';' after top level declarator
        LINUX_COMPILE_HOST ") (" LINUX_COMPILER ") " UTS_VERSION "\n";
                                ^
                                ;
xxx/kernel-4.19/init/version.c:55:6: error: expected ';' after top level declarator
        " (" LINUX_COMPILER ") %s\n";
            ^
            ;
2 warnings and 5 errors generated.

这和编译环境没有关系,是因为生成中间h文件时读取系统信息里读取到了cuda的环境信息,导致内容多了一个回车,出现语法错误,详细信息可以直接看out目录下的./include/generated/compile.h,修改办法如下

位置在kernel目录下,直接把那个需要显示的信息干掉,这个信息主要是编译环境信息,理论对系统运行不会构成什么影响。

scripts/mkcompile_h
Index: scripts/mkcompile_h
===================================================================
--- scripts/mkcompile_h    (版本 16555)
+++ scripts/mkcompile_h    (工作副本)
@@ -76,7 +76,7 @@
   CC_VERSION=$($CC -v 2>&1 | grep ' version ' | sed 's/[[:space:]]*$//')
   LD_VERSION=$($LD -v | head -n1 | sed 's/(compatible with [^)]*)//' \
               | sed 's/[[:space:]]*$//')
-  printf '#define LINUX_COMPILER "%s"\n' "$CC_VERSION, $LD_VERSION"
+  printf '#define LINUX_COMPILER "%s"' # "$CC_VERSION, $LD_VERSION" # \n
 ) > .tmpcompile
 
 # Only replace the real compile.h if the new one is different,

  • 2
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值