ubuntu编译错误:You are building kernel with non-retpoline compiler, please update your compiler

ubuntu16.04在编译某个内核模块时,突然提示错误:

arch/x86/Makefile:245: *** You are building kernel with non-retpoline compiler, please update your compiler.. Stop.

正如字面意思,需要升级编译器,比如gcc,当前ubuntu16.04上使用的是gcc4.9(非默认的gcc5.4),应该是ubuntu内核与gcc版本上有些不适合;

通过uname -r 查看当前内核版本:4.15.0-52-generic,编译的内核目录:/usr/src/linux-headers-4.15.0-52-generic;其中/usr/src/目录下还有其他的内核版本:linux-headers-4.15.0-47-generic,linux-headers-4.15.0-50-generic,linux-headers-4.15.0-51-generic,linux-headers-4.15.0-52-generic;

分析后可以有两个方向尝试解决:

1.升级gcc到更高级的版本;

2.回退内核到低级的版本;

第一种方法通过sudo apt install就可以解决,如果当前系统gcc有多版本,可以通过sudo update-alternative --config gcc选择;

第二种方法,可以重启虚拟机,然后按ESC进入grub,选择ubuntu options中的较低版本内核启动即可;如果要设置为默认启动选项,需要修改/boot/grub/grub.cfg文件。

 

Foreword by Jack W. Crenshaw (the package’s readme.txt) TUTOR.ZIP This file contains all of the installments of Jack Crenshaw’s tutorial on compiler construction, includ- ing the new Installment 15. The intended audience is those folks who are not computer scientists, but who enjoy computing and have always wanted to know how compilers work. A lot of compiler the- ory has been left out, but the practical issues are covered. By the time you have completed the series, you should be able to design and build your own working compiler. It will not be the world’s best, nor will it put out incredibly tight code. Your product will probably never put Borland or MicroSoft out of business. But it will work, and it will be yours. A word about the file format: The files were originally created using Borland’s DOS editor, Sprint. Sprint could write to a text file only if you formatted the file to go to the selected printer. I used the most common printer I could think of, the Epson MX-80, but even then the files ended up with printer control sequences at the beginning and end of each page. To bring the files up to date and get myself positioned to continue the series, I recently (1994) converted all the files to work with Microsoft Word for Windows. Unlike Sprint, Word allows you to write the file as a DOS text file. Unfortunately, this gave me a new problem, because when Word is writing to a text file, it doesn’t write hard page breaks or page numbers. In other words, in six years we’ve gone from a file with page breaks and page numbers, but embedded escape sequences, to files with no embedded escape sequences but no page breaks or page numbers. Isn’t progress wonderful? Of course, it’s possible for me to insert the page numbers as straight text, rather than asking the editor to do it for me. But since Word won’t allow me to write page breaks to the file, we would end up with files with page numbers that may or may not fall at the ends of the pages, depending on your editor and your printer. It seems to me that almost every file I’ve ever downloaded from CompuServe or BBS’s that had such page numbering was incompatible with my printer, and gave me pages that were one line short or one line long, with the page numbers consequently walking up the page. So perhaps this new format is, after all, the safest one for general distribution. The files as they exist will look just fine if read into any text editor capable of reading DOS text files. Since most editors these days include rather sophisticated word processing capabilities, you should be able to get your editor to paginate for you, prior to printing. I hope you like the tutorials. Much thought went into them. Jack W. Crenshaw
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值