diff --git a/package/glibc/Config.in b/package/glibc/Config.in index 5ecd058145..8e9ddac7d9 100644 --- a/package/glibc/Config.in +++ b/package/glibc/Config.in @@ -10,6 +10,18 @@ config BR2_PACKAGE_GLIBC help https://www.gnu.org/software/libc/ +config BR2_PACKAGE_GLIBC_KERNEL_COMPAT + bool "Enable compatibiltiy shims to run on older kernels" + help + Say 'y' here if you plan on running your system on a kernel + older than the version used for the toolchain headers. + + Enabling those compatibility shims may generate a slightly + bigger and slightly slower glibc library. + + The oldest supported kernel version depends on the + architecture. + config BR2_PACKAGE_GLIBC_UTILS bool "Install glibc utilities" help diff --git a/package/glibc/glibc.mk b/package/glibc/glibc.mk index 9b591aa2a3..2702994c6b 100644 --- a/package/glibc/glibc.mk +++ b/package/glibc/glibc.mk @@ -98,6 +98,10 @@ endif GLIBC_MAKE = $(BR2_MAKE) GLIBC_CONF_ENV += ac_cv_prog_MAKE="$(BR2_MAKE)" +ifeq ($(BR2_PACKAGE_GLIBC_KERNEL_COMPAT),) +GLIBC_CONF_OPTS += --enable-kernel=$(call qstrip,$(BR2_TOOLCHAIN_HEADERS_AT_LEAST)) +endif + # Even though we use the autotools-package infrastructure, we have to # override the default configure commands for several reasons: # @@ -128,8 +132,8 @@ define GLIBC_CONFIGURE_CMDS --disable-profile \ --disable-werror \ --without-gd \ - --enable-kernel=$(call qstrip,$(BR2_TOOLCHAIN_HEADERS_AT_LEAST)) \ - --with-headers=$(STAGING_DIR)/usr/include) + --with-headers=$(STAGING_DIR)/usr/include \ + $(GLIBC_CONF_OPTS)) $(GLIBC_ADD_MISSING_STUB_H) endef