Google 删除了 Android 内核的交叉编译器。他们现在在哪里?

发布于 2025-01-10 08:02:26 字数 637 浏览 4 评论 0原文

到目前为止,我已经使用了 UBERTC 预构建的交叉编译器,但是在编译 Android 内核时出现错误,并且它们自 2016 年以来就没有更新过他们的东西,所以我只是想找到一个替代方案。

显然,谷歌应该拥有它们。但我找不到他们。它们应该位于此处,但存储库是空的,最后一次提交显示:

删除 aarch64-linux-android gcc-4.9 库并包含

Android 已迁移到 LLVM。

垃圾箱已经被移除。删除除所有者之外的所有其他内容。

所以,我想他们已经把它们转移到其他地方了。但在哪里呢?

我不想听到您需要编译整个 AOSP 树才能进入编译器。我真的希望有另一种方式。

I've used UBERTC prebuilt cross compilers so far, but I get errors when compiling an android kernel, and they haven't updated their stuff since 2016, so I just would like to find an alternative.

Google should have them, obviosly. But I'm unable to find them. They should be here, but the repo is empty and the last commit says:

Remove aarch64-linux-android gcc-4.9 libs and includes

Android has moved to LLVM.

The bins were already removed. Remove everything else except for OWNERS.

So, I suppose they've moved them elsewhere. But where?

I wouldn't like to hear that you need to compile the whole AOSP tree to get to the compilers. I really hope there is another way.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

滥情哥ㄟ 2025-01-17 08:02:26

我找到了旧的工具链。有趣的是:由于某种原因,清理存储库之前的最新提交不包含gcc。所以我必须“爬”上 git 树才能找到包含它的树。这是 32 -bit ARM 工具链64 位 ARM 工具< /a>.这是 2019 年的 gcc 4.9

他们的意思是什么

Android 已迁移到 LLVM。

是您应该能够使用 clangllvm 交叉编译内核,并且不应再使用它们的独立解决方案。但他们没有提供任何有关如何操作的信息。是的,干得好。

下载看起来像这样:

# clone the repo, it will be empty
git clone https://android.googlesource.com/platform/prebuilts/gcc/linux-x86/arm/arm-linux-androideabi-4.9 toolchain
# go to the repo folder
cd toolchain
# use the hash of the commit to restore the commit which actually contains the toolchain
git checkout e9b2ab0932573a0ca90cad11ab75d9619f19c458

对于像我这样还没有完全了解 llvmclang 的人来说,还有替代工具链。 这是来自arm的一个。 com 基于 gcc 11.2。还有 Linaro 的。

不管怎样,有时你应该使用旧的工具链来构建旧的内核,因为新的编译器往往会抛出更多警告,默认情况下,Makefile 将这些警告视为错误。例如,我无法使用 arm.com 编译我的内核,因为它们太聪明并且发现了太多警告,而我还没有找到禁用它们的方法。修改 Makefile 似乎不是一个有效的选项,因为它大约有 2k 行长。

如果有人知道如何禁用它们,我也很想知道。但现在我将尝试坚持使用旧内核的谷歌工具链。

GLHF,哈哈。

I've found the old toolchain. The funny thing is: the latest commit before the repository was cleaned out does not contain gcc for some reason. So I had to "climb" up the git tree to find one which contains it. Here is 32-bit ARM toochain and 64-bit ARM toolchan. It's gcc 4.9 from back in 2019.

What they meant by

Android has moved to LLVM.

is that you should be able to cross-compile kernels with clang and llvm and should not use their stand-alone solution anymore. But they didn't provide any info on how to do it. So yeah, nice job.

Downloading looks like this:

# clone the repo, it will be empty
git clone https://android.googlesource.com/platform/prebuilts/gcc/linux-x86/arm/arm-linux-androideabi-4.9 toolchain
# go to the repo folder
cd toolchain
# use the hash of the commit to restore the commit which actually contains the toolchain
git checkout e9b2ab0932573a0ca90cad11ab75d9619f19c458

There are also alternative toolchains for those like myself, who haven't wrapped their heads around llvm and clang just yet. Here is one from arm.com based on gcc 11.2. There are also Linaro ones.

Anyways, you should sometimes use the old toolchains to build older kernels, since new compilers tend to throw more warnings, which are treated by Makefile as errors by default. For example, I'm not able to compile my kernel with the arm.com ones, because they are too smart and spot too many warnings, which I haven't found a way to disable. Modifying the Makefile doesn't seem like a valid option, as it's ~2k lines long.

If someone knows, how to disable those, I'd really love to know that too. But for now I'm gonna try to stick with the google toolchain for the older kernels.

GLHF, lol.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文