Ubuntu22.04及以上版本buildroot SIGSTKSZ 报错问题
本文提供一种解决 Buildroot SIGSTKSZ 报错途径
解决途径来源参考:Buildroot error when building with Ubuntu 21.10
其出现原因在于 GNU C Library 2.34 release announcement:
Add _SC_MINSIGSTKSZ and _SC_SIGSTKSZ. When _DYNAMIC_STACK_SIZE_SOURCE or _GNU_SOURCE are defined, MINSIGSTKSZ and SIGSTKSZ are no longer constant on Linux. MINSIGSTKSZ is redefined to sysconf(_SC_MINSIGSTKSZ) and SIGSTKSZ is redefined to sysconf (_SC_SIGSTKSZ). This supports dynamic sized register sets for modern architectural features like Arm SVE.
也就是 Buildroot 默认使用的 host-m4 版本太老了,导致出现了下面的问题:
解决途径:
解决思路在于升级 host-m4
这个 package 的版本,因此进入到 buildroot/package/m4
的目录,按照下面步骤操作即可,步骤 1 和 2 的两个文件可以从https://github.com/buildroot/buildroot/tree/master/package/m4 这里获取,也可以按照我下面的形式修改,或者直接从官方复制粘贴替换掉你本地的 m4.mk
和 m4.hash
文件。
- 配置
host-m4
为1.4.19
版本,修改m4.mk
文件:################################################################################ # # m4 # ################################################################################# M4_VERSION = 1.4.18 M4_VERSION = 1.4.19 M4_SOURCE = m4-$(M4_VERSION).tar.xz M4_SITE = $(BR2_GNU_MIRROR)/m4 M4_LICENSE = GPL-3.0+ M4_LICENSE_FILES = COPYING HOST_M4_CONF_OPTS = --disable-static$(eval $(host-autotools-package))
- 修改
m4.hash
文件,改为1.4.19
版本的包校验值:# Locally calculated after checking pgp signature # sha256 f2c1e86ca0a404ff281631bdc8377638992744b175afb806e25871a24a934e07 m4-1.4.18.tar.xz # License files, locally calculated # sha256 8ceb4b9ee5adedde47b31e975c1d90c73ad27b6b165a1dcd80c7c545eb65b903 COPYING # Locally calculated after checking pgp signature sha256 63aede5c6d33b6d9b13511cd0be2cac046f2e70fd0a07aa9573a04a82783af96 m4-1.4.19.tar.xz # License files, locally calculated sha256 3972dc9744f6499f0f9b2dbf76696f2ae7ad8af9b23dde66d6af86c9dfb36986 COPYING
- 删除掉原本
buildroot/package/m4
中的两个 patch,0001-fflush-adjust-to-glibc-2.28-libio.h-removal.patch
、0002-fflush-be-more-paranoid-about-libio.h-change.patch
(如果没有可以略过)
回到 SDK 目录就可以正常编译了,可以看到 host-m4 这块已经成功编译过去了: