2018-11-24 06:14:07 +00:00
|
|
|
# C library build routines. We don't invoke the corresponding functions directly
|
|
|
|
# because some of them build on top of another. E.g. moxiebox runtime requires
|
|
|
|
# newlib as a prerequisite.
|
|
|
|
|
|
|
|
# Define default hooks - download/unpack just the main package; no-op build hooks.
|
|
|
|
# The actual implementation can override just what it needs then.
|
2018-12-15 02:50:51 +00:00
|
|
|
eval "${CT_LIBC//[^A-Za-z0-9]/_}_get() { CT_Fetch \"\${CT_LIBC_${CT_LIBC_CHOICE_KSYM}_PKG_KSYM}\"; }"
|
|
|
|
eval "${CT_LIBC//[^A-Za-z0-9]/_}_extract() { CT_ExtractPatch \"\${CT_LIBC_${CT_LIBC_CHOICE_KSYM}_PKG_KSYM}\"; }"
|
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
|
|
|
for _m in headers main post_cc; do
|
2018-11-24 06:14:07 +00:00
|
|
|
eval "${CT_LIBC//[^A-Za-z0-9]/_}_${_m}() { :; }"
|
|
|
|
done
|
|
|
|
|
|
|
|
# Source the selected libc.
|
|
|
|
. "${CT_LIB_DIR}/scripts/build/libc/${CT_LIBC}.sh"
|
|
|
|
|
|
|
|
do_libc_get()
|
|
|
|
{
|
|
|
|
eval "${CT_LIBC//[^A-Za-z0-9]/_}_get"
|
|
|
|
}
|
|
|
|
|
|
|
|
do_libc_extract()
|
|
|
|
{
|
|
|
|
eval "${CT_LIBC//[^A-Za-z0-9]/_}_extract"
|
|
|
|
}
|
|
|
|
|
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
|
|
|
do_libc_headers()
|
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
|
|
|
eval "${CT_LIBC//[^A-Za-z0-9]/_}_headers"
|
2018-11-24 06:14:07 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
do_libc_main()
|
|
|
|
{
|
|
|
|
eval "${CT_LIBC//[^A-Za-z0-9]/_}_main"
|
|
|
|
}
|
|
|
|
|
|
|
|
do_libc_post_cc()
|
|
|
|
{
|
|
|
|
eval "${CT_LIBC//[^A-Za-z0-9]/_}_post_cc"
|
|
|
|
}
|