8wDlpd.png
8wDFp9.png
8wDEOx.png
8wDMfH.png
8wDKte.png

错误:在为 android 构建内核时,‘struct cs_target’ 的声明在此函数之外不可见 [-Werror,-Wvisibility]

Karson Jo 2月前

123 0

我是为 Android 构建内核的新手。我遇到了一个问题,好几天都没能解决。错误如下:../kernel/cgroup/cpuset.c:1794:16:错误:声明“str...

我是为 Android 构建内核的新手。我遇到了一个问题,好几天都无法解决。错误如下:

../kernel/cgroup/cpuset.c:1794:16: error: declaration of 'struct cs_target' will not be visible outside of this function [-Werror,-Wvisibility]
                                           struct cs_target tgt, size_t nbytes,
                                                  ^
../kernel/cgroup/cpuset.c:1794:26: error: variable has incomplete type 'struct cs_target'
                                           struct cs_target tgt, size_t nbytes,
                                                            ^
../kernel/cgroup/cpuset.c:1794:16: note: forward declaration of 'struct cs_target'
                                           struct cs_target tgt, size_t nbytes,

我该如何解决这个问题? 来源

以下是我的步骤:

cd /home/me/kuroneko_r_mt6765
export ARCH=arm64
export SUBARCH=arm
export CLANG_TRIPLE=aarch64-linux-gnu-
export CROSS_COMPILE=aarch64-linux-gnu-
export CROSS_COMPILE_ARM32=arm-linux-gnueabi-
make blossom_defconfig O=out
make -j4 CC=clang O=out
帖子版权声明 1、本帖标题:错误:在为 android 构建内核时,‘struct cs_target’ 的声明在此函数之外不可见 [-Werror,-Wvisibility]
    本站网址:http://xjnalaquan.com/
2、本网站的资源部分来源于网络,如有侵权,请联系站长进行删除处理。
3、会员发帖仅代表会员个人观点,并不代表本站赞同其观点和对其真实性负责。
4、本站一律禁止以任何方式发布或转载任何违法的相关信息,访客发现请向站长举报
5、站长邮箱:yeweds@126.com 除非注明,本帖由Karson Jo在本站《ubuntu》版块原创发布, 转载请注明出处!
最新回复 (0)
  • Parm 2月前 0 只看Ta
    引用 2

    我使用的是 Ubuntu 机器,当我打开 Visual Studio Code 时,它​​会打开一秒钟左右,然后崩溃。当通过终端使用以下命令启动 Visual Studio Code(可执行代码)时

    我正在使用 Ubuntu 机器,当我打开 Visual Studio Code 时,它​​会打开一秒钟左右,然后崩溃。当 code 使用命令通过终端启动 Visual Studio Code(可执行文件) code --verbose ,我收到以下错误。

    [19814:0606/134456.415221:ERROR:gpu_process_host.cc(993)] GPU process exited unexpectedly: exit_code=133
    [19814:0606/134456.415235:WARNING:gpu_process_host.cc(1364)] The GPU process has crashed 6 time(s)
    [19814:0606/134456.415243:FATAL:gpu_data_manager_impl_private.cc(448)] GPU process isn't usable. Goodbye.
    [0606/134456.419486:ERROR:process_memory_range.cc(75)] read out of range
    [0606/134456.419494:ERROR:process_memory_range.cc(75)] read out of range
    ...
    

    以下是部分错误消息。

    我也尝试删除代码并重新安装。但仍然出现错误。我该如何修复?

    为了删除,我使用了 sudo snap remove vscode & cd ~ && rm -rf .vscode && rm -rf .config/Code .

  • @PeterMortensen 是的,微软发布了一个显然只破坏了 snap 版本的版本:

  • 有解决方案: Visual Studio Code 在 Ubuntu 22.04 上启动 1.86 版本时崩溃 #204159

    这个对我有用:

    sudo snap revert code --revision 159
    
  • qwer 2月前 0 只看Ta
    引用 5

    今天早上更新后,我在 24.04 LTS 上遇到了同样的问题;恢复也对我有帮助。

  • 今天早上更新后,Ubuntu 22.04 LTS 上出现了完全相同的问题。恢复后我也解决了这个问题。

  • 当我执行该命令时,我收到以下输出:`错误:无法恢复\'code\':找不到 snap \'code\' 的修订版 159`

  • ayushjain@ubuntu:~/Downloads$ sudo apt install --reinstall ./code_1.88.1-1712771838_amd64.deb 正在读取软件包列表...完成正在构建依赖关系树正在读取状态信息...完成注意,

    ayushjain@ubuntu:~/Downloads$ sudo apt install --reinstall ./code_1.88.1-1712771838_amd64.deb 
    Reading package lists... Done
    Building dependency tree       
    Reading state information... Done
    Note, selecting 'code' instead of './code_1.88.1-1712771838_amd64.deb'
    Some packages could not be installed. This may mean that you have
    requested an impossible situation or if you are using the unstable
    distribution that some required packages have not yet been created
    or been moved out of Incoming.
    The following information may help to resolve the situation:
    
    The following packages have unmet dependencies:
     code : Depends: libc6 (>= 2.28) but 2.23-0ubuntu11.3 is to be installed
            Depends: libgssapi-krb5-2 (>= 1.17) but 1.13.2+dfsg-5ubuntu2.2 is to be installed
            Depends: libnss3 (>= 2:3.30) but 2:3.28.4-0ubuntu0.16.04.14 is to be installed
            Depends: libxkbfile1 (>= 1:1.1.0) but 1:1.0.9-0ubuntu1 is to be installed
    E: Unable to correct problems, you have held broken packages.
    
    
    I tried installing the vscode using command sudo apt install /.code
    but it is throwing 
    The following packages have unmet dependencies:
     code : Depends: libc6 (>= 2.28) but 2.23-0ubuntu11.3 is to be installed
            Depends: libgssapi-krb5-2 (>= 1.17) but 1.13.2+dfsg-5ubuntu2.2 is to be installed
            Depends: libnss3 (>= 2:3.30) but 2:3.28.4-0ubuntu0.16.04.14 is to be installed
            Depends: libxkbfile1 (>= 1:1.1.0) but 1:1.0.9-0ubuntu1 is to be installed
    E: Unable to correct problems, you have held broken packages.
    

    这个错误

  • 它很有帮助,我早上收到此错误 \'[9383:0607/104742.040850:ERROR:gpu_process_host.cc(993)] GPU 进程意外退出:exit_code=133 [9383:0607/104742.040892:WARNING:gpu_process_host.cc(1364)] GPU 进程已崩溃 6 次 [9383:0607/104742.040911:FATAL:gpu_data_manager_impl_private.cc(448)] GPU 进程不可用。再见。\'

  • 更新你的问题,告诉大家你使用的是什么版本的操作系统...在 Ubuntu 上执行上述操作之前,请确保你的系统是最新版本,方法是:

  • 您遇到这种情况的原因可能有很多。请尝试以下操作,这不会使情况变得更糟,并且可能解决您遇到的问题 apt

    $ sudo apt update
    $ sudo apt upgrade -f
    

    不过,在 Ubuntu 上安装 VSCode 的推荐方法是使用 Snap,它不会受到你所遇到的问题的影响 apt .

    $ sudo snap install --classic code
    

    请参阅: https://code.visualstudio.com/docs/setup/linux#_snap

  • 引用 12

    无需重新安装或降级。使用 此解决方法 对我有用(在 Ubuntu 22.04.4 LTS 上测试):

    code --in-process-gpu
    

    为什么这个解决方法有效?

    我不是 Electron/Chromium 方面的专家,因此 我引用此评论 :

    • p3

    • p4

    • p5

  • 引用 13

    它为什么有效?这个想法是什么?操作理论是什么?也许链接到 \'--in-process-gpu\' 的官方文档。请通过编辑(更改)您的答案来回应,而不是在这里的评论中(但 *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** \'编辑:\'、\'更新:\' 或类似 - 答案应该看起来像是现在写的一样)。

  • 我有相同的存储库,用于在 ubuntu 20.04 和 ubuntu 24.04 上交叉编译 Linux 内核。更准确地说,我这样做:make ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- Image modules -j4在两个发行版上,...

    我有相同的存储库,用于在 ubuntu 20.04 和 ubuntu 24.04 上交叉编译 Linux 内核。更准确地说,我这样做:

    使 ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- 图像模块 -j4

    在两个发行版上,我都使用 amd64 gcc 9.5 和相同的交叉编译工具链。

    在 Ubuntu 24.04 上,即使没有更改任何文件,编译也会每次重新编译所有内容。在 Ubuntu 20.04 上不会发生这种情况。

    在 ubuntu 24.04 上:

    make ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- Image modules -j4
      CHK     include/config/kernel.release
      CHK     include/generated/uapi/linux/version.h
      CC      scripts/mod/empty.o
      CC      scripts/mod/devicetable-offsets.s
      MKELF   scripts/mod/elfconfig.h
      HOSTCC  scripts/mod/modpost.o
      HOSTCC  scripts/mod/sumversion.o
      GEN     scripts/mod/devicetable-offsets.h
      HOSTCC  scripts/mod/file2alias.o
    
      CHK     include/generated/utsrelease.h
      CHK     include/generated/timeconst.h
      CC      kernel/bounds.s
      CHK     include/generated/bounds.h
      CC      arch/arm64/kernel/asm-offsets.s
      CHK     include/generated/asm-offsets.h
      CALL    scripts/checksyscalls.sh
      HOSTLD  scripts/mod/modpost
      CC      init/main.o
      ....
    

    文件戳未更改,其他一切相同。换句话说,唯一的区别是 Ubuntu 24.04 与 Ubuntu 20.04。

    怎么可能所有内容都在 24.04 上重新编译,而在 20.04 上却没有(这是预期的行为)?

    #################################################### ########

    编辑1

    我已将 Ubuntu 20.04 和 Ubuntu 24.04 的输出与评论中建议的选项 -j1 和 V=1 进行比较。在 Ubuntu 24.04 上,很早以前,我有一个额外的编译行:

    set -e; : '  CHK     include/config/kernel.release'; mkdir -p include/config/;  echo "4.4.71$(/bin/bash ./scripts/setlocalversion .)" < include/config/auto.conf > include/config/kernel.release.tmp; if [ -r include/config/kernel.release ] && cmp -s include/config/kernel.release include/config/kernel.release.tmp; then rm -f include/config/kernel.release.tmp; else : '  UPD     include/config/kernel.release'; mv -f include/config/kernel.release.tmp include/config/kernel.release; fi
    make -f ./scripts/Makefile.asm-generic \
                src=asm obj=arch/arm64/include/generated/asm
    make -f ./scripts/Makefile.asm-generic \
                src=uapi/asm obj=arch/arm64/include/generated/uapi/asm
    set -e; : '  CHK     include/generated/uapi/linux/version.h'; mkdir -p include/generated/uapi/linux/;   (echo \#define LINUX_VERSION_CODE 263239; echo '#define KERNEL_VERSION(a,b,c) (((a) << 16) + ((b) << 8) + (c))';) < Makefile > include/generated/uapi/linux/version.h.tmp; if [ -r include/generated/uapi/linux/version.h ] && cmp -s include/generated/uapi/linux/version.h include/generated/uapi/linux/version.h.tmp; then rm -f include/generated/uapi/linux/version.h.tmp; else : '  UPD     include/generated/uapi/linux/version.h'; mv -f include/generated/uapi/linux/version.h.tmp include/generated/uapi/linux/version.h; fi
    rm -f include/linux/version.h
    set -e; : '  CHK     include/generated/utsrelease.h'; mkdir -p include/generated/;  if [ `echo -n "4.4.71-00005-g2fc62ed91813-dirty" | wc -c ` -gt 64 ]; then echo '"4.4.71-00005-g2fc62ed91813-dirty" exceeds 64 characters' >&2; exit 1; fi; (echo \#define UTS_RELEASE \"4.4.71-00005-g2fc62ed91813-dirty\";) < include/config/kernel.release > include/generated/utsrelease.h.tmp; if [ -r include/generated/utsrelease.h ] && cmp -s include/generated/utsrelease.h include/generated/utsrelease.h.tmp; then rm -f include/generated/utsrelease.h.tmp; else : '  UPD     include/generated/utsrelease.h'; mv -f include/generated/utsrelease.h.tmp include/generated/utsrelease.h; fi
    mkdir -p .tmp_versions ; rm -f .tmp_versions/*
    make -f ./scripts/Makefile.build obj=scripts/basic
    (cat /dev/null; ) > scripts/basic/modules.order
    rm -f .tmp_quiet_recordmcount
    make -f ./scripts/Makefile.build obj=.
    (cat /dev/null; ) > modules.order
    mkdir -p kernel/
    

    此编译行仅存在于 Ubuntu 24.04:

      aarch64-linux-gnu-gcc -Wp,-MD,kernel/.bounds.s.d -nostdinc -isystem /home/gregoire/tmp-inout/gcc-linaro-5.3.1-2016.05-x86_64_aarch64-linux-gnu/bin/../lib/gcc/aarch64-linux-gnu/5.3.1/include -I./arch/arm64/include -Iarch/arm64/include/generated/uapi -Iarch/arm64/include/generated  -Iinclude -I./arch/arm64/include/uapi -Iarch/arm64/include/generated/uapi -I./include/uapi -Iinclude/generated/uapi -include ./include/linux/kconfig.h -D__KERNEL__ -mlittle-endian -Wall -Wundef -Wstrict-prototypes -Wno-trigraphs -fno-strict-aliasing -fno-common -Werror-implicit-function-declaration -Wno-format-security -std=gnu89 -fno-PIE -mgeneral-regs-only -DCONFIG_AS_LSE=1 -mpc-relative-literal-loads -fno-delete-null-pointer-checks -Wno-maybe-uninitialized -Os --param=allow-store-data-races=0 -Wframe-larger-than=1024 -fno-stack-protector -Wno-unused-but-set-variable -fno-omit-frame-pointer -fno-optimize-sibling-calls -fno-var-tracking-assignments -g -pg -Wdeclaration-after-statement -Wno-pointer-sign -fno-strict-overflow -fconserve-stack -Werror=implicit-int -Werror=strict-prototypes -Werror=date-time -DCC_HAVE_ASM_GOTO    -D"KBUILD_STR(s)=#s" -D"KBUILD_BASENAME=KBUILD_STR(bounds)"  -D"KBUILD_MODNAME=KBUILD_STR(bounds)"  -fverbose-asm -S -o kernel/bounds.s kernel/bounds.c
    

    下一行在两个环境中是相同的:

    set -e; : '  CHK     include/generated/bounds.h'; mkdir -p include/generated/; (set -e; echo "#ifndef __LINUX_BOUNDS_H__"; echo "#define __LINUX_BOUNDS_H__"; echo "/*"; echo " * DO NOT MODIFY."; echo " *"; echo " * This file was generated by Kbuild"; echo " */"; echo ""; sed -ne     "/^->/{s:->#\(.*\):/* \1 */:; s:^->\([^ ]*\) [\$#]*\([-0-9]*\) \(.*\):#define \1 \2 /* \3 */:; s:^->\([^ ]*\) [\$#]*\([^ ]*\) \(.*\):#define \1 \2 /* \3 */:; s:->::; p;}"; echo ""; echo "#endif" ) < kernel/bounds.s > include/generated/bounds.h.tmp; if [ -r include/generated/bounds.h ] && cmp -s include/generated/bounds.h include/generated/bounds.h.tmp; then rm -f include/generated/bounds.h.tmp; else : '  UPD     include/generated/bounds.h'; mv -f include/generated/bounds.h.tmp include/generated/bounds.h; fi
    

    在 Ubuntu 24.04 上,我有:

    Ubuntu 24.04:
      File: kernel/bounds.c
      Size: 703         Blocks: 8          IO Block: 4096   regular file
    Device: 259,2   Inode: 14559530    Links: 1
    Access: (0664/-rw-rw-r--)  Uid: ( 1000/gregoire)   Gid: ( 1000/gregoire)
    Access: 2024-05-14 10:05:28.629197631 -0700
    Modify: 2017-09-23 09:19:33.558726253 -0700
    Change: 2024-05-07 15:44:11.170012538 -0700
     Birth: 2024-04-26 08:54:22.911042385 -0700
     
      File: kernel/bounds.s
      Size: 14617       Blocks: 32         IO Block: 4096   regular file
    Device: 259,2   Inode: 14559336    Links: 1
    Access: (0664/-rw-rw-r--)  Uid: ( 1000/gregoire)   Gid: ( 1000/gregoire)
    Access: 2024-05-14 10:26:03.478134345 -0700
    Modify: 2024-05-14 10:26:03.467134218 -0700
    Change: 2024-05-14 10:26:03.467134218 -0700
     Birth: 2024-05-04 21:27:59.503527455 -0700
    

    至于文件系统:

    Ubuntu 24.04:
    /dev/nvme0n1p2 on / type ext4 (rw,relatime,stripe=32)
    Ubuntu 20.04:
    /dev/sda5 on / type ext4 (rw,relatime,errors=remount-ro)
    
  • 您可能正在使用虚拟环境?这可能解释了时钟(时区)不一致,而 make 会将其识别为编译文件的信号。

  • 引用 16

    当 Unity 应用在 Android 设备上运行时,我开始收到错误,在 UnityPurchasing InitializeUnity 2022.3.181、应用内购买 4.12.2、目标 API 34UnityEngine.AndroidJavaException:...

    当 Unity 应用在 Android 设备上运行时,我在 UnityPurchasing Initialize 上收到错误

    Unity 2022.3.181,应用内购买 4.12.2,目标 API 34

    UnityEngine.AndroidJavaException: java.lang.ClassNotFoundException: com.android.billingclient.api.PurchasesUpdatedListener
    at UnityEngine.AndroidJNISafe.CheckException () [0x00000] in <00000000000000000000000000000000>:0 
    at UnityEngine.AndroidJNISafe.FindClass (System.String name) [0x00000] in <00000000000000000000000000000000>:0 
    at UnityEngine.AndroidJavaClass._AndroidJavaClass (System.String className) [0x00000] in <00000000000000000000000000000000>:0 
    at UnityEngine.AndroidJavaProxy..ctor (System.String javaInterface) [0x00000] in <00000000000000000000000000000000>:0 
    at UnityEngine.Purchasing.GooglePurchaseUpdatedListener..ctor (UnityEngine.Purchasing.Interfaces.IGoogleLastKnownProductService googleLastKnownProductService, UnityEngine.Purchasing.Interfaces.IGooglePurchaseCallback googlePurchaseCallback, UnityEngine.Purchasing.Interfaces.IGooglePurchaseBuilder purchaseBuilder, UnityEngine.Purchasing.IGoogleCachedQueryProductDetailsService googleCachedQueryProductDetailsService, UnityEngine.Pur
    

    我尝试添加自定义 proguard, -keep class com.android.billingclient.** {*; } 但没有任何改变

    关于如何修复它有什么提示吗?

  • 我遇到了同样的问题。我也尝试修改proguard,因为我以前遇到过类似的问题 - 但这次没有成功。你能找到问题所在吗?

  • 效果很好。我希望将此问题转发给 VS-Code 开发人员,以便他们尽快修复此问题

  • 您似乎正在使用过时的计费客户端依赖项,并结合使用计费实现,该实现针对该库的较新版本运行。这可能是由于不尽心尽力的更新导致库未更新。也许您的本地缓存中仍有该过时的库?

    正如文档所述(当前版本为 7.0.0 ):

    提醒:到 2024 年 8 月 31 日,所有新应用和现有应用的更新都必须使用计费库版本 6 或更新版本。

    更新日志 changelog 说明其包含哪个版本。

  • 关于时间问题,文件系统是如何挂载的?检查所有标志并比较默认值。很可能它只是没有更新目标文件上的时间。您实际上可以运行

返回
作者最近主题: