summaryrefslogtreecommitdiff
path: root/scripts/crosstool-NG.sh.in
AgeCommit message (Collapse)AuthorFilesLines
2017-01-30Add install wrapperAlexey Neyman1-2/+6
... to work around Gentoo's wrapper idiosyncrasy. Signed-off-by: Alexey Neyman <stilor@att.net>
2017-01-30Allow for per-tool templates when creating overridesAlexey Neyman1-12/+16
... will be used to implement a smarter install wrapper. While there, correct the spelling of "OVERIDE". Signed-off-by: Alexey Neyman <stilor@att.net>
2017-01-25Fix log saving/restoringAlexey Neyman1-2/+2
after the CT_Log{Enable,Disable} changes. Signed-off-by: Alexey Neyman <stilor@att.net>
2017-01-20Make build-all rely on kconfig options.Alexey Neyman1-7/+5
For that, make CT_BUILD_TOP_DIR a non-settable config option (so that it is recursively expanded with CT_HOST/CT_TARGET). Use a common prefix, with same default as for regular sample build. Use showConfig.sh to determine host toolchain path (for canadian crosses) and build directory to be removed. Remove LIBC_SYSROOT_ARG (unused). Signed-off-by: Alexey Neyman <stilor@att.net>
2017-01-20Get rid of .config.2.Alexey Neyman1-4/+0
Now handled by CT_LoadConfig. Signed-off-by: Alexey Neyman <stilor@att.net>
2017-01-20Install canadian crosses into a separate subdir.Alexey Neyman1-28/+8
Makes them sorted out by host, and removes the need for similar hack in samples.mk. Change how canadian crosses are named: using `=' character resulted in Glibc build failure. Move loading config into a common function, CT_LoadConfig. Signed-off-by: Alexey Neyman <stilor@att.net>
2017-01-10Add MacOS options.Alexey Neyman1-0/+23
Needed for linking gettext/libiconv. Signed-off-by: Alexey Neyman <stilor@att.net>
2017-01-10For simple cross or native pick up both build/host flags.Alexey Neyman1-3/+17
Signed-off-by: Alexey Neyman <stilor@att.net>
2017-01-10Point FOR_BUILD flags to buildtools/{include,lib}.Alexey Neyman1-5/+6
Similarly to FOR_HOST; recent change in 100-gcc.sh that switched FOR_HOST->FOR_BUILD broke simple cross configurations on macos. Signed-off-by: Alexey Neyman <stilor@att.net>
2016-12-19Kill CT_INSTALL_DIR.Alexey Neyman1-10/+9
We now use CT_PREFIX and expect the resulting toolchain to be relocatable. Signed-off-by: Alexey Neyman <stilor@att.net>
2016-12-02Add 'companion tools for host' step.Alexey Neyman1-0/+11
Signed-off-by: Alexey Neyman <stilor@att.net>
2016-12-02Move companion tool build into a separate step.Alexey Neyman1-7/+1
Also, rename "build" -> "for_build", since we're going to have a "for_host" as well. Signed-off-by: Alexey Neyman <stilor@att.net>
2016-08-26cross: Only make 'build tools' for the 'build'Bryan Hundven1-2/+2
For a cross-compiler, we only need to make the 'build tools' for the 'build'. We also build the 'build tools' for the 'host' when building a cross-canadian toolchain. Closes #430 Signed-off-by: Bryan Hundven <bryanhundven@gmail.com>
2016-08-23libc/*.sh: Deprecate libc_check_config step.Alexey Neyman1-3/+1
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-23libc/*.sh: handle combinations of multilib root/dir.Alexey Neyman1-2/+2
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-1/+9
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-23crosstool-NG.sh.in: Don't make lots of symlinks to lib folderRay Donnelly1-30/+4
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-04-02Unbreak static cross-gdb.Alexey Neyman1-0/+2
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-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>
2015-11-17consistency: Use exported variables of required toolsBryan Hundven1-2/+2
We check for apps: * make * sed * grep * awk * libtool/libtoolize * install * patch * and more ...during configure. Our scripts should be consistent about using the variables that define where the found tool was found. Of course, we do hard-link these tools in buildtools, but that should be a backup for the components we are building. Our scripts should always use the tools we find. Signed-off-by: Bryan Hundven <bryanhundven@gmail.com>
2015-11-11Use install-strip target for gcc optionallyIlya Lyubimov1-1/+1
2015-10-30Sanity check for number of parallel jobs.Alexey Neyman1-1/+6
Signed-off-by: Alexey Neyman <stilor@att.net>
2015-10-30Implement 'ct-ng source'.Alexey Neyman1-0/+3
Provides a simpler alternative to editing config to enable CT_ONLY_DOWNLOAD, doing ct-ng build and then restoring .config. Signed-off-by: Alexey Neyman <stilor@att.net>
2015-06-01scripts: Update crosstool-NG internals for multiple compilers.Ray Donnelly1-4/+4
This change updates the CC.* references to CC_GCC.* in the internal scripts. Signed-off-by: Ray Donnelly <mingw.android@gmail.com> Reviewed-by: Bryan Hundven <bryanhundven@gmail.com> Reviewed-by: Yann Diorcet <diorcetyann@gmail.com>
2015-05-29multi_cc: Prepare ct-ng for multiple compilersRay Donnelly1-1/+1
This commit moves gcc.sh to 100-gcc.sh to accomodate for other cross-compilers that crosstool-ng might be able to build. The first, to come soon, is llvm/clang. Signed-off-by: Ray Donnelly <mingw.android@gmail.com> Reviewed-by: Bryan Hundven <bryanhundven@gmail.com> Reviewed-by: Yann Diorcet <diorcetyann@gmail.com>
2015-05-10scripts: If paths.sh is included, use the variablesBryan Hundven1-1/+1
This commit changes sed, awk, and grep to use the ones we found during configure time. This helps make the build more consistent. Signed-off-by: Bryan Hundven <bryanhundven@gmail.com>
2014-12-05scripts/crosstool-NG.sh.in: patch regex to work with BSD grepJason T. Masker1-1/+1
BSD grep does not interpret a null alteration. It complains about an empty sub-expression, e.g.: $ grep --version && grep -E '^(# |)CT_' .config grep (BSD grep) 2.5.1-FreeBSD grep: empty (sub)expression This patch replaces the null alteration with a zero or once quantifier which works with both BSD & GNU grep. $ grep --version && grep -E '^(# )?CT_' .config grep (BSD grep) 2.5.1-FreeBSD CT_CONFIGURE_has_xz=y CT_CONFIGURE_has_svn=y ... $ ggrep --version && ggrep -E '^(# )?CT_' .config ggrep (GNU grep) 2.20 Copyright (C) 2014 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>. This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. Written by Mike Haertel and others, see <http://git.sv.gnu.org/cgit/grep.git/tree/AUTHORS>. CT_CONFIGURE_has_xz=y CT_CONFIGURE_has_svn=y ... Signed-off-by: Jason T. Masker <jason@masker.net> Tested-by: Andreas Bießmann <andreas@biessmann.de> Signed-off-by: Bryan Hundven <bryanhundven@gmail.com>
2014-09-02scripts: properly restore stdout/err/in at the endYann E. MORIN1-2/+2
Byt the end of the main script, the log file is being moved and compressed, and the final destination might become read-only at any time, so we consign stdout/err to oblivion. This is incorrect, as some actions after may still fail (out of space, for example). So, properly restore stdout/err, but also stdin (useless, but harmless) instead, so the user has a chance to see the error, especially since it is not logged into the log file. Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
2014-08-28scripts/crosstool-NG: use ${grep} instead of 'grep'Fabian Freyer1-3/+3
Helps building on BSD-like systems. Reported-by: Fabian Freyer <fabian.freyer@physik.tu-berlin.de> Signed-off-by: "Fabian Freyer" <fabian.freyer@physik.tu-berlin.de> [yann.morin.1998@free.fr: split the original patch] Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr> Cc: Fabian Freyer <fabian.freyer@physik.tu-berlin.de>
2014-01-02scripts: do not allow commas in directories, it breaks thingsYann E. MORIN"1-0/+3
The comma is used by the autotools as separator in many sed expressions, which break if a directory contains commas. Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
2013-11-15scripts: remove duplicate '/' in prefix, it breaks relocationYann E. MORIN"1-0/+3
Reported-by: Richard Weinberger <richard.weinberger@gmail.com> Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
2013-01-28scripts: fix finishing the toolchain when download/extract-only is setYann E. MORIN"1-2/+7
In case we only download or extract the sources, do not fail while finishing the toolchain: the test-suite directory may not exist, so we can't chmod it. Also, use safer constructs that won't trigger the 'set -e' in case of failure (eg.: "[ ... ] && ..." is not safe in case the test fails). Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
2013-01-27script: allow to pass any float value for CT_LOADSamuel Martin1-1/+1
Signed-off-by: Samuel Martin <s.martin49@gmail.com> Message-Id: <b51acf21c72b4a8e882e.1359320015@laptop> Patchwork-Id: 216062
2013-01-10scripts: woops, root's UID is 0, not 1000!Yann E. MORIN"1-1/+1
Left-over from a test... :-( Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
2013-01-10scripts: check for running as rootYann E. MORIN"1-0/+8
Running as root is really, really dangerous. Add a runtime-check that refuses to build if running as root. Can be overriden with a double switch in the menuconfig. Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
2012-11-21scripts: refine static linking check to better guide the userDaniel Price1-15/+36
The current mechanism to check if static linking is possible, and the mesage displayed on failure, can be puzzling to the unsuspecting user. Also, the current implementation is not using the existing infrastructure, and is thus difficult to enhance with new tests. So, switch to using the standard CT_DoExecLog infra, and use four tests to check for the host compiler: - check we can run it - check it can build a trivial program - check it can statically link that program - check if it statically link with libstdc++ That should cover most of the problems. Hopefully. (At the same time, fix a typo in a comment) Signed-off-by: Daniel Price <daniel.price@gmail.com> [yann.morin.1998@free.fr: split original patch for self-contained changes] [yann.morin.1998@free.fr: use steps to better see gcc's output] [yann.morin.1998@free.fr: commit log] Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr> Message-Id: <163f86b5216fc08c672a.1353459722@nipigon.dssd.com> Patchwork-Id: 200536
2012-11-21scripts: fail on ':' in pathsDaniel Price1-0/+3
Signed-off-by: Daniel Price <daniel.price@gmail.com> [yann.morin.1998@free.fr: split original patch for self-contained changes] Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr> Message-Id: <163f86b5216fc08c672a.1353459722@nipigon.dssd.com> Patchwork-Id: 200536
2012-11-19binutils: introduce the infrastructure to support binutils alternativesYann Diorcet1-4/+1
Rework binutils in order to provide soon binutils alternative. Signed-off-by: Yann Diorcet <diorcet.yann@gmail.com> [yann.morin.1998@free.fr: split up original patch for self-contained changes] Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr> Message-Id: <d3d1d51f399e6d2c1163.1353320546@macbook-smorlat.local> Patchwork-Id: 199971
2012-11-16scripts: add BUILD/HOST extra cflags/ldflagsYann Diorcet1-2/+12
On some hosts, and for certain toolchains (eg. toolchain targetting the upcoming Darwin), it may be necessary to pass arbitrary CFLAGS and/or LDFLAGS when building the components. And necessary infrastructure: - EXTRA_{CFLAGS,LDFLAGS}_FOR_{BUILD,HOST} as config options - pass those extra flags to components Fix-up a slight typo in elf2flt at the same time (misnamed cflags). Signed-off-by: Yann Diorcet <diorcet.yann@gmail.com> Message-Id: <d24043276c9243a35421.1353077450@macbook-smorlat.local> Patchwork-Id: 199645
2012-11-19binutils/sstrip: removeYann Diorcet1-3/+0
sstrip has been obsoleted for a while now, as it's still broken for some archs, and there seems to be no incentive to fix it upstream. Besides, the space gained with sstrip is marginal at best. Signed-off-by: Yann Diorcet <diorcet.yann@gmail.com> Message-Id: <65c8bf534d0647ce52cd.1353320545@macbook-smorlat.local> Patchwork-Id: 199970
2012-11-16complibs: introduce generic multi-complibs infrastructureYann Diorcet (diorcet yann1-18/+3
Use the same method as companion tools for providing generic and extendable companion libs. Signed-off-by: Yann Diorcet <diorcet.yann@gmail.com> Message-Id: <515c5c4635d99ebe4877.1353074410@macbook-smorlat.local> Patchwork-Id: 199613
2012-11-13scripts: set default CFLAGS to optimise.Michael Hope1-1/+3
The extra CFLAGS override the product defaults, causing the product to be built without optimisation or debug. Be explicit and add these in. Reported-by: Johannes Stezenbach <js@sig21.net> Signed-off-by: Michael Hope <michael.hope@linaro.org> Message-Id: <CANLjY-=3Gbio6nzUPhhevDHV7cUN=6Vigooe9nSf-RnGCqnjog@mail.gmail.com> Patchwork-Id: 198808
2012-10-06scripts: add option to start an interactive debug shellYann E. MORIN"1-0/+8
Add an option that, when a command fails: - starts an interactive shell with the failed command's environment - attempts re-execution of the failed command, continues, or aborts at user's whim. Before starting the debug-shell, the backtrace is printed. When exiting for an abort, the standard error message is printed. Based on an idea and a patch from: Johannes Stezenbach <js@sig21.net> http://sourceware.org/ml/crossgcc/2012-09/msg00144.html Signed-off-by: Johannes Stezenbach <js@sig21.net> [yann.morin.1998@free.fr: integrate in the fault handler] Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr> Acked-by: Johannes Stezenbach <js@sig21.net> Patchwork-Id: 191571 Patchwork-Id: 191668
2012-10-14scripts: move backtrace marker to CT_WORK_DIRJohannes Stezenbach1-0/+1
Avoid error when commands in scripts/crosstool-NG.sh fail before CT_BUILD_DIR is set. So we need to remove the backtrace marker of a potential previous build. Previously, it was implicitly removed because we did remove the directory it was in, which is no longer the case. Signed-off-by: Johannes Stezenbach <js@sig21.net> [yann.morin.1998@free.fr: remove backtrace marker on start of build] Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr> Message-Id: <20121015094615.GA18673@sig21.net> Patchwork-Id: 191498
2012-10-17scripts: fix default work-dir nameYann E. MORIN"1-1/+1
It's been a long time the default work-dir changed its name from 'target' to '.build'. Change the left-over. Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
2012-09-25scripts: exporting (even empty) LIBRARY_PATH and/or LPATH breaks gccYann E. MORIN"1-4/+2
If either LIBRARY_PATH or LPATH is set, even to the empty string, the gcc build breaks. Fix that by bailing-out rather than re-setting. Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
2012-05-12scripts: unset LIBRARY_PATH and LPATHErik Inge Bolsø1-0/+4
These environment variables set search path for gcc at link time, which can break the build. Signed-off-by: Erik Inge Bolsø <knan-ct@anduin.net> Message-Id: <alpine.BSF.2.00.1205130131550.21551@anduin.net> PatchWork-Id: 186872
2012-05-08scripts: fix catching build failures, the proper way, nowYann E. MORIN"1-1/+1
Serves me for pushing too fast... :-( Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
2012-05-08scripts: fix catching failuresYann E. MORIN"1-0/+4
POSIX 1003.1-2008 does not say whether "set -e" should catch a sub-shell that exits with !0 (it has a list of conditions to catch, but no list of conditions not to catch, and this situation is not listed). bash-3 does not catch such a failure, but bash-4 does. That why, on my Squeeze system I did not see the issue, while Thomas did on is Lenny chroot. Reported-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com> Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
2012-01-03cc/gcc: build core compilers for canadianYann E. MORIN"1-1/+1
Currently, we rely on an existing external cross-compiler targetting the target, to build the C library. This can pause quite a few problems if that compiler is different from the one we are building, because it could introduce some ABI issues. This patch removes this dependency, by building the core compilers as we do for standard cross, and also by building the binutils and gcc, for running on the build machine. This means we no longer need to offer the cross-sompiler selection in the menuconfig. Signed-off-by: "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>