summaryrefslogtreecommitdiff
path: root/scripts/build/libc/glibc.sh
AgeCommit message (Collapse)AuthorFilesLines
2022-02-11Fold libc_start_files into libcAlexey Neyman1-166/+35
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>
2021-06-24Fix build of older Glibc using GCC >=10Nik Konyuchenko1-0/+4
Issue #1535 GCC 10 changed the default to -fno-common, which leads to a linking error in GLibc older than 2.30. This change adds -fcommon cflag for the target GLibc versions <=2.29 and GCC >=10. This change also adds additional cflags for the target GLibc to disable new GCC11 checks that lead to compilation errors. Signed-off-by: Nik Konyuchenko <spaun2002mobile@gmail.com>
2020-10-05glibc: set glibc build system default_cflags emptyHans-Christian Noren Egtvedt1-0/+2
By setting glibc build system default_cflags to be empty before building, we will enforce the build system to only use the crosstool-ng CFLAGS when building glibc. Properly solves the issue identified in #1396. Signed-off-by: Hans-Christian Noren Egtvedt <hegtvedt@cisco.com>
2019-10-27prevent the glibc build from overwriting flagsNorbert Lange1-1/+4
The glibc will append the content of the CFLAGS variable, overriding previous flags. If unset, the CFLAGS variable is not empty, so explicitly set it. Instead prepend the default CFLAGS flags. Signed-off-by: Norbert Lange <nolange79@gmail.com>
2019-04-05Rename JOBSFLAGS -> CT_JOBSFLAGSAlexey Neyman1-7/+7
... so that it is saved/restored when restarting the build. Signed-off-by: Alexey Neyman <stilor@att.net>
2019-02-16Disable CXX while building glibcAlexey Neyman1-3/+4
Otherwise, glibc 2.29 tries to use it - but we haven't built libstdc++ yet. We really need to implement #808... Until now, pass empty CXX to make. Signed-off-by: Alexey Neyman <stilor@att.net>
2018-12-07Disable -fstack-protector* from being used by glibcAlexey Neyman1-0/+8
... until it was fixed (to some extent) in 2.25. Signed-off-by: Alexey Neyman <stilor@att.net>
2018-12-05Add configuration options for enabling SSPAlexey Neyman1-0/+4
... in uClibc and glibc. Fixes #681. While here, relocate additional "sources" for uClibc/binutils into packages/ directory. Signed-off-by: Alexey Neyman <stilor@att.net>
2018-12-01Add moxiebox as a choice for libcAlexey Neyman1-23/+28
This required some rework of the libc selection, as moxiebox is a layer on top of another libc - newlib. Also, moxiebox'es host VM (`sandbox`) needs a libcrypto on the host. We will not have it if we're cross-compiling a canadian cross. Fortunately, all moxiebox needs from libcrypto is SHA256, and it already includes a standalone implementation of SHA256 in its runtime. Provide a little wrapper that allows moxiebox use that implementation for the host binary, too. Also, automate collecting/printing the list of all packages in a given category (e.g. LIBC or COMP_TOOLS), generate a list of all Kconfig symbols for a given category. Signed-off-by: Alexey Neyman <stilor@att.net>
2018-10-16Create glibc-ports symlink inside CT_SRC_DIRAlexey Neyman1-2/+2
... so that it works in both "bundled" and "bundled,local" cases. Fixes #1060. Signed-off-by: Alexey Neyman <stilor@att.net>
2018-09-28Fix up timestamps after patchingAlexey Neyman1-1/+0
... so that autotools-based packages do not re-run autoconf/autoheader/automake. Signed-off-by: Alexey Neyman <stilor@att.net>
2018-06-05Avoid adding arch/cpu/tune flags for target to GCC buildAlexey Neyman1-1/+1
... as it may need to override them for building runtime-selectable code. Signed-off-by: Alexey Neyman <stilor@att.net>
2018-05-15Too many fixes need backporting for GCC8...Alexey Neyman1-7/+1
... so instead, disable -Werror for older versions of glibc. Signed-off-by: Alexey Neyman <stilor@att.net>
2018-05-12First batch of fixesAlexey Neyman1-0/+7
- Incompatible function type for ifunc alias - Multiple statements macro expansion in strftime - if_nametoindex size checking Signed-off-by: Alexey Neyman <stilor@att.net>
2017-09-03Use the new SuperH fixes in the two multilib samplesAlexey Neyman1-0/+1
- Glibc configure args and tuple need adjustment on SuperH - Only allow "both endian" and "with CPU" for unspecified arch variant. May reconsider endianness (was breaking things before adjusting glibc tuple) - Retire non-multilib sample, it should be a subset of the multilib one now. Signed-off-by: Alexey Neyman <stilor@att.net>
2017-09-03Workaround for static uClibc-ng issue with -lpthreadAlexey Neyman1-36/+36
Also, preserve .config when running test-package.sh. Signed-off-by: Alexey Neyman <stilor@att.net>
2017-09-01config: Add package versioning flexibilityNathan Chancellor1-2/+2
Some users (like myself) may want to omit the crosstool-NG version from the binaries' versioning output, as it can be incredibly long and not too helpful. Add a config option to disable it. The possible combinations are as follows: - crosstool-NG version (default) - crosstool-NG version - custom toolchain ID - Custom toolchain ID - No crosstool-NG version OR custom toolchain ID Signed-off-by: Nathan Chancellor <natechancellor@gmail.com>
2017-08-26Make --enable-obsolete-rpc an option in ct-ngAlexey Neyman1-2/+3
Signed-off-by: Alexey Neyman <stilor@att.net>
2017-08-26Fix glibc-ports with the new frameworkAlexey Neyman1-4/+8
While here, also consider patched by anything other than "bundled patches" as per-target sources. Add scary warnings in case of a failure. Signed-off-by: Alexey Neyman <stilor@att.net>
2017-07-08Building packages using the new frameworkAlexey Neyman1-2/+2
(fails at building GMP off the VCS because it needs to run bootstrap scripts) Signed-off-by: Alexey Neyman <stilor@att.net>
2017-07-08Fix the references to old config variablesAlexey Neyman1-103/+24
Signed-off-by: Alexey Neyman <stilor@att.net>
2017-07-08Convert the rest of packages to new frameworkAlexey Neyman1-23/+23
Signed-off-by: Alexey Neyman <stilor@att.net>
2017-03-31MinGW-W64 fixesAlexey Neyman1-1/+1
- libpthread requires iteration over multilibs, unlike the core, it does not detect and build multilibs by itself. - Disable parallel builds for mingw-w64 components; until mingw-w64 core builds clean, I am not trusting it. - Make the list of tools to build configurable - Turn on multilib in x86_64 sample. - Make warnings about tuple less redundant. As in, "one WARN is enough, no need to shout it three times". - Messages about various steps/substeps are more aligned with the rest of the components. - Use 'make' instead of ${make} to invoke the companion make just built, if applicable. Signed-off-by: Alexey Neyman <stilor@att.net>
2017-03-12Move tools alias creation to a common functionAlexey Neyman1-0/+2
... and in addition to final toolchain aliasing, use it when configuring multilibs for glibc/musl. Note that uClibc does not need it, it is explicitly selecting the tools using CROSS_PREFIX. Signed-off-by: Alexey Neyman <stilor@att.net>
2017-03-07Merge pull request #635 from stilor/macos-skip-localesAlexey Neyman1-1/+1
Skip locales on macos
2017-03-07Skip building locales on macos, tooAlexey Neyman1-1/+1
--enable-hacker-mode is not sufficient, in 2.25 configure then fails while checking for sysdeps fragments that apply to a given configuration, and with that worked around, fails on binutils & compiler version check. In brief: if someone wants locales on cygwin/macos, you'd have to implement cross-localedef (similar to cross-rpcgen) in glibc and submit it upstream. Signed-off-by: Alexey Neyman <stilor@att.net>
2017-03-02glibc: hide native c++ executable from buildDan McGregor1-0/+4
If glibc's configure finds the host c++ executable it assumes that c++ should be enabled for the build. In case we don't have cross g++ built yet (ie, for headers), this causes the build to fail creating C++ headers. So hide C++ from the build. Signed-off-by: Dan McGregor <dan.mcgregor@usask.ca>
2017-03-02Bring in FreeBSD supportDan McGregor1-1/+9
Check for FreeBSD specific issues, it is mostly the same as Darwin. Signed-off-by: Dan McGregor <dan.mcgregor@usask.ca>
2017-03-01Skip locale build on CygwinAlexey Neyman1-0/+9
Signed-off-by: Alexey Neyman <stilor@att.net>
2017-02-27Revert "Determine whether -E/-r option selects extended regexp"Alexey Neyman1-3/+3
This reverts commit 7bcf18bfab84374d3305c7a088f95ac1219ddf93.
2017-02-14Determine whether -E/-r option selects extended regexpAlexey Neyman1-3/+3
... and then use the right option. See the note in scripts/functions on where we should use ${foo} and where just 'foo'; this boils down to whether we can expect the build tools override to be in effect (e.g. in the actual build scripts) or not (i.e. outside of scripts/build). While running in scripts/functions, or in scripts/crosstool-NG.sh the build tools override directory (.build/tools/bin) may have not been set up (yet, or at all). Also, modify the installed scripts (populate, xldd) accordingly. Signed-off-by: Alexey Neyman <stilor@att.net>
2017-02-10External addons supported by glibc even nowAlexey Neyman1-27/+24
... though none are provided by default. Signed-off-by: Alexey Neyman <stilor@att.net>
2017-02-10Revert "glibc: Remove support for downloading and extracting add-ons"Alexey Neyman1-0/+67
This reverts commit 39273e0843cc5f7f91d50651b299a0472f59f472.
2017-01-30Fix location where libc manual is builtAlexey Neyman1-2/+2
Signed-off-by: Alexey Neyman <stilor@att.net>
2017-01-25Run all configure scripts using ${CONFIG_SHELL}Alexey Neyman1-0/+1
... as its help message says in menuconfig. Signed-off-by: Alexey Neyman <stilor@att.net>
2017-01-14Use ${CT_CC} instead of gcc ...Alexey Neyman1-6/+6
... when refering to target's compiler. Signed-off-by: Alexey Neyman <stilor@att.net>
2017-01-13Unify fetching Linaro components.Alexey Neyman1-11/+10
Add CT_GetLinaro, use it from gcc/binutils/gdb/glibc/newlib. Signed-off-by: Alexey Neyman <stilor@att.net>
2017-01-10Darwin needs -liconv when building glibc.Alexey Neyman1-7/+2
Signed-off-by: Alexey Neyman <stilor@att.net>
2017-01-10Avoid trampling user's LDFLAGS_FOR_HOST...Alexey Neyman1-7/+11
... by passing BUILD_LDFLAGS twice (the 2nd argument overrides the first). Also, no need to pass -I/-L for BUILD_CFLAGS/LDFLAGS, they are already included by crosstool-NG.sh (but keep for BUILD_CPPFLAGS, as we set it up here). Remove -Wl,-Bstatic/-Wl,-Bdynamic (we only build static complibs). Signed-off-by: Alexey Neyman <stilor@att.net>
2016-11-21Partially revert 6f8e89cb5ca061e899bf3feaaf3fecf30d366c3e.Alexey Neyman1-13/+13
The referenced commit replaced 'make' with '${make}' everywhere. This is wrong for at least the utilities that we may build as companion tools (make, libtool): this will always invoke the version detected by configure by supplying the absolute path. In other words, the wrappers in .build/tools/bin are not fallbacks - they are either temporary (in case a respective companion tool is built) or permanent redirectors. This is the reason why the PATH= has .build/*/buildtools/bin at higher precedence than .build/tools/bin; the latter has the versions detected by configure and the former has the versions built as companion tools. Revert the rest of the gang (grep/sed/...) for consistency. After all, we may decide to supply some of them as well (awk, for instance). Signed-off-by: Alexey Neyman <stilor@att.net>
2016-09-14build/glibc: Improve confusing commentKirill K. Smirnov1-1/+2
Up until cset 4e2227e8a5537a8553c503e55d2cb2190f2a0d2f there was an 'if' statement with a comment. The abovementioned changeset removed the conditional statement but the comment survived. Signed-off-by: Kirill K. Smirnov <kirill.k.smirnov@gmail.com>
2016-08-23Support multilib in sh/uClibc.Alexey Neyman1-105/+17
Signed-off-by: Alexey Neyman <stilor@att.net>
2016-08-23Treat multiroots differently.Alexey Neyman1-10/+46
'ld' does not search for dependency libraries in multi_os_directory, so if there's both multi_os_directory and multi_root, and there is only one configuration in each multi_root, forgo the multi_os_directory suffix. Needed for sh4-multilib-linux-uclibc. Signed-off-by: Alexey Neyman <stilor@att.net>
2016-08-23Change multilib functions to set the variable.Alexey Neyman1-2/+3
Rather than echo-ing the new value, set the value into the variable with the name passed as an argument (similar to CT_SanitizeVarDir). This allows to use CT_DoLog in these functions. Signed-off-by: Alexey Neyman <stilor@att.net>
2016-08-23libc/*.sh: Deprecate libc_check_config step.Alexey Neyman1-27/+2
This step was only used in uClibc. However, with upcoming multilib, the config management will have to be done for each variant differently, anyway. uClibc was the only user of libc_check_config step, as well as CT_CONFIG_DIR directory. Retire these. Two other clean-ups in uClibc.sh: - KERNEL_HEADERS check seems to be bogus, this config option is not present even in 0.9.30 - which is not supported already. - SHARED_LIB_LOADER_PREFIX was renamed to MULTILIB_DIR in 0.9.31, according to ChangeLog - and MULTILIB_DIR is passed from command line instead. Signed-off-by: Alexey Neyman <stilor@att.net>
2016-08-23glibc.sh: cleanupsAlexey Neyman1-55/+33
- 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 <stilor@att.net>
2016-08-23libc/*.sh: handle combinations of multilib root/dir.Alexey Neyman1-116/+74
Install startfiles for libc variants into the most specific combination (suffixed sysroot, if applicable + suffixed multi-os dir, if applicable). Install headers once in every suffixed sysroot (although it seems that GCC picks up headers from top-level sysroot, GCC manual claims that sysroot suffix affects headers search path). In uClibc, this requires a better sanitization of the directory: it creates symlinks from {sysroot}/usr/lib/{multi_os_dir} to {sysroot}/lib/{multi_os_dir} and to do so, it counts the number of path components in the libdir. This breaks if one of such components is `..' - symlinks contain an extra `../..' then. Since such sanitization had to be implemented anyway, use it in other places to print more sensible directory names. Also, fix the description of configure --host/--target per musl's configure help message (and its actual code). Signed-off-by: Alexey Neyman <stilor@att.net>
2016-08-23multilib: Determine which options may pass through.Alexey Neyman1-3/+19
On some arches (e.g. MIPS) the options like -mabi do not work if specified more than once (see the comment in 100-gcc.sh). Therefore, we need to determine which of the options produced by <arch>.sh can be passed to multilib builds and which must be removed (i.e., which options vary among the multilibs). This presents a chicken-and-egg problem. GCC developers, in their infinite wisdom, do not allow arbitrary multilib specification to be supplied to GCC's configure. Instead, the target (and sometimes some extra options) determine the set of multilibs - which may include different CPUs, different ABIs, different endianness, different FPUs, different floating-point ABIs, ... That is, we don't know which parts vary until we build GCC and ask it. So, the solution implemented here is: - For multilib builds, start with empty CT_ARCH_TARGET_CFLAGS/LDFLAGS. - For multilib builds, require core pass 1. Pass 1 does not build any target binaries, so at that point, our target options have not been used yet. - Provide an API to modify the environment variables for the steps that follow the current one. - As a part of multilib-related housekeeping, determine the variable part of multilibs and filter out these options; pass the rest into CT_TARGET_CFLAGS/LDFLAGS. This still does not handle extra dependencies between GCC options (like -ma implying -mcpu=X -mtune=Y, etc.) but I feel that would complicate matters too much. Let's leave this until there's a compelling case for it. Also, query GCC's sysroot suffix for targets that use it (SuperH, for example) - the default multilib may not work if the command line specifies the default option explicitly (%sysroot_suffix_spec is not aware of multilib defaults). Signed-off-by: Alexey Neyman <stilor@att.net>
2016-08-23glibc: Build manuals and locales lastRay Donnelly1-3/+17
Rather then building the manuals and locales for each multilib target, only build the manuals on the last multilib target. If you are not building a multilib toolchain, then the first libc build will be the last. Signed-off-by: Bryan Hundven <bryanhundven@gmail.com>
2016-08-23glibc.sh: Use --print-multi-os-directoryAlexey Neyman1-41/+44
GCC makes the distinction between: multilib (-print-multi-lib) and multilib-os (--print-multi-os-directory) as the GCC library and GCC sysroot library paths, respecitively. Use this to build libc into the correct locations, the same applies to the dummy libc.so Changed by Alexey Neyman: restore missing CT_EndStep. Signed-off-by: Ray Donnelly <mingw.android@gmail.com> Signed-off-by: Alexey Neyman <stilor@att.net>