2007-02-24 11:00:05 +00:00
|
|
|
# This file declares functions to install the uClibc C library
|
|
|
|
# Copyright 2007 Yann E. MORIN
|
|
|
|
# Licensed under the GPL v2. See COPYING in the root of this package
|
|
|
|
|
2016-04-02 06:28:43 +00:00
|
|
|
# This function builds and install the full C library
|
2022-01-05 08:37:45 +00:00
|
|
|
uClibc_ng_main()
|
2018-11-24 06:14:07 +00:00
|
|
|
{
|
Fold libc_start_files into libc
After 557b9d4, libc_start_files and libc_main steps are performed one
after another. It doesn't make sense, especially since some of the libcs
(glibc, uClibc-ng) go to great lengths to first install start files in
the first step, libc_start_files, only to remove them immediately in the
second step, libc_main.
Current build steps also break in the xtensa newlib configurations, as
it needs to install the custom xtensa headers before building the libgcc
and after 557b9d4, the headers are not installed before libgcc is built
in pass-1.
Therefore, finish what 557b9d4 mentioned but did not do: move header
installation into a new step, libc_headers, and combine libc_start_files
and libc_main into a single step.
This also allows to combine the core pass-1/pass-2 steps, to be done in
a subsequent commit.
Signed-off-by: Alexey Neyman <stilor@att.net>
2022-02-08 23:52:48 +00:00
|
|
|
CT_DoStep INFO "Installing C library"
|
|
|
|
CT_mkdir_pushd "${CT_BUILD_DIR}/build-libc"
|
|
|
|
CT_IterateMultilibs uClibc_ng_backend_once multilib
|
2016-04-12 06:11:22 +00:00
|
|
|
CT_Popd
|
2016-04-05 21:47:20 +00:00
|
|
|
CT_EndStep
|
|
|
|
}
|
|
|
|
|
|
|
|
# Common backend for 1st and 2nd passes, once per multilib.
|
2022-01-05 08:37:45 +00:00
|
|
|
uClibc_ng_backend_once()
|
2018-11-24 06:14:07 +00:00
|
|
|
{
|
2016-04-11 20:59:16 +00:00
|
|
|
local multi_dir multi_os_dir multi_root multi_flags multi_index multi_count
|
|
|
|
local multilib_dir startfiles_dir
|
2022-01-05 08:37:45 +00:00
|
|
|
local jflag=${CT_JOBSFLAGS}
|
2016-04-05 21:47:20 +00:00
|
|
|
local -a make_args
|
|
|
|
local extra_cflags f cfg_cflags cf
|
|
|
|
local hdr_install_subdir
|
|
|
|
|
|
|
|
for arg in "$@"; do
|
|
|
|
eval "${arg// /\\ }"
|
|
|
|
done
|
|
|
|
|
2017-07-03 21:49:54 +00:00
|
|
|
CT_DoStep INFO "Building for multilib ${multi_index}/${multi_count}: '${multi_flags}'"
|
2007-02-24 11:00:05 +00:00
|
|
|
|
2016-04-02 06:28:43 +00:00
|
|
|
multilib_dir="lib/${multi_os_dir}"
|
|
|
|
startfiles_dir="${multi_root}/usr/${multilib_dir}"
|
|
|
|
CT_SanitizeVarDir multilib_dir startfiles_dir
|
|
|
|
|
|
|
|
# Construct make arguments:
|
|
|
|
# - uClibc uses the CROSS environment variable as a prefix to the compiler
|
2022-02-09 01:25:12 +00:00
|
|
|
# tools to use. Since it requires core compiler, thusly named compiler is
|
2016-04-02 06:28:43 +00:00
|
|
|
# already available.
|
|
|
|
# - Note about CFLAGS: In uClibc, CFLAGS are generated by Rules.mak,
|
|
|
|
# depending on the configuration of the library. That is, they are tailored
|
|
|
|
# to best fit the target. So it is useless and seems to be a bad thing to
|
|
|
|
# use LIBC_EXTRA_CFLAGS here.
|
|
|
|
# - We do _not_ want to strip anything for now, in case we specifically
|
|
|
|
# asked for a debug toolchain, thus the STRIPTOOL= assignment.
|
|
|
|
make_args=( CROSS_COMPILE="${CT_TARGET}-" \
|
2017-04-02 20:25:41 +00:00
|
|
|
HOSTCC="${CT_BUILD}-gcc" \
|
2016-04-02 06:28:43 +00:00
|
|
|
PREFIX="${multi_root}/" \
|
|
|
|
MULTILIB_DIR="${multilib_dir}" \
|
|
|
|
STRIPTOOL=true \
|
|
|
|
${CT_LIBC_UCLIBC_VERBOSITY} \
|
|
|
|
)
|
2016-03-21 18:18:53 +00:00
|
|
|
|
2017-07-03 21:49:54 +00:00
|
|
|
# Simply copy files until uClibc has the ability to build out-of-tree
|
|
|
|
CT_DoLog EXTRA "Copying sources to build dir"
|
2022-01-05 08:37:45 +00:00
|
|
|
CT_DoExecLog ALL cp -av "${CT_SRC_DIR}/uClibc-ng/." .
|
2017-07-03 21:49:54 +00:00
|
|
|
|
2016-04-02 06:28:43 +00:00
|
|
|
# Force the date of the pregen locale data, as the
|
|
|
|
# newer ones that are referenced are not available
|
2007-02-24 11:00:05 +00:00
|
|
|
CT_DoLog EXTRA "Applying configuration"
|
2016-04-02 07:12:41 +00:00
|
|
|
|
|
|
|
# Use the default config if the user did not provide one.
|
|
|
|
if [ -z "${CT_LIBC_UCLIBC_CONFIG_FILE}" ]; then
|
2022-01-05 08:37:45 +00:00
|
|
|
CT_LIBC_UCLIBC_CONFIG_FILE="${CT_LIB_DIR}/packages/uClibc-ng/config"
|
2016-04-02 07:12:41 +00:00
|
|
|
fi
|
|
|
|
|
2016-04-05 21:47:20 +00:00
|
|
|
manage_uClibc_config "${CT_LIBC_UCLIBC_CONFIG_FILE}" .config "${multi_flags}"
|
2017-02-05 05:16:10 +00:00
|
|
|
CT_DoExecLog ALL make "${make_args[@]}" olddefconfig
|
2016-04-02 06:28:43 +00:00
|
|
|
|
2016-04-05 21:47:20 +00:00
|
|
|
# Now filter the multilib flags. manage_uClibc_config did the opposite of
|
|
|
|
# what Rules.mak in uClibc would do: by the multilib's CFLAGS, it determined
|
|
|
|
# the applicable configuration options. We don't want to pass the same options
|
|
|
|
# in the UCLIBC_EXTRA_CFLAGS again (on some targets, the options do not correctly
|
|
|
|
# override each other). On the other hand, we do not want to lose the options
|
|
|
|
# that are not reflected in the .config.
|
|
|
|
extra_cflags="-pipe"
|
|
|
|
{ echo "include Rules.mak"; echo "show-cpu-flags:"; printf '\t@echo $(CPU_CFLAGS)\n'; } \
|
|
|
|
> .show-cpu-cflags.mk
|
2016-11-21 07:50:17 +00:00
|
|
|
cfg_cflags=$( make "${make_args[@]}" \
|
2016-04-05 21:47:20 +00:00
|
|
|
--no-print-directory -f .show-cpu-cflags.mk show-cpu-flags )
|
|
|
|
CT_DoExecLog ALL rm -f .show-cpu-cflags.mk
|
|
|
|
CT_DoLog DEBUG "CPU_CFLAGS detected by uClibc: ${cfg_cflags[@]}"
|
|
|
|
for f in ${multi_flags}; do
|
|
|
|
for cf in ${cfg_cflags}; do
|
|
|
|
if [ "${f}" = "${cf}" ]; then
|
|
|
|
f=
|
|
|
|
break
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
if [ -n "${f}" ]; then
|
|
|
|
extra_cflags+=" ${f}"
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
CT_DoLog DEBUG "Filtered multilib CFLAGS: ${extra_cflags}"
|
|
|
|
make_args+=( UCLIBC_EXTRA_CFLAGS="${extra_cflags}" )
|
|
|
|
|
|
|
|
# uClibc does not have a way to select the installation subdirectory for headers,
|
|
|
|
# it is always $(DEVEL_PREFIX)/include. Also, we're reinstalling the headers
|
|
|
|
# at the final stage (see the note below), we may already have the subdirectory
|
|
|
|
# in /usr/include.
|
|
|
|
CT_DoArchUClibcHeaderDir hdr_install_subdir "${multi_flags}"
|
2016-04-14 07:30:34 +00:00
|
|
|
if [ -n "${hdr_install_subdir}" ]; then
|
2016-04-05 21:47:20 +00:00
|
|
|
CT_DoExecLog ALL cp -a "${multi_root}/usr/include" "${multi_root}/usr/include.saved"
|
|
|
|
fi
|
|
|
|
|
Fold libc_start_files into libc
After 557b9d4, libc_start_files and libc_main steps are performed one
after another. It doesn't make sense, especially since some of the libcs
(glibc, uClibc-ng) go to great lengths to first install start files in
the first step, libc_start_files, only to remove them immediately in the
second step, libc_main.
Current build steps also break in the xtensa newlib configurations, as
it needs to install the custom xtensa headers before building the libgcc
and after 557b9d4, the headers are not installed before libgcc is built
in pass-1.
Therefore, finish what 557b9d4 mentioned but did not do: move header
installation into a new step, libc_headers, and combine libc_start_files
and libc_main into a single step.
This also allows to combine the core pass-1/pass-2 steps, to be done in
a subsequent commit.
Signed-off-by: Alexey Neyman <stilor@att.net>
2022-02-08 23:52:48 +00:00
|
|
|
CT_DoLog EXTRA "Building C library"
|
|
|
|
CT_DoExecLog ALL make "${make_args[@]}" pregen
|
|
|
|
CT_DoExecLog ALL make ${jflag} "${make_args[@]}" all
|
|
|
|
CT_DoLog EXTRA "Installing C library"
|
|
|
|
CT_DoExecLog ALL make "${make_args[@]}" install install_utils
|
2007-02-24 11:00:05 +00:00
|
|
|
|
2016-04-05 21:47:20 +00:00
|
|
|
# Now, if installing headers into a subdirectory, put everything in its place.
|
|
|
|
# Remove the header subdirectory if it existed already.
|
2016-04-14 07:30:34 +00:00
|
|
|
if [ -n "${hdr_install_subdir}" ]; then
|
2016-04-05 21:47:20 +00:00
|
|
|
CT_DoExecLog ALL mv "${multi_root}/usr/include" "${multi_root}/usr/include.new"
|
|
|
|
CT_DoExecLog ALL mv "${multi_root}/usr/include.saved" "${multi_root}/usr/include"
|
|
|
|
CT_DoExecLog ALL rm -rf "${multi_root}/usr/include/${hdr_install_subdir}"
|
|
|
|
CT_DoExecLog ALL mv "${multi_root}/usr/include.new" "${multi_root}/usr/include/${hdr_install_subdir}"
|
|
|
|
fi
|
2016-04-12 06:11:22 +00:00
|
|
|
|
2016-04-11 20:59:16 +00:00
|
|
|
CT_EndStep
|
|
|
|
}
|
|
|
|
|
2007-02-24 11:00:05 +00:00
|
|
|
# Initialises the .config file to sensible values
|
2007-07-28 11:59:37 +00:00
|
|
|
# $1: original file
|
2015-11-10 07:50:13 +00:00
|
|
|
# $2: modified file
|
2018-11-24 06:14:07 +00:00
|
|
|
manage_uClibc_config()
|
|
|
|
{
|
2015-11-10 07:50:13 +00:00
|
|
|
src="$1"
|
|
|
|
dst="$2"
|
2016-04-05 21:47:20 +00:00
|
|
|
flags="$3"
|
2007-02-24 11:00:05 +00:00
|
|
|
|
2015-11-10 07:50:13 +00:00
|
|
|
# Start with fresh files
|
|
|
|
CT_DoExecLog ALL cp "${src}" "${dst}"
|
2010-01-01 17:47:20 +00:00
|
|
|
|
2011-11-20 20:08:27 +00:00
|
|
|
case "${CT_ARCH_ENDIAN}" in
|
2017-08-29 22:36:52 +00:00
|
|
|
big|big,little)
|
2015-11-10 07:50:13 +00:00
|
|
|
CT_KconfigDisableOption "ARCH_LITTLE_ENDIAN" "${dst}"
|
|
|
|
CT_KconfigDisableOption "ARCH_WANTS_LITTLE_ENDIAN" "${dst}"
|
|
|
|
CT_KconfigEnableOption "ARCH_BIG_ENDIAN" "${dst}"
|
|
|
|
CT_KconfigEnableOption "ARCH_WANTS_BIG_ENDIAN" "${dst}"
|
|
|
|
;;
|
2017-08-29 22:36:52 +00:00
|
|
|
little|little,big)
|
2015-11-10 07:50:13 +00:00
|
|
|
CT_KconfigDisableOption "ARCH_BIG_ENDIAN" "${dst}"
|
|
|
|
CT_KconfigDisableOption "ARCH_WANTS_BIG_ENDIAN" "${dst}"
|
|
|
|
CT_KconfigEnableOption "ARCH_LITTLE_ENDIAN" "${dst}"
|
|
|
|
CT_KconfigEnableOption "ARCH_WANTS_LITTLE_ENDIAN" "${dst}"
|
|
|
|
;;
|
2007-02-24 11:00:05 +00:00
|
|
|
esac
|
|
|
|
|
2011-04-24 16:57:01 +00:00
|
|
|
if [ "${CT_ARCH_USE_MMU}" = "y" ]; then
|
2015-11-10 07:50:13 +00:00
|
|
|
CT_KconfigEnableOption "ARCH_USE_MMU" "${dst}"
|
2011-04-24 16:57:01 +00:00
|
|
|
else
|
2015-11-10 07:50:13 +00:00
|
|
|
CT_KconfigDisableOption "ARCH_USE_MMU" "${dst}"
|
2019-02-20 08:43:39 +00:00
|
|
|
CT_KconfigDisableOption "UCLIBC_FORMAT_FDPIC" "${dst}"
|
|
|
|
CT_KconfigDisableOption "UCLIBC_FORMAT_FLAT" "${dst}"
|
|
|
|
CT_KconfigDisableOption "UCLIBC_FORMAT_SHARED_FLAT" "${dst}"
|
|
|
|
case "${CT_ARCH_BINFMT_FLAT},${CT_ARCH_BINFMT_FDPIC},${CT_SHARED_LIBS}" in
|
|
|
|
y,,y) CT_KconfigEnableOption "UCLIBC_FORMAT_SHARED_FLAT" "${dst}";;
|
|
|
|
y,,) CT_KconfigEnableOption "UCLIBC_FORMAT_FLAT" "${dst}";;
|
|
|
|
,y,*) CT_KconfigEnableOption "UCLIBC_FORMAT_FDPIC" "${dst}";;
|
|
|
|
*) CT_Abort "Unsupported binary format";;
|
|
|
|
esac
|
2011-04-24 16:57:01 +00:00
|
|
|
fi
|
|
|
|
|
2016-08-29 17:46:02 +00:00
|
|
|
if [ "${CT_SHARED_LIBS}" = "y" ]; then
|
|
|
|
CT_KconfigEnableOption "HAVE_SHARED" "${dst}"
|
|
|
|
else
|
|
|
|
CT_KconfigDisableOption "HAVE_SHARED" "${dst}"
|
|
|
|
fi
|
|
|
|
|
2007-05-19 22:52:47 +00:00
|
|
|
# Accomodate for old and new uClibc version, where the
|
|
|
|
# way to select between hard/soft float has changed
|
2011-11-14 17:54:37 +00:00
|
|
|
case "${CT_ARCH_FLOAT}" in
|
|
|
|
hard|softfp)
|
2015-11-10 07:50:13 +00:00
|
|
|
CT_KconfigEnableOption "UCLIBC_HAS_FPU" "${dst}"
|
|
|
|
CT_KconfigEnableOption "UCLIBC_HAS_FLOATS" "${dst}"
|
2007-02-24 11:00:05 +00:00
|
|
|
;;
|
2011-11-14 17:54:37 +00:00
|
|
|
soft)
|
2015-11-10 07:50:13 +00:00
|
|
|
CT_KconfigDisableOption "UCLIBC_HAS_FPU" "${dst}"
|
|
|
|
CT_KconfigEnableOption "UCLIBC_HAS_FLOATS" "${dst}"
|
|
|
|
CT_KconfigEnableOption "DO_C99_MATH" "${dst}"
|
2007-02-24 11:00:05 +00:00
|
|
|
;;
|
|
|
|
esac
|
2014-01-04 15:19:18 +00:00
|
|
|
if [ "${CT_LIBC_UCLIBC_FENV}" = "y" ]; then
|
2015-11-10 07:50:13 +00:00
|
|
|
CT_KconfigEnableOption "UCLIBC_HAS_FENV" "${dst}"
|
2017-01-23 22:37:18 +00:00
|
|
|
else
|
|
|
|
CT_KconfigDisableOption "UCLIBC_HAS_FENV" "${dst}"
|
|
|
|
fi
|
|
|
|
if [ "${CT_LIBC_UCLIBC_RPC}" = "y" ]; then
|
|
|
|
CT_KconfigEnableOption "UCLIBC_HAS_RPC" "${dst}"
|
|
|
|
else
|
|
|
|
CT_KconfigDisableOption "UCLIBC_HAS_RPC" "${dst}"
|
2014-01-04 15:19:18 +00:00
|
|
|
fi
|
2007-02-24 11:00:05 +00:00
|
|
|
|
2011-08-12 22:05:51 +00:00
|
|
|
# We always want ctor/dtor
|
2015-11-10 07:50:13 +00:00
|
|
|
CT_KconfigEnableOption "UCLIBC_CTOR_DTOR" "${dst}"
|
2011-08-12 22:05:51 +00:00
|
|
|
|
2007-09-16 17:59:18 +00:00
|
|
|
# Change paths to work with crosstool-NG
|
2015-11-10 07:50:13 +00:00
|
|
|
#
|
|
|
|
# DEVEL_PREFIX is left as '/usr/' because it is post-pended to $PREFIX,
|
|
|
|
# which is the correct value of ${PREFIX}/${TARGET}.
|
|
|
|
CT_KconfigSetOption "DEVEL_PREFIX" "\"/usr/\"" "${dst}"
|
|
|
|
CT_KconfigSetOption "RUNTIME_PREFIX" "\"/\"" "${dst}"
|
|
|
|
CT_KconfigSetOption "KERNEL_HEADERS" "\"${CT_HEADERS_DIR}\"" "${dst}"
|
2007-02-24 11:00:05 +00:00
|
|
|
|
2008-11-01 17:13:54 +00:00
|
|
|
# Locales support
|
2007-02-24 11:00:05 +00:00
|
|
|
# Note that the two PREGEN_LOCALE and the XLOCALE lines may be missing
|
|
|
|
# entirely if LOCALE is not set. If LOCALE was already set, we'll
|
|
|
|
# assume the user has already made all the appropriate generation
|
|
|
|
# arrangements. Note that having the uClibc Makefile download the
|
2017-07-03 21:49:54 +00:00
|
|
|
# pregenerated locales is not compatible with crosstool.
|
2017-07-04 00:45:37 +00:00
|
|
|
if [ -z "${CT_LIBC_UCLIBC_LOCALES}" ]; then
|
|
|
|
CT_KconfigDisableOption "UCLIBC_HAS_LOCALE" "${dst}"
|
|
|
|
else
|
2015-11-10 07:50:13 +00:00
|
|
|
CT_KconfigEnableOption "UCLIBC_HAS_LOCALE" "${dst}"
|
|
|
|
CT_KconfigDeleteOption "UCLIBC_PREGENERATED_LOCALE_DATA" "${dst}"
|
2017-07-03 21:49:54 +00:00
|
|
|
CT_KconfigDeleteOption "UCLIBC_DOWNLOAD_PREGENERATED_LOCALE_DATA" "${dst}"
|
2017-07-04 00:45:37 +00:00
|
|
|
fi
|
2008-11-01 17:13:54 +00:00
|
|
|
|
2009-11-06 19:17:30 +00:00
|
|
|
# WCHAR support
|
2015-11-10 07:50:13 +00:00
|
|
|
if [ "${CT_LIBC_UCLIBC_WCHAR}" = "y" ]; then
|
|
|
|
CT_KconfigEnableOption "UCLIBC_HAS_WCHAR" "${dst}"
|
2009-11-06 19:17:30 +00:00
|
|
|
else
|
2015-11-10 07:50:13 +00:00
|
|
|
CT_KconfigDisableOption "UCLIBC_HAS_WCHAR" "${dst}"
|
2009-11-06 19:17:30 +00:00
|
|
|
fi
|
|
|
|
|
2015-11-23 06:18:08 +00:00
|
|
|
# IPv6 support
|
|
|
|
if [ "${CT_LIBC_UCLIBC_IPV6}" = "y" ]; then
|
|
|
|
CT_KconfigEnableOption "UCLIBC_HAS_IPV6" "${dst}"
|
|
|
|
else
|
|
|
|
CT_KconfigDisableOption "UCLIBC_HAS_IPV6" "${dst}"
|
|
|
|
fi
|
|
|
|
|
2018-02-10 22:35:50 +00:00
|
|
|
# Iconv support
|
|
|
|
if [ "${CT_LIBC_UCLIBC_LIBICONV}" = "y" ]; then
|
|
|
|
CT_KconfigEnableOption "UCLIBC_HAS_LIBICONV" "${dst}"
|
|
|
|
else
|
|
|
|
CT_KconfigDisableOption "UCLIBC_HAS_LIBICONV" "${dst}"
|
|
|
|
fi
|
|
|
|
|
2008-11-01 17:13:54 +00:00
|
|
|
# Force on options needed for C++ if we'll be making a C++ compiler.
|
|
|
|
# I'm not sure locales are a requirement for doing C++... Are they?
|
2007-02-24 11:00:05 +00:00
|
|
|
if [ "${CT_CC_LANG_CXX}" = "y" ]; then
|
2015-11-10 07:50:13 +00:00
|
|
|
CT_KconfigEnableOption "DO_C99_MATH" "${dst}"
|
|
|
|
CT_KconfigEnableOption "UCLIBC_HAS_GNU_GETOPT" "${dst}"
|
|
|
|
fi
|
|
|
|
|
|
|
|
# Stack Smash Protection (SSP)
|
2018-12-05 00:15:37 +00:00
|
|
|
if [ "${CT_LIBC_UCLIBC_HAS_SSP}" = "y" ]; then
|
2015-11-10 07:50:13 +00:00
|
|
|
CT_KconfigEnableOption "UCLIBC_HAS_SSP" "${dst}"
|
|
|
|
else
|
|
|
|
CT_KconfigDisableOption "UCLIBC_HAS_SSP" "${dst}"
|
2018-12-05 00:15:37 +00:00
|
|
|
fi
|
|
|
|
if [ "${CT_LIBC_UCLIBC_BUILD_SSP}" = "y" ]; then
|
|
|
|
CT_KconfigEnableOption "UCLIBC_BUILD_SSP" "${dst}"
|
|
|
|
else
|
2015-11-10 07:50:13 +00:00
|
|
|
CT_KconfigDisableOption "UCLIBC_BUILD_SSP" "${dst}"
|
2007-02-24 11:00:05 +00:00
|
|
|
fi
|
|
|
|
|
2010-06-08 22:41:25 +00:00
|
|
|
# Push the threading model
|
2016-04-04 15:25:07 +00:00
|
|
|
CT_KconfigDisableOption "UCLIBC_HAS_THREADS" "${dst}"
|
|
|
|
CT_KconfigDisableOption "LINUXTHREADS_OLD" "${dst}"
|
|
|
|
CT_KconfigDisableOption "LINUXTHREADS_NEW" "${dst}"
|
|
|
|
CT_KconfigDisableOption "UCLIBC_HAS_THREADS_NATIVE" "${dst}"
|
2022-01-05 08:37:45 +00:00
|
|
|
case "${CT_THREADS}" in
|
|
|
|
none)
|
2010-06-08 22:41:25 +00:00
|
|
|
;;
|
2022-01-05 08:37:45 +00:00
|
|
|
linuxthreads)
|
2016-09-20 01:50:08 +00:00
|
|
|
CT_KconfigEnableOption "UCLIBC_HAS_THREADS" "${dst}"
|
|
|
|
CT_KconfigEnableOption "UCLIBC_HAS_LINUXTHREADS" "${dst}"
|
|
|
|
;;
|
2022-01-05 08:37:45 +00:00
|
|
|
nptl)
|
2015-11-10 07:50:13 +00:00
|
|
|
CT_KconfigEnableOption "UCLIBC_HAS_THREADS" "${dst}"
|
|
|
|
CT_KconfigEnableOption "UCLIBC_HAS_THREADS_NATIVE" "${dst}"
|
2010-06-08 22:41:25 +00:00
|
|
|
;;
|
2010-07-02 23:15:28 +00:00
|
|
|
*)
|
2022-01-05 08:37:45 +00:00
|
|
|
CT_Abort "Incorrect thread settings: CT_THREADS='${CT_THREADS}'"
|
2010-07-02 23:15:28 +00:00
|
|
|
;;
|
2010-06-08 22:41:25 +00:00
|
|
|
esac
|
|
|
|
|
2008-06-19 08:14:52 +00:00
|
|
|
# Always build the libpthread_db
|
2015-11-10 07:50:13 +00:00
|
|
|
CT_KconfigEnableOption "PTHREADS_DEBUG_SUPPORT" "${dst}"
|
2008-06-19 08:14:52 +00:00
|
|
|
|
2007-02-24 11:00:05 +00:00
|
|
|
# Force on debug options if asked for
|
2016-04-04 15:25:07 +00:00
|
|
|
CT_KconfigDisableOption "DODEBUG" "${dst}"
|
|
|
|
CT_KconfigDisableOption "DODEBUG_PT" "${dst}"
|
|
|
|
CT_KconfigDisableOption "DOASSERTS" "${dst}"
|
|
|
|
CT_KconfigDisableOption "SUPPORT_LD_DEBUG" "${dst}"
|
|
|
|
CT_KconfigDisableOption "SUPPORT_LD_DEBUG_EARLY" "${dst}"
|
|
|
|
CT_KconfigDisableOption "UCLIBC_MALLOC_DEBUGGING" "${dst}"
|
2007-02-24 11:00:05 +00:00
|
|
|
case "${CT_LIBC_UCLIBC_DEBUG_LEVEL}" in
|
2015-11-10 07:50:13 +00:00
|
|
|
0)
|
|
|
|
;;
|
|
|
|
1)
|
|
|
|
CT_KconfigEnableOption "DODEBUG" "${dst}"
|
|
|
|
;;
|
|
|
|
2)
|
|
|
|
CT_KconfigEnableOption "DODEBUG" "${dst}"
|
|
|
|
CT_KconfigEnableOption "DOASSERTS" "${dst}"
|
|
|
|
CT_KconfigEnableOption "SUPPORT_LD_DEBUG" "${dst}"
|
|
|
|
CT_KconfigEnableOption "UCLIBC_MALLOC_DEBUGGING" "${dst}"
|
|
|
|
;;
|
|
|
|
3)
|
|
|
|
CT_KconfigEnableOption "DODEBUG" "${dst}"
|
|
|
|
CT_KconfigEnableOption "DODEBUG_PT" "${dst}"
|
|
|
|
CT_KconfigEnableOption "DOASSERTS" "${dst}"
|
|
|
|
CT_KconfigEnableOption "SUPPORT_LD_DEBUG" "${dst}"
|
|
|
|
CT_KconfigEnableOption "SUPPORT_LD_DEBUG_EARLY" "${dst}"
|
|
|
|
CT_KconfigEnableOption "UCLIBC_MALLOC_DEBUGGING" "${dst}"
|
|
|
|
;;
|
2007-02-24 11:00:05 +00:00
|
|
|
esac
|
2016-04-04 15:25:07 +00:00
|
|
|
|
|
|
|
# Remove stripping: its the responsibility of the
|
|
|
|
# firmware builder to strip or not.
|
|
|
|
CT_KconfigDisableOption "DOSTRIP" "${dst}"
|
|
|
|
|
|
|
|
# Now allow architecture to tweak as it wants
|
|
|
|
CT_DoArchUClibcConfig "${dst}"
|
2016-04-05 21:47:20 +00:00
|
|
|
CT_DoArchUClibcCflags "${dst}" "${flags}"
|
2019-02-20 07:39:14 +00:00
|
|
|
|
|
|
|
# Preserve the config we created (before uclibc's `make olddefconfig`
|
|
|
|
# overrides anything).
|
|
|
|
CT_DoExecLog ALL cp "${dst}" "${dst}.created-by-ct-ng"
|
2007-02-24 11:00:05 +00:00
|
|
|
}
|
2015-06-21 23:53:06 +00:00
|
|
|
|
2022-01-05 08:37:45 +00:00
|
|
|
uClibc_ng_post_cc()
|
2018-11-24 06:14:07 +00:00
|
|
|
{
|
2016-04-17 07:11:03 +00:00
|
|
|
# uClibc and GCC disagree where the dynamic linker lives. uClibc always
|
|
|
|
# places it in the MULTILIB_DIR, while gcc does that for *some* variants
|
|
|
|
# and expects it in /lib for the other. So, create a symlink from lib
|
|
|
|
# to the actual location, but only if that will not override the actual
|
|
|
|
# file in /lib. Thus, need to do this after all the variants are built.
|
|
|
|
# Moreover, need to do this after the final compiler is built: on targets
|
|
|
|
# that use elf2flt, the core compilers cannot find ld when running elf2flt.
|
2017-03-13 02:41:09 +00:00
|
|
|
CT_MultilibFixupLDSO
|
2019-01-23 07:52:04 +00:00
|
|
|
|
|
|
|
if [ -n "${CT_LIBC_UCLIBC_CONFIG_FILE}" ]; then
|
2019-01-23 07:54:29 +00:00
|
|
|
CT_InstallConfigurationFile "${CT_LIBC_UCLIBC_CONFIG_FILE}" libc
|
2019-01-23 07:52:04 +00:00
|
|
|
fi
|
2015-06-21 23:53:06 +00:00
|
|
|
}
|