summaryrefslogtreecommitdiff
path: root/scripts/build/libc
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/build/libc')
-rw-r--r--scripts/build/libc/bionic.sh2
-rw-r--r--scripts/build/libc/glibc.sh201
-rw-r--r--scripts/build/libc/mingw-w64.sh18
-rw-r--r--scripts/build/libc/moxiebox.sh4
-rw-r--r--scripts/build/libc/musl.sh101
-rw-r--r--scripts/build/libc/newlib.sh7
-rw-r--r--scripts/build/libc/uClibc-ng.sh (renamed from scripts/build/libc/uClibc.sh)137
7 files changed, 98 insertions, 372 deletions
diff --git a/scripts/build/libc/bionic.sh b/scripts/build/libc/bionic.sh
index e122d86..0ffd4d8 100644
--- a/scripts/build/libc/bionic.sh
+++ b/scripts/build/libc/bionic.sh
@@ -3,7 +3,7 @@
# Licensed under the GPL v2. See COPYING in the root of this package
# Install Unified headers
-bionic_start_files()
+bionic_headers()
{
CT_DoStep INFO "Installing C library headers"
CT_DoExecLog ALL cp -r "${CT_SRC_DIR}/android-ndk/sysroot/usr" "${CT_SYSROOT_DIR}"
diff --git a/scripts/build/libc/glibc.sh b/scripts/build/libc/glibc.sh
index 0db7c1c..c78f069 100644
--- a/scripts/build/libc/glibc.sh
+++ b/scripts/build/libc/glibc.sh
@@ -30,48 +30,14 @@ glibc_extract()
fi
}
-# Build and install headers and start files
-glibc_start_files()
-{
- # Start files and Headers should be configured the same way as the
- # final libc, but built and installed differently.
- glibc_backend libc_mode=startfiles
-}
-
# This function builds and install the full C library
glibc_main()
{
- glibc_backend libc_mode=final
-}
-
-# This backend builds the C library once for each multilib
-# variant the compiler gives us
-# Usage: glibc_backend param=value [...]
-# Parameter : Definition : Type : Default
-# libc_mode : 'startfiles' or 'final' : string : (none)
-glibc_backend()
-{
- local libc_mode
local arg
- for arg in "$@"; do
- eval "${arg// /\\ }"
- done
-
- case "${libc_mode}" in
- startfiles)
- CT_DoStep INFO "Installing C library headers & start files"
- ;;
- final)
- CT_DoStep INFO "Installing C library"
- ;;
- *)
- CT_Abort "Unsupported (or unset) libc_mode='${libc_mode}'"
- ;;
- esac
-
- CT_mkdir_pushd "${CT_BUILD_DIR}/build-libc-${libc_mode}"
- CT_IterateMultilibs glibc_backend_once multilib libc_mode="${libc_mode}"
+ CT_DoStep INFO "Installing C library"
+ CT_mkdir_pushd "${CT_BUILD_DIR}/build-libc"
+ CT_IterateMultilibs glibc_backend_once multilib
CT_Popd
CT_EndStep
}
@@ -79,13 +45,14 @@ glibc_backend()
# This backend builds the C library once
# Usage: glibc_backend_once param=value [...]
# Parameter : Definition : Type
-# libc_mode : 'startfiles' or 'final' : string : (empty)
# multi_* : as defined in CT_IterateMultilibs : (varies) :
glibc_backend_once()
{
+ # Glibc seems to be smart enough to know about the cases that can coexist
+ # in the same root and installs them into proper multilib-os directory; all
+ # we need is to point to the right root.
local multi_flags multi_dir multi_os_dir multi_root multi_index multi_count multi_target
local build_cflags build_cppflags build_ldflags
- local startfiles_dir
local src_dir="${CT_SRC_DIR}/glibc"
local -a extra_config
local -a extra_make_args
@@ -104,29 +71,9 @@ glibc_backend_once()
# Adjust target tuple according GLIBC quirks
CT_DoArchGlibcAdjustTuple multi_target
- # Glibc seems to be smart enough to know about the cases that can coexist
- # in the same root and installs them into proper multilib-os directory; all
- # we need is to point to the right root. We do need to handle multilib-os
- # here, though, for the first pass where we install crt*.o and a dummy
- # libc.so; we therefore install it to the most specific location of
- # <sysroot>/<suffix>/usr/lib/<multilib-os> where it is least likely to clash
- # with other multilib variants. We then remove these temporary files at
- # the beginning of the libc-final step and allow glibc to install them
- # where it thinks is proper.
- startfiles_dir="${multi_root}/usr/lib/${multi_os_dir}"
- CT_SanitizeVarDir startfiles_dir
-
- if [ "${libc_mode}" = "final" ]; then
- CT_DoLog EXTRA "Cleaning up start files"
- CT_DoExecLog ALL rm -f "${startfiles_dir}/crt1.o" \
- "${startfiles_dir}/crti.o" \
- "${startfiles_dir}/crtn.o" \
- "${startfiles_dir}/libc.so"
- fi
-
CT_DoLog EXTRA "Configuring C library"
- # Also, if those two are missing, iconv build breaks
+ # If those two are missing, iconv build breaks
extra_config+=( --disable-debug --disable-sanity-checks )
if [ "${CT_GLIBC_ENABLE_OBSOLETE_RPC}" = "y" ]; then
@@ -259,7 +206,6 @@ glibc_backend_once()
CT_DoLog DEBUG "Configuring with addons : '$(glibc_add_ons_list ,)'"
CT_DoLog DEBUG "Extra config args passed : '${extra_config[*]}'"
CT_DoLog DEBUG "Extra CFLAGS passed : '${glibc_cflags}'"
- CT_DoLog DEBUG "Placing startfiles into : '${startfiles_dir}'"
CT_DoLog DEBUG "Configuring with --host : '${multi_target}'"
# CFLAGS are only applied when compiling .c files. .S files are compiled with ASFLAGS,
@@ -324,111 +270,34 @@ glibc_backend_once()
extra_make_args+=( "BUILD_CPPFLAGS=${build_cppflags}" )
extra_make_args+=( "BUILD_LDFLAGS=${build_ldflags}" )
- if [ "${libc_mode}" = "startfiles" -a ! -r "${multi_root}/.libc_headers_installed" ]; then
- CT_DoLog EXTRA "Installing C library headers"
- CT_DoExecLog ALL touch "${multi_root}/.libc_headers_installed"
-
- # use the 'install-headers' makefile target to install the
- # headers
- CT_DoExecLog ALL make ${CT_JOBSFLAGS} \
- install_root=${multi_root} \
- install-bootstrap-headers=yes \
- "${extra_make_args[@]}" \
- install-headers
-
- # Two headers -- stubs.h and features.h -- aren't installed by install-headers,
- # so do them by hand. We can tolerate an empty stubs.h for the moment.
- # See e.g. http://gcc.gnu.org/ml/gcc/2002-01/msg00900.html
- mkdir -p "${CT_HEADERS_DIR}/gnu"
- CT_DoExecLog ALL touch "${CT_HEADERS_DIR}/gnu/stubs.h"
- CT_DoExecLog ALL cp -v "${CT_SRC_DIR}/glibc/include/features.h" \
- "${CT_HEADERS_DIR}/features.h"
-
- # Building the bootstrap gcc requires either setting inhibit_libc, or
- # having a copy of stdio_lim.h... see
- # http://sources.redhat.com/ml/libc-alpha/2003-11/msg00045.html
- CT_DoExecLog ALL cp -v bits/stdio_lim.h "${CT_HEADERS_DIR}/bits/stdio_lim.h"
-
- # Following error building gcc-4.0.0's gcj:
- # error: bits/syscall.h: No such file or directory
- # solved by following copy; see http://sourceware.org/ml/crossgcc/2005-05/msg00168.html
- # but it breaks arm, see http://sourceware.org/ml/crossgcc/2006-01/msg00091.html
- # Of course, only copy it if it does not already exist
- case "${CT_ARCH}" in
- arm) ;;
- *) if [ -f "${CT_HEADERS_DIR}/bits/syscall.h" ]; then
- CT_DoLog ALL "Not over-writing existing bits/syscall.h"
- elif [ -f "misc/bits/syscall.h" ]; then
- CT_DoExecLog ALL cp -v "misc/bits/syscall.h" \
- "${CT_HEADERS_DIR}/bits/syscall.h"
- else
- # "Old" glibces do not have the above file,
- # but provide this one:
- CT_DoExecLog ALL cp -v "misc/syscall-list.h" \
- "${CT_HEADERS_DIR}/bits/syscall.h"
- fi
- ;;
- esac
- elif [ "${libc_mode}" = "final" -a -r "${multi_root}/.libc_headers_installed" ]; then
- CT_DoExecLog ALL rm -f "${multi_root}/.libc_headers_installed"
- fi # installing headers
-
- if [ "${libc_mode}" = "startfiles" ]; then
- if [ "${CT_THREADS}" = "nptl" ]; then
- CT_DoLog EXTRA "Installing C library start files"
-
- # there are a few object files needed to link shared libraries,
- # which we build and install by hand
- CT_DoExecLog ALL mkdir -p "${startfiles_dir}"
- CT_DoExecLog ALL make ${CT_JOBSFLAGS} \
- "${extra_make_args[@]}" \
- csu/subdir_lib
- CT_DoExecLog ALL cp csu/crt1.o csu/crti.o csu/crtn.o \
- "${startfiles_dir}"
-
- # Finally, 'libgcc_s.so' requires a 'libc.so' to link against.
- # However, since we will never actually execute its code,
- # it doesn't matter what it contains. So, treating '/dev/null'
- # as a C source file, we produce a dummy 'libc.so' in one step
- CT_DoExecLog ALL "${CT_TARGET}-${CT_CC}" ${multi_flags} \
- -nostdlib \
- -nostartfiles \
- -shared \
- -x c /dev/null \
- -o "${startfiles_dir}/libc.so"
- fi # threads == nptl
- fi # libc_mode = startfiles
-
- if [ "${libc_mode}" = "final" ]; then
- CT_DoLog EXTRA "Building C library"
- CT_DoExecLog ALL make ${CT_JOBSFLAGS} \
- "${extra_make_args[@]}" \
- all
-
- CT_DoLog EXTRA "Installing C library"
- CT_DoExecLog ALL make ${CT_JOBSFLAGS} \
- "${extra_make_args[@]}" \
- install_root="${multi_root}" \
- install
-
- if [ "${CT_BUILD_MANUALS}" = "y" -a "${multi_index}" = "${multi_count}" ]; then
- # We only need to build the manuals once. Only build them on the
- # last multilib target. If it's not multilib, it will happen on the
- # only target.
- CT_DoLog EXTRA "Building and installing the C library manual"
- # Omit CT_JOBSFLAGS as GLIBC has problems building the
- # manuals in parallel
- CT_DoExecLog ALL make pdf html
- CT_DoExecLog ALL mkdir -p ${CT_PREFIX_DIR}/share/doc
- CT_DoExecLog ALL cp -av manual/*.pdf \
- manual/libc \
- ${CT_PREFIX_DIR}/share/doc
- fi
-
- if [ "${CT_GLIBC_LOCALES}" = "y" -a "${multi_index}" = "${multi_count}" ]; then
- glibc_locales
- fi
- fi # libc_mode = final
+ CT_DoLog EXTRA "Building C library"
+ CT_DoExecLog ALL make ${CT_JOBSFLAGS} \
+ "${extra_make_args[@]}" \
+ all
+
+ CT_DoLog EXTRA "Installing C library"
+ CT_DoExecLog ALL make ${CT_JOBSFLAGS} \
+ "${extra_make_args[@]}" \
+ install_root="${multi_root}" \
+ install
+
+ if [ "${CT_BUILD_MANUALS}" = "y" -a "${multi_index}" = "${multi_count}" ]; then
+ # We only need to build the manuals once. Only build them on the
+ # last multilib target. If it's not multilib, it will happen on the
+ # only target.
+ CT_DoLog EXTRA "Building and installing the C library manual"
+ # Omit CT_JOBSFLAGS as GLIBC has problems building the
+ # manuals in parallel
+ CT_DoExecLog ALL make pdf html
+ CT_DoExecLog ALL mkdir -p ${CT_PREFIX_DIR}/share/doc
+ CT_DoExecLog ALL cp -av manual/*.pdf \
+ manual/libc \
+ ${CT_PREFIX_DIR}/share/doc
+ fi
+
+ if [ "${CT_GLIBC_LOCALES}" = "y" -a "${multi_index}" = "${multi_count}" ]; then
+ glibc_locales
+ fi
CT_EndStep
}
diff --git a/scripts/build/libc/mingw-w64.sh b/scripts/build/libc/mingw-w64.sh
index 683f8be..54e8d07 100644
--- a/scripts/build/libc/mingw-w64.sh
+++ b/scripts/build/libc/mingw-w64.sh
@@ -9,7 +9,7 @@ mingw_w64_set_install_prefix()
fi
}
-mingw_w64_start_files() {
+mingw_w64_headers() {
local -a sdk_opts
CT_DoStep INFO "Installing C library headers"
@@ -56,15 +56,13 @@ mingw_w64_start_files() {
do_check_mingw_vendor_tuple()
{
- if [ "${CT_MINGW_W64_REQUIRES_W64_VENDOR}" = "y" ]; then
- CT_DoStep INFO "Checking configured vendor tuple"
- if [ ${CT_TARGET_VENDOR} = "w64" ]; then
- CT_DoLog DEBUG "The tuple is set to '${CT_TARGET_VENDOR}', as recommended by mingw-64 developers."
- else
- CT_DoLog WARN "The tuple vendor is '${CT_TARGET_VENDOR}', not equal to 'w64' and might break the toolchain!"
- fi
- CT_EndStep
- fi
+ CT_DoStep INFO "Checking configured vendor tuple"
+ if [ ${CT_TARGET_VENDOR} = "w64" ]; then
+ CT_DoLog DEBUG "The tuple is set to '${CT_TARGET_VENDOR}', as recommended by mingw-64 developers."
+ else
+ CT_DoLog WARN "The tuple vendor is '${CT_TARGET_VENDOR}', not equal to 'w64' and might break the toolchain!"
+ fi
+ CT_EndStep
}
do_mingw_tools()
diff --git a/scripts/build/libc/moxiebox.sh b/scripts/build/libc/moxiebox.sh
index 25ef6e7..35e2ea4 100644
--- a/scripts/build/libc/moxiebox.sh
+++ b/scripts/build/libc/moxiebox.sh
@@ -14,9 +14,9 @@ moxiebox_extract()
CT_ExtractPatch MOXIEBOX
}
-moxiebox_start_files()
+moxiebox_headers()
{
- newlib_start_files
+ newlib_headers
}
moxiebox_main()
diff --git a/scripts/build/libc/musl.sh b/scripts/build/libc/musl.sh
index 05da1d4..bc2a2e6 100644
--- a/scripts/build/libc/musl.sh
+++ b/scripts/build/libc/musl.sh
@@ -2,42 +2,18 @@
# Copyright 2013 Timo Teräs
# Licensed under the GPL v2. See COPYING in the root of this package
-# Build and install headers and start files
-musl_start_files()
+musl_post_cc()
{
- # Start files and Headers should be configured the same way as the
- # final libc, but built and installed differently.
- musl_backend libc_mode=startfiles
-}
-
-# This function builds and install the full C library
-musl_main()
-{
- musl_backend libc_mode=final
-}
-
-musl_post_cc() {
# MUSL creates dynamic linker symlink with absolute path - which works on the
# target but not on the host. We want our cross-ldd tool to work.
CT_MultilibFixupLDSO
}
-musl_backend() {
- local libc_mode
- local arg
-
- for arg in "$@"; do
- eval "${arg// /\\ }"
- done
-
- case "${libc_mode}" in
- startfiles) CT_DoStep INFO "Installing C library headers & start files";;
- final) CT_DoStep INFO "Installing C library";;
- *) CT_Abort "Unsupported (or unset) libc_mode='${libc_mode}'";;
- esac
-
- CT_mkdir_pushd "${CT_BUILD_DIR}/build-libc-${libc_mode}"
- CT_IterateMultilibs musl_backend_once multilib libc_mode="${libc_mode}"
+musl_main()
+{
+ CT_DoStep INFO "Installing C library"
+ CT_mkdir_pushd "${CT_BUILD_DIR}/build-libc"
+ CT_IterateMultilibs musl_backend_once multilib
CT_Popd
CT_EndStep
}
@@ -45,9 +21,9 @@ musl_backend() {
# This backend builds the C library
# Usage: musl_backend param=value [...]
# Parameter : Definition : Type : Default
-# libc_mode : 'startfiles' or 'final' : string : (none)
-musl_backend_once() {
- local libc_mode
+# multi_* : as defined in CT_IterateMultilibs : (varies) :
+musl_backend_once()
+{
local -a extra_cflags
local -a extra_config
local src_dir="${CT_SRC_DIR}/musl"
@@ -110,45 +86,26 @@ musl_backend_once() {
--disable-gcc-wrapper \
"${extra_config[@]}"
- if [ "${libc_mode}" = "startfiles" ]; then
- CT_DoLog EXTRA "Installing C library headers"
- CT_DoExecLog ALL make DESTDIR="${multi_root}" install-headers
- CT_DoLog EXTRA "Building C library start files"
- CT_DoExecLog ALL make DESTDIR="${multi_root}" \
- obj/crt/crt1.o obj/crt/crti.o obj/crt/crtn.o
- CT_DoLog EXTRA "Installing C library start files"
- CT_DoExecLog ALL cp -av obj/crt/crt*.o "${multi_root}${multilib_dir}"
- CT_DoExecLog ALL ${CT_TARGET}-${CT_CC} -nostdlib \
- -nostartfiles -shared -x c /dev/null -o "${multi_root}${multilib_dir}/libc.so"
- fi
- if [ "${libc_mode}" = "final" ]; then
- CT_DoLog EXTRA "Cleaning up start files"
- CT_DoExecLog ALL rm -f "${multi_root}${multilib_dir}/crt1.o" \
- "${multi_root}${multilib_dir}/crti.o" \
- "${multi_root}${multilib_dir}/crtn.o" \
- "${multi_root}${multilib_dir}/libc.so"
-
- CT_DoLog EXTRA "Building C library"
- CT_DoExecLog ALL make ${CT_JOBSFLAGS}
-
- CT_DoLog EXTRA "Installing C library"
- CT_DoExecLog ALL make DESTDIR="${multi_root}" install
-
- # Convert /lib/ld-* symlinks to relative paths so that they are valid
- # both on the host and on the target.
- for f in ${multi_root}/ld-musl-*; do
- [ -L "${f}" ] || continue
- l=$( readlink ${f} )
- case "${l}" in
- ${multilib_dir}/*)
- CT_DoExecLog ALL ln -sf "../${l}" "${f}"
- ;;
- esac
- done
-
- # Any additional actions for this architecture
- CT_DoArchMUSLPostInstall
- fi
+ CT_DoLog EXTRA "Building C library"
+ CT_DoExecLog ALL make ${CT_JOBSFLAGS}
+
+ CT_DoLog EXTRA "Installing C library"
+ CT_DoExecLog ALL make DESTDIR="${multi_root}" install
+
+ # Convert /lib/ld-* symlinks to relative paths so that they are valid
+ # both on the host and on the target.
+ for f in ${multi_root}/ld-musl-*; do
+ [ -L "${f}" ] || continue
+ l=$( readlink ${f} )
+ case "${l}" in
+ ${multilib_dir}/*)
+ CT_DoExecLog ALL ln -sf "../${l}" "${f}"
+ ;;
+ esac
+ done
+
+ # Any additional actions for this architecture
+ CT_DoArchMUSLPostInstall
CT_EndStep
}
diff --git a/scripts/build/libc/newlib.sh b/scripts/build/libc/newlib.sh
index ddecdb1..72111a9 100644
--- a/scripts/build/libc/newlib.sh
+++ b/scripts/build/libc/newlib.sh
@@ -5,11 +5,10 @@
# Edited by Martin Lund <mgl@doredevelopment.dk>
#
-newlib_start_files()
+newlib_headers()
{
- CT_DoStep INFO "Installing C library headers & start files"
- CT_DoExecLog ALL cp -a "${CT_SRC_DIR}/newlib/newlib/libc/include/." \
- "${CT_HEADERS_DIR}"
+ CT_DoStep INFO "Installing C library headers"
+ CT_DoExecLog ALL cp -a "${CT_SRC_DIR}/newlib/newlib/libc/include/." "${CT_HEADERS_DIR}"
if [ "${CT_ARCH_XTENSA}" = "y" ]; then
CT_DoLog EXTRA "Installing Xtensa headers"
CT_DoExecLog ALL cp -r "${CT_SRC_DIR}/newlib/newlib/libc/sys/xtensa/include/." \
diff --git a/scripts/build/libc/uClibc.sh b/scripts/build/libc/uClibc-ng.sh
index 4328542..7b81d92 100644
--- a/scripts/build/libc/uClibc.sh
+++ b/scripts/build/libc/uClibc-ng.sh
@@ -2,64 +2,30 @@
# Copyright 2007 Yann E. MORIN
# Licensed under the GPL v2. See COPYING in the root of this package
-# Build and install headers and start files
-uClibc_start_files()
-{
- # Start files and Headers should be configured the same way as the
- # final libc, but built and installed differently.
- uClibc_backend libc_mode=startfiles
-}
-
# This function builds and install the full C library
-uClibc_main()
-{
- uClibc_backend libc_mode=final
-}
-
-# Common backend for 1st and 2nd passes.
-uClibc_backend()
+uClibc_ng_main()
{
- local libc_mode
- local arg
-
- for arg in "$@"; do
- eval "${arg// /\\ }"
- done
-
- case "${libc_mode}" in
- startfiles) CT_DoStep INFO "Installing C library headers & start files";;
- final) CT_DoStep INFO "Installing C library";;
- *) CT_Abort "Unsupported (or unset) libc_mode='${libc_mode}'";;
- esac
-
- CT_mkdir_pushd "${CT_BUILD_DIR}/build-libc-${libc_mode}"
- CT_IterateMultilibs uClibc_backend_once multilib libc_mode="${libc_mode}"
+ CT_DoStep INFO "Installing C library"
+ CT_mkdir_pushd "${CT_BUILD_DIR}/build-libc"
+ CT_IterateMultilibs uClibc_ng_backend_once multilib
CT_Popd
CT_EndStep
}
# Common backend for 1st and 2nd passes, once per multilib.
-uClibc_backend_once()
+uClibc_ng_backend_once()
{
- local libc_mode
local multi_dir multi_os_dir multi_root multi_flags multi_index multi_count
local multilib_dir startfiles_dir
- local jflag=${CT_LIBC_UCLIBC_PARALLEL:+${CT_JOBSFLAGS}}
+ local jflag=${CT_JOBSFLAGS}
local -a make_args
local extra_cflags f cfg_cflags cf
local hdr_install_subdir
- local uClibc_name
for arg in "$@"; do
eval "${arg// /\\ }"
done
- if [ "${CT_UCLIBC_USE_UCLIBC_NG_ORG}" = "y" ]; then
- uClibc_name="uClibc-ng"
- elif [ "${CT_UCLIBC_USE_UCLIBC_ORG}" = "y" ]; then
- uClibc_name="uClibc"
- fi
-
CT_DoStep INFO "Building for multilib ${multi_index}/${multi_count}: '${multi_flags}'"
multilib_dir="lib/${multi_os_dir}"
@@ -68,7 +34,7 @@ uClibc_backend_once()
# Construct make arguments:
# - uClibc uses the CROSS environment variable as a prefix to the compiler
- # tools to use. Since it requires core pass-1, thusly named compiler is
+ # tools to use. Since it requires core compiler, thusly named compiler is
# 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
@@ -86,7 +52,7 @@ uClibc_backend_once()
# Simply copy files until uClibc has the ability to build out-of-tree
CT_DoLog EXTRA "Copying sources to build dir"
- CT_DoExecLog ALL cp -av "${CT_SRC_DIR}/uClibc/." .
+ CT_DoExecLog ALL cp -av "${CT_SRC_DIR}/uClibc-ng/." .
# Force the date of the pregen locale data, as the
# newer ones that are referenced are not available
@@ -94,7 +60,7 @@ uClibc_backend_once()
# Use the default config if the user did not provide one.
if [ -z "${CT_LIBC_UCLIBC_CONFIG_FILE}" ]; then
- CT_LIBC_UCLIBC_CONFIG_FILE="${CT_LIB_DIR}/packages/${uClibc_name}/config"
+ CT_LIBC_UCLIBC_CONFIG_FILE="${CT_LIB_DIR}/packages/uClibc-ng/config"
fi
manage_uClibc_config "${CT_LIBC_UCLIBC_CONFIG_FILE}" .config "${multi_flags}"
@@ -136,65 +102,11 @@ uClibc_backend_once()
CT_DoExecLog ALL cp -a "${multi_root}/usr/include" "${multi_root}/usr/include.saved"
fi
- if [ "${libc_mode}" = "startfiles" ]; then
- CT_DoLog EXTRA "Building headers"
- CT_DoExecLog ALL make "${make_args[@]}" headers
-
- # Ensure the directory for installing multilib-specific binaries exists.
- CT_DoExecLog ALL mkdir -p "${startfiles_dir}"
-
- CT_DoLog EXTRA "Installing headers"
- CT_DoExecLog ALL make "${make_args[@]}" install_headers
-
- # The check might look bogus, but it is the same condition as is used
- # by GCC build script to enable/disable shared library support.
- if [ "${CT_THREADS}" = "nptl" ]; then
- CT_DoLog EXTRA "Building start files"
- CT_DoExecLog ALL make ${jflag} "${make_args[@]}" \
- lib/crt1.o lib/crti.o lib/crtn.o
-
- if [ "${CT_SHARED_LIBS}" = "y" ]; then
- # From: http://git.openembedded.org/cgit.cgi/openembedded/commit/?id=ad5668a7ac7e0436db92e55caaf3fdf782b6ba3b
- # libm.so is needed for ppc, as libgcc is linked against libm.so
- # No problem to create it for other archs.
- CT_DoLog EXTRA "Building dummy shared libs"
- CT_DoExecLog ALL "${CT_TARGET}-${CT_CC}" -nostdlib -nostartfiles \
- -shared ${multi_flags} -x c /dev/null -o libdummy.so
-
- CT_DoLog EXTRA "Installing start files"
- CT_DoExecLog ALL install -m 0644 lib/crt1.o lib/crti.o lib/crtn.o \
- "${startfiles_dir}"
-
- CT_DoLog EXTRA "Installing dummy shared libs"
- CT_DoExecLog ALL install -m 0755 libdummy.so "${startfiles_dir}/libc.so"
- CT_DoExecLog ALL install -m 0755 libdummy.so "${startfiles_dir}/libm.so"
- fi # CT_SHARED_LIBS == y
- fi # CT_THREADS == nptl
- fi # libc_mode == startfiles
-
- if [ "${libc_mode}" = "final" ]; then
- CT_DoLog EXTRA "Cleaning up startfiles"
- CT_DoExecLog ALL rm -f "${startfiles_dir}/crt1.o" \
- "${startfiles_dir}/crti.o" \
- "${startfiles_dir}/crtn.o" \
- "${startfiles_dir}/libc.so" \
- "${startfiles_dir}/libm.so"
-
- CT_DoLog EXTRA "Building C library"
- CT_DoExecLog ALL make "${make_args[@]}" pregen
- CT_DoExecLog ALL make ${jflag} "${make_args[@]}" all
-
- # YEM-FIXME:
- # - we want to install 'runtime' files, eg. lib*.{a,so*}, crti.o and
- # such files, except the headers as they already are installed
- # - "make install_dev" installs the headers, the crti.o... and the
- # static libs, but not the dynamic libs
- # - "make install_runtime" installs the dynamic libs only
- # - "make install" calls install_runtime and install_dev
- # - so we're left with re-installing the headers... Sigh...
- CT_DoLog EXTRA "Installing C library"
- CT_DoExecLog ALL make "${make_args[@]}" install install_utils
- fi # libc_mode == final
+ 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
# Now, if installing headers into a subdirectory, put everything in its place.
# Remove the header subdirectory if it existed already.
@@ -350,28 +262,19 @@ manage_uClibc_config()
CT_KconfigDisableOption "LINUXTHREADS_OLD" "${dst}"
CT_KconfigDisableOption "LINUXTHREADS_NEW" "${dst}"
CT_KconfigDisableOption "UCLIBC_HAS_THREADS_NATIVE" "${dst}"
- case "${CT_THREADS}:${CT_LIBC_UCLIBC_LNXTHRD}" in
- none:)
+ case "${CT_THREADS}" in
+ none)
;;
- linuxthreads:)
- # Newer version of uClibc-ng, no old/new dichotomy
+ linuxthreads)
CT_KconfigEnableOption "UCLIBC_HAS_THREADS" "${dst}"
CT_KconfigEnableOption "UCLIBC_HAS_LINUXTHREADS" "${dst}"
;;
- linuxthreads:old)
- CT_KconfigEnableOption "UCLIBC_HAS_THREADS" "${dst}"
- CT_KconfigEnableOption "LINUXTHREADS_OLD" "${dst}"
- ;;
- linuxthreads:new)
- CT_KconfigEnableOption "UCLIBC_HAS_THREADS" "${dst}"
- CT_KconfigEnableOption "LINUXTHREADS_NEW" "${dst}"
- ;;
- nptl:)
+ nptl)
CT_KconfigEnableOption "UCLIBC_HAS_THREADS" "${dst}"
CT_KconfigEnableOption "UCLIBC_HAS_THREADS_NATIVE" "${dst}"
;;
*)
- CT_Abort "Incorrect thread settings: CT_THREADS='${CT_THREAD}' CT_LIBC_UCLIBC_LNXTHRD='${CT_LIBC_UCLIBC_LNXTHRD}'"
+ CT_Abort "Incorrect thread settings: CT_THREADS='${CT_THREADS}'"
;;
esac
@@ -420,7 +323,7 @@ manage_uClibc_config()
CT_DoExecLog ALL cp "${dst}" "${dst}.created-by-ct-ng"
}
-uClibc_post_cc()
+uClibc_ng_post_cc()
{
# uClibc and GCC disagree where the dynamic linker lives. uClibc always
# places it in the MULTILIB_DIR, while gcc does that for *some* variants