From d58e740be8ea07e5f4f24378f903773eae247828 Mon Sep 17 00:00:00 2001 From: Alexey Neyman Date: Thu, 31 Mar 2016 08:44:50 -0700 Subject: glibc.sh: cleanups - Dump CT_LIBC_EXTRA_CC_ARGS: instead, treat CT_LIBC_EXTRA_CFLAGS as arguments to CC (or they are not applied to .S, for example). Combine them with multi_flags and CT_TARGET_CFLAGS in proper order. - Analyze thus combined flags to determine --with-fp/--without-fp. Don't need to check CT_ARCH_FLOAT - it is reflected in CT_TARGET_CFLAGS anyway. Check more soft/hard float options defined on different architectures. - Drop checking for endianness flags: they are not reflected in configure arguments in any way, and they're already present in CFLAGS (either via multi_flags or via CT_TARGET_CFLAGS). Besides, CT_ARCH_ENDIAN_OPT was actually called CT_ARCH_ENDIAN_CFLAG, so this was a no-op anyway. Signed-off-by: Alexey Neyman --- config/libc/glibc.in.2 | 10 ---------- 1 file changed, 10 deletions(-) (limited to 'config/libc') diff --git a/config/libc/glibc.in.2 b/config/libc/glibc.in.2 index 346f9b7c..104552a6 100644 --- a/config/libc/glibc.in.2 +++ b/config/libc/glibc.in.2 @@ -55,16 +55,6 @@ config LIBC_GLIBC_EXTRA_CFLAGS help Extra target CFLAGS to use when building. -config LIBC_EXTRA_CC_ARGS - string - prompt "gcc extra flags" - default "" - help - Extra flags to pass gcc when building. - - Seldom used, except for sparc64 which seems to need the flag -64 - to be passed onto gcc. - config LIBC_ENABLE_FORTIFIED_BUILD bool prompt "Enable fortified build (EXPERIMENTAL)" -- cgit v1.2.3 From f204cc8ec4b70eee4de79ac5e7df831cfe0cb751 Mon Sep 17 00:00:00 2001 From: Alexey Neyman Date: Fri, 1 Apr 2016 15:43:56 -0700 Subject: Spelling fixes. Signed-off-by: Alexey Neyman --- config/cc/gcc.in | 2 +- config/debug/gdb.in.cross | 2 +- config/libc/none.in | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) (limited to 'config/libc') diff --git a/config/cc/gcc.in b/config/cc/gcc.in index 2df20580..1fcdb722 100644 --- a/config/cc/gcc.in +++ b/config/cc/gcc.in @@ -226,7 +226,7 @@ config CC_GCC_HAS_LNK_HASH_STYLE bool # Only enable gcc's support for plugins if binutils has it as well -# They are usefull only when doing LTO, but it does no harm enabling +# They are useful only when doing LTO, but it does no harm enabling # them even without LTO. config CC_GCC_ENABLE_PLUGINS bool diff --git a/config/debug/gdb.in.cross b/config/debug/gdb.in.cross index 07b85b85..fb993c91 100644 --- a/config/debug/gdb.in.cross +++ b/config/debug/gdb.in.cross @@ -21,7 +21,7 @@ config GDB_CROSS_STATIC depends on CONFIGURE_has_static_link select WANTS_STATIC_LINK help - A static cross gdb can be usefull if you debug on a machine that is + A static cross gdb can be useful if you debug on a machine that is not the one that is used to compile the toolchain. That way, you can share the cross-gdb without installing a toolchain diff --git a/config/libc/none.in b/config/libc/none.in index d587faff..b8860b07 100644 --- a/config/libc/none.in +++ b/config/libc/none.in @@ -4,10 +4,10 @@ ## ## help Do not use a C library. ## help -## help This is usefull if your project is self-contained, does not rely on +## help This is useful if your project is self-contained, does not rely on ## help an external C library, and provides all the necessary bits. ## help -## help Most probably usefull to bootloaders, as they generally don't depend +## help Most probably useful to bootloaders, as they generally don't depend ## help on the C library. ## help ## help If unsure: do *not* choose that, and use another option in the choice. -- cgit v1.2.3 From 4ee22d66a849123c06812736dd1472840aad5823 Mon Sep 17 00:00:00 2001 From: Alexey Neyman Date: Fri, 1 Apr 2016 23:28:43 -0700 Subject: uclibc: merge startfiles/final into single backend. In preparation for multilib support, use the same "backend" model that is already employed by glibc and musl. Also, the verbosity setting descriptions were swapped. V=2 is actually less verbose than V=1: V=1 prints full commands, while V=2 prints 'CC '. Signed-off-by: Alexey Neyman --- config/libc/uClibc.in | 4 +- scripts/build/libc/uClibc.sh | 269 ++++++++++++++++++------------------------- 2 files changed, 111 insertions(+), 162 deletions(-) (limited to 'config/libc') diff --git a/config/libc/uClibc.in b/config/libc/uClibc.in index 989da7ba..a99ff736 100644 --- a/config/libc/uClibc.in +++ b/config/libc/uClibc.in @@ -129,13 +129,13 @@ config LIBC_UCLIBC_VERBOSITY_0 config LIBC_UCLIBC_VERBOSITY_1 bool - prompt "Brief build (show defines, ld flags)" + prompt "Very verbose build" help Print simplified command lines. config LIBC_UCLIBC_VERBOSITY_2 bool - prompt "Very verbose build" + prompt "Brief build (show defines, ld flags)" help Print full command lines. diff --git a/scripts/build/libc/uClibc.sh b/scripts/build/libc/uClibc.sh index 41b651f2..edd82f6a 100644 --- a/scripts/build/libc/uClibc.sh +++ b/scripts/build/libc/uClibc.sh @@ -73,180 +73,129 @@ do_libc_check_config() { # Build and install headers and start files do_libc_start_files() { - local multi_os_dir multi_root startfiles_dir - - CT_DoStep INFO "Installing C library headers" - - # 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 -a "${CT_SRC_DIR}/${uclibc_name}-${CT_LIBC_VERSION}" \ - "${CT_BUILD_DIR}/build-libc-headers" - cd "${CT_BUILD_DIR}/build-libc-headers" - - # Retrieve the config file - CT_DoExecLog ALL cp "${CT_CONFIG_DIR}/uClibc.config" .config - - multi_os_dir=$( "${CT_TARGET}-gcc" -print-multi-os-directory ) - multi_root=$( "${CT_TARGET}-gcc" -print-sysroot ) - startfiles_dir="${multi_root}/usr/lib/${multi_os_dir}" - CT_SanitizeVarDir startfiles_dir - CT_DoExecLog ALL mkdir -p "${startfiles_dir}" - - # Force the date of the pregen locale data, as the - # newer ones that are referenced are not available - CT_DoLog EXTRA "Applying configuration" - CT_DoYes "" |CT_DoExecLog ALL \ - ${make} CROSS_COMPILE="${CT_TARGET}-" \ - UCLIBC_EXTRA_CFLAGS="-pipe" \ - PREFIX="${multi_root}/" \ - LOCALE_DATA_FILENAME="${uclibc_locale_tarball}.tgz" \ - oldconfig - - CT_DoLog EXTRA "Building headers" - CT_DoExecLog ALL \ - ${make} ${CT_LIBC_UCLIBC_VERBOSITY} \ - CROSS_COMPILE="${CT_TARGET}-" \ - UCLIBC_EXTRA_CFLAGS="-pipe" \ - PREFIX="${multi_root}/" \ - LOCALE_DATA_FILENAME="${uclibc_locale_tarball}.tgz" \ - headers - - CT_DoLog EXTRA "Installing headers" - CT_DoExecLog ALL \ - ${make} ${CT_LIBC_UCLIBC_VERBOSITY} \ - CROSS_COMPILE="${CT_TARGET}-" \ - UCLIBC_EXTRA_CFLAGS="-pipe" \ - PREFIX="${multi_root}/" \ - LOCALE_DATA_FILENAME="${uclibc_locale_tarball}.tgz" \ - 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} ${CT_LIBC_UCLIBC_PARALLEL:+${JOBSFLAGS}} \ - CROSS_COMPILE="${CT_TARGET}-" \ - UCLIBC_EXTRA_CFLAGS="-pipe" \ - PREFIX="${multi_root}/" \ - STRIPTOOL=true \ - ${CT_LIBC_UCLIBC_VERBOSITY} \ - LOCALE_DATA_FILENAME="${uclibc_locale_tarball}.tgz" \ - lib/crt1.o lib/crti.o lib/crtn.o - - # 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}-gcc" -nostdlib \ - -nostartfiles \ - -shared \ - -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_THREADS == nptl - - CT_EndStep + # Start files and Headers should be configured the same way as the + # final libc, but built and installed differently. + do_libc_backend libc_mode=startfiles } -# This function build and install the full uClibc +# This function builds and install the full C library do_libc() { + do_libc_backend libc_mode=final +} + +# Common backend for 1st and 2nd passes +do_libc_backend() { + local libc_mode local multi_os_dir multi_root multilib_dir startfiles_dir + local jflag=${CT_LIBC_UCLIBC_PARALLEL:+${JOBSFLAGS}} + local -a make_args - CT_DoStep INFO "Installing C library" + 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 # 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_name}-${CT_LIBC_VERSION}" \ - "${CT_BUILD_DIR}/build-libc" - cd "${CT_BUILD_DIR}/build-libc" - - # Retrieve the config file - CT_DoExecLog ALL cp "${CT_CONFIG_DIR}/uClibc.config" .config + CT_DoExecLog ALL cp -a "${CT_SRC_DIR}/${uclibc_name}-${CT_LIBC_VERSION}" \ + "${CT_BUILD_DIR}/build-libc-${libc_mode}" + cd "${CT_BUILD_DIR}/build-libc-${libc_mode}" multi_os_dir=$( "${CT_TARGET}-gcc" -print-multi-os-directory ) multi_root=$( "${CT_TARGET}-gcc" -print-sysroot ) - startfiles_dir="${multi_root}/usr/lib/${multi_os_dir}" + 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 + # tools to use. Since it requires core pass-1, 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 + # 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}-" \ + UCLIBC_EXTRA_CFLAGS="-pipe" \ + PREFIX="${multi_root}/" \ + MULTILIB_DIR="${multilib_dir}" \ + LOCALE_DATA_FILENAME="${uclibc_locale_tarball}.tgz" \ + STRIPTOOL=true \ + ${CT_LIBC_UCLIBC_VERBOSITY} \ + ) - 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" + # Retrieve the config file + CT_DoExecLog ALL cp "${CT_CONFIG_DIR}/uClibc.config" .config - multilib_dir="lib/${multi_os_dir}" - CT_SanitizeVarDir multilib_dir - - # uClibc uses the CROSS environment variable as a prefix to the compiler - # tools to use. The newly built tools should be in our path, so we need - # only give the correct name for them. - # 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. + # Force the date of the pregen locale data, as the + # newer ones that are referenced are not available CT_DoLog EXTRA "Applying configuration" - CT_DoYes "" |CT_DoExecLog CFG \ - ${make} CROSS_COMPILE=${CT_TARGET}- \ - UCLIBC_EXTRA_CFLAGS="-pipe" \ - PREFIX="${multi_root}/" \ - LOCALE_DATA_FILENAME="${uclibc_locale_tarball}.tgz" \ - oldconfig - - # We do _not_ want to strip anything for now, in case we specifically - # asked for a debug toolchain, thus the STRIPTOOL= assignment - # /Old/ versions can not build in // - CT_DoLog EXTRA "Building C library" - CT_DoExecLog ALL \ - ${make} -j1 \ - CROSS_COMPILE=${CT_TARGET}- \ - UCLIBC_EXTRA_CFLAGS="-pipe" \ - PREFIX="${multi_root}/" \ - STRIPTOOL=true \ - ${CT_LIBC_UCLIBC_VERBOSITY} \ - LOCALE_DATA_FILENAME="${uclibc_locale_tarball}.tgz" \ - pregen - CT_DoExecLog ALL \ - ${make} ${CT_LIBC_UCLIBC_PARALLEL:+${JOBSFLAGS}} \ - CROSS_COMPILE=${CT_TARGET}- \ - UCLIBC_EXTRA_CFLAGS="-pipe" \ - PREFIX="${multi_root}/" \ - STRIPTOOL=true \ - ${CT_LIBC_UCLIBC_VERBOSITY} \ - LOCALE_DATA_FILENAME="${uclibc_locale_tarball}.tgz" \ - 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... - # - # We do _not_ want to strip anything for now, in case we specifically - # asked for a debug toolchain, hence the STRIPTOOL= assignment - # - # Note: JOBSFLAGS is not useful for installation. - # - CT_DoLog EXTRA "Installing C library" - CT_DoExecLog ALL \ - ${make} CROSS_COMPILE=${CT_TARGET}- \ - UCLIBC_EXTRA_CFLAGS="-pipe" \ - PREFIX="${multi_root}/" \ - STRIPTOOL=true \ - ${CT_LIBC_UCLIBC_VERBOSITY} \ - LOCALE_DATA_FILENAME="${uclibc_locale_tarball}.tgz" \ - MULTILIB_DIR="${multilib_dir}" \ - install + CT_DoYes | CT_DoExecLog ALL ${make} "${make_args[@]}" oldconfig + + 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 + + # 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}-gcc" -nostdlib -nostartfiles \ + -shared -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_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 + fi # libc_mode == final CT_EndStep } -- cgit v1.2.3 From 4b4082785d2a68d225d9791b023e68f23d9d6f3c Mon Sep 17 00:00:00 2001 From: Yogesh Sharma Date: Tue, 19 Jul 2016 16:14:29 -0400 Subject: musl: updated version to 1.1.15 Signed-off-by: Yogesh Sharma --- config/libc/musl.in | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'config/libc') diff --git a/config/libc/musl.in b/config/libc/musl.in index ff84448b..3e0b5a12 100644 --- a/config/libc/musl.in +++ b/config/libc/musl.in @@ -55,7 +55,7 @@ choice config LIBC_MUSL_V_1_1 bool - prompt "1.1.14 (Mainline)" + prompt "1.1.15 (Mainline)" depends on EXPERIMENTAL endchoice @@ -64,6 +64,6 @@ config LIBC_VERSION string # Don't remove next line # CT_INSERT_VERSION_STRING_BELOW - default "1.1.14" if LIBC_MUSL_V_1_1 + default "1.1.15" if LIBC_MUSL_V_1_1 endif # ! LIBC_MUSL_CUSTOM -- cgit v1.2.3