前置条件
-
- macOS Sonoma (14.1.1) 强烈建议至少是这个版本的系统,更早的系统虚拟机稳定性存在问题,经常崩溃
- MacBook Pro 2023-Apple M2 Pro (4能效核、8性能核、32GB内存、2TB磁盘)
- Homebrew (4.0.28 或更高版本)
- UTM 4.4.3
- ubuntu 22.04.3 Server ARM
根据 Google 官方文档,2021年6月22日之后的Android系统版本不支持在macOS系统上构建,我们在 Applic Silicon 的 macOS 系统是不能直接成功构建后续版本的,但是之前的版本可以在修改编译配置后成功编译,只是是否能正常运行存疑。
尝试过使用 Podman Desktop / Docker 方式进行编译、也尝试过借助 OrbStack, Lima 这些纯虚拟机通过安装 ubuntu 22.04 系统镜像的方式进行编译,结果都在执行 lunch 命令的时候长时间卡住,观察系统进程发现名为 nsjail 进程的 CPU 占用持续卡住在 100% 上无法继续编译,并且由于 Docker 或者虚拟机文件系统是 Linux 文件系统,而宿主机的文件系统是 AppleFS 文件系统,导致需要进行文件转换,中间的转换性能代价非常高,性能很差。
相反,目前测试来看,直接在 UTM 虚拟机里执行编译的性能反倒更好一些。但是目前测试发现存在严重的文件系统缺陷,编译/大量文件复制过程中,经常出现文件系统损坏,导致编译失败。
另外,我们需要安装 Rosetta 2 支持运行部分 x86_64 应用。注意 Rosetta 2 只支持 64 位应用,不支持 32 位应用。 参考 Does Rosetta 2 support 32-bit Intel apps?
准备环境
安装依赖
1 2 |
# 安装 Rosetta 2 支持 x86_64 应用 $ /usr/sbin/softwareupdate --install-rosetta --agree-to-license |
安装虚拟机应用
安装ARM版本操作系统
去 Ubuntu Server for ARM 官网,下载 Ubuntu 22.04.3 LTS ARM 系统镜像。
创建虚拟机
虚拟化引擎选择部分,务必勾选 Apple Virtualization 。如果不勾选此项,那么后续的 Rosetta 是没办法选择的,并且性能是不足以进行系统编译的。
如下图:
内存,CPU 部分,建议尽量多给一些,这样编译速度更快,但是不一太多,太多会导致宿主机卡顿,这个需要均衡考虑,尤其是宿主机还需要同步执行其他事情的时候。
如下图:
磁盘部分,建议至少 400GB 以上,如下图:
共享目录部分,如果是编译代码,不建议使用,性能不够,如果是常规的文件共享,问题不大。
如下图:
最终的配置如下:
操作系统安装
键盘点击确认(回车),默认下一步
键盘点击确认(回车),默认下一步
键盘点击确认(回车),默认下一步
键盘点击确认(回车),默认下一步
键盘点击确认(回车),默认下一步
键盘点击确认(回车),默认下一步
等待镜像服务器测试完成之后,键盘点击确认(回车),默认下一步
接下来, 注意:务必取消掉 “Set up this disk as an LVM group”选项,否则不管你给出磁盘有多大,都是默认分配 100GB 的磁盘,其余磁盘空间需要手工分区。
移动上下键,到指定位置,点击键盘上的空格,取消选中,如下图:
移动上下键,到 Done ,键盘点击确认(回车),默认下一步
键盘点击确认(回车),默认下一步
移动上下键,到 Continue ,确认使用上述的分区配置,键盘点击确认(回车),执行下一步
用户名,密码,机器名等配置(此处,我们默认都输入 ubuntu),输入完成后,移动上下键,键盘点击确认(回车),执行下一步
键盘点击确认(回车),默认下一步
配合上下键,空格,选中 "Install OpenSSH server", 键盘点击确认(回车),默认下一步
此处,没有我们需要的服务器配置,键盘上下键调整到 “Done” 高亮 ,点击确认(回车),默认下一步
等待安装完成,直到底部出现 “Reboot Now”,键盘上下键调整到 “Reboot Now” 高亮 ,点击确认(回车)系统重启,安装完成。
重启之后,会再次回到安装界面,如下图:
原因是我们没有弹出安装镜像导致的,我们需要手工弹出安装光盘,直接关闭虚拟机,然后如下操作
设置 Rosetta 启用对于 x86_64 架构应用的支持
登录到刚刚创建的虚拟机(建议通过 SSH 登录进去,直接通过虚拟机提供的屏幕操作,不方便复制粘贴),然后执行如下命令:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 |
$ sudo mkdir /media/rosetta $ sudo mount -t virtiofs rosetta /media/rosetta $ sudo apt install binfmt-support # 此命令的是通知操作系统 0x7f 开头的ELF文件委托给 rosetta 进行加载 # 0x7f 开头代表的是 x86_64 的可执行文件, rosetta 会把文件进行动态转译成 ARM64 指令,从而提升执行性能 # 另外注意,rosetta 只支持 x86_64 , 不支持 x86_32 的应用 $ sudo /usr/sbin/update-binfmts --install rosetta /media/rosetta/rosetta \ --magic "\x7fELF\x02\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x3e\x00" \ --mask "\xff\xff\xff\xff\xff\xfe\xfe\x00\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff\xff" \ --credentials yes --preserve no --fix-binary yes |
添加到系统文件加载项,要求系统启动的时候自动加载 rosetta 。
1 |
$ sudo vim /etc/fstab |
在文件尾部新增一行:
1 |
rosetta /media/rosetta virtiofs ro,nofail 0 0 |
修改后的配置文件类似如下:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 |
# /etc/fstab: static file system information. # # Use 'blkid' to print the universally unique identifier for a # device; this may be used with UUID= as a more robust way to name devices # that works even if disks are added and removed. See fstab(5). # # <file system> <mount point> <type> <options> <dump> <pass> # / was on /dev/vda2 during curtin installation /dev/disk/by-uuid/c564e919-be8a-40fc-89cf-bba11fbc6c45 / ext4 defaults 0 1 # /boot/efi was on /dev/vda1 during curtin installation /dev/disk/by-uuid/92AB-2A45 /boot/efi vfat defaults 0 1 /swap.img none swap sw 0 0 rosetta /media/rosetta virtiofs ro,nofail 0 0 |
执行 df 命令,应该可以看到 rosetta 已经被正常加载,如下:
1 2 3 4 5 6 7 8 9 |
$ df -h Filesystem Size Used Avail Use% Mounted on tmpfs 2.6G 1012K 2.6G 1% /run /dev/vda2 392G 11G 361G 3% / tmpfs 13G 0 13G 0% /dev/shm tmpfs 5.0M 0 5.0M 0% /run/lock /dev/vda1 1.1G 6.4M 1.1G 1% /boot/efi tmpfs 2.6G 4.0K 2.6G 1% /run/user/1000 rosetta 1.9T 1.8T 25G 99% /media/rosetta |
配置完成之后,务必重启一次虚拟机,否则大概率虚拟机系统会在运行过程中崩溃。
启用多处理器架构应用安装
1 |
$ sudo dpkg --add-architecture amd64 |
此时注意,默认情况下 ARM 安装包的 APT 服务器是跟 x86 安装包的服务器是不同的,如果执行上述命令后,更新安装源,会报错找不到文件,我们需要手工指定不同架构的安装包搜索服务器。可以参照下面的方式修改 /etc/apt/sources.list 显式声明各个架构的服务器地址,如下:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 |
# See http://help.ubuntu.com/community/UpgradeNotes for how to upgrade to # newer versions of the distribution. deb [arch=arm64] http://ports.ubuntu.com/ubuntu-ports/ jammy main restricted # deb-src [arch=arm64] http://ports.ubuntu.com/ubuntu-ports/ jammy main restricted ## Major bug fix updates produced after the final release of the ## distribution. deb [arch=arm64] http://ports.ubuntu.com/ubuntu-ports/ jammy-updates main restricted # deb-src [arch=arm64] http://ports.ubuntu.com/ubuntu-ports/ jammy-updates main restricted ## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu ## team. Also, please note that software in universe WILL NOT receive any ## review or updates from the Ubuntu security team. deb [arch=arm64] http://ports.ubuntu.com/ubuntu-ports/ jammy universe # deb-src [arch=arm64] http://ports.ubuntu.com/ubuntu-ports/ jammy universe deb [arch=arm64] http://ports.ubuntu.com/ubuntu-ports/ jammy-updates universe # deb-src [arch=arm64] http://ports.ubuntu.com/ubuntu-ports/ jammy-updates universe ## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu ## team, and may not be under a free licence. Please satisfy yourself as to ## your rights to use the software. Also, please note that software in ## multiverse WILL NOT receive any review or updates from the Ubuntu ## security team. deb [arch=arm64] http://ports.ubuntu.com/ubuntu-ports/ jammy multiverse # deb-src [arch=arm64] http://ports.ubuntu.com/ubuntu-ports/ jammy multiverse deb [arch=arm64] http://ports.ubuntu.com/ubuntu-ports/ jammy-updates multiverse # deb-src [arch=arm64] http://ports.ubuntu.com/ubuntu-ports/ jammy-updates multiverse ## N.B. software from this repository may not have been tested as ## extensively as that contained in the main release, although it includes ## newer versions of some applications which may provide useful features. ## Also, please note that software in backports WILL NOT receive any review ## or updates from the Ubuntu security team. deb [arch=arm64] http://ports.ubuntu.com/ubuntu-ports/ jammy-backports main restricted universe multiverse # deb-src [arch=arm64] http://ports.ubuntu.com/ubuntu-ports/ jammy-backports main restricted universe multiverse deb [arch=arm64] http://ports.ubuntu.com/ubuntu-ports/ jammy-security main restricted # deb-src [arch=arm64] http://ports.ubuntu.com/ubuntu-ports/ jammy-security main restricted deb [arch=arm64] http://ports.ubuntu.com/ubuntu-ports/ jammy-security universe # deb-src [arch=arm64] http://ports.ubuntu.com/ubuntu-ports/ jammy-security universe deb [arch=arm64] http://ports.ubuntu.com/ubuntu-ports/ jammy-security multiverse # deb-src [arch=arm64] http://ports.ubuntu.com/ubuntu-ports/ jammy-security multiverse deb [arch=amd64] http://archive.ubuntu.com/ubuntu/ jammy main restricted deb [arch=amd64] http://archive.ubuntu.com/ubuntu/ jammy-updates main restricted deb [arch=amd64] http://archive.ubuntu.com/ubuntu/ jammy universe deb [arch=amd64] http://archive.ubuntu.com/ubuntu/ jammy-updates universe deb [arch=amd64] http://archive.ubuntu.com/ubuntu/ jammy multiverse deb [arch=amd64] http://archive.ubuntu.com/ubuntu/ jammy-updates multiverse deb [arch=amd64] http://security.ubuntu.com/ubuntu jammy-security main restricted deb [arch=amd64] http://security.ubuntu.com/ubuntu jammy-security universe deb [arch=amd64] http://security.ubuntu.com/ubuntu jammy-security multiverse |
更新源
1 2 3 4 5 |
$ sudo apt update $ sudo apt dist-upgrade $ sudo apt autoremove |
至此,我们已经可以在 ARM64 环境下,正常安装并运行 x86_64 的应用,只是安装应用的时候,需要明确指定安装包的处理器架构。
安装编译依赖
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 |
# 此处需要明确架构为 x86_64 架构,否则默认安装 ARM 架构的应用,我们编译需要使用 x86_64 架构的编译工具 $ sudo apt install gcc:amd64 # 解决 # prebuilts/clang/host/linux-x86/clang-3289846/bin/clang.real: error while loadin g shared libraries: libncurses.so.5: cannot open shared object file: No such fi le or directory $ sudo apt install libncurses5:amd64 # repo、git、ccache 这些工具,使用ARM64版本即可 $ sudo apt install repo ccache zip unzip $ sudo apt install git $ git config --global user.email "user@email.com" $ git config --global user.name "user" $ sudo apt autoremove |
代码拉取&构建
1.使用镜像下载Android
源代码
清华大学的镜像
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 |
# 建议直接下载压缩包,使用repo更新基本上都会失败,即使用国内镜像也是一样(目前大约96GB) # 不建议直接在aosp根目录下直接操作,由于APFS创建的卷宗根目录下会放置回收站 .Trashes 因此编译的时候可能会报错: # opendir failed: .Trashes: Operation not permitted # 建议通过直接清华源的镜像压缩包进行代码同步 # 不要通过 repo sync 进行,目前测试发现 repo sync 成功的概率越来越低了 # 此处大概率虚拟机会挂掉,原因在UTM官方有解释 https://docs.getutm.app/guides/debian/ # There is a bug present in Linux virtual machines on Ventura and the base M1 chip which causes the virtual machine to kernel panic and freeze up randomly. Unfortunately, this means that base M1 users should avoid Apple Virtualization backend until Apple or Linux maintainers provide a fix. # 目前的解决方案就是强制重启虚拟机,然后继续。 # 当前测试挂掉的概率还是比较低的,只是第一次磁盘空间扩展的时候,大概率会出现卡死的情况 $ curl -OC - https://mirrors.tuna.tsinghua.edu.cn/aosp-monthly/aosp-latest.tar # 磁盘空间变化很大的情况下,务必重启一次系统,否则大概率在后续编译过程中系统运行异常 $ sudo reboot now $ tar xvf aosp-latest.tar # 磁盘空间变化很大的情况下,务必重启一次系统,否则大概率在后续编译过程中系统运行异常 $ sudo reboot now $ cd aosp |
2.编译源代码
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 |
# 查看分支 # cd .repo/manifests # git branch -a | grep "android-11" # 检出代码代码 # repo init -b android-10.0.0_r47 $ repo init -b android-security-11.0.0_r72 $ repo sync -j4 --fail-fast $ export USE_CCACHE=1 # 移除 nsjail 否则无法启动编译 $ mv prebuilts/build-tools/linux-x86/bin/nsjail prebuilts/build-tools/linux-x86/bin/nsjail.old # 执行构建 $ source build/envsetup.sh # 默认编译的镜像是 release 模式的,运行速度更快,但是不方便系统调试 # 如果需要跟踪调试代码,建议编译为调试类型 # export TARGET_BUILD_TYPE=debug # 纯ARM64系统镜像,可以刷机 # lunch aosp_arm64-eng # eng:代表 engineer,开发工程师的版本,拥有最大的权限(root等),具有额外调试工具的开发配置。 # 执行 lunch 命令可以输出全部的编译目标列表 # 更多的编译选项可以从 build/make/target/product/ 下看到 # 模拟器使用的系统镜像 # lunch sdk_phone_arm64-userdebug $ lunch sdk_phone_arm64-eng $ m |
注意,如果执行
1 |
lunch sdk_phone_arm64-eng |
的时候长时间卡住,Ctrl + C 停止之后报错:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 |
ubuntu@ubuntu:~/aosp$ lunch sdk_phone_arm64-eng 06:19:01 Got signal: interrupt 06:19:01 Got signal: interrupt 06:19:01 Still alive, killing subprocesses... 06:19:02 Got signal: interrupt 06:19:02 Still alive, cleaning up... 06:19:02 Timed out exiting... panic: write to panicWriter goroutine 281325 [running]: android/soong/ui/logger.panicWriter.Write(...) build/soong/ui/logger/logger.go:185 log.(*Logger).Output(0xc0001660a0, 0x3, 0xc000c74e80, 0x15, 0x0, 0x0) /home/ubuntu/aosp/prebuilts/go/linux-x86/src/log/log.go:172 +0x287 android/soong/ui/logger.(*stdLogger).Output(0xc000150210, 0x2, 0xc000c74e80, 0x15, 0x15, 0x7f1d68) build/soong/ui/logger/logger.go:223 +0x88 android/soong/ui/logger.(*stdLogger).Panicln(0xc000150210, 0xc00c028070, 0x1, 0x1) build/soong/ui/logger/logger.go:318 +0x78 android/soong/ui/build.handleSignals.func1.1(0x7f1d20, 0xc000150210, 0xc0001701e0) build/soong/ui/build/signal.go:71 +0xaa created by android/soong/ui/build.handleSignals.func1 build/soong/ui/build/signal.go:68 +0x105 goroutine 1 [chan receive]: os/exec.(*Cmd).Wait(0xc0057ce000, 0x0, 0x0) /home/ubuntu/aosp/prebuilts/go/linux-x86/src/os/exec/exec.go:509 +0x125 os/exec.(*Cmd).Run(0xc0057ce000, 0xc007804000, 0x0) /home/ubuntu/aosp/prebuilts/go/linux-x86/src/os/exec/exec.go:341 +0x5c os/exec.(*Cmd).CombinedOutput(0xc0057ce000, 0xc0068ca010, 0x1, 0x1, 0xe, 0xc0057ce000) /home/ubuntu/aosp/prebuilts/go/linux-x86/src/os/exec/exec.go:561 +0x91 android/soong/ui/build.(*Cmd).sandboxSupported.func1() build/soong/ui/build/sandbox_linux.go:87 +0x3b4 sync.(*Once).doSlow(0x9fcac0, 0xc0002f1218) /home/ubuntu/aosp/prebuilts/go/linux-x86/src/sync/once.go:66 +0xe3 sync.(*Once).Do(...) /home/ubuntu/aosp/prebuilts/go/linux-x86/src/sync/once.go:57 android/soong/ui/build.(*Cmd).sandboxSupported(0xc009acd800, 0x0) build/soong/ui/build/sandbox_linux.go:69 +0x8e android/soong/ui/build.(*Cmd).prepare(0xc009acd800) build/soong/ui/build/exec.go:56 +0x3f android/soong/ui/build.(*Cmd).Start(0xc009acd800, 0x0, 0x0) build/soong/ui/build/exec.go:64 +0x2b android/soong/ui/build.(*Cmd).StartOrFatal(0xc009acd800) build/soong/ui/build/exec.go:88 +0x2f android/soong/ui/build.dumpMakeVars(0xc0000c4480, 0xc000188000, 0x0, 0x0, 0x0, 0xc0039a2f00, 0x2e, 0x2f, 0x0, 0x0, ...) build/soong/ui/build/dumpvars.go:108 +0x693 android/soong/ui/build.DumpMakeVars(0xc0000c4480, 0xc000188000, 0x0, 0x0, 0x0, 0xc0039a2c00, 0x2f, 0x30, 0x0, 0x0, ...) build/soong/ui/build/dumpvars.go:68 +0x708 main.dumpVars(0xc0000c4480, 0xc000188000, 0xc0000c4140, 0x4, 0x4, 0xc0000b1238, 0x3) build/soong/cmd/soong_ui/main.go:316 +0x5d9 main.main() build/soong/cmd/soong_ui/main.go:206 +0x12ab goroutine 35 [syscall]: os/signal.signal_recv(0x7e9f80) /home/ubuntu/aosp/prebuilts/go/linux-x86/src/runtime/sigqueue.go:147 +0x9c os/signal.loop() /home/ubuntu/aosp/prebuilts/go/linux-x86/src/os/signal/signal_unix.go:23 +0x22 created by os/signal.init.0 /home/ubuntu/aosp/prebuilts/go/linux-x86/src/os/signal/signal_unix.go:29 +0x41 goroutine 37 [select]: android/soong/ui/build.handleSignals(0xc00009a180, 0x7f1d20, 0xc000150210, 0xc000152050, 0xc0001701e0) build/soong/ui/build/signal.go:79 +0x136 created by android/soong/ui/build.SetupSignals build/soong/ui/build/signal.go:44 +0x136 goroutine 281322 [IO wait, 4 minutes]: internal/poll.runtime_pollWait(0x7ffffc2dcea8, 0x72, 0xffffffffffffffff) /home/ubuntu/aosp/prebuilts/go/linux-x86/src/runtime/netpoll.go:184 +0x55 internal/poll.(*pollDesc).wait(0xc0005b2078, 0x72, 0x201, 0x216, 0xffffffffffffffff) /home/ubuntu/aosp/prebuilts/go/linux-x86/src/internal/poll/fd_poll_runtime.go:87 +0x45 internal/poll.(*pollDesc).waitRead(...) /home/ubuntu/aosp/prebuilts/go/linux-x86/src/internal/poll/fd_poll_runtime.go:92 internal/poll.(*FD).Read(0xc0005b2060, 0xc00001a9ea, 0x216, 0x216, 0x0, 0x0, 0x0) /home/ubuntu/aosp/prebuilts/go/linux-x86/src/internal/poll/fd_unix.go:169 +0x1cf os.(*File).read(...) /home/ubuntu/aosp/prebuilts/go/linux-x86/src/os/file_unix.go:259 os.(*File).Read(0xc0068c8008, 0xc00001a9ea, 0x216, 0x216, 0x3d, 0x0, 0x0) /home/ubuntu/aosp/prebuilts/go/linux-x86/src/os/file.go:116 +0x71 bytes.(*Buffer).ReadFrom(0xc007804000, 0x7e77c0, 0xc0068c8008, 0x7ffffc258028, 0xc007804000, 0x78f801) /home/ubuntu/aosp/prebuilts/go/linux-x86/src/bytes/buffer.go:204 +0xb4 io.copyBuffer(0x7e7420, 0xc007804000, 0x7e77c0, 0xc0068c8008, 0x0, 0x0, 0x0, 0x4562d0, 0xc006175fa0, 0x406885) /home/ubuntu/aosp/prebuilts/go/linux-x86/src/io/io.go:388 +0x2ed io.Copy(...) /home/ubuntu/aosp/prebuilts/go/linux-x86/src/io/io.go:364 os/exec.(*Cmd).writerDescriptor.func1(0xc006175fc0, 0x5d3fd5) /home/ubuntu/aosp/prebuilts/go/linux-x86/src/os/exec/exec.go:311 +0x63 os/exec.(*Cmd).Start.func1(0xc0057ce000, 0xc0073b4080) /home/ubuntu/aosp/prebuilts/go/linux-x86/src/os/exec/exec.go:435 +0x27 created by os/exec.(*Cmd).Start /home/ubuntu/aosp/prebuilts/go/linux-x86/src/os/exec/exec.go:434 +0x608 |
则观察当前执行的进程,会发现名为 nsjail 的进程长时间卡住,并且 100% CPU 占用,如下:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 |
ubuntu@ubuntu:~/aosp$ top top - 06:19:16 up 3:16, 2 users, load average: 1.02, 1.00, 0.90 Tasks: 175 total, 2 running, 173 sleeping, 0 stopped, 0 zombie %Cpu(s): 0.6 us, 7.8 sy, 0.0 ni, 91.6 id, 0.0 wa, 0.0 hi, 0.0 si, 0.0 st MiB Mem : 26003.1 total, 2185.0 free, 491.4 used, 23326.8 buff/cache MiB Swap: 8192.0 total, 8185.2 free, 6.8 used. 25160.6 avail Mem PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND 38314 ubuntu 20 0 1198852 3496 1116 R 100.0 0.0 4:30.61 nsjail 93 root 20 0 0 0 0 I 0.3 0.0 0:01.22 kworker/7:1-eve+ 1 root 20 0 19028 9232 6024 S 0.0 0.0 0:01.96 systemd 2 root 20 0 0 0 0 S 0.0 0.0 0:00.04 kthreadd 3 root 0 -20 0 0 0 I 0.0 0.0 0:00.00 rcu_gp 4 root 0 -20 0 0 0 I 0.0 0.0 0:00.00 rcu_par_gp 5 root 0 -20 0 0 0 I 0.0 0.0 0:00.00 slub_flushwq 6 root 0 -20 0 0 0 I 0.0 0.0 0:00.00 netns 8 root 0 -20 0 0 0 I 0.0 0.0 0:00.00 kworker/0:0H-ev+ 10 root 0 -20 0 0 0 I 0.0 0.0 0:00.00 mm_percpu_wq |
nsjail 是 Android 用于建立隔离环境,防止进程之间相互干扰的一个沙箱工具,功能类似 Docker 。
应用位于源代码的位置: prebuilts/build-tools/linux-x86/bin/nsjail
Rosetta 转译造成应用运行异常,最简单的方案,就是直接重命名或者删除 prebuilts/build-tools/linux-x86/bin/nsjail,让编译工具找不到 nsjail, 不使用沙箱进行编译即可。
如下:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 |
ubuntu@ubuntu:~/aosp$ mv prebuilts/build-tools/linux-x86/bin/nsjail prebuilts/build-tools/linux-x86/bin/nsjail.old ubuntu@ubuntu:~/aosp$ lunch sdk_phone_arm64-eng 06:58:21 Build sandboxing disabled due to nsjail error. ============================================ PLATFORM_VERSION_CODENAME=REL PLATFORM_VERSION=11 TARGET_PRODUCT=sdk_phone_arm64 TARGET_BUILD_VARIANT=eng TARGET_BUILD_TYPE=release TARGET_ARCH=arm64 TARGET_ARCH_VARIANT=armv8-a TARGET_CPU_VARIANT=generic TARGET_2ND_ARCH=arm TARGET_2ND_ARCH_VARIANT=armv8-a TARGET_2ND_CPU_VARIANT=generic HOST_ARCH=x86_64 HOST_2ND_ARCH=x86 HOST_OS=linux HOST_OS_EXTRA=Linux-5.15.0-86-generic-x86_64-Ubuntu-22.04.3-LTS HOST_CROSS_OS=windows HOST_CROSS_ARCH=x86 HOST_CROSS_2ND_ARCH=x86_64 HOST_BUILD_TYPE=release BUILD_ID=RSV1.210329.100 OUT_DIR=out PRODUCT_SOONG_NAMESPACES=device/generic/goldfish device/generic/goldfish-opengl hardware/google/camera hardware/google/camera/devices/EmulatedCamera device/generic/goldfish device/generic/goldfish-opengl ============================================ |
针对警告 “Build sandboxing disabled due to nsjail error.” 可以直接无视。
如果报错:
1 2 3 4 |
info: A new version of repo is available warning: repo is not tracking a remote branch, so it will not receive updates repo reset: 错误:Entry 'README.md' not uptodate. Cannot merge. 致命错误:不能重置索引文件至版本 'v2.37^0'。 |
则说明当前的 repo 版本太低,需要更新到最新版本。
执行如下命令:
1 2 3 |
$ cd .repo/repo $ git pull |
如果报错:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 |
FAILED: out/target/common/obj/PACKAGING/core_dex_intermediates/classes.dex /bin/bash -c "(mkdir -p out/target/common/obj/PACKAGING/core_dex_intermediates/tmp ) && (rm -f out/target/common/obj/PACKAGING/core_dex_intermediates/classes*.dex out/target/common/obj/PACKAGING/core_dex_intermediates/d8_input.jar ) && (out/soong/host/linux-x86/bin/zip2zip -j -i prebuilts/sdk/current/system/android.jar -o out/target/common/obj/PACKAGING/core_dex_intermediates/d8_input.jar \"**/*.class\" ) && (out/soong/host/linux-x86/bin/d8 -JXms16M -JXmx2048M -JXX:OnError='cat hs_err_pid%p.log' -JXX:CICompilerCount=6 -JXX:+UseDynamicNumberOfGCThreads --output out/target/common/obj/PACKAGING/core_dex_intermediates/tmp --min-api 1000 out/target/common/obj/PACKAGING/core_dex_intermediates/d8_input.jar ) && (mv out/target/common/obj/PACKAGING/core_dex_intermediates/tmp/* out/target/common/obj/PACKAGING/core_dex_intermediates/ ) && (rm -f out/target/common/obj/PACKAGING/core_dex_intermediates/d8_input.jar ) && (rm -rf out/target/common/obj/PACKAGING/core_dex_intermediates/tmp )" Warning: An API level of 1000 is not supported by this compiler. Please use an API level of 30 or earlier # # A fatal error has been detected by the Java Runtime Environment: # # SIGSEGV (0xb) at pc=0x00007ffffeca1af0, pid=503429, tid=508159 # # JRE version: OpenJDK Runtime Environment (11.0.4) (build 11.0.4+0-5935077) # Java VM: OpenJDK 64-Bit Server VM (11.0.4+0-5935077, mixed mode, tiered, compressed oops, g1 gc, linux-amd64) # Problematic frame: # V [libjvm.so+0x6a1af0] void G1ParScanThreadState::do_oop_evac<oopDesc*>(oopDesc**)+0x10 # # Core dump will be written. Default location: Core dumps may be processed with "/usr/share/apport/apport -p%p -s%s -c%c -d%d -P%P -u%u -g%g -- %E" (or dumping to /home/ubuntu/aosp/core.503429) # # An error report file with more information is saved as: # /home/ubuntu/aosp/hs_err_pid503429.log # # If you would like to submit a bug report, please visit: # http://bugreport.java.com/bugreport/crash.jsp # # # -XX:OnError="cat hs_err_pid%p.log" # Executing /bin/sh -c "cat hs_err_pid503429.log" ... # # A fatal error has been detected by the Java Runtime Environment: # # SIGSEGV (0xb) at pc=0x00007ffffeca1af0, pid=503429, tid=508159 # # JRE version: OpenJDK Runtime Environment (11.0.4) (build 11.0.4+0-5935077) # Java VM: OpenJDK 64-Bit Server VM (11.0.4+0-5935077, mixed mode, tiered, compressed oops, g1 gc, linux-amd64) # Problematic frame: # V [libjvm.so+0x6a1af0] void G1ParScanThreadState::do_oop_evac<oopDesc*>(oopDesc**)+0x10 # # Core dump will be written. Default location: Core dumps may be processed with "/usr/share/apport/apport -p%p -s%s -c%c -d%d -P%P -u%u -g%g -- %E" (or dumping to /home/ubuntu/aosp/core.503429) # # If you would like to submit a bug report, please visit: # http://bugreport.java.com/bugreport/crash.jsp # --------------- S U M M A R Y ------------ Command Line: -Xms16M -Xmx2048M -XX:OnError=cat hs_err_pid%p.log -XX:CICompilerCount=6 -XX:+UseDynamicNumberOfGCThreads com.android.tools.r8.D8 --output out/target/common/obj/PACKAGING/core_dex_intermediates/tmp --min-api 1000 out/target/common/obj/PACKAGING/core_dex_intermediates/d8_input.jar Host: x86_64, 12 cores, 25G, Ubuntu 22.04.3 LTS Time: Thu Oct 19 08:39:10 2023 UTC elapsed time: 39 seconds (0d 0h 0m 39s) --------------- T H R E A D --------------- Current thread (0x00007fffc4162800): GCTaskThread "GC Thread#7" [stack: 0x00007fff961ea000,0x00007fff962ea000] [id=508159] Stack: [0x00007fff961ea000,0x00007fff962ea000], sp=0x00007fff962e8bc0, free space=1018k Native frames: (J=compiled Java code, A=aot compiled Java code, j=interpreted, Vv=VM code, C=native code) V [libjvm.so+0x6a1af0] void G1ParScanThreadState::do_oop_evac<oopDesc*>(oopDesc**)+0x10 V [libjvm.so+0x69f2dc] G1ParEvacuateFollowersClosure::do_void()+0xdc V [libjvm.so+0x6a30d6] G1ParTask::work(unsigned int)+0x146 V [libjvm.so+0xc66bdd] GangWorker::loop()+0x4d V [libjvm.so+0xbd7750] Thread::call_run()+0x60 V [libjvm.so+0xa824fe] thread_native_entry(Thread*)+0x1ce siginfo: si_signo: 11 (SIGSEGV), si_code: 1 (SEGV_MAPERR), si_addr: 0x0000000000000000 .................................................. 7ffffd8ff000-7ffffda00000 rw-p 00000000 00:00 0 7ffffda00000-7ffffda1b000 r-xp 00000000 fc:02 11824118 /home/ubuntu/aosp/prebuilts/jdk/jdk11/linux-x86/lib/libzip.so 7ffffda1b000-7ffffdc1b000 ---p 0001b000 fc:02 11824118 /home/ubuntu/aosp/prebuilts/jdk/jdk11/linux-x86/lib/libzip.so 7ffffdc1b000-7ffffdc1c000 r--p 0001b000 fc:02 11824118 /home/ubuntu/aosp/prebuilts/jdk/jdk11/linux-x86/lib/libzip.so 7ffffdc1c000-7ffffdc1d000 rw-p 0001c000 fc:02 11824118 /home/ubuntu/aosp/prebuilts/jdk/jdk11/linux-x86/lib/libzip.so 7ffffdc27000-7ffffdc7e000 r--p 00000000 fc:02 12059906 /usr/lib/locale/C.utf8/LC_CTYPE 7ffffdc7e000-7ffffde00000 rw-p 00000000 00:00 0 7ffffde00000-7ffffde25000 r-xp 00000000 fc:02 11824096 /home/ubuntu/aosp/prebuilts/jdk/jdk11/linux-x86/lib/libjava.so 7ffffde25000-7ffffe025000 ---p 00025000 fc:02 11824096 /home/ubuntu/aosp/prebuilts/jdk/jdk11/linux-x86/lib/libjava.so 7ffffe025000-7ffffe026000 r--p 00025000 fc:02 11824096 /home/ubuntu/aosp/prebuilts/jdk/jdk11/linux-x86/lib/libjava.so 7ffffe026000-7ffffe027000 rw-p 00026000 fc:02 11824096 /home/ubuntu/aosp/prebuilts/jdk/jdk11/linux-x86/lib/libjava.so .................................................. Memory: 4k page, physical 26627212k(4172424k free), swap 8388604k(8384596k free) vm_info: OpenJDK 64-Bit Server VM (11.0.4+0-5935077) for linux-amd64 JRE (11.0.4+0-5935077), built on Oct 11 2019 19:04:17 by "androidbuild" with gcc 4.2.1 Compatible Android (5657785 based on r353983d) Clang 9.0.4 (https://android.googlesource.com/toolchain/llvm-project 2a90cc9d899e6fe6dcf0da193244b25f75735c7b) .................................................. |
报错内容提示的是 OpenJDK 64-Bit Server VM (11.0.4+0-5935077) for linux-amd64 运行异常。
而 Java 代码完全可以使用 ARM64 版本的 Java 进行编译。
我们可以链接 ARM64 的 Java 编译器到指定的目录,执行如下命令:
1 2 3 4 5 6 7 8 9 10 |
ubuntu@ubuntu:~/aosp$ sudo apt install openjdk-11-jdk ubuntu@ubuntu:~/aosp$ mv prebuilts/jdk/jdk11/linux-x86/bin prebuilts/jdk/jdk11/linux-x86/bin.bak ubuntu@ubuntu:~/aosp$ ln -s /usr/lib/jvm/java-11-openjdk-arm64/bin prebuilts/jdk/jdk11/linux-x86/bin # 此处,我们需要完整删除以前构建残留,否则可能会发生后续无法链接文件的问题 ubuntu@ubuntu:~/aosp$ rm -rf out ubuntu@ubuntu:~/aosp$ m |
接下来就是长时间卡住在 link 命令,结束不了,如下:
1 2 3 4 5 6 7 8 9 10 |
[ 82% 93325/112509] //system/libhidl:libhidlbase link libhidlbase.so [com.android.media.swcodec] 80:55 //system/libhidl:libhidlbase link libhidlbase.so 8:47 //external/perfetto:libperfetto link libperfetto.so 7:50 //external/perfetto:heapprofd link heapprofd 7:50 //external/perfetto:heapprofd_client link heapprofd_client.so 7:49 //external/perfetto:heapprofd_client link heapprofd_client.so [arm] 7:47 //external/vixl:libvixl link libvixl.so [com.android.art.debug] 7:46 //external/vixl:libvixl link libvixl.so [arm com.android.art.debug] 7:41 //frameworks/av/media/extractors/mpeg2:libmpeg2extractor link libmpeg2extractor.so [com.android.media] 7:41 //frameworks/ml/nn/runtime:libneuralnetworks link libneuralnetworks.so [com.android.neuralnetworks] |
观察构建日志,会发现在如下命令卡住:
1 2 3 4 5 6 7 8 |
ubuntu@ubuntu:~/aosp$ cat out/soong.log ....................................................................... | | `-ld.lld,772339 /home/ubuntu/aosp/prebuilts/clang/host/linux-x86/clang-r383902b/bin/ld.lld -z noexecstack -EL --fix-cortex-a53-843419 --warn-shared-textrel -z now -z relro -z max-page-size=4096 --hash-style=gnu --enable-new-dtags --eh-frame-hdr -m aarch64linux -shared -o out/soong/.intermediates/system/libhidl/libhidlbase/android_vendor.30_arm64_armv8-a_shared/unstripped/libhidlbase.so -L/home/ubuntu/aosp/prebuilts/clang/host/linux-x86/clang-r383902b/lib64/clang/11.0.2/lib/linux/aarch64 -L/home/ubuntu/aosp/prebuilts/clang/host/linux-x86/clang-r383902b/bin/../lib64 -L/home/ubuntu/aosp/prebuilts/clang/host/linux-x86/clang-r383902b/bin/../lib -L/lib -L/usr/lib out/soong/.intermediates/bionic/libc/crtbegin_so/android_vendor.30_arm64_armv8-a/crtbegin_so.o out/soong/.intermediates/system/libhidl/libhidlbase/android_vendor.30_arm64_armv8-a_static/obj/system/libhidl/base/HidlInternal.o out/soong/.intermediates/system/libhidl/libhidlbase/android_vendor.30_arm64_armv8-a_static/obj/system/libhidl/base/HidlSupport.o out/soong/.intermediates/system/libhidl/libhidlbase/android_vendor.30_arm64_armv8-a_static/obj/system/libhidl/base/Status.o out/soong/.intermediates/system/libhidl/libhidlbase/android_vendor.30_arm64_armv8-a_static/obj/system/libhidl/base/TaskRunner.o out/soong/.intermediates/system/libhidl/libhidlbase/android_vendor.30_arm64_armv8-a_static/obj/system/libhidl/transport/HidlBinderSupport.o out/soong/.intermediates/system/libhidl/libhidlbase/android_vendor.30_arm64_armv8-a_static/obj/system/libhidl/transport/HidlLazyUtils.o out/soong/.intermediates/system/libhidl/libhidlbase/android_vendor.30_arm64_armv8-a_static/obj/system/libhidl/transport/HidlPassthroughSupport.o out/soong/.intermediates/system/libhidl/libhidlbase/android_vendor.30_arm64_armv8-a_static/obj/system/libhidl/transport/HidlTransportSupport.o out/soong/.intermediates/system/libhidl/libhidlbase/android_vendor.30_arm64_armv8-a_static/obj/system/libhidl/transport/HidlTransportUtils.o out/soong/.intermediates/system/libhidl/libhidlbase/android_vendor.30_arm64_armv8-a_static/obj/system/libhidl/transport/LegacySupport.o out/soong/.intermediates/system/libhidl/libhidlbase/android_vendor.30_arm64_armv8-a_static/obj/system/libhidl/transport/ServiceManagement.o out/soong/.intermediates/system/libhidl/libhidlbase/android_vendor.30_arm64_armv8-a_static/obj/system/libhidl/transport/Static.o out/soong/.intermediates/system/libhidl/libhidlbase/android_vendor.30_arm64_armv8-a_static/obj/.intermediates/system/libhidl/transport/manager/1.0/android.hidl.manager@1.0_genc++/gen/android/hidl/manager/1.0/ServiceManagerAll.o out/soong/.intermediates/system/libhidl/libhidlbase/android_vendor.30_arm64_armv8-a_static/obj/.intermediates/system/libhidl/transport/manager/1.0/android.hidl.manager@1.0_genc++/gen/android/hidl/manager/1.0/ServiceNotificationAll.o out/soong/.intermediates/system/libhidl/libhidlbase/android_vendor.30_arm64_armv8-a_static/obj/.intermediates/system/libhidl/transport/manager/1.1/android.hidl.manager@1.1_genc++/gen/android/hidl/manager/1.1/ServiceManagerAll.o out/soong/.intermediates/system/libhidl/libhidlbase/android_vendor.30_arm64_armv8-a_static/obj/.intermediates/system/libhidl/transport/manager/1.2/android.hidl.manager@1.2_genc++/gen/android/hidl/manager/1.2/ClientCallbackAll.o out/soong/.intermediates/system/libhidl/libhidlbase/android_vendor.30_arm64_armv8-a_static/obj/.intermediates/system/libhidl/transport/manager/1.2/android.hidl.manager@1.2_genc++/gen/android/hidl/manager/1.2/ServiceManagerAll.o out/soong/.intermediates/system/libhidl/libhidlbase/android_vendor.30_arm64_armv8-a_static/obj/.intermediates/system/libhidl/transport/base/1.0/android.hidl.base@1.0_genc++/gen/android/hidl/base/1.0/BaseAll.o out/soong/.intermediates/system/libhidl/libhidlbase/android_vendor.30_arm64_armv8-a_static/obj/.intermediates/system/libhidl/transport/base/1.0/android.hidl.base@1.0_genc++/gen/android/hidl/base/1.0/types.o prebuilts/clang/host/linux-x86/clang-r383902b/lib64/clang/11.0.2/lib/linux/libclang_rt.ubsan_minimal-aarch64-android.a --whole-archive out/soong/.intermediates/system/libhwbinder/libhwbinder-impl-internal/android_vendor.30_arm64_armv8-a_static/libhwbinder-impl-internal.a --no-whole-archive out/soong/.intermediates/system/libhwbinder/libhwbinder-impl-internal/android_vendor.30_arm64_armv8-a_static/libhwbinder-impl-internal.a out/soong/.intermediates/external/libcxxabi/libc++demangle/android_vendor.30_arm64_armv8-a_static/libc++demangle.a prebuilts/clang/host/linux-x86/clang-r383902b/lib64/clang/11.0.2/lib/linux/libclang_rt.builtins-aarch64-android.a prebuilts/gcc/linux-x86/aarch64/aarch64-linux-android-4.9/aarch64-linux-android/lib64/libatomic.a out/soong/.intermediates/system/core/base/libbase/android_vendor.30_arm64_armv8-a_shared/libbase.so out/soong/.intermediates/system/core/liblog/liblog.llndk/android_vendor.30_arm64_armv8-a_shared/liblog.so out/soong/.intermediates/system/core/libutils/libutils/android_vendor.30_arm64_armv8-a_shared/libutils.so out/soong/.intermediates/system/core/libcutils/libcutils/android_vendor.30_arm64_armv8-a_shared/libcutils.so out/soong/.intermediates/system/core/libvndksupport/libvndksupport.llndk/android_vendor.30_arm64_armv8-a_shared/libvndksupport.so out/soong/.intermediates/external/libcxx/libc++/android_vendor.30_arm64_armv8-a_shared/libc++.so out/soong/.intermediates/bionic/libc/libc.llndk/android_vendor.30_arm64_armv8-a_shared/libc.so out/soong/.intermediates/bionic/libm/libm.llndk/android_vendor.30_arm64_armv8-a_shared/libm.so out/soong/.intermediates/bionic/libdl/libdl.llndk/android_vendor.30_arm64_armv8-a_shared/libdl.so out/soong/.intermediates/bionic/libc/crtend_so/android_vendor.30_arm64_armv8-a/obj/bionic/libc/arch-common/bionic/crtend_so.o -z noexecstack -z relro -z now --build-id=md5 --warn-shared-textrel --fatal-warnings --no-undefined-version --exclude-libs libgcc.a --exclude-libs libgcc_stripped.a --exclude-libs libunwind_llvm.a --pack-dyn-relocs=android+relr --use-android-relr-tags --no-undefined --hash-style=gnu -z separate-code --icf=safe -z max-page-size=4096 --exclude-libs=libclang_rt.builtins-aarch64-android.a --gc-sections -soname libhidlbase.so prebuilts/clang/host/linux-x86/clang-r383902b/lib64/clang/11.0.2/lib/linux/libclang_rt.ubsan_minimal-aarch64-android.a --exclude-libs libclang_rt.ubsan_minimal-aarch64-android.a --exclude-libs libclang_rt.ubsan_minimal-aarch64-android.a | `-sh,774089 -c prebuilts/clang/host/linux-x86/clang-r383902b/bin/clang++ out/soong/.intermediates/bionic/libc/crtbegin_so/android_vendor.30_arm64_armv8-a_com.android.media.swcodec/crtbegin_so.o @out/soong/.intermediates/system/libhidl/libhidlbase/android_vendor.30_arm64_armv8-a_shared_com.android.media.swcodec/unstripped/libhidlbase.so.rsp prebuilts/clang/host/linux-x86/clang-r383902b/lib64/clang/11.0.2/lib/linux/libclang_rt.ubsan_minimal-aarch64-android.a -Wl,--whole-archive out/soong/.intermediates/system/libhwbinder/libhwbinder-impl-internal/android_vendor.30_arm64_armv8-a_static_com.android.media.swcodec/libhwbinder-impl-internal.a -Wl,--no-whole-archive out/soong/.intermediates/system/libhwbinder/libhwbinder-impl-internal/android_vendor.30_arm64_armv8-a_static_com.android.media.swcodec/libhwbinder-impl-internal.a out/soong/.intermediates/external/libcxxabi/libc++demangle/android_vendor.30_arm64_armv8-a_static_com.android.media.swcodec/libc++demangle.a out/soong/.intermediates/build/soong/libgcc_stripped/android_vendor.30_arm64_armv8-a_static_com.android.media.swcodec/libgcc_stripped.a prebuilts/clang/host/linux-x86/clang-r383902b/lib64/clang/11.0.2/lib/linux/libclang_rt.builtins-aarch64-android.a prebuilts/gcc/linux-x86/aarch64/aarch64-linux-android-4.9/aarch64-linux-android/lib64/libatomic.a out/soong/.intermediates/system/core/base/libbase/android_vendor.30_arm64_armv8-a_shared_com.android.media.swcodec/libbase.so out/soong/.intermediates/system/core/liblog/liblog.llndk/android_vendor.30_arm64_armv8-a_shared_29/liblog.so out/soong/.intermediates/system/core/libutils/libutils/android_vendor.30_arm64_armv8-a_shared_com.android.media.swcodec/libutils.so out/soong/.intermediates/system/core/libcutils/libcutils/android_vendor.30_arm64_armv8-a_shared_com.android.media.swcodec/libcutils.so out/soong/.intermediates/system/core/libvndksupport/libvndksupport.llndk/android_vendor.30_arm64_armv8-a_shared_29/libvndksupport.so out/soong/.intermediates/external/libcxx/libc++/android_vendor.30_arm64_armv8-a_shared_com.android.media.swcodec/libc++.so out/soong/.intermediates/bionic/libc/libc.llndk/android_vendor.30_arm64_armv8-a_shared_29/libc.so out/soong/.intermediates/bionic/libm/libm.llndk/android_vendor.30_arm64_armv8-a_shared_29/libm.so out/soong/.intermediates/bionic/libdl/libdl.llndk/android_vendor.30_arm64_armv8-a_shared_29/libdl.so out/soong/.intermediates/bionic/libc/crtend_so/android_vendor.30_arm64_armv8-a_com.android.media.swcodec/obj/bionic/libc/arch-common/bionic/crtend_so.o -o out/soong/.intermediates/system/libhidl/libhidlbase/android_vendor.30_arm64_armv8-a_shared_com.android.media.swcodec/unstripped/libhidlbase.so -target aarch64-linux-android30 -Bprebuilts/gcc/linux-x86/aarch64/aarch64-linux-android-4.9/aarch64-linux-android/bin -Wl,-z,noexecstack -Wl,-z,relro -Wl,-z,now -Wl,--build-id=md5 -Wl,--warn-shared-textrel -Wl,--fatal-warnings -Wl,--no-undefined-version -Wl,--exclude-libs,libgcc.a -Wl,--exclude-libs,libgcc_stripped.a -Wl,--exclude-libs,libunwind_llvm.a -fuse-ld=lld -Wl,--pack-dyn-relocs=android+relr -Wl,--use-android-relr-tags -Wl,--no-undefined -Wl,--hash-style=gnu -Wl,-z,separate-code -Wl,--icf=safe -Wl,-z,max-page-size=4096 -Wl,--exclude-libs=libclang_rt.builtins-aarch64-android.a -nostdlib -Wl,--gc-sections -shared -Wl,-soname,libhidlbase.so prebuilts/clang/host/linux-x86/clang-r383902b/lib64/clang/11.0.2/lib/linux/libclang_rt.ubsan_minimal-aarch64-android.a -Wl,--exclude-libs,libclang_rt.ubsan_minimal-aarch64-android.a -Wl,--exclude-libs,libclang_rt.ubsan_minimal-aarch64-android.a | `-clang++.real,774090 prebuilts/clang/host/linux-x86/clang-r383902b/bin/clang++.real out/soong/.intermediates/bionic/libc/crtbegin_so/android_vendor.30_arm64_armv8-a_com.android.media.swcodec/crtbegin_so.o @out/soong/.intermediates/system/libhidl/libhidlbase/android_vendor.30_arm64_armv8-a_shared_com.android.media.swcodec/unstripped/libhidlbase.so.rsp prebuilts/clang/host/linux-x86/clang-r383902b/lib64/clang/11.0.2/lib/linux/libclang_rt.ubsan_minimal-aarch64-android.a -Wl,--whole-archive out/soong/.intermediates/system/libhwbinder/libhwbinder-impl-internal/android_vendor.30_arm64_armv8-a_static_com.android.media.swcodec/libhwbinder-impl-internal.a -Wl,--no-whole-archive out/soong/.intermediates/system/libhwbinder/libhwbinder-impl-internal/android_vendor.30_arm64_armv8-a_static_com.android.media.swcodec/libhwbinder-impl-internal.a out/soong/.intermediates/external/libcxxabi/libc++demangle/android_vendor.30_arm64_armv8-a_static_com.android.media.swcodec/libc++demangle.a out/soong/.intermediates/build/soong/libgcc_stripped/android_vendor.30_arm64_armv8-a_static_com.android.media.swcodec/libgcc_stripped.a prebuilts/clang/host/linux-x86/clang-r383902b/lib64/clang/11.0.2/lib/linux/libclang_rt.builtins-aarch64-android.a prebuilts/gcc/linux-x86/aarch64/aarch64-linux-android-4.9/aarch64-linux-android/lib64/libatomic.a out/soong/.intermediates/system/core/base/libbase/android_vendor.30_arm64_armv8-a_shared_com.android.media.swcodec/libbase.so out/soong/.intermediates/system/core/liblog/liblog.llndk/android_vendor.30_arm64_armv8-a_shared_29/liblog.so out/soong/.intermediates/system/core/libutils/libutils/android_vendor.30_arm64_armv8-a_shared_com.android.media.swcodec/libutils.so out/soong/.intermediates/system/core/libcutils/libcutils/android_vendor.30_arm64_armv8-a_shared_com.android.media.swcodec/libcutils.so out/soong/.intermediates/system/core/libvndksupport/libvndksupport.llndk/android_vendor.30_arm64_armv8-a_shared_29/libvndksupport.so out/soong/.intermediates/external/libcxx/libc++/android_vendor.30_arm64_armv8-a_shared_com.android.media.swcodec/libc++.so out/soong/.intermediates/bionic/libc/libc.llndk/android_vendor.30_arm64_armv8-a_shared_29/libc.so out/soong/.intermediates/bionic/libm/libm.llndk/android_vendor.30_arm64_armv8-a_shared_29/libm.so out/soong/.intermediates/bionic/libdl/libdl.llndk/android_vendor.30_arm64_armv8-a_shared_29/libdl.so out/soong/.intermediates/bionic/libc/crtend_so/android_vendor.30_arm64_armv8-a_com.android.media.swcodec/obj/bionic/libc/arch-common/bionic/crtend_so.o -o out/soong/.intermediates/system/libhidl/libhidlbase/android_vendor.30_arm64_armv8-a_shared_com.android.media.swcodec/unstripped/libhidlbase.so -target aarch64-linux-android30 -Bprebuilts/gcc/linux-x86/aarch64/aarch64-linux-android-4.9/aarch64-linux-android/bin -Wl,-z,noexecstack -Wl,-z,relro -Wl,-z,now -Wl,--build-id=md5 -Wl,--warn-shared-textrel -Wl,--fatal-warnings -Wl,--no-undefined-version -Wl,--exclude-libs,libgcc.a -Wl,--exclude-libs,libgcc_stripped.a -Wl,--exclude-libs,libunwind_llvm.a -fuse-ld=lld -Wl,--pack-dyn-relocs=android+relr -Wl,--use-android-relr-tags -Wl,--no-undefined -Wl,--hash-style=gnu -Wl,-z,separate-code -Wl,--icf=safe -Wl,-z,max-page-size=4096 -Wl,--exclude-libs=libclang_rt.builtins-aarch64-android.a -nostdlib -Wl,--gc-sections -shared -Wl,-soname,libhidlbase.so prebuilts/clang/host/linux-x86/clang-r383902b/lib64/clang/11.0.2/lib/linux/libclang_rt.ubsan_minimal-aarch64-android.a -Wl,--exclude-libs,libclang_rt.ubsan_minimal-aarch64-android.a -Wl,--exclude-libs,libclang_rt.ubsan_minimal-aarch64-android.a | `-ld.lld,774095 /home/ubuntu/aosp/prebuilts/clang/host/linux-x86/clang-r383902b/bin/ld.lld -z noexecstack -EL --fix-cortex-a53-843419 --warn-shared-textrel -z now -z relro -z max-page-size=4096 --hash-style=gnu --enable-new-dtags --eh-frame-hdr -m aarch64linux -shared -o out/soong/.intermediates/system/libhidl/libhidlbase/android_vendor.30_arm64_armv8-a_shared_com.android.media.swcodec/unstripped/libhidlbase.so -L/home/ubuntu/aosp/prebuilts/clang/host/linux-x86/clang-r383902b/lib64/clang/11.0.2/lib/linux/aarch64 -L/home/ubuntu/aosp/prebuilts/clang/host/linux-x86/clang-r383902b/bin/../lib64 -L/home/ubuntu/aosp/prebuilts/clang/host/linux-x86/clang-r383902b/bin/../lib -L/lib -L/usr/lib out/soong/.intermediates/bionic/libc/crtbegin_so/android_vendor.30_arm64_armv8-a_com.android.media.swcodec/crtbegin_so.o out/soong/.intermediates/system/libhidl/libhidlbase/android_vendor.30_arm64_armv8-a_static_com.android.media.swcodec/obj/system/libhidl/base/HidlInternal.o out/soong/.intermediates/system/libhidl/libhidlbase/android_vendor.30_arm64_armv8-a_static_com.android.media.swcodec/obj/system/libhidl/base/HidlSupport.o out/soong/.intermediates/system/libhidl/libhidlbase/android_vendor.30_arm64_armv8-a_static_com.android.media.swcodec/obj/system/libhidl/base/Status.o out/soong/.intermediates/system/libhidl/libhidlbase/android_vendor.30_arm64_armv8-a_static_com.android.media.swcodec/obj/system/libhidl/base/TaskRunner.o out/soong/.intermediates/system/libhidl/libhidlbase/android_vendor.30_arm64_armv8-a_static_com.android.media.swcodec/obj/system/libhidl/transport/HidlBinderSupport.o out/soong/.intermediates/system/libhidl/libhidlbase/android_vendor.30_arm64_armv8-a_static_com.android.media.swcodec/obj/system/libhidl/transport/HidlLazyUtils.o out/soong/.intermediates/system/libhidl/libhidlbase/android_vendor.30_arm64_armv8-a_static_com.android.media.swcodec/obj/system/libhidl/transport/HidlPassthroughSupport.o out/soong/.intermediates/system/libhidl/libhidlbase/android_vendor.30_arm64_armv8-a_static_com.android.media.swcodec/obj/system/libhidl/transport/HidlTransportSupport.o out/soong/.intermediates/system/libhidl/libhidlbase/android_vendor.30_arm64_armv8-a_static_com.android.media.swcodec/obj/system/libhidl/transport/HidlTransportUtils.o out/soong/.intermediates/system/libhidl/libhidlbase/android_vendor.30_arm64_armv8-a_static_com.android.media.swcodec/obj/system/libhidl/transport/LegacySupport.o out/soong/.intermediates/system/libhidl/libhidlbase/android_vendor.30_arm64_armv8-a_static_com.android.media.swcodec/obj/system/libhidl/transport/ServiceManagement.o out/soong/.intermediates/system/libhidl/libhidlbase/android_vendor.30_arm64_armv8-a_static_com.android.media.swcodec/obj/system/libhidl/transport/Static.o out/soong/.intermediates/system/libhidl/libhidlbase/android_vendor.30_arm64_armv8-a_static_com.android.media.swcodec/obj/.intermediates/system/libhidl/transport/manager/1.0/android.hidl.manager@1.0_genc++/gen/android/hidl/manager/1.0/ServiceManagerAll.o out/soong/.intermediates/system/libhidl/libhidlbase/android_vendor.30_arm64_armv8-a_static_com.android.media.swcodec/obj/.intermediates/system/libhidl/transport/manager/1.0/android.hidl.manager@1.0_genc++/gen/android/hidl/manager/1.0/ServiceNotificationAll.o out/soong/.intermediates/system/libhidl/libhidlbase/android_vendor.30_arm64_armv8-a_static_com.android.media.swcodec/obj/.intermediates/system/libhidl/transport/manager/1.1/android.hidl.manager@1.1_genc++/gen/android/hidl/manager/1.1/ServiceManagerAll.o out/soong/.intermediates/system/libhidl/libhidlbase/android_vendor.30_arm64_armv8-a_static_com.android.media.swcodec/obj/.intermediates/system/libhidl/transport/manager/1.2/android.hidl.manager@1.2_genc++/gen/android/hidl/manager/1.2/ClientCallbackAll.o out/soong/.intermediates/system/libhidl/libhidlbase/android_vendor.30_arm64_armv8-a_static_com.android.media.swcodec/obj/.intermediates/system/libhidl/transport/manager/1.2/android.hidl.manager@1.2_genc++/gen/android/hidl/manager/1.2/ServiceManagerAll.o out/soong/.intermediates/system/libhidl/libhidlbase/android_vendor.30_arm64_armv8-a_static_com.android.media.swcodec/obj/.intermediates/system/libhidl/transport/base/1.0/android.hidl.base@1.0_genc++/gen/android/hidl/base/1.0/BaseAll.o out/soong/.intermediates/system/libhidl/libhidlbase/android_vendor.30_arm64_armv8-a_static_com.android.media.swcodec/obj/.intermediates/system/libhidl/transport/base/1.0/android.hidl.base@1.0_genc++/gen/android/hidl/base/1.0/types.o prebuilts/clang/host/linux-x86/clang-r383902b/lib64/clang/11.0.2/lib/linux/libclang_rt.ubsan_minimal-aarch64-android.a --whole-archive out/soong/.intermediates/system/libhwbinder/libhwbinder-impl-internal/android_vendor.30_arm64_armv8-a_static_com.android.media.swcodec/libhwbinder-impl-internal.a --no-whole-archive out/soong/.intermediates/system/libhwbinder/libhwbinder-impl-internal/android_vendor.30_arm64_armv8-a_static_com.android.media.swcodec/libhwbinder-impl-internal.a out/soong/.intermediates/external/libcxxabi/libc++demangle/android_vendor.30_arm64_armv8-a_static_com.android.media.swcodec/libc++demangle.a out/soong/.intermediates/build/soong/libgcc_stripped/android_vendor.30_arm64_armv8-a_static_com.android.media.swcodec/libgcc_stripped.a prebuilts/clang/host/linux-x86/clang-r383902b/lib64/clang/11.0.2/lib/linux/libclang_rt.builtins-aarch64-android.a prebuilts/gcc/linux-x86/aarch64/aarch64-linux-android-4.9/aarch64-linux-android/lib64/libatomic.a out/soong/.intermediates/system/core/base/libbase/android_vendor.30_arm64_armv8-a_shared_com.android.media.swcodec/libbase.so out/soong/.intermediates/system/core/liblog/liblog.llndk/android_vendor.30_arm64_armv8-a_shared_29/liblog.so out/soong/.intermediates/system/core/libutils/libutils/android_vendor.30_arm64_armv8-a_shared_com.android.media.swcodec/libutils.so out/soong/.intermediates/system/core/libcutils/libcutils/android_vendor.30_arm64_armv8-a_shared_com.android.media.swcodec/libcutils.so out/soong/.intermediates/system/core/libvndksupport/libvndksupport.llndk/android_vendor.30_arm64_armv8-a_shared_29/libvndksupport.so out/soong/.intermediates/external/libcxx/libc++/android_vendor.30_arm64_armv8-a_shared_com.android.media.swcodec/libc++.so out/soong/.intermediates/bionic/libc/libc.llndk/android_vendor.30_arm64_armv8-a_shared_29/libc.so out/soong/.intermediates/bionic/libm/libm.llndk/android_vendor.30_arm64_armv8-a_shared_29/libm.so out/soong/.intermediates/bionic/libdl/libdl.llndk/android_vendor.30_arm64_armv8-a_shared_29/libdl.so out/soong/.intermediates/bionic/libc/crtend_so/android_vendor.30_arm64_armv8-a_com.android.media.swcodec/obj/bionic/libc/arch-common/bionic/crtend_so.o -z noexecstack -z relro -z now --build-id=md5 --warn-shared-textrel --fatal-warnings --no-undefined-version --exclude-libs libgcc.a --exclude-libs libgcc_stripped.a --exclude-libs libunwind_llvm.a --pack-dyn-relocs=android+relr --use-android-relr-tags --no-undefined --hash-style=gnu -z separate-code --icf=safe -z max-page-size=4096 --exclude-libs=libclang_rt.builtins-aarch64-android.a --gc-sections -soname libhidlbase.so prebuilts/clang/host/linux-x86/clang-r383902b/lib64/clang/11.0.2/lib/linux/libclang_rt.ubsan_minimal-aarch64-android.a --exclude-libs libclang_rt.ubsan_minimal-aarch64-android.a --exclude-libs libclang_rt.ubsan_minimal-aarch64-android.a |
我们手工执行这些卡住的命令,也是照样卡住,如下:
1 |
ubuntu@ubuntu:~/aosp$ /home/ubuntu/aosp/prebuilts/clang/host/linux-x86/clang-r383902b/bin/ld.lld -z noexecstack -EL --fix-cortex-a53-843419 --warn-shared-textrel -z now -z relro -z max-page-size=4096 --hash-style=gnu --enable-new-dtags --eh-frame-hdr -m aarch64linux -shared -o out/soong/.intermediates/system/libhidl/libhidlbase/android_vendor.30_arm64_armv8-a_shared_com.android.media.swcodec/unstripped/libhidlbase.so -L/home/ubuntu/aosp/prebuilts/clang/host/linux-x86/clang-r383902b/lib64/clang/11.0.2/lib/linux/aarch64 -L/home/ubuntu/aosp/prebuilts/clang/host/linux-x86/clang-r383902b/bin/../lib64 -L/home/ubuntu/aosp/prebuilts/clang/host/linux-x86/clang-r383902b/bin/../lib -L/lib -L/usr/lib out/soong/.intermediates/bionic/libc/crtbegin_so/android_vendor.30_arm64_armv8-a_com.android.media.swcodec/crtbegin_so.o out/soong/.intermediates/system/libhidl/libhidlbase/android_vendor.30_arm64_armv8-a_static_com.android.media.swcodec/obj/system/libhidl/base/HidlInternal.o out/soong/.intermediates/system/libhidl/libhidlbase/android_vendor.30_arm64_armv8-a_static_com.android.media.swcodec/obj/system/libhidl/base/HidlSupport.o out/soong/.intermediates/system/libhidl/libhidlbase/android_vendor.30_arm64_armv8-a_static_com.android.media.swcodec/obj/system/libhidl/base/Status.o out/soong/.intermediates/system/libhidl/libhidlbase/android_vendor.30_arm64_armv8-a_static_com.android.media.swcodec/obj/system/libhidl/base/TaskRunner.o out/soong/.intermediates/system/libhidl/libhidlbase/android_vendor.30_arm64_armv8-a_static_com.android.media.swcodec/obj/system/libhidl/transport/HidlBinderSupport.o out/soong/.intermediates/system/libhidl/libhidlbase/android_vendor.30_arm64_armv8-a_static_com.android.media.swcodec/obj/system/libhidl/transport/HidlLazyUtils.o out/soong/.intermediates/system/libhidl/libhidlbase/android_vendor.30_arm64_armv8-a_static_com.android.media.swcodec/obj/system/libhidl/transport/HidlPassthroughSupport.o out/soong/.intermediates/system/libhidl/libhidlbase/android_vendor.30_arm64_armv8-a_static_com.android.media.swcodec/obj/system/libhidl/transport/HidlTransportSupport.o out/soong/.intermediates/system/libhidl/libhidlbase/android_vendor.30_arm64_armv8-a_static_com.android.media.swcodec/obj/system/libhidl/transport/HidlTransportUtils.o out/soong/.intermediates/system/libhidl/libhidlbase/android_vendor.30_arm64_armv8-a_static_com.android.media.swcodec/obj/system/libhidl/transport/LegacySupport.o out/soong/.intermediates/system/libhidl/libhidlbase/android_vendor.30_arm64_armv8-a_static_com.android.media.swcodec/obj/system/libhidl/transport/ServiceManagement.o out/soong/.intermediates/system/libhidl/libhidlbase/android_vendor.30_arm64_armv8-a_static_com.android.media.swcodec/obj/system/libhidl/transport/Static.o out/soong/.intermediates/system/libhidl/libhidlbase/android_vendor.30_arm64_armv8-a_static_com.android.media.swcodec/obj/.intermediates/system/libhidl/transport/manager/1.0/android.hidl.manager@1.0_genc++/gen/android/hidl/manager/1.0/ServiceManagerAll.o out/soong/.intermediates/system/libhidl/libhidlbase/android_vendor.30_arm64_armv8-a_static_com.android.media.swcodec/obj/.intermediates/system/libhidl/transport/manager/1.0/android.hidl.manager@1.0_genc++/gen/android/hidl/manager/1.0/ServiceNotificationAll.o out/soong/.intermediates/system/libhidl/libhidlbase/android_vendor.30_arm64_armv8-a_static_com.android.media.swcodec/obj/.intermediates/system/libhidl/transport/manager/1.1/android.hidl.manager@1.1_genc++/gen/android/hidl/manager/1.1/ServiceManagerAll.o out/soong/.intermediates/system/libhidl/libhidlbase/android_vendor.30_arm64_armv8-a_static_com.android.media.swcodec/obj/.intermediates/system/libhidl/transport/manager/1.2/android.hidl.manager@1.2_genc++/gen/android/hidl/manager/1.2/ClientCallbackAll.o out/soong/.intermediates/system/libhidl/libhidlbase/android_vendor.30_arm64_armv8-a_static_com.android.media.swcodec/obj/.intermediates/system/libhidl/transport/manager/1.2/android.hidl.manager@1.2_genc++/gen/android/hidl/manager/1.2/ServiceManagerAll.o out/soong/.intermediates/system/libhidl/libhidlbase/android_vendor.30_arm64_armv8-a_static_com.android.media.swcodec/obj/.intermediates/system/libhidl/transport/base/1.0/android.hidl.base@1.0_genc++/gen/android/hidl/base/1.0/BaseAll.o out/soong/.intermediates/system/libhidl/libhidlbase/android_vendor.30_arm64_armv8-a_static_com.android.media.swcodec/obj/.intermediates/system/libhidl/transport/base/1.0/android.hidl.base@1.0_genc++/gen/android/hidl/base/1.0/types.o prebuilts/clang/host/linux-x86/clang-r383902b/lib64/clang/11.0.2/lib/linux/libclang_rt.ubsan_minimal-aarch64-android.a --whole-archive out/soong/.intermediates/system/libhwbinder/libhwbinder-impl-internal/android_vendor.30_arm64_armv8-a_static_com.android.media.swcodec/libhwbinder-impl-internal.a --no-whole-archive out/soong/.intermediates/system/libhwbinder/libhwbinder-impl-internal/android_vendor.30_arm64_armv8-a_static_com.android.media.swcodec/libhwbinder-impl-internal.a out/soong/.intermediates/external/libcxxabi/libc++demangle/android_vendor.30_arm64_armv8-a_static_com.android.media.swcodec/libc++demangle.a out/soong/.intermediates/build/soong/libgcc_stripped/android_vendor.30_arm64_armv8-a_static_com.android.media.swcodec/libgcc_stripped.a prebuilts/clang/host/linux-x86/clang-r383902b/lib64/clang/11.0.2/lib/linux/libclang_rt.builtins-aarch64-android.a prebuilts/gcc/linux-x86/aarch64/aarch64-linux-android-4.9/aarch64-linux-android/lib64/libatomic.a out/soong/.intermediates/system/core/base/libbase/android_vendor.30_arm64_armv8-a_shared_com.android.media.swcodec/libbase.so out/soong/.intermediates/system/core/liblog/liblog.llndk/android_vendor.30_arm64_armv8-a_shared_29/liblog.so out/soong/.intermediates/system/core/libutils/libutils/android_vendor.30_arm64_armv8-a_shared_com.android.media.swcodec/libutils.so out/soong/.intermediates/system/core/libcutils/libcutils/android_vendor.30_arm64_armv8-a_shared_com.android.media.swcodec/libcutils.so out/soong/.intermediates/system/core/libvndksupport/libvndksupport.llndk/android_vendor.30_arm64_armv8-a_shared_29/libvndksupport.so out/soong/.intermediates/external/libcxx/libc++/android_vendor.30_arm64_armv8-a_shared_com.android.media.swcodec/libc++.so out/soong/.intermediates/bionic/libc/libc.llndk/android_vendor.30_arm64_armv8-a_shared_29/libc.so out/soong/.intermediates/bionic/libm/libm.llndk/android_vendor.30_arm64_armv8-a_shared_29/libm.so out/soong/.intermediates/bionic/libdl/libdl.llndk/android_vendor.30_arm64_armv8-a_shared_29/libdl.so out/soong/.intermediates/bionic/libc/crtend_so/android_vendor.30_arm64_armv8-a_com.android.media.swcodec/obj/bionic/libc/arch-common/bionic/crtend_so.o -z noexecstack -z relro -z now --build-id=md5 --warn-shared-textrel --fatal-warnings --no-undefined-version --exclude-libs libgcc.a --exclude-libs libgcc_stripped.a --exclude-libs libunwind_llvm.a --pack-dyn-relocs=android+relr --use-android-relr-tags --no-undefined --hash-style=gnu -z separate-code --icf=safe -z max-page-size=4096 --exclude-libs=libclang_rt.builtins-aarch64-android.a --gc-sections -soname libhidlbase.so prebuilts/clang/host/linux-x86/clang-r383902b/lib64/clang/11.0.2/lib/linux/libclang_rt.ubsan_minimal-aarch64-android.a --exclude-libs libclang_rt.ubsan_minimal-aarch64-android.a --exclude-libs libclang_rt.ubsan_minimal-aarch64-android.a |
于是执行观察进程信息:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 |
ubuntu@ubuntu:~$ ps -A | grep ld 164 ? 00:00:00 kthrotld 167 ? 00:00:00 mld 173329 pts/0 00:00:00 ld.lld 202622 pts/0 00:00:00 ld.lld 213495 pts/0 00:00:00 ld.lld 213548 pts/0 00:00:00 ld.lld 213900 pts/0 00:00:00 ld.lld 214713 pts/0 00:00:00 ld.lld 214789 pts/0 00:00:00 ld.lld 215848 pts/0 00:00:00 ld.lld 218993 pts/0 00:00:14 ld.lld 219011 pts/0 00:00:00 ld.lld 220320 pts/0 00:00:00 ld.lld 221908 pts/0 00:00:00 ld.lld 222517 pts/0 00:00:00 ld.lld 224287 pts/0 00:00:00 ld.lld 652624 pts/0 00:00:00 ld.lld 752485 pts/0 00:00:01 ld.lld 763478 pts/0 00:00:00 ld.lld 763483 pts/0 00:00:00 ld.lld 763741 pts/0 00:00:00 ld.lld 764270 pts/0 00:00:00 ld.lld 764453 pts/0 00:00:00 ld.lld 765278 pts/0 00:00:22 ld.lld 765319 pts/0 00:00:00 ld.lld 767095 pts/0 00:00:00 ld.lld 769867 pts/0 00:00:00 ld.lld 771731 pts/0 00:00:01 ld.lld 772339 pts/0 00:00:00 ld.lld 774095 pts/0 00:00:00 ld.lld 788714 pts/0 00:00:00 ld.lld |
可以看到相当多的进程卡住了。
随便选择一个进程,查看进程当前卡住的地方
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 |
ubuntu@ubuntu:~$ sudo strace -p 774095 strace: Process 580996 attached futex(0xf529b70, FUTEX_WAIT_BITSET_PRIVATE|FUTEX_CLOCK_REALTIME, 0, NULL, FUTEX_BITSET_MATCH_ANY ubuntu@ubuntu:~$ sudo cat /proc/774095/stack [<0>] __switch_to+0xf8/0x150 [<0>] futex_wait_queue_me+0xbc/0x14c [<0>] futex_wait+0xd4/0x240 [<0>] do_futex+0x118/0x1cc [<0>] __arm64_sys_futex+0x7c/0x190 [<0>] invoke_syscall+0x78/0x100 [<0>] el0_svc_common.constprop.0+0x54/0x184 [<0>] do_el0_svc+0x30/0xac [<0>] el0_svc+0x48/0x160 [<0>] el0t_64_sync_handler+0xa4/0x130 [<0>] el0t_64_sync+0x1a4/0x1a8 |
可以发现都是卡住在相同的地方。
检查操作系统内核版本:
1 2 |
ubuntu@ubuntu:~$ uname -r 5.15.0-86-generic |
这个是操作系统内核的 BUG 。
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 |
FAILED: out/soong/nanopi3/dex_artjars/android/apex/art_boot_images/javalib/arm/boot-apache-xml.art out/soong/nanopi3/dex_artjars/android/apex/art_boot_images/javalib/arm/boot-apache-xml.oat out/soong/nanopi3/dex_artjars/android/apex/art_boot_images/javalib/arm/boot-apache-xml.vdex out/soong/nanopi3/dex_artjars/android/apex/art_boot_images/javalib/arm/boot-bouncycastle.art out/soong/nanopi3/dex_artjars/android/apex/art_boot_images/javalib/arm/boot-bouncycastle.oat out/soong/nanopi3/dex_artjars/android/apex/art_boot_images/javalib/arm/boot-bouncycastle.vdex out/soong/nanopi3/dex_artjars/android/apex/art_boot_images/javalib/arm/boot-core-libart.art out/soong/nanopi3/dex_artjars/android/apex/art_boot_images/javalib/arm/boot-core-libart.oat out/soong/nanopi3/dex_artjars/android/apex/art_boot_images/javalib/arm/boot-core-libart.vdex out/soong/nanopi3/dex_artjars/android/apex/art_boot_images/javalib/arm/boot-okhttp.art out/soong/nanopi3/dex_artjars/android/apex/art_boot_images/javalib/arm/boot-okhttp.oat out/soong/nanopi3/dex_artjars/android/apex/art_boot_images/javalib/arm/boot-okhttp.vdex out/soong/nanopi3/dex_artjars/android/apex/art_boot_images/javalib/arm/boot.art out/soong/nanopi3/dex_artjars/android/apex/art_boot_images/javalib/arm/boot.invocation out/soong/nanopi3/dex_artjars/android/apex/art_boot_images/javalib/arm/boot.oat out/soong/nanopi3/dex_artjars/android/apex/art_boot_images/javalib/arm/boot.vdex out/soong/nanopi3/dex_artjars_unstripped/android/apex/art_boot_images/javalib/arm/boot-apache-xml.oat out/soong/nanopi3/dex_artjars_unstripped/android/apex/art_boot_images/javalib/arm/boot-bouncycastle.oat out/soong/nanopi3/dex_artjars_unstripped/android/apex/art_boot_images/javalib/arm/boot-core-libart.oat out/soong/nanopi3/dex_artjars_unstripped/android/apex/art_boot_images/javalib/arm/boot-okhttp.oat out/soong/nanopi3/dex_artjars_unstripped/android/apex/art_boot_images/javalib/arm/boot.oat mkdir -p out/soong/nanopi3/dex_artjars_unstripped/android/apex/art_boot_images/javalib/arm && rm -f out/soong/nanopi3/dex_artjars_unstripped/android/apex/art_boot_images/javalib/arm/*.art out/soong/nanopi3/dex_artjars_unstripped/android/apex/art_boot_images/javalib/arm/*.oat out/soong/nanopi3/dex_artjars_unstripped/android/apex/art_boot_images/javalib/arm/*.invocation && rm -f out/soong/nanopi3/dex_artjars/android/apex/art_boot_images/javalib/arm/*.art out/soong/nanopi3/dex_artjars/android/apex/art_boot_images/javalib/arm/*.oat out/soong/nanopi3/dex_artjars/android/apex/art_boot_images/javalib/arm/*.invocation && ANDROID_LOG_TAGS="*:e" out/soong/host/linux-x86/bin/dex2oatd --avoid-storing-invocation --write-invocation-to=out/soong/nanopi3/dex_artjars/android/apex/art_boot_images/javalib/arm/boot.invocation --runtime-arg -Xms64m --runtime-arg -Xmx64m --compiler-filter=speed-profile --profile-file=out/soong/nanopi3/dex_artjars/boot.prof --dirty-image-objects=frameworks/base/config/dirty-image-objects --base=0x70000000 --dex-file=out/soong/nanopi3/dex_artjars_input/core-oj.jar --dex-file=out/soong/nanopi3/dex_artjars_input/core-libart.jar --dex-file=out/soong/nanopi3/dex_artjars_input/okhttp.jar --dex-file=out/soong/nanopi3/dex_artjars_input/bouncycastle.jar --dex-file=out/soong/nanopi3/dex_artjars_input/apache-xml.jar --dex-location=/apex/com.android.art/javalib/core-oj.jar --dex-location=/apex/com.android.art/javalib/core-libart.jar --dex-location=/apex/com.android.art/javalib/okhttp.jar --dex-location=/apex/com.android.art/javalib/bouncycastle.jar --dex-location=/apex/com.android.art/javalib/apache-xml.jar --generate-debug-info --generate-build-id --image-format=lz4hc --oat-symbols=out/soong/nanopi3/dex_artjars_unstripped/android/apex/art_boot_images/javalib/arm/boot.oat --strip --oat-file=out/soong/nanopi3/dex_artjars/android/apex/art_boot_images/javalib/arm/boot.oat --oat-location=out/soong/nanopi3/dex_artjars/android/apex/art_boot_images/javalib/boot.oat --image=out/soong/nanopi3/dex_artjars/android/apex/art_boot_images/javalib/arm/boot.art --instruction-set=arm --android-root=out/empty --no-inline-from=core-oj.jar --force-determinism --abort-on-hard-verifier-error --instruction-set-variant=cortex-a55 --instruction-set-features=default --generate-mini-debug-info || ( echo 'ERROR: Dex2oat failed to compile a boot image.It is likely that the boot classpath is inconsistent.Rebuild with ART_BOOT_IMAGE_EXTRA_ARGS="--runtime-arg -verbose:verifier" to see verification errors.' ; false ) # hash of input list: 44d8dffdfa1ff3bc64c8e206680d293a8acc0cae26ec3bdac57dc11e6b99f2f7 dex2oatd F 11-06 07:15:20 1895904 1895904 casts.h:110] Check failed: (static_cast<intmax_t>(std::numeric_limits<Dest>::min()) <= static_cast<intmax_t>(std::numeric_limits<Source>::min()) || source >= static_cast<Source>(std::numeric_limits<Dest>::min())) && (static_cast<uintmax_t>(std::numeric_limits<Dest>::max()) >= static_cast<uintmax_t>(std::numeric_limits<Source>::max()) || source <= static_cast<Source>(std::numeric_limits<Dest>::max())) dchecked_integral_cast failed for 140737403473984 (would be 4210085952) Runtime aborting... All threads: DALVIK THREADS (1): "main" prio=5 tid=1 Runnable (still starting up) | group="" sCount=0 ucsCount=0 flags=0 obj=(nil) self=0x555556ec8270 | sysTid=1895904 nice=0 cgrp=default sched=0/0 handle=0x7fffffc73740 | state=R schedstat=( 399535502 142200201 504 ) utm=29 stm=10 core=9 HZ=100 | stack=0x5554ff800000-0x5554ff802000 stackSize=8192KB | held mutexes= "abort lock" "mutator lock"(shared held) native: #00 pc 0000000000da5528 /home/ubuntu/aosp/out/soong/host/linux-x86/bin/dex2oatd64 (UnwindStackCurrent::UnwindFromContext(unsigned long, void*)+88) native: #01 pc 0000000000da02d8 /home/ubuntu/aosp/out/soong/host/linux-x86/bin/dex2oatd64 (art::DumpNativeStack(std::__1::basic_ostream<char, std::__1::char_traits<char> >&, int, BacktraceMap*, char const*, art::ArtMethod*, void*, bool)+136) native: #02 pc 0000000000e4582c /home/ubuntu/aosp/out/soong/host/linux-x86/bin/dex2oatd64 (art::Thread::DumpStack(std::__1::basic_ostream<char, std::__1::char_traits<char> >&, bool, BacktraceMap*, bool) const+396) native: #03 pc 0000000000e6e846 /home/ubuntu/aosp/out/soong/host/linux-x86/bin/dex2oatd64 (art::DumpCheckpoint::Run(art::Thread*)+582) native: __compressed_pair_elem native: external/libcxx/include/memory:2140 native: __compressed_pair<true, void> native: external/libcxx/include/memory:2234 native: basic_string<nullptr_t> native: external/libcxx/include/string:820 native: UnwindStackCurrent::UnwindFromContext(unsigned long, void*) native: system/unwinding/libbacktrace/UnwindStack.cpp:169 native: #04 pc 0000000000e67522 /home/ubuntu/aosp/out/soong/host/linux-x86/bin/dex2oatd64 (art::ThreadList::RunCheckpoint(art::Closure*, art::Closure*)+290) native: art::DumpNativeStack(std::__1::basic_ostream<char, std::__1::char_traits<char> >&, int, BacktraceMap*, char const*, art::ArtMethod*, void*, bool) native: art/runtime/native_stack_dump.cc:335 (discriminator 2) native: #05 pc 0000000000e67100 /home/ubuntu/aosp/out/soong/host/linux-x86/bin/dex2oatd64 (art::ThreadList::Dump(std::__1::basic_ostream<char, std::__1::char_traits<char> >&, bool)+368) native: #06 pc 0000000000d3964a /home/ubuntu/aosp/out/soong/host/linux-x86/bin/dex2oatd64 (art::AbortState::Dump(std::__1::basic_ostream<char, std::__1::char_traits<char> >&) const+186) native: #07 pc 0000000000d23136 /home/ubuntu/aosp/out/soong/host/linux-x86/bin/dex2oatd64 (art::Runtime::Abort(char const*)+406) native: #08 pc 000000000169e08c /home/ubuntu/aosp/out/soong/host/linux-x86/bin/dex2oatd64 (android::base::SetAborter(std::__1::function<void (char const*)>&&)::$_3::__invoke(char const*)+60) native: #09 pc 000000000169dd15 /home/ubuntu/aosp/out/soong/host/linux-x86/bin/dex2oatd64 (android::base::LogMessage::~LogMessage()+341) native: #10 pc 000000000049c4e0 /home/ubuntu/aosp/out/soong/host/linux-x86/bin/dex2oatd64 (unsigned int art::dchecked_integral_cast<unsigned int, unsigned long>(unsigned long)+240) native: #11 pc 00000000005cc668 /home/ubuntu/aosp/out/soong/host/linux-x86/bin/dex2oatd64 (art::ArtMethod::SetDataPtrSize(void const*, art::PointerSize)+88) native: art::Thread::DumpStack(std::__1::basic_ostream<char, std::__1::char_traits<char> >&, bool, BacktraceMap*, bool) const native: art/runtime/thread.cc:2193 (discriminator 2) native: #12 pc 000000000077f628 /home/ubuntu/aosp/out/soong/host/linux-x86/bin/dex2oatd64 (art::ArtMethod::SetImtConflictTable(art::ImtConflictTable*, art::PointerSize)+56) native: art::DumpCheckpoint::Run(art::Thread*) native: art/runtime/thread_list.cc:213 (discriminator 2) native: art::ThreadList::RunCheckpoint(art::Closure*, art::Closure*) native: art/runtime/thread_list.cc:374 native: art::ThreadList::Dump(std::__1::basic_ostream<char, std::__1::char_traits<char> >&, bool) native: art/runtime/thread_list.cc:257 native: #13 pc 0000000000d32d07 /home/ubuntu/aosp/out/soong/host/linux-x86/bin/dex2oatd64 (art::Runtime::CreateImtConflictMethod(art::LinearAlloc*)+295) native: #14 pc 0000000000705535 /home/ubuntu/aosp/out/soong/host/linux-x86/bin/dex2oatd64 (art::ClassLinker::InitWithoutImage(std::__1::vector<std::__1::unique_ptr<art::DexFile const, std::__1::default_delete<art::DexFile const> >, std::__1::allocator<std::__1::unique_ptr<art::DexFile const, std::__1::default_delete<art::DexFile const> > > >, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >*)+10389) native: #15 pc 0000000000d28209 /home/ubuntu/aosp/out/soong/host/linux-x86/bin/dex2oatd64 (art::Runtime::Init(art::RuntimeArgumentMap&&)+18249) native: #16 pc 0000000000d23a6a /home/ubuntu/aosp/out/soong/host/linux-x86/bin/dex2oatd64 (art::Runtime::Create(art::RuntimeArgumentMap&&)+74) native: #17 pc 000000000047fc3f /home/ubuntu/aosp/out/soong/host/linux-x86/bin/dex2oatd64 (art::Dex2Oat::CreateRuntime(art::RuntimeArgumentMap&&)+127) native: #18 pc 00000000004723d1 /home/ubuntu/aosp/out/soong/host/linux-x86/bin/dex2oatd64 (art::Dex2Oat::Setup()+2081) native: #19 pc 000000000046caf6 /home/ubuntu/aosp/out/soong/host/linux-x86/bin/dex2oatd64 (main+1414) native: #20 pc 0000000000029d8f /usr/lib/x86_64-linux-gnu/libc.so.6 (???) native: #21 pc 0000000000029e3f /usr/lib/x86_64-linux-gnu/libc.so.6 (__libc_start_main+127) native: __libc_start_main native: ??:? native: #22 pc 00000000004155a8 /home/ubuntu/aosp/out/soong/host/linux-x86/bin/dex2oatd64 (???) (no managed stack frames) dex2oatd E 11-06 07:15:30 1895904 1895904 thread-inl.h:158] holding "abort lock" at point where thread suspension is expected Aborting thread: "main" prio=5 tid=1 Runnable (still starting up) | group="" sCount=0 ucsCount=0 flags=0 obj=(nil) self=0x555556ec8270 | sysTid=1895904 nice=0 cgrp=default sched=0/0 handle=0x7fffffc73740 | state=R schedstat=( 585151910 181451831 848 ) utm=42 stm=15 core=1 HZ=100 | stack=0x5554ff800000-0x5554ff802000 stackSize=8192KB | held mutexes= "abort lock" "mutator lock"(shared held) native: #00 pc 0000000000da5528 /home/ubuntu/aosp/out/soong/host/linux-x86/bin/dex2oatd64 (UnwindStackCurrent::UnwindFromContext(unsigned long, void*)+88) native: #01 pc 0000000000da02d8 /home/ubuntu/aosp/out/soong/host/linux-x86/bin/dex2oatd64 (art::DumpNativeStack(std::__1::basic_ostream<char, std::__1::char_traits<char> >&, int, BacktraceMap*, char const*, art::ArtMethod*, void*, bool)+136) native: #02 pc 0000000000e4582c /home/ubuntu/aosp/out/soong/host/linux-x86/bin/dex2oatd64 (art::Thread::DumpStack(std::__1::basic_ostream<char, std::__1::char_traits<char> >&, bool, BacktraceMap*, bool) const+396) native: __compressed_pair_elem native: external/libcxx/include/memory:2140 native: __compressed_pair<true, void> native: external/libcxx/include/memory:2234 native: basic_string<nullptr_t> native: external/libcxx/include/string:820 native: UnwindStackCurrent::UnwindFromContext(unsigned long, void*) native: system/unwinding/libbacktrace/UnwindStack.cpp:169 native: #03 pc 0000000000d3991d /home/ubuntu/aosp/out/soong/host/linux-x86/bin/dex2oatd64 (art::AbortState::DumpThread(std::__1::basic_ostream<char, std::__1::char_traits<char> >&, art::Thread*) const+93) native: art::DumpNativeStack(std::__1::basic_ostream<char, std::__1::char_traits<char> >&, int, BacktraceMap*, char const*, art::ArtMethod*, void*, bool) native: art/runtime/native_stack_dump.cc:335 (discriminator 2) native: #04 pc 0000000000d23136 /home/ubuntu/aosp/out/soong/host/linux-x86/bin/dex2oatd64 (art::Runtime::Abort(char const*)+406) native: #05 pc 000000000169e08c /home/ubuntu/aosp/out/soong/host/linux-x86/bin/dex2oatd64 (android::base::SetAborter(std::__1::function<void (char const*)>&&)::$_3::__invoke(char const*)+60) native: #06 pc 000000000169dd15 /home/ubuntu/aosp/out/soong/host/linux-x86/bin/dex2oatd64 (android::base::LogMessage::~LogMessage()+341) native: #07 pc 000000000049c4e0 /home/ubuntu/aosp/out/soong/host/linux-x86/bin/dex2oatd64 (unsigned int art::dchecked_integral_cast<unsigned int, unsigned long>(unsigned long)+240) native: #08 pc 00000000005cc668 /home/ubuntu/aosp/out/soong/host/linux-x86/bin/dex2oatd64 (art::ArtMethod::SetDataPtrSize(void const*, art::PointerSize)+88) native: #09 pc 000000000077f628 /home/ubuntu/aosp/out/soong/host/linux-x86/bin/dex2oatd64 (art::ArtMethod::SetImtConflictTable(art::ImtConflictTable*, art::PointerSize)+56) native: #10 pc 0000000000d32d07 /home/ubuntu/aosp/out/soong/host/linux-x86/bin/dex2oatd64 (art::Runtime::CreateImtConflictMethod(art::LinearAlloc*)+295) native: #11 pc 0000000000705535 /home/ubuntu/aosp/out/soong/host/linux-x86/bin/dex2oatd64 (art::ClassLinker::InitWithoutImage(std::__1::vector<std::__1::unique_ptr<art::DexFile const, std::__1::default_delete<art::DexFile const> >, std::__1::allocator<std::__1::unique_ptr<art::DexFile const, std::__1::default_delete<art::DexFile const> > > >, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >*)+10389) native: art::Thread::DumpStack(std::__1::basic_ostream<char, std::__1::char_traits<char> >&, bool, BacktraceMap*, bool) const native: art/runtime/thread.cc:2193 (discriminator 2) native: #12 pc 0000000000d28209 /home/ubuntu/aosp/out/soong/host/linux-x86/bin/dex2oatd64 (art::Runtime::Init(art::RuntimeArgumentMap&&)+18249) native: #13 pc 0000000000d23a6a /home/ubuntu/aosp/out/soong/host/linux-x86/bin/dex2oatd64 (art::Runtime::Create(art::RuntimeArgumentMap&&)+74) native: #14 pc 000000000047fc3f /home/ubuntu/aosp/out/soong/host/linux-x86/bin/dex2oatd64 (art::Dex2Oat::CreateRuntime(art::RuntimeArgumentMap&&)+127) native: #15 pc 00000000004723d1 /home/ubuntu/aosp/out/soong/host/linux-x86/bin/dex2oatd64 (art::Dex2Oat::Setup()+2081) native: #16 pc 000000000046caf6 /home/ubuntu/aosp/out/soong/host/linux-x86/bin/dex2oatd64 (main+1414) native: #17 pc 0000000000029d8f /usr/lib/x86_64-linux-gnu/libc.so.6 (???) native: #18 pc 0000000000029e3f /usr/lib/x86_64-linux-gnu/libc.so.6 (__libc_start_main+127) native: __libc_start_main native: ??:? native: #19 pc 00000000004155a8 /home/ubuntu/aosp/out/soong/host/linux-x86/bin/dex2oatd64 (???) (no managed stack frames) Aborted (core dumped) ERROR: Dex2oat failed to compile a boot image.It is likely that the boot classpath is inconsistent.Rebuild with ART_BOOT_IMAGE_EXTRA_ARGS="--runtime-arg -verbose:verifier" to see verification errors. [ 96% 126822/131217] //external/kotlinx.coroutines:kotlinx_coroutines_android k warning: some JAR files in the classpath have the Kotlin Runtime library bundled into them. This may cause difficult to debug problems if there's a different version of the Kotlin Runtime library in the classpath. Consider removing these libraries from the classpath out/soong/.intermediates/external/kotlinx.coroutines/kotlinx_coroutines/android_common/turbine-combined/kotlinx_coroutines.jar: warning: library has Kotlin runtime bundled into it 07:16:14 ninja failed with: exit status 1 #### failed to build some targets (07:06:51 (hh:mm:ss)) #### |
运行镜像
选择 system-qemu.img 和 vendor-qemu.img,这两个镜像是专门为 qemu 运行制作的,如果选择 system.img 和 vendor.img,则 avd 运行失败。
1 2 3 4 5 6 7 8 9 10 11 12 13 |
$ cd /Volumes/aosp $ export ANDROID_BUILD_TOP=/Volumes/aosp/aosp $ export PATH=$PATH:$ANDROID_BUILD_TOP/out/host/darwin-x86/bin $ export ANDROID_SWT=$ANDROID_BUILD_TOP/out/host/darwin-x86/framework $ export ANDROID_PRODUCT_OUT=$ANDROID_BUILD_TOP/out/target/product/emulator_arm64 $ export OUT=$ANDROID_PRODUCT_OUT $ ./emu/emulator -verbose -show-kernel |
上面运行起来的镜像是从 /Volumes/aosp/aosp/out/target/product/emulator_arm64/hardware-qemu.ini
读取配置信息的,但是这个文件直接修改无效。我们如果需要修改参数,只能从启动参数中设置。
比如我们如果需要增大内存,开启 GPU
的支持,则执行如下命令:
1 |
$ ./emu/emulator -gpu on -memory 4096 -verbose -show-kernel |
参考链接
- macOS Big Sur(11.7.5)编译Android 12.0源码过程总结
- ubuntu 20.04编译Android 11源代码&模拟器
- macOS Big Sur 编译Android11.0源码过程总结
- 代号、标记和 build 号
- AOSP 编译Android12源码全记录
- Android 开发者代码实验室
- macOS Sierra (10.12.3)上编译ARM版本Android 5.1.1_r38 (Lollipop)源代码
- How can I download and install macOS 10.12 SDK?
- Fix depends on disabled module "libbit_field_derive" error when building.
- 搭建编译环境
- [android-building] Platform development on MacOS isn't supported as of June 22, 2021.
- Can I download AOSP and compile the Android OS on a MacBook or other macOS device?
- Platform development on MacOS isn't supported as of June 22, 2021.
- Building Android 11 for x86 with ARM compatibility
- 使用VsCode调试Android Framework C/C++源代码
- How to build AOSP on M1
- Error in compiling android (12) aosp on mac 13.3 m1 max
- Intel/Apple Silicon架构MacOS平台编译AOSP源码
- 在Mac平台使用Docker搭建AOSP(Android源代码)编译环境
- ubuntu 22.04.2编译Android 12.1源代码&模拟器
- 五、Docker 数据持久化存储与性能调优
- 如何提高 Docker 在 Mac 下的文件读写速度?
- 如何提升Docker for Mac性能
- docker性能分析命令 docker 磁盘性能 转载
- Speed boost achievement unlocked on Docker Desktop 4.6 for Mac
- File system performance improvements #1592
- Docker volumes 挂载时 cached 和 delegated 的区别和选择
- Docker 优化之 Docker-sync 解决 Docker 挂载缓慢
- Enabling aarch64 as a host architecture for Android Build (WIP)
- Re: [android-building] AOSP on aws a1 instance (arm)
- [Docker Desktop for Mac] - Support for running x86-64 binaries with Rosetta 2
- M1 和 Docker 谈了个恋爱
- Using Rosetta in a UTM Linux VM with Docker on Apple Silicon
- Running Intel Binaries in Linux VMs with Rosetta
- WARNING: The requested image's platform (linux/amd64) does not match the detected host platform (linux/arm64/v8)
- Docker多架构支持-buildx构建多架构镜像
- Liviable now shares folders in Linux VMs, and should support Rosetta 2
- Running Intel Binaries in Linux VMs with Rosetta
- Rosetta in Docker
- macOS-Linux-VM-with-Rosetta
- 利用 Lima 在 M1 執行 x86 的 Ubuntu
- Compare Podman Desktop vs lima and see what are their differences.
- UTM:开源的多面手 macOS 虚拟机(更新到 2023.8.20)
- WSL Ubuntu 20.04下Android源码编译与导入Android Studio
- WSL进行aosp下载编译
- UTM:开源的多面手 macOS 虚拟机(更新到 2023.8.20)
- ubuntu server硬盘扩容(LVM)
- Build sandboxing disabled due to docker
- "Build sandboxing disabled due to nsjail error. This may become fatal in the future."
- google/nsjail
- Intel-on-ARM and ARM-on-Intel
- Intel/Apple Silicon架构MacOS平台编译AOSP源码
- MacOSX 11.6 下编译 AOSP android11 系统源代码
- FAILED: out/target/product/generic_arm64/obj/PACKAGING/vndk_intermediates/check-list-timestamp
- android-emulator-m1-preview
- 模拟器版本说明
- repo sync出现contains uncommitted changes错误解决办法
- boringssl_self_test_apex64 error, endless boot loop, emulator screen stuck on "Connecting to the Emulator"
- AVD (API 31) black screen
- Android-11 build for Raspberry Pi4
- arpi 11 : framework patch
- Build faild #71
- Android Emulator MacOS Development
- [android-kernel环境搭建]emulator_kernel
- AOSP sepolicy_tests_intermediates/sepolicy_tests error on building using MAC Catalina
- android/prebuilts/qemu-kernel
- make public aosp 11/10 build and run on M1
- Rosetta results with error for any AMD64 binary #5567
- Linux 使用strace命令查找进程卡死原因
- 内核futex的BUG导致程序hang死问题排查
- How to Install the Latest Mainline Linux Kernel Version in Ubuntu [GUI and Terminal Methods]
- Android Clang/LLVM Toolchain
- Android Clang/LLVM Prebuilts
- Android8.1源码编译问题集锦
- Source build Error Help #355
- Android dex2oat build:ERROR: Dex2oat failed to compile a boot image
- Compiling a deodexed AOSP?