在Ubuntu 20上编译内核3.x.x

问题描述 投票:0回答:1

我需要为armhf编译内核3.4,这需要gcc-4.9。cmd行是:make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- tegra_defconfig(在这里我不确定是否需要设置CROSS_COMPILE)make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf-

问题是我无法使用ubuntu来使用gcc-4.9,这是不可用的,我不得不将xenial添加到'sources.list'文件中,现在我可以在系统上使用它,但是无法使用它。然后,将CC=gcc-4.9添加到命令中将不会使用arm-linux-gnueabihf定义的CROSS_COMPILE前缀。update-alternatives无法将gcc-4.9识别为第二个c编译器。有谁看到解决方法?请不要只删除“ install xenial”之类的评论。

cross-compiling compatibility
1个回答
0
投票
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-4.9 50 sudo update-alternatives --set gcc /usr/bin/gcc-4.9 gcc --version gcc (Ubuntu 4.9.3-13ubuntu2) 4.9.3 Copyright (C) 2015 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

坚持我的观点(交叉编译):

sudo update-alternatives --install /usr/bin/arm-linux-gnueabihf-gcc arm-linux-gnueabihf-gcc /usr/bin/arm-linux-gnueabihf-gcc-4.9 50
sudo update-alternatives --set arm-linux-gnueabihf-gcc /usr/bin/arm-linux-gnueabihf-gcc-4.9

对于内核3.x.x和更低版本的perl是必需的,在完成perlbrew use perl-5.10.0perlbrew init之后,可以克服perlbrew install perl-5.10.0的错误(仔细阅读最后两个命令的输出)。

© www.soinside.com 2019 - 2024. All rights reserved.