make 工具降版本
使用替换后make编译内核3.18.4时出现
segmentation fault
错误导致无法使用, 方案放弃
前言
因为要编译低版本的内核, 但是高版本make在编译时会因为编译规则问题而报错,因此要考虑降低 make 版本
实现
下载 make 3.81
在官网 https://ftp.gnu.org/gnu/make/ 下载对应版本的 make, 如:
wget http://ftp.gnu.org/gnu/make/make-3.81.tar.gz
解压
tar xf make-3.81.tar.gz
执行 configuration
./configure --prefix=/usr/local/make-3.81
执行build.sh
sh build.sh
安装 make
sudo make install
替换 make
sudo cp make /usr/bin/make
可以看到版本已经降下来了
➜ make-3.81 make --version
GNU Make 3.81
Copyright (C) 2006 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.
This program built for x86_64-unknown-linux-gnu
问题
在执行
sh build.sh
时, 遇到如下错误glob.o: In function `glob_in_dir':
/mnt/d/Users/Lantern/Desktop/work/kernal/make-3.81/./glob/glob.c:1336: undefined reference to `__alloca'
/mnt/d/Users/Lantern/Desktop/work/kernal/make-3.81/./glob/glob.c:1250: undefined reference to `__alloca'
/mnt/d/Users/Lantern/Desktop/work/kernal/make-3.81/./glob/glob.c:1277: undefined reference to `__alloca'
/mnt/d/Users/Lantern/Desktop/work/kernal/make-3.81/./glob/glob.c:1361: undefined reference to `__alloca'
glob.o: In function `glob':
/mnt/d/Users/Lantern/Desktop/work/kernal/make-3.81/./glob/glob.c:575: undefined reference to `__alloca'
glob.o:/mnt/d/Users/Lantern/Desktop/work/kernal/make-3.81/./glob/glob.c:726: more undefined references to `__alloca' follow
collect2: error: ld returned 1 exit status在 https://stackoverflow.com/questions/51675200/install-older-version-of-gnu-make-in-ubuntu-18-04 找到解决方法:
将
glob.c
中的改为
即可成功编译
本博客所有文章除特别声明外,均采用 CC BY-NC-SA 4.0 许可协议。转载请注明来自 Lantern's 小站!
评论