2013-07-01 03:29:05 +08:00
|
|
|
################################################################################
|
|
|
|
#
|
|
|
|
# uclibc
|
|
|
|
#
|
|
|
|
################################################################################
|
|
|
|
|
2020-12-27 02:32:28 +08:00
|
|
|
UCLIBC_VERSION = 1.0.37
|
2016-01-28 05:25:30 +08:00
|
|
|
UCLIBC_SOURCE = uClibc-ng-$(UCLIBC_VERSION).tar.xz
|
2018-11-25 07:49:29 +08:00
|
|
|
UCLIBC_SITE = https://downloads.uclibc-ng.org/releases/$(UCLIBC_VERSION)
|
2017-03-30 21:43:34 +08:00
|
|
|
UCLIBC_LICENSE = LGPL-2.1+
|
2014-06-25 02:55:49 +08:00
|
|
|
UCLIBC_LICENSE_FILES = COPYING.LIB
|
2013-07-01 03:29:05 +08:00
|
|
|
UCLIBC_INSTALL_STAGING = YES
|
|
|
|
|
2016-06-05 00:30:52 +08:00
|
|
|
define UCLIBC_HELP_CMDS
|
|
|
|
@echo ' uclibc-menuconfig - Run uClibc menuconfig'
|
|
|
|
endef
|
|
|
|
|
2014-02-14 17:55:04 +08:00
|
|
|
# uclibc is part of the toolchain so disable the toolchain dependency
|
|
|
|
UCLIBC_ADD_TOOLCHAIN_DEPENDENCY = NO
|
|
|
|
|
2013-07-01 03:29:05 +08:00
|
|
|
# Before uClibc is configured, we must have the first stage
|
|
|
|
# cross-compiler and the kernel headers
|
|
|
|
UCLIBC_DEPENDENCIES = host-gcc-initial linux-headers
|
|
|
|
|
|
|
|
# specifying UCLIBC_CONFIG_FILE on the command-line overrides the .config
|
|
|
|
# setting.
|
|
|
|
ifndef UCLIBC_CONFIG_FILE
|
|
|
|
UCLIBC_CONFIG_FILE = $(call qstrip,$(BR2_UCLIBC_CONFIG))
|
|
|
|
endif
|
|
|
|
|
2014-08-03 23:32:42 +08:00
|
|
|
UCLIBC_KCONFIG_FILE = $(UCLIBC_CONFIG_FILE)
|
2015-04-28 22:34:34 +08:00
|
|
|
UCLIBC_KCONFIG_FRAGMENT_FILES = $(call qstrip,$(BR2_UCLIBC_CONFIG_FRAGMENT_FILES))
|
2014-08-03 23:32:42 +08:00
|
|
|
|
package/uclibc: use HOSTCC_NOCCACHE as kconfig HOSTCC
uclibc is part of the toolchain, and as such does not have a dependency
on it. As a consequence, it does not have a dependency on host-ccache,
when this is needed.
Usually, host-ccache is built before uclibc, as part of the dependency
of gcc-initial, host-binutils, and a few other host packages that are
built before uclibc.
However, during top-level parallel builds, this ordering is only ever
guaranteed at the beginning of the configure step, and not before.
But for kconfig-packages, the moment we apply the configuration to
prepare the .config file is a pseudo step that happens somewhere in
limbo between the patch step and the configure step. As such, the
build ordering that is otherwise guaranteed by the _DEPENDENCIES is not
applicable yet.
And so, with top-level parallel builds with ccache enabled, there is
nothing that guarantees host-ccache to be built and installed by the
time we are trying to generate uclibc's .config file, which can be quite
early in the build process, and thus the build fails:
/home/raphael/github/ftcommunity-TXT/buildroot-rootfs/output/per-package/uclibc/host/bin/ccache /usr/bin/gcc /home/raphael/github/ftcommunity-TXT/buildroot-rootfs/output/build/uclibc-1.0.34/extra/config/conf.c -c -o ../../extra/config/conf.o -Os -I/usr/include/ncursesw -DCURSES_LOC="<curses.h>" -DNCURSES_WIDECHAR=1 -DLOCALE -DKBUILD_NO_NLS -DCONFIG_='""' -I/usr/include/ncursesw -DCURSES_LOC="<curses.h>" -DNCURSES_WIDECHAR=1 -DLOCALE -DKBUILD_NO_NLS -DCONFIG_='""'
/bin/sh: 1: /home/raphael/github/ftcommunity-TXT/buildroot-rootfs/output/per-package/uclibc/host/bin/ccache: not found
make[2]: *** [Makefile:64: ../../extra/config/conf.o] Error 127
make[1]: *** [Makefile.in:475: extra/config/conf] Error 2
make[1]: Leaving directory '/home/raphael/github/ftcommunity-TXT/buildroot-rootfs/output/build/uclibc-1.0.34'
make: *** [package/uclibc/uclibc.mk:458: /home/raphael/github/ftcommunity-TXT/buildroot-rootfs/output/build/uclibc-1.0.34/.stamp_dotconfig] Error 2
make: *** Waiting for unfinished jobs....
The root cause is that uclibc sets;
UCLIBC_KCONFIG_OPTS = $(UCLIBC_MAKE_FLAGS) [...]
with:
UCLIBC_MAKE_FLAGS = [...] HOSTCC="$(HOSTCC)"
And then the kconfig-package infra calls to the configurators,
menuconfig, xconfig et al, but also olddefconfig et al.. with:
[...] $($(1)_MAKE) [...] $(PKG_KCONFIG_COMMON_OPTS) $($(1)_KCONFIG_OPTS) [...]
with (note a latent bug in there, will be fixed in another patch):
PKG_KCONFIG_COMMON_OPTS = HOSTCC=$(HOSTCC_NOCCACHE)
So, a HOSTCC as set by a package will always win onver the one set by
the infra, which is exactly what we want.
But in this case, uclibc sets HOSTCC so that it can build its host tools
needed during the build, and in doing so uses the ccache-enabled host c
compiler. Which might not yet be available for the kconfig-package infra
to generate the .config file.
We had a similar (non-)issue for the linux package, which was fixed in
commit 71a31b2357 (linux: use HOSTCC_NOCCACHE as kconfig HOSTCC).
But here, uclibc does not have the toolchain in its dependencies (as said
earlier, uclibc *is* part of the toolchain).
Since the host compiler is only used to build very few files to generate
the simple executable needed to generate the .config file, doing without
the ccache-enabled host compiler will be amply enough.
So, we override HOSTCC in UCLIBC_KCONFIG_OPTS, to use the non-cached
host compiler.
Note that, in a first approximation, one would be tempted to change the
ordering in the kconfig-package infra:
$($(1)_KCONFIG_OPTS) $(PKG_KCONFIG_COMMON_OPTS)
so that the non-cached HOSTCC always wins over the cached one. But this
would be incorrect, in cases where the package really needs to override
HOSTCC; indeed we want the package-provided values to always win over
the default ones providing by the infra.
Reported-by: Raphael Jacob <r.jacob2002@gmail.com>
Signed-off-by: Yann E. MORIN <yann.morin.1998@free.fr>
Acked-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
Signed-off-by: Yann E. MORIN <yann.morin.1998@free.fr>
2020-08-30 04:37:20 +08:00
|
|
|
# UCLIBC_MAKE_FLAGS set HOSTCC to the default HOSTCC, which may be
|
|
|
|
# wrapped with ccache. However, host-ccache may not already be built
|
|
|
|
# and installed when we apply the configuration, so we override that
|
|
|
|
# to use the non-ccached host compiler.
|
2014-09-28 03:32:47 +08:00
|
|
|
UCLIBC_KCONFIG_OPTS = \
|
2014-12-22 16:12:05 +08:00
|
|
|
$(UCLIBC_MAKE_FLAGS) \
|
package/uclibc: use HOSTCC_NOCCACHE as kconfig HOSTCC
uclibc is part of the toolchain, and as such does not have a dependency
on it. As a consequence, it does not have a dependency on host-ccache,
when this is needed.
Usually, host-ccache is built before uclibc, as part of the dependency
of gcc-initial, host-binutils, and a few other host packages that are
built before uclibc.
However, during top-level parallel builds, this ordering is only ever
guaranteed at the beginning of the configure step, and not before.
But for kconfig-packages, the moment we apply the configuration to
prepare the .config file is a pseudo step that happens somewhere in
limbo between the patch step and the configure step. As such, the
build ordering that is otherwise guaranteed by the _DEPENDENCIES is not
applicable yet.
And so, with top-level parallel builds with ccache enabled, there is
nothing that guarantees host-ccache to be built and installed by the
time we are trying to generate uclibc's .config file, which can be quite
early in the build process, and thus the build fails:
/home/raphael/github/ftcommunity-TXT/buildroot-rootfs/output/per-package/uclibc/host/bin/ccache /usr/bin/gcc /home/raphael/github/ftcommunity-TXT/buildroot-rootfs/output/build/uclibc-1.0.34/extra/config/conf.c -c -o ../../extra/config/conf.o -Os -I/usr/include/ncursesw -DCURSES_LOC="<curses.h>" -DNCURSES_WIDECHAR=1 -DLOCALE -DKBUILD_NO_NLS -DCONFIG_='""' -I/usr/include/ncursesw -DCURSES_LOC="<curses.h>" -DNCURSES_WIDECHAR=1 -DLOCALE -DKBUILD_NO_NLS -DCONFIG_='""'
/bin/sh: 1: /home/raphael/github/ftcommunity-TXT/buildroot-rootfs/output/per-package/uclibc/host/bin/ccache: not found
make[2]: *** [Makefile:64: ../../extra/config/conf.o] Error 127
make[1]: *** [Makefile.in:475: extra/config/conf] Error 2
make[1]: Leaving directory '/home/raphael/github/ftcommunity-TXT/buildroot-rootfs/output/build/uclibc-1.0.34'
make: *** [package/uclibc/uclibc.mk:458: /home/raphael/github/ftcommunity-TXT/buildroot-rootfs/output/build/uclibc-1.0.34/.stamp_dotconfig] Error 2
make: *** Waiting for unfinished jobs....
The root cause is that uclibc sets;
UCLIBC_KCONFIG_OPTS = $(UCLIBC_MAKE_FLAGS) [...]
with:
UCLIBC_MAKE_FLAGS = [...] HOSTCC="$(HOSTCC)"
And then the kconfig-package infra calls to the configurators,
menuconfig, xconfig et al, but also olddefconfig et al.. with:
[...] $($(1)_MAKE) [...] $(PKG_KCONFIG_COMMON_OPTS) $($(1)_KCONFIG_OPTS) [...]
with (note a latent bug in there, will be fixed in another patch):
PKG_KCONFIG_COMMON_OPTS = HOSTCC=$(HOSTCC_NOCCACHE)
So, a HOSTCC as set by a package will always win onver the one set by
the infra, which is exactly what we want.
But in this case, uclibc sets HOSTCC so that it can build its host tools
needed during the build, and in doing so uses the ccache-enabled host c
compiler. Which might not yet be available for the kconfig-package infra
to generate the .config file.
We had a similar (non-)issue for the linux package, which was fixed in
commit 71a31b2357 (linux: use HOSTCC_NOCCACHE as kconfig HOSTCC).
But here, uclibc does not have the toolchain in its dependencies (as said
earlier, uclibc *is* part of the toolchain).
Since the host compiler is only used to build very few files to generate
the simple executable needed to generate the .config file, doing without
the ccache-enabled host compiler will be amply enough.
So, we override HOSTCC in UCLIBC_KCONFIG_OPTS, to use the non-cached
host compiler.
Note that, in a first approximation, one would be tempted to change the
ordering in the kconfig-package infra:
$($(1)_KCONFIG_OPTS) $(PKG_KCONFIG_COMMON_OPTS)
so that the non-cached HOSTCC always wins over the cached one. But this
would be incorrect, in cases where the package really needs to override
HOSTCC; indeed we want the package-provided values to always win over
the default ones providing by the infra.
Reported-by: Raphael Jacob <r.jacob2002@gmail.com>
Signed-off-by: Yann E. MORIN <yann.morin.1998@free.fr>
Acked-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
Signed-off-by: Yann E. MORIN <yann.morin.1998@free.fr>
2020-08-30 04:37:20 +08:00
|
|
|
HOSTCC="$(HOSTCC_NOCCACHE)" \
|
2014-12-22 16:12:05 +08:00
|
|
|
PREFIX=$(STAGING_DIR) \
|
|
|
|
DEVEL_PREFIX=/usr/ \
|
2017-04-05 06:50:14 +08:00
|
|
|
RUNTIME_PREFIX=$(STAGING_DIR)/
|
2014-08-03 23:32:42 +08:00
|
|
|
|
2013-07-01 03:29:05 +08:00
|
|
|
UCLIBC_TARGET_ARCH = $(call qstrip,$(BR2_UCLIBC_TARGET_ARCH))
|
|
|
|
|
2014-11-14 06:17:24 +08:00
|
|
|
UCLIBC_GENERATE_LOCALES = $(call qstrip,$(BR2_GENERATE_LOCALE))
|
|
|
|
|
|
|
|
ifeq ($(UCLIBC_GENERATE_LOCALES),)
|
2013-07-01 03:29:05 +08:00
|
|
|
# We need at least one locale
|
|
|
|
UCLIBC_LOCALES = en_US
|
|
|
|
else
|
|
|
|
# Strip out the encoding part of locale names, if any
|
2015-01-15 15:21:39 +08:00
|
|
|
UCLIBC_LOCALES = \
|
|
|
|
$(foreach locale,$(UCLIBC_GENERATE_LOCALES),\
|
|
|
|
$(firstword $(subst .,$(space),$(locale))))
|
2013-07-01 03:29:05 +08:00
|
|
|
endif
|
|
|
|
|
2016-05-13 15:01:08 +08:00
|
|
|
# noMMU binary formats
|
|
|
|
ifeq ($(BR2_BINFMT_FLAT_ONE),y)
|
|
|
|
define UCLIBC_BINFMT_CONFIG
|
2020-04-04 20:10:19 +08:00
|
|
|
$(call KCONFIG_ENABLE_OPT,UCLIBC_FORMAT_FLAT)
|
|
|
|
$(call KCONFIG_DISABLE_OPT,UCLIBC_FORMAT_FLAT_SEP_DATA)
|
|
|
|
$(call KCONFIG_DISABLE_OPT,UCLIBC_FORMAT_SHARED_FLAT)
|
|
|
|
$(call KCONFIG_DISABLE_OPT,UCLIBC_FORMAT_FDPIC_ELF)
|
2016-05-13 15:01:08 +08:00
|
|
|
endef
|
|
|
|
endif
|
|
|
|
ifeq ($(BR2_BINFMT_FLAT_SHARED),y)
|
|
|
|
define UCLIBC_BINFMT_CONFIG
|
2020-04-04 20:10:19 +08:00
|
|
|
$(call KCONFIG_DISABLE_OPT,UCLIBC_FORMAT_FLAT)
|
|
|
|
$(call KCONFIG_DISABLE_OPT,UCLIBC_FORMAT_FLAT_SEP_DATA)
|
|
|
|
$(call KCONFIG_ENABLE_OPT,UCLIBC_FORMAT_SHARED_FLAT)
|
|
|
|
$(call KCONFIG_DISABLE_OPT,UCLIBC_FORMAT_FDPIC_ELF)
|
2016-05-13 15:01:08 +08:00
|
|
|
endef
|
|
|
|
endif
|
|
|
|
|
2014-10-30 21:57:28 +08:00
|
|
|
#
|
|
|
|
# ARC definitions
|
|
|
|
#
|
|
|
|
|
|
|
|
ifeq ($(UCLIBC_TARGET_ARCH),arc)
|
2015-07-17 17:11:42 +08:00
|
|
|
UCLIBC_ARC_PAGE_SIZE = CONFIG_ARC_PAGE_SIZE_$(call qstrip,$(BR2_ARC_PAGE_SIZE))
|
|
|
|
define UCLIBC_ARC_PAGE_SIZE_CONFIG
|
|
|
|
$(SED) '/CONFIG_ARC_PAGE_SIZE_*/d' $(@D)/.config
|
2020-04-04 20:10:19 +08:00
|
|
|
$(call KCONFIG_ENABLE_OPT,$(UCLIBC_ARC_PAGE_SIZE))
|
2015-07-17 17:11:42 +08:00
|
|
|
endef
|
|
|
|
|
2017-04-20 01:48:57 +08:00
|
|
|
ifeq ($(BR2_ARC_ATOMIC_EXT),)
|
|
|
|
define UCLIBC_ARC_ATOMICS_CONFIG
|
2020-04-04 20:10:19 +08:00
|
|
|
$(call KCONFIG_DISABLE_OPT,CONFIG_ARC_HAS_ATOMICS)
|
2017-04-20 01:48:57 +08:00
|
|
|
endef
|
|
|
|
endif
|
|
|
|
|
2014-10-30 21:57:28 +08:00
|
|
|
endif # arc
|
|
|
|
|
2013-07-01 03:29:05 +08:00
|
|
|
#
|
|
|
|
# ARM definitions
|
|
|
|
#
|
|
|
|
|
|
|
|
ifeq ($(UCLIBC_TARGET_ARCH),arm)
|
|
|
|
define UCLIBC_ARM_ABI_CONFIG
|
|
|
|
$(SED) '/CONFIG_ARM_.ABI/d' $(@D)/.config
|
2020-04-04 20:10:19 +08:00
|
|
|
$(call KCONFIG_ENABLE_OPT,CONFIG_ARM_EABI)
|
2013-07-01 03:29:05 +08:00
|
|
|
endef
|
|
|
|
|
2016-03-19 05:08:09 +08:00
|
|
|
ifeq ($(BR2_BINFMT_FLAT),y)
|
|
|
|
define UCLIBC_ARM_BINFMT_FLAT
|
2020-04-04 20:10:19 +08:00
|
|
|
$(call KCONFIG_DISABLE_OPT,DOPIC)
|
2016-03-19 05:08:09 +08:00
|
|
|
endef
|
|
|
|
endif
|
|
|
|
|
2016-04-01 03:00:07 +08:00
|
|
|
# context functions are written with ARM instructions. Therefore, if
|
|
|
|
# we are using a Thumb2-only platform (i.e, Cortex-M), they must be
|
|
|
|
# disabled. Thumb1 platforms are not a problem, since they all also
|
|
|
|
# support the ARM instructions.
|
|
|
|
ifeq ($(BR2_ARM_INSTRUCTIONS_THUMB2):$(BR2_ARM_CPU_HAS_ARM),y:)
|
|
|
|
define UCLIBC_ARM_NO_CONTEXT_FUNCS
|
2020-04-04 20:10:19 +08:00
|
|
|
$(call KCONFIG_DISABLE_OPT,UCLIBC_HAS_CONTEXT_FUNCS)
|
2016-04-01 03:00:07 +08:00
|
|
|
endef
|
|
|
|
endif
|
|
|
|
|
2013-07-01 03:29:05 +08:00
|
|
|
endif # arm
|
|
|
|
|
2016-04-30 01:51:23 +08:00
|
|
|
#
|
|
|
|
# m68k/coldfire definitions
|
|
|
|
#
|
|
|
|
|
|
|
|
ifeq ($(UCLIBC_TARGET_ARCH),m68k)
|
|
|
|
|
|
|
|
# disable DOPIC for flat without separate data
|
|
|
|
ifeq ($(BR2_BINFMT_FLAT_ONE),y)
|
|
|
|
define UCLIBC_M68K_BINFMT_FLAT
|
2020-04-04 20:10:19 +08:00
|
|
|
$(call KCONFIG_DISABLE_OPT,DOPIC)
|
2016-04-30 01:51:23 +08:00
|
|
|
endef
|
|
|
|
endif
|
|
|
|
|
|
|
|
endif # m68k/coldfire
|
|
|
|
|
2013-07-01 03:29:05 +08:00
|
|
|
#
|
|
|
|
# MIPS definitions
|
|
|
|
#
|
|
|
|
|
|
|
|
ifeq ($(UCLIBC_TARGET_ARCH),mips)
|
|
|
|
UCLIBC_MIPS_ABI = CONFIG_MIPS_$(call qstrip,$(BR2_UCLIBC_MIPS_ABI))_ABI
|
|
|
|
define UCLIBC_MIPS_ABI_CONFIG
|
|
|
|
$(SED) '/CONFIG_MIPS_[NO].._ABI/d' $(@D)/.config
|
2020-04-04 20:10:19 +08:00
|
|
|
$(call KCONFIG_ENABLE_OPT,$(UCLIBC_MIPS_ABI))
|
2013-07-01 03:29:05 +08:00
|
|
|
endef
|
|
|
|
|
2017-02-03 22:16:58 +08:00
|
|
|
UCLIBC_MIPS_NAN = CONFIG_MIPS_NAN_$(call qstrip,$(BR2_UCLIBC_MIPS_NAN))
|
|
|
|
define UCLIBC_MIPS_NAN_CONFIG
|
|
|
|
$(SED) '/CONFIG_MIPS_NAN_.*/d' $(@D)/.config
|
2020-04-04 20:10:19 +08:00
|
|
|
$(call KCONFIG_ENABLE_OPT,$(UCLIBC_MIPS_NAN))
|
2013-07-01 03:29:05 +08:00
|
|
|
endef
|
|
|
|
endif # mips
|
|
|
|
|
|
|
|
#
|
|
|
|
# SH definitions
|
|
|
|
#
|
|
|
|
|
|
|
|
ifeq ($(UCLIBC_TARGET_ARCH),sh)
|
|
|
|
UCLIBC_SH_TYPE = CONFIG_$(call qstrip,$(BR2_UCLIBC_SH_TYPE))
|
|
|
|
define UCLIBC_SH_TYPE_CONFIG
|
|
|
|
$(SED) '/CONFIG_SH[234A]*/d' $(@D)/.config
|
2020-04-04 20:10:19 +08:00
|
|
|
$(call KCONFIG_ENABLE_OPT,$(UCLIBC_SH_TYPE))
|
2013-07-01 03:29:05 +08:00
|
|
|
endef
|
|
|
|
endif # sh
|
|
|
|
|
|
|
|
#
|
|
|
|
# SPARC definitions
|
|
|
|
#
|
|
|
|
|
|
|
|
ifeq ($(UCLIBC_TARGET_ARCH),sparc)
|
|
|
|
UCLIBC_SPARC_TYPE = CONFIG_SPARC_$(call qstrip,$(BR2_UCLIBC_SPARC_TYPE))
|
|
|
|
define UCLIBC_SPARC_TYPE_CONFIG
|
|
|
|
$(SED) 's/^\(CONFIG_[^_]*[_]*SPARC[^=]*\)=.*/# \1 is not set/g' \
|
2014-10-27 16:25:28 +08:00
|
|
|
$(@D)/.config
|
2020-04-04 20:10:19 +08:00
|
|
|
$(call KCONFIG_ENABLE_OPT,$(UCLIBC_SPARC_TYPE))
|
2013-07-01 03:29:05 +08:00
|
|
|
endef
|
|
|
|
endif # sparc
|
|
|
|
|
|
|
|
#
|
|
|
|
# PowerPC definitions
|
|
|
|
#
|
|
|
|
|
|
|
|
ifeq ($(UCLIBC_TARGET_ARCH),powerpc)
|
|
|
|
UCLIBC_POWERPC_TYPE = CONFIG_$(call qstrip,$(BR2_UCLIBC_POWERPC_TYPE))
|
|
|
|
define UCLIBC_POWERPC_TYPE_CONFIG
|
2020-04-04 20:10:19 +08:00
|
|
|
$(call KCONFIG_DISABLE_OPT,CONFIG_GENERIC)
|
|
|
|
$(call KCONFIG_DISABLE_OPT,CONFIG_E500)
|
|
|
|
$(call KCONFIG_ENABLE_OPT,$(UCLIBC_POWERPC_TYPE))
|
2013-07-01 03:29:05 +08:00
|
|
|
endef
|
|
|
|
endif # powerpc
|
|
|
|
|
|
|
|
#
|
|
|
|
# x86 definitions
|
|
|
|
#
|
|
|
|
ifeq ($(UCLIBC_TARGET_ARCH),i386)
|
|
|
|
UCLIBC_X86_TYPE = CONFIG_$(call qstrip,$(BR2_UCLIBC_X86_TYPE))
|
|
|
|
define UCLIBC_X86_TYPE_CONFIG
|
2020-04-04 20:10:19 +08:00
|
|
|
$(call KCONFIG_ENABLE_OPT,$(UCLIBC_X86_TYPE))
|
2013-07-01 03:29:05 +08:00
|
|
|
endef
|
|
|
|
endif
|
|
|
|
|
2016-05-16 04:50:25 +08:00
|
|
|
#
|
|
|
|
# Debug
|
|
|
|
#
|
|
|
|
ifeq ($(BR2_ENABLE_DEBUG),y)
|
|
|
|
define UCLIBC_DEBUG_CONFIG
|
2020-04-04 20:10:19 +08:00
|
|
|
$(call KCONFIG_ENABLE_OPT,DODEBUG)
|
2016-05-16 04:50:25 +08:00
|
|
|
endef
|
|
|
|
endif
|
|
|
|
|
2013-07-01 03:29:05 +08:00
|
|
|
#
|
2014-05-01 03:18:57 +08:00
|
|
|
# Endianness
|
2013-07-01 03:29:05 +08:00
|
|
|
#
|
|
|
|
|
|
|
|
ifeq ($(call qstrip,$(BR2_ENDIAN)),BIG)
|
|
|
|
define UCLIBC_ENDIAN_CONFIG
|
2020-04-04 20:10:19 +08:00
|
|
|
$(call KCONFIG_ENABLE_OPT,ARCH_BIG_ENDIAN)
|
|
|
|
$(call KCONFIG_ENABLE_OPT,ARCH_WANTS_BIG_ENDIAN)
|
|
|
|
$(call KCONFIG_DISABLE_OPT,ARCH_LITTLE_ENDIAN)
|
|
|
|
$(call KCONFIG_DISABLE_OPT,ARCH_WANTS_LITTLE_ENDIAN)
|
2013-07-01 03:29:05 +08:00
|
|
|
endef
|
|
|
|
else
|
|
|
|
define UCLIBC_ENDIAN_CONFIG
|
2020-04-04 20:10:19 +08:00
|
|
|
$(call KCONFIG_ENABLE_OPT,ARCH_LITTLE_ENDIAN)
|
|
|
|
$(call KCONFIG_ENABLE_OPT,ARCH_WANTS_LITTLE_ENDIAN)
|
|
|
|
$(call KCONFIG_DISABLE_OPT,ARCH_BIG_ENDIAN)
|
|
|
|
$(call KCONFIG_DISABLE_OPT,ARCH_WANTS_BIG_ENDIAN)
|
2013-07-01 03:29:05 +08:00
|
|
|
endef
|
|
|
|
endif
|
|
|
|
|
2013-08-10 03:23:40 +08:00
|
|
|
#
|
|
|
|
# MMU
|
|
|
|
#
|
|
|
|
|
|
|
|
ifeq ($(BR2_USE_MMU),y)
|
|
|
|
define UCLIBC_MMU_CONFIG
|
2020-04-04 20:10:19 +08:00
|
|
|
$(call KCONFIG_ENABLE_OPT,ARCH_HAS_MMU)
|
|
|
|
$(call KCONFIG_ENABLE_OPT,ARCH_USE_MMU)
|
2013-08-10 03:23:40 +08:00
|
|
|
endef
|
|
|
|
else
|
|
|
|
define UCLIBC_MMU_CONFIG
|
2020-04-04 20:10:19 +08:00
|
|
|
$(call KCONFIG_DISABLE_OPT,ARCH_HAS_MMU)
|
|
|
|
$(call KCONFIG_DISABLE_OPT,ARCH_USE_MMU)
|
2013-08-10 03:23:40 +08:00
|
|
|
endef
|
|
|
|
endif
|
|
|
|
|
2013-07-01 03:29:05 +08:00
|
|
|
#
|
|
|
|
# IPv6
|
|
|
|
#
|
|
|
|
|
2020-04-04 20:10:19 +08:00
|
|
|
UCLIBC_IPV6_CONFIG = $(call KCONFIG_ENABLE_OPT,UCLIBC_HAS_IPV6)
|
2013-07-01 03:29:05 +08:00
|
|
|
|
|
|
|
#
|
|
|
|
# soft-float
|
|
|
|
#
|
|
|
|
|
|
|
|
ifeq ($(BR2_SOFT_FLOAT),y)
|
|
|
|
define UCLIBC_FLOAT_CONFIG
|
2020-04-04 20:10:19 +08:00
|
|
|
$(call KCONFIG_DISABLE_OPT,UCLIBC_HAS_FPU)
|
|
|
|
$(call KCONFIG_ENABLE_OPT,UCLIBC_HAS_FLOATS)
|
|
|
|
$(call KCONFIG_ENABLE_OPT,DO_C99_MATH)
|
2013-07-01 03:29:05 +08:00
|
|
|
endef
|
|
|
|
else
|
|
|
|
define UCLIBC_FLOAT_CONFIG
|
2020-04-04 20:10:19 +08:00
|
|
|
$(call KCONFIG_ENABLE_OPT,UCLIBC_HAS_FPU)
|
|
|
|
$(call KCONFIG_ENABLE_OPT,UCLIBC_HAS_FLOATS)
|
2013-07-01 03:29:05 +08:00
|
|
|
endef
|
|
|
|
endif
|
|
|
|
|
|
|
|
#
|
|
|
|
# SSP
|
|
|
|
#
|
|
|
|
ifeq ($(BR2_TOOLCHAIN_BUILDROOT_USE_SSP),y)
|
2013-07-05 02:30:26 +08:00
|
|
|
define UCLIBC_SSP_CONFIG
|
2020-04-04 20:10:19 +08:00
|
|
|
$(call KCONFIG_ENABLE_OPT,UCLIBC_HAS_SSP)
|
|
|
|
$(call KCONFIG_ENABLE_OPT,UCLIBC_BUILD_SSP)
|
2013-07-05 02:30:26 +08:00
|
|
|
endef
|
2013-07-01 03:29:05 +08:00
|
|
|
else
|
2013-07-05 02:30:26 +08:00
|
|
|
define UCLIBC_SSP_CONFIG
|
2020-04-04 20:10:19 +08:00
|
|
|
$(call KCONFIG_DISABLE_OPT,UCLIBC_HAS_SSP)
|
|
|
|
$(call KCONFIG_DISABLE_OPT,UCLIBC_BUILD_SSP)
|
2013-07-05 02:30:26 +08:00
|
|
|
endef
|
2013-07-01 03:29:05 +08:00
|
|
|
endif
|
|
|
|
|
|
|
|
#
|
|
|
|
# Threads
|
|
|
|
#
|
|
|
|
ifeq ($(BR2_PTHREADS_NONE),y)
|
|
|
|
define UCLIBC_THREAD_CONFIG
|
2020-04-04 20:10:19 +08:00
|
|
|
$(call KCONFIG_DISABLE_OPT,UCLIBC_HAS_THREADS)
|
|
|
|
$(call KCONFIG_DISABLE_OPT,UCLIBC_HAS_LINUXTHREADS)
|
|
|
|
$(call KCONFIG_DISABLE_OPT,UCLIBC_HAS_THREADS_NATIVE)
|
2013-07-01 03:29:05 +08:00
|
|
|
endef
|
|
|
|
else ifeq ($(BR2_PTHREADS),y)
|
|
|
|
define UCLIBC_THREAD_CONFIG
|
2020-04-04 20:10:19 +08:00
|
|
|
$(call KCONFIG_ENABLE_OPT,UCLIBC_HAS_THREADS)
|
|
|
|
$(call KCONFIG_ENABLE_OPT,UCLIBC_HAS_LINUXTHREADS)
|
|
|
|
$(call KCONFIG_DISABLE_OPT,UCLIBC_HAS_THREADS_NATIVE)
|
2013-07-01 03:29:05 +08:00
|
|
|
endef
|
|
|
|
else ifeq ($(BR2_PTHREADS_NATIVE),y)
|
|
|
|
define UCLIBC_THREAD_CONFIG
|
2020-04-04 20:10:19 +08:00
|
|
|
$(call KCONFIG_ENABLE_OPT,UCLIBC_HAS_THREADS)
|
|
|
|
$(call KCONFIG_DISABLE_OPT,UCLIBC_HAS_LINUXTHREADS)
|
|
|
|
$(call KCONFIG_ENABLE_OPT,UCLIBC_HAS_THREADS_NATIVE)
|
2013-07-01 03:29:05 +08:00
|
|
|
endef
|
|
|
|
endif
|
|
|
|
|
|
|
|
#
|
|
|
|
# Thread debug
|
|
|
|
#
|
|
|
|
|
|
|
|
ifeq ($(BR2_PTHREAD_DEBUG),y)
|
2020-04-04 20:10:19 +08:00
|
|
|
UCLIBC_THREAD_DEBUG_CONFIG = $(call KCONFIG_ENABLE_OPT,PTHREADS_DEBUG_SUPPORT)
|
2013-07-01 03:29:05 +08:00
|
|
|
else
|
2020-04-04 20:10:19 +08:00
|
|
|
UCLIBC_THREAD_DEBUG_CONFIG = $(call KCONFIG_DISABLE_OPT,PTHREADS_DEBUG_SUPPORT)
|
2013-07-01 03:29:05 +08:00
|
|
|
endif
|
|
|
|
|
|
|
|
#
|
|
|
|
# Locale
|
|
|
|
#
|
|
|
|
|
|
|
|
ifeq ($(BR2_TOOLCHAIN_BUILDROOT_LOCALE),y)
|
|
|
|
define UCLIBC_LOCALE_CONFIG
|
2020-04-04 20:10:19 +08:00
|
|
|
$(call KCONFIG_ENABLE_OPT,UCLIBC_HAS_LOCALE)
|
|
|
|
$(call KCONFIG_DISABLE_OPT,UCLIBC_BUILD_ALL_LOCALE)
|
|
|
|
$(call KCONFIG_ENABLE_OPT,UCLIBC_BUILD_MINIMAL_LOCALE)
|
|
|
|
$(call KCONFIG_SET_OPT,UCLIBC_BUILD_MINIMAL_LOCALES,"$(UCLIBC_LOCALES)")
|
|
|
|
$(call KCONFIG_DISABLE_OPT,UCLIBC_PREGENERATED_LOCALE_DATA)
|
|
|
|
$(call KCONFIG_DISABLE_OPT,DOWNLOAD_PREGENERATED_LOCALE_DATA)
|
|
|
|
$(call KCONFIG_ENABLE_OPT,UCLIBC_HAS_XLOCALE)
|
|
|
|
$(call KCONFIG_DISABLE_OPT,UCLIBC_HAS_GLIBC_DIGIT_GROUPING)
|
2013-07-01 03:29:05 +08:00
|
|
|
endef
|
|
|
|
else
|
|
|
|
define UCLIBC_LOCALE_CONFIG
|
2020-04-04 20:10:19 +08:00
|
|
|
$(call KCONFIG_DISABLE_OPT,UCLIBC_HAS_LOCALE)
|
2013-07-01 03:29:05 +08:00
|
|
|
endef
|
|
|
|
endif
|
|
|
|
|
|
|
|
#
|
|
|
|
# wchar
|
|
|
|
#
|
|
|
|
|
|
|
|
ifeq ($(BR2_TOOLCHAIN_BUILDROOT_WCHAR),y)
|
2020-04-04 20:10:19 +08:00
|
|
|
UCLIBC_WCHAR_CONFIG = $(call KCONFIG_ENABLE_OPT,UCLIBC_HAS_WCHAR)
|
2013-07-01 03:29:05 +08:00
|
|
|
else
|
2020-04-04 20:10:19 +08:00
|
|
|
UCLIBC_WCHAR_CONFIG = $(call KCONFIG_DISABLE_OPT,UCLIBC_HAS_WCHAR)
|
2013-07-01 03:29:05 +08:00
|
|
|
endif
|
|
|
|
|
2014-10-13 00:34:45 +08:00
|
|
|
#
|
|
|
|
# static/shared libs
|
|
|
|
#
|
|
|
|
|
2014-12-04 05:41:29 +08:00
|
|
|
ifeq ($(BR2_STATIC_LIBS),y)
|
2020-04-04 20:10:19 +08:00
|
|
|
UCLIBC_SHARED_LIBS_CONFIG = $(call KCONFIG_DISABLE_OPT,HAVE_SHARED)
|
2014-10-13 00:34:45 +08:00
|
|
|
else
|
2020-04-04 20:10:19 +08:00
|
|
|
UCLIBC_SHARED_LIBS_CONFIG = $(call KCONFIG_ENABLE_OPT,HAVE_SHARED)
|
2014-10-13 00:34:45 +08:00
|
|
|
endif
|
|
|
|
|
2013-07-01 03:29:05 +08:00
|
|
|
#
|
|
|
|
# Commands
|
|
|
|
#
|
|
|
|
|
|
|
|
UCLIBC_MAKE_FLAGS = \
|
|
|
|
ARCH="$(UCLIBC_TARGET_ARCH)" \
|
|
|
|
CROSS_COMPILE="$(TARGET_CROSS)" \
|
2018-04-04 23:54:51 +08:00
|
|
|
UCLIBC_EXTRA_CFLAGS="$(TARGET_ABI)" \
|
2013-07-01 03:29:05 +08:00
|
|
|
HOSTCC="$(HOSTCC)"
|
|
|
|
|
2014-08-03 23:32:42 +08:00
|
|
|
define UCLIBC_KCONFIG_FIXUP_CMDS
|
2020-04-04 20:10:19 +08:00
|
|
|
$(call KCONFIG_SET_OPT,CROSS_COMPILER_PREFIX,"$(TARGET_CROSS)")
|
|
|
|
$(call KCONFIG_ENABLE_OPT,TARGET_$(UCLIBC_TARGET_ARCH))
|
|
|
|
$(call KCONFIG_SET_OPT,TARGET_ARCH,"$(UCLIBC_TARGET_ARCH)")
|
|
|
|
$(call KCONFIG_SET_OPT,KERNEL_HEADERS,"$(LINUX_HEADERS_DIR)/usr/include")
|
|
|
|
$(call KCONFIG_SET_OPT,RUNTIME_PREFIX,"/")
|
|
|
|
$(call KCONFIG_SET_OPT,DEVEL_PREFIX,"/usr")
|
|
|
|
$(call KCONFIG_SET_OPT,SHARED_LIB_LOADER_PREFIX,"/lib")
|
2013-09-05 10:24:19 +08:00
|
|
|
$(UCLIBC_MMU_CONFIG)
|
2016-05-13 15:01:08 +08:00
|
|
|
$(UCLIBC_BINFMT_CONFIG)
|
2015-07-17 17:11:42 +08:00
|
|
|
$(UCLIBC_ARC_PAGE_SIZE_CONFIG)
|
2017-04-20 01:48:57 +08:00
|
|
|
$(UCLIBC_ARC_ATOMICS_CONFIG)
|
2013-07-01 03:29:05 +08:00
|
|
|
$(UCLIBC_ARM_ABI_CONFIG)
|
2016-03-19 05:08:09 +08:00
|
|
|
$(UCLIBC_ARM_BINFMT_FLAT)
|
2016-04-01 03:00:07 +08:00
|
|
|
$(UCLIBC_ARM_NO_CONTEXT_FUNCS)
|
2016-04-30 01:51:23 +08:00
|
|
|
$(UCLIBC_M68K_BINFMT_FLAT)
|
2013-07-01 03:29:05 +08:00
|
|
|
$(UCLIBC_MIPS_ABI_CONFIG)
|
2017-02-03 22:16:58 +08:00
|
|
|
$(UCLIBC_MIPS_NAN_CONFIG)
|
2013-07-01 03:29:05 +08:00
|
|
|
$(UCLIBC_SH_TYPE_CONFIG)
|
|
|
|
$(UCLIBC_SPARC_TYPE_CONFIG)
|
|
|
|
$(UCLIBC_POWERPC_TYPE_CONFIG)
|
|
|
|
$(UCLIBC_X86_TYPE_CONFIG)
|
2016-05-16 04:50:25 +08:00
|
|
|
$(UCLIBC_DEBUG_CONFIG)
|
2013-07-01 03:29:05 +08:00
|
|
|
$(UCLIBC_ENDIAN_CONFIG)
|
|
|
|
$(UCLIBC_IPV6_CONFIG)
|
|
|
|
$(UCLIBC_FLOAT_CONFIG)
|
|
|
|
$(UCLIBC_SSP_CONFIG)
|
|
|
|
$(UCLIBC_THREAD_CONFIG)
|
|
|
|
$(UCLIBC_THREAD_DEBUG_CONFIG)
|
|
|
|
$(UCLIBC_LOCALE_CONFIG)
|
|
|
|
$(UCLIBC_WCHAR_CONFIG)
|
2014-10-13 00:34:45 +08:00
|
|
|
$(UCLIBC_SHARED_LIBS_CONFIG)
|
2013-07-18 17:25:49 +08:00
|
|
|
endef
|
|
|
|
|
2013-07-01 03:29:05 +08:00
|
|
|
define UCLIBC_BUILD_CMDS
|
2015-02-14 17:23:13 +08:00
|
|
|
$(MAKE) -C $(@D) $(UCLIBC_MAKE_FLAGS) headers
|
|
|
|
$(MAKE) -C $(@D) $(UCLIBC_MAKE_FLAGS)
|
2014-06-28 00:26:00 +08:00
|
|
|
$(MAKE) -C $(@D)/utils \
|
2013-07-01 03:29:05 +08:00
|
|
|
PREFIX=$(HOST_DIR) \
|
|
|
|
HOSTCC="$(HOSTCC)" hostutils
|
|
|
|
endef
|
|
|
|
|
2013-07-20 20:52:09 +08:00
|
|
|
ifeq ($(BR2_UCLIBC_INSTALL_UTILS),y)
|
|
|
|
define UCLIBC_INSTALL_UTILS_TARGET
|
|
|
|
$(MAKE1) -C $(@D) \
|
|
|
|
CC="$(TARGET_CC)" CPP="$(TARGET_CPP)" LD="$(TARGET_LD)" \
|
|
|
|
ARCH="$(UCLIBC_TARGET_ARCH)" \
|
|
|
|
PREFIX=$(TARGET_DIR) \
|
|
|
|
utils install_utils
|
|
|
|
endef
|
|
|
|
endif
|
|
|
|
|
2013-07-01 03:29:05 +08:00
|
|
|
define UCLIBC_INSTALL_TARGET_CMDS
|
|
|
|
$(MAKE1) -C $(@D) \
|
|
|
|
$(UCLIBC_MAKE_FLAGS) \
|
|
|
|
PREFIX=$(TARGET_DIR) \
|
|
|
|
DEVEL_PREFIX=/usr/ \
|
|
|
|
RUNTIME_PREFIX=/ \
|
|
|
|
install_runtime
|
2013-07-20 20:52:09 +08:00
|
|
|
$(UCLIBC_INSTALL_UTILS_TARGET)
|
2013-07-01 03:29:05 +08:00
|
|
|
endef
|
|
|
|
|
2014-05-26 06:12:56 +08:00
|
|
|
# STATIC has no ld* tools, only getconf
|
2014-12-04 05:41:29 +08:00
|
|
|
ifeq ($(BR2_STATIC_LIBS),)
|
2013-07-20 20:52:13 +08:00
|
|
|
define UCLIBC_INSTALL_UTILS_STAGING
|
2017-07-05 19:14:19 +08:00
|
|
|
$(INSTALL) -D -m 0755 $(@D)/utils/ldd.host $(HOST_DIR)/bin/ldd
|
|
|
|
ln -sf ldd $(HOST_DIR)/bin/$(GNU_TARGET_NAME)-ldd
|
|
|
|
$(INSTALL) -D -m 0755 $(@D)/utils/ldconfig.host $(HOST_DIR)/bin/ldconfig
|
|
|
|
ln -sf ldconfig $(HOST_DIR)/bin/$(GNU_TARGET_NAME)-ldconfig
|
2013-07-20 20:52:13 +08:00
|
|
|
endef
|
|
|
|
endif
|
|
|
|
|
2013-07-01 03:29:05 +08:00
|
|
|
define UCLIBC_INSTALL_STAGING_CMDS
|
|
|
|
$(MAKE1) -C $(@D) \
|
|
|
|
$(UCLIBC_MAKE_FLAGS) \
|
|
|
|
PREFIX=$(STAGING_DIR) \
|
|
|
|
DEVEL_PREFIX=/usr/ \
|
|
|
|
RUNTIME_PREFIX=/ \
|
|
|
|
install_runtime install_dev
|
2013-07-20 20:52:13 +08:00
|
|
|
$(UCLIBC_INSTALL_UTILS_STAGING)
|
2013-07-01 03:29:05 +08:00
|
|
|
endef
|
|
|
|
|
2015-07-13 18:32:04 +08:00
|
|
|
# Checks to give errors that the user can understand
|
|
|
|
# Must be before we call to kconfig-package
|
2015-07-14 18:13:21 +08:00
|
|
|
ifeq ($(BR2_PACKAGE_UCLIBC)$(BR_BUILDING),yy)
|
2015-07-13 18:32:04 +08:00
|
|
|
ifeq ($(call qstrip,$(BR2_UCLIBC_CONFIG)),)
|
|
|
|
$(error No uClibc configuration file specified, check your BR2_UCLIBC_CONFIG setting)
|
|
|
|
endif
|
|
|
|
endif
|
|
|
|
|
2014-08-03 23:32:42 +08:00
|
|
|
$(eval $(kconfig-package))
|