Bug : mm/page-writeback.c:820: internal compiler error: Segmentation fault

本文介绍了一种解决Android编译过程中出现的内部编译错误的方法。该错误发生在mm/page-writeback.c文件第918行,通过注释掉特定代码行可以避免编译失败。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

Android 编译bug  mm/page-writeback.c:820: internal compiler error: Segmentation fault 解决:


问题描述:

CC      mm/page-writeback.o

mm/page-writeback.c: In function 'write_cache_pages':

mm/page-writeback.c:918: internal compiler error: Segmentation fault

Please submit a full bug report,

with preprocessed source if appropriate.

See <http://gcc.gnu.org/bugs.html
> for instructions.

make[1]: *** [mm/page-writeback.o] Error 1

make: *** [mm] Error 2





解决方法:vi kernel/mm/page-backwrite.c +918

注释下面这一行即可

// BUG_ON(PageWriteback(page));



重新编译ok


参考文档:http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45102
/home/lhl/ga-4.1/repo_code/out/oriole/kernel/src_tmp/linux-5.15/mm/vmscan.c:431:13: error: static declaration of 'cgroup_reclaim' follows non-static declaration static bool cgroup_reclaim(struct scan_control *sc) ^ /home/lhl/ga-4.1/repo_code/out/oriole/kernel/src_tmp/linux-5.15/include/linux/swap.h:423:13: note: previous declaration is here extern bool cgroup_reclaim(struct scan_control *sc); ^ /home/lhl/ga-4.1/repo_code/out/oriole/kernel/src_tmp/linux-5.15/mm/vmscan.c:449:13: error: static declaration of 'writeback_throttling_sane' follows non-static declaration static bool writeback_throttling_sane(struct scan_control *sc) ^ /home/lhl/ga-4.1/repo_code/out/oriole/kernel/src_tmp/linux-5.15/include/linux/swap.h:427:13: note: previous declaration is here extern bool writeback_throttling_sane(struct scan_control *sc); ^ /home/lhl/ga-4.1/repo_code/out/oriole/kernel/src_tmp/linux-5.15/mm/vmscan.c:591:22: error: static declaration of 'lruvec_lru_size' follows non-static declaration static unsigned long lruvec_lru_size(struct lruvec *lruvec, enum lru_list lru, ^ /home/lhl/ga-4.1/repo_code/out/oriole/kernel/src_tmp/linux-5.15/include/linux/mmzone.h:1205:22: note: previous declaration is here extern unsigned long lruvec_lru_size(struct lruvec *lruvec, enum lru_list lru, int zone_idx); ^ /home/lhl/ga-4.1/repo_code/out/oriole/kernel/src_tmp/linux-5.15/mm/vmscan.c:891:22: error: static declaration of 'shrink_slab' follows non-static declaration static unsigned long shrink_slab(gfp_t gfp_mask, int nid, ^ /home/lhl/ga-4.1/repo_code/out/oriole/kernel/src_tmp/linux-5.15/include/linux/swap.h:425:22: note: previous declaration is here extern unsigned long shrink_slab(gfp_t gfp_mask, int nid, struct mem_cgroup *memcg, ^ /home/lhl/ga-4.1/repo_code/out/oriole/kernel/src_tmp/linux-5.15/mm/vmscan.c:2224:12: error: static declaration of 'current_may_throttle' follows non-static declaration static int current_may_throttle(void) ^ /home/lhl/ga-4.1/repo_code/out/oriole/kernel/src_tmp/linux-5.15/include/linux/swap.h:432:12: note: previous declaration is here extern int current_may_throttle(void); ^ /home/lhl/ga-4.1/repo_code/out/oriole/kernel/src_tmp/linux-5.15/mm/vmscan.c:2497:22: error: static declaration of 'shrink_list' follows non-static declaration static unsigned long shrink_list(enum lru_list lru, unsigned long nr_to_scan, ^ /home/lhl/ga-4.1/repo_code/out/oriole/kernel/src_tmp/linux-5.15/include/linux/swap.h:419:22: note: previous declaration is here extern unsigned long shrink_list(enum lru_list lru, unsigned long nr_to_scan, ^ /home/lhl/ga-4.1/repo_code/out/oriole/kernel/src_tmp/linux-5.15/mm/vmscan.c:2539:13: error: static declaration of 'inactive_is_low' follows non-static declaration static bool inactive_is_low(struct lruvec *lruvec, enum lru_list inactive_lru) ^ /home/lhl/ga-4.1/repo_code/out/oriole/kernel/src_tmp/linux-5.15/include/linux/swap.h:422:13: note: previous declaration is here extern bool inactive_is_low(struct lruvec *lruvec, enum lru_list inactive_lru); ^ /home/lhl/ga-4.1/repo_code/out/oriole/kernel/src_tmp/linux-5.15/mm/vmscan.c:4261:12: error: static declaration of 'kswapd' follows non-static declaration static int kswapd(void *p) ^ /home/lhl/ga-4.1/repo_code/out/oriole/kernel/src_tmp/linux-5.15/include/linux/swap.h:37:5: note: previous declaration is here int kswapd (void *p); ^
最新发布
07-19
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值