summaryrefslogtreecommitdiff
path: root/scripts
AgeCommit message (Collapse)AuthorFilesLines
2016-08-23musl: Add multilib support.Alexey Neyman4-36/+77
Signed-off-by: Alexey Neyman <stilor@att.net>
2016-08-23uClibc: move ldso check to post_cc.Alexey Neyman1-43/+54
It turns out that core GCC on binfmt architectures (m68k, for example) cannot produce the final executable (looks for ld.real in the wrong place). Need to wait for the final gcc to become available. Signed-off-by: Alexey Neyman <stilor@att.net>
2016-08-23Support multilib in sh/uClibc.Alexey Neyman4-217/+213
Signed-off-by: Alexey Neyman <stilor@att.net>
2016-08-23Treat multiroots differently.Alexey Neyman2-17/+83
'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-23First stab at multilib/uClibc.Alexey Neyman5-16/+273
Create a separate 'libc_backend_once', install headers into a subdirectory (different sets of headers are installed for 32- and 64-bit architectures), and create a symlink for the dynamic linker location expected by GCC. Signed-off-by: Alexey Neyman <stilor@att.net>
2016-08-23uClibc: Split configuration tweaker into per-arch functions.Alexey Neyman11-113/+174
Signed-off-by: Alexey Neyman <stilor@att.net>
2016-08-23Change multilib functions to set the variable.Alexey Neyman7-57/+79
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 Neyman20-147/+94
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-23uclibc: merge startfiles/final into single backend.Alexey Neyman1-160/+109
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 <file> <defines>'. Signed-off-by: Alexey Neyman <stilor@att.net>
2016-08-23uClibc.sh: typo, local -> locale.Alexey Neyman1-13/+13
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 Neyman6-171/+197
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 Neyman4-55/+220
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-23crosstool-NG.sh.in: Don't make lots of symlinks to lib folderRay Donnelly3-68/+47
For 4 different folders: ${CT_PREFIX_DIR} ${CT_SYSROOT_DIR} ${CT_SYSROOT_DIR}/usr ${CT_PREFIX_DIR}/${CT_TARGET} .. symlinks from 'lib32' and 'lib64' to 'lib' were created. This was untidy and incorrect for multilib (the bitness of the libraries in 'lib32' and 'lib64' will not be the same) We can not know which folders this toolchain configuration will require at this time so let them be created on-demand instead. Changed by Alexey Neyman: original change removed too much; we still need to create the default directories because the os directories are based off them (e.g. `lib/../lib64'). Signed-off-by: Ray Donnelly <mingw.android@gmail.com> Signed-off-by: Alexey Neyman <stilor@att.net>
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>
2016-06-10glibc.sh: build dummy libc.so with correct extra flagsAlexey Neyman1-1/+2
Signed-off-by: Alexey Neyman <stilor@att.net>
2016-06-10glibc: Use common arch call to get multilib targetsRay Donnelly2-1/+37
The previous patch added the function 'CT_DoMultilibTarget()' to scripts/build/arch/*.sh. This patch calls the common function to (currently) get just the target tuple for the current multilib target. This patch was originally by: Cody P Schafer Changed by Alexey Neyman: first, try `gcc -print-multiarch`. If it is supported, use whatever it reports. Otherwise, fall back to our guesswork. Move "i486" quirk into glibc.sh, as it is specific to glibc (e.g. uclibc will need i386, which is what GCC reports). Signed-off-by: Bryan Hundven <bryanhundven@gmail.com> Signed-off-by: Ray Donnelly <mingw.android@gmail.com> Signed-off-by: Alexey Neyman <stilor@att.net>
2016-06-10arch/x86: add a sanity checkAlexey Neyman1-0/+11
i[34567]86-*-gnux32 is not a valid tuple. Signed-off-by: Bryan Hundven <bryanhundven@gmail.com> Signed-off-by: Ray Donnelly <ray.donnelly@gmail.com> Signed-off-by: Alexey Neyman <stilor@att.net>
2016-06-10 arch/all: Add common function to return multilib targetAlexey Neyman10-0/+181
This code was abstracted out of Cody P Schafer's multilib patch. It doesn't seem right having architecture dependent code in a specific libc implementation script. So this patch breaks it out into scripts/build/arch/<arch>.sh in a function: multilib_target_to_build="$(CT_DoArchMultilibTarget 'multi_flags' 'target-in')" Note that this function gets called on each multilib variant with different sets of compiler flags supplied in 'multi_flags'. The caller will first filter the flags so that there is no conflicting flags (e.g., no '-m32 -m64') supplied. Changed by Alexey Neyman: - make option analysis check specific option rather than match global options string as a whole. Moreover, old code did not handle multiple options in the same multilib, e.g. '-m64 -mlittle'. - fixed substitutions in powerpc.sh (*le variants did not match the pattern in the shell parameter expansion) - make s390.sh actually apply the flags it gathered from the options. - straighten the spaghetti in x86.sh by setting two flags, arch & abi. Also, do not depend on "gnu" being the last part - we can have '*-uclibcx32', for example. Signed-off-by: Bryan Hundven <bryanhundven@gmail.com> Signed-off-by: Ray Donnelly <ray.donnelly@gmail.com> Signed-off-by: Alexey Neyman <stilor@att.net>
2016-06-10gcc: Add --with-multilib-list optionRay Donnelly1-0/+6
Written by Bryan Hundven. Modified by Alexey Neyman to actually add the option to gcc.in. Signed-off-by: Bryan Hundven <bryanhundven@gmail.com> Signed-off-by: Ray Donnelly <mingw.android@gmail.com> Signed-off-by: Alexey Neyman <stilor@att.net>
2016-06-10Enable multiarch support in pass-1 GCC.Alexey Neyman1-3/+12
By default, it is 'auto' - which means, it is enabled if there are multilibs directories detected in the installation location for libgcc. Thus, it is not detected for pass-1 GCC: the installation location is empty at this point. Signed-off-by: Alexey Neyman <stilor@att.net>
2016-06-10glibc: do not add bogus optionsAlexey Neyman1-2/+2
If a multilib configuration contains an endianness option, the ${endian_extra} is set to, for example, 'mb' (note, no dash!). It is then added to CFLAGS, resulting in bogus flags like 'mb -mb'. But it is not even needed, as ${extra_flags} already contains the very same option! Found by experimenting with multilibs with different endianness on SH, which still didn't work, but that's another story... Signed-off-by: Alexey Neyman <stilor@att.net>
2016-06-10arch/sparc: better default CPU when targetting LinuxAlexey Neyman1-0/+13
By default, sparc64-*-linux is configured with -mcpu=v9. However, according to https://sourceware.org/ml/libc-alpha/2005-12/msg00027.html: "There is no Linux sparc64 port that runs on non-UltraSPARC-I+ ISA CPUs." v9 is such a "non-UltraSPARC-I+ ISA CPU", so it makes no sense to default to v9 when targetting Linux. Change the default to ultrasparc, even though it can suboptimally schedule instructions for newer SPARC CPUs. See the pending patch: https://patchwork.ozlabs.org/patch/409424/ Signed-off-by: Alexey Neyman <stilor@att.net>
2016-05-13Merge pull request #373 from stilor/unbreak-ppc-uclibcBryan Hundven3-11/+44
Unbreak samples
2016-05-12addToolVersion: Fix syntax issuesBryan Hundven1-4/+4
This issue was reported on github: https://github.com/crosstool-ng/crosstool-ng/issues/378 by: alonbg This is the same addToolVersion.sh change in the zipfile, with minor changes. (whitespace) This closes #378 Signed-off-by: Bryan Hundven <bryanhundven@gmail.com>
2016-04-02Work-around another quirk in GDB configure.Alexey Neyman1-4/+11
Previous fix for cross-gdb broke powerpc-unknown_nofpu-linux-gnu which uses an old GDB (6.8a). That GDB's configure chokes on $CC values with multiple consecutive spaces; see the comment in 300-gdb.sh. Signed-off-by: Alexey Neyman <stilor@att.net>
2016-04-02Unbreak sparc-unknown-linux-gnu.Alexey Neyman1-2/+17
GLIBC 2.23 dropped support for pre-v9 SPARC in pthreads. Pass host triplet with s/sparc/sparcv9/ replacement for 2.23. Signed-off-by: Alexey Neyman <stilor@att.net>
2016-04-02Unbreak static cross-gdb.Alexey Neyman2-5/+16
GDB's configure mishandles the libexpat.{so,a} libraries when it is given -static in CFLAGS AND --with-libexpat-prefix in configure's args: it checks for <prefix>/lib/libexpat.so and finding that, attempts to link it as `gcc -static .. conftest.c <prefix>/lib/libexpat.so`; this obviously fails (.so cannot be statically linked), so configure assumes libexpat is unusable. Thus, --with-libexpat-prefix is dangerous and should be avoided; instead, configure should find the libraries via the supplied CC/LD definitions.
2016-03-26Merge pull request #320 from bhundven/newlib_updatesBryan Hundven1-0/+11
Newlib updates
2016-03-15scripts/build/cc: pass FLAGS_FOR_TARGET in do_gcc_core_backendMax Filippov1-0/+3
Pass CFLAGS_FOR_TARGET, CXXFLAGS_FOR_TARGET and LDFLAGS_FOR_TARGET to gcc configure in do_gcc_core_backend as they may be used to build libstdc++ for bare-metal target. Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
2016-03-08newlib: add option to enable nano formatted ioBryan Hundven1-0/+3
Signed-off-by: Bryan Hundven <bryanhundven@gmail.com>
2016-03-08newlib: add option to enable nano mallocBryan Hundven1-0/+3
Signed-off-by: Bryan Hundven <bryanhundven@gmail.com>
2016-03-08newlib: disable multilib if it is not enabledBryan Hundven1-0/+5
Signed-off-by: Bryan Hundven <bryanhundven@gmail.com>
2016-03-03config.{sub,guess}: Ran ct-ng updatetoolsBryan Hundven2-51/+58
Signed-off-by: Bryan Hundven <bryanhundven@gmail.com>
2016-03-01musl-libc: Rewrite musl.sh build scriptBryan Hundven1-50/+67
This commit moves the do_libc_configure function to do_libc_backend and switches do_libc_start_files and do_libc_final to call do_libc_backend. The major reason for the rewrite is that musl => 1.1.13 has had it's own build system rewritten and can now build out-of-tree. Signed-off-by: Bryan Hundven <bryanhundven@gmail.com>
2016-02-24glibc: Mirror extra_config flags from do_libc_backend_onceBryan Hundven1-0/+1
In do_libc_backend_once: ``` # Also, if those two are missing, iconv build breaks extra_config+=( --disable-debug --disable-sanity-checks ) ``` But in do_libc_locales we only add ```--disable-debug```. This change adds ```--disable-sanity-checks``` to do_libc_locales to mirror this, as I've seen iconv break this way. Signed-off-by: Bryan Hundven <bryanhundven@gmail.com>
2016-02-24glibc: remove do_libc_locales_extract; it's emptyBryan Hundven1-10/+0
No point in calling an empty function. Must be left over from the glibc/eglibc split up... then re-merge. Signed-off-by: Bryan Hundven <bryanhundven@gmail.com>
2016-02-24glibc: Remove support for downloading and extracting add-onsBryan Hundven1-67/+0
Since external add-ons were removed in 2.17, and we only support >= 2.18, this support is no longer needed. Signed-off-by: Bryan Hundven <bryanhundven@gmail.com>
2016-02-24glibc: reformat glibc build scriptBryan Hundven1-66/+64
Move crosstool-ng hook functions to be in the normal locations. This commit has no functional changes. Signed-off-by: Bryan Hundven <bryanhundven@gmail.com>
2016-02-19functions: use 'ln -sf' for softlinksBryan Hundven1-1/+1
I should have just used ln -sf when I rewrote the custom locations change. BSD based systems don't have 'cp -s', so switch to using 'ln -sf'. Signed-off-by: Bryan Hundven <bryanhundven@gmail.com>
2016-02-09functions: Softlink custom directoryBryan Hundven1-1/+1
Hardlinking the custom source directory does not work across separate mount points. Chnage this to a softlink instead. This closes #336 Reported-by: Jasmin Jessich <jasmin@anw.at> Signed-off-by: Bryan Hundven <bryanhundven@gmail.com>
2016-02-08Merge pull request #322 from modbw/libelfBryan Hundven1-4/+0
Remove GCC dependency to libelf
2016-02-05binutils: Add binutils-2.26Bryan Hundven1-0/+2
Signed-off-by: Bryan Hundven <bryanhundven@gmail.com>
2016-02-04env: Bail out if CPATH and friends are setBryan Hundven1-0/+4
If CPATH, C_INCLUDE_PATH, CPLUS_INCLUDE_PATH, or OBJC_INCLUDE_PATH are set, bail out. These environment variables are known to break crosstool-ng's build. This closes #327 Signed-off-by: Bryan Hundven <bryanhundven@gmail.com>
2016-01-18Remove GCC dependency to libelfMatthias Weisser1-4/+0
As crosstools-ng only support GCC >= 4.8 we do not need libelf for gcc. GCC dropped this dependency with 4.6. Signed-off-by: Matthias Weisser <m.weisser.m@gmail.com>
2016-01-13linux: allow `arm*` to build headers for no-mmuBryan Hundven1-0/+1
Signed-off-by: Bryan Hundven <bryanhundven@gmail.com>
2016-01-13elf2flt: Use openadk version of elf2fltBryan Hundven1-1/+1
elf2flt is now hosted on github here: https://github.com/uclinux-dev/elf2flt But, until arm support is upstream, we'll switch to Waldemar Brodkorb version of elf2flt. Signed-off-by: Bryan Hundven <bryanhundven@gmail.com>
2016-01-07gcc: fix previous commitBryan Hundven1-1/+1
In a5057713a0394d189adc8b9abb0eb65592ecfc49 ...I forgot to add a line continuation at the break in the 'if' statement. Reported-by: asavah <asavah@avh.od.ua> Signed-off-by: Bryan Hundven <bryanhundven@gmail.com>
2016-01-06gcc: Fix CC_GCC_ENABLE_CXX_FLAGS for mode=baremetalBryan Hundven1-0/+6
When creating a baremetal toolchain, CC_GCC_ENABLE_CXX_FLAGS has no effect. This closes #298 Signed-off-by: Bryan Hundven <bryanhundven@gmail.com>