summaryrefslogtreecommitdiff
path: root/scripts/build/cc/100-gcc.sh
AgeCommit message (Collapse)AuthorFilesLines
2017-07-08Fix the references to old config variablesAlexey Neyman1-1178/+0
Signed-off-by: Alexey Neyman <stilor@att.net>
2017-06-16Honor CFLAGS_FOR_BUILDAlexey Neyman1-1/+1
Signed-off-by: Alexey Neyman <stilor@att.net>
2017-05-25Retire CT_CC_GCC_TARGET_FINALAlexey Neyman1-8/+4
Make this behavior default in case the core gcc backend is used for final compiler (i.e., for baremetal configurations). Not setting this option breaks canadian baremetal configurations, and not setting it makes little sense at all in any baremetal configuration (since in baremetal we don't have any libc to begin with). Signed-off-by: Alexey Neyman <stilor@att.net>
2017-03-29Add symlinks from the libraries' original location to the new one.Alexey Neyman1-0/+3
Signed-off-by: Alexey Neyman <stilor@att.net>
2017-03-27Fix up the sysroot issue for sh4 in a different wayAlexey Neyman1-52/+2
(see the comments in the code for details on the issue) Old workaround in 100-gcc.sh stopped working (probably, due to one of GCC version upgrades), so switch to the other approach originally described there: adjust the list of multilibs to not include the default target explicitly. Signed-off-by: Alexey Neyman <stilor@att.net>
2017-03-23Do not create multilib symlinks if not using sysrootAlexey Neyman1-1/+1
Signed-off-by: Alexey Neyman <stilor@att.net>
2017-03-17Add an option to "demultilib"Alexey Neyman1-20/+38
It turns out buildroot does not currently accept a toolchain where a dynamic linker does not reside in the multi-os-directory. Unfortunately this is how glibc installs itself on AArch64 without any extra tricks. So, provide an option to force everything into /lib or /usr/lib; patch to buildroot will be worked on separately. Signed-off-by: Alexey Neyman <stilor@att.net>
2017-03-13Create ld.so.confAlexey Neyman1-1/+1
Also a fix for CT_IterateMultilibs: it didn't pass multi_os_dir_gcc, so it only worked if the caller did *not* declare it as a local variable. Signed-off-by: Alexey Neyman <stilor@att.net>
2017-03-10When moving gcc libs, prefer the same directory as libcAlexey Neyman1-3/+12
If libc ended up in a directory other than /lib, place GCC's libs in that directory as well. Signed-off-by: Alexey Neyman <stilor@att.net>
2017-03-07Only add clang-specific flags to clangAlexey Neyman1-4/+32
I.e., only to CFLAGS_FOR_BUILD if the build is canadian. Signed-off-by: Alexey Neyman <stilor@att.net>
2017-02-27Revert "Determine whether -E/-r option selects extended regexp"Alexey Neyman1-1/+1
This reverts commit 7bcf18bfab84374d3305c7a088f95ac1219ddf93.
2017-02-21Added new gcc config option CC_GCC_CONFIG_TLSJasmin Jessich1-0/+12
Adding new tristate configuration for TLS (Thread Local Storage) to add "--enable-tls" (y), "--disable-tls" (n) or nothing (m). Signed-off-by: Jasmin Jessich <jasmin@anw.at>
2017-02-19More garbage collectionAlexey Neyman1-14/+6
Signed-off-by: Alexey Neyman <stilor@att.net>
2017-02-19Have LTO depend-on non-static buildsAlexey Neyman1-0/+2
Loading a dynamic library (LTO plugin) from a static binary fails on ArchLinux. It is also prone to break if a system is ever upgraded. Also, disable plugins if not enabled explicitly. Signed-off-by: Alexey Neyman <stilor@att.net>
2017-02-19More GCAlexey Neyman1-22/+16
Signed-off-by: Alexey Neyman <stilor@att.net>
2017-02-19Garbage collection for GCC options that are sameAlexey Neyman1-12/+10
... on all supported versions. Signed-off-by: Alexey Neyman <stilor@att.net>
2017-02-14Determine whether -E/-r option selects extended regexpAlexey Neyman1-1/+1
... 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-01-25Run all configure scripts using ${CONFIG_SHELL}Alexey Neyman1-16/+18
... as its help message says in menuconfig. Signed-off-by: Alexey Neyman <stilor@att.net>
2017-01-16Merge pull request #535 from stilor/broke-newlib-cxx-canadianAlexey Neyman1-0/+7
Restore copying headers for gcc_build
2017-01-14Restore copying headers for gcc_build.Alexey Neyman1-0/+7
Only needed in canadian configurations to build libstdc++. Signed-off-by: Alexey Neyman <stilor@att.net>
2017-01-14Use ${CT_CC} instead of gcc ...Alexey Neyman1-12/+12
... when refering to target's compiler. Signed-off-by: Alexey Neyman <stilor@att.net>
2017-01-14Merge pull request #526 from stilor/double-includeAlexey Neyman1-3/+0
Avoid creating include/include
2017-01-13Unify fetching Linaro components.Alexey Neyman1-24/+12
Add CT_GetLinaro, use it from gcc/binutils/gdb/glibc/newlib. Signed-off-by: Alexey Neyman <stilor@att.net>
2017-01-13No need to copy header; libc_start_file does it.Alexey Neyman1-3/+0
Signed-off-by: Alexey Neyman <stilor@att.net>
2017-01-10Select libintl from gettext we built.Alexey Neyman1-2/+10
Also, require gettext for NLS, and require iconv/ncurses for gettext. Signed-off-by: Alexey Neyman <stilor@att.net>
2017-01-10Kill CT_COMPLIBS_SHARED.Alexey Neyman1-14/+12
There is no such option so the check is always true. Signed-off-by: Alexey Neyman <stilor@att.net>
2016-12-17Pass original multi_os_dir to iterator.Alexey Neyman1-2/+3
This is needed for callbacks that use that directory to look inside GCC internal directories, e.g. moving the libraries. This broke when I made libexpat for target honor ${CT_SHARED_LIBS}. Signed-off-by: Alexey Neyman <stilor@att.net>
2016-11-29Pass FOR_BUILD flags when building the pass-1/2 core GCC.Alexey Neyman1-7/+8
Current build passes {CFLAGS,LDFLAGS}_FOR_HOST - which breaks canadian cross (e.g. tried building for x86_64-unknown-linux-uclibc host). This dates back to the days of yore when CFLAGS were set directly in the do_gcc_core_backend (and that function is used as the final gcc's backend). do_gcc_core_backend is now passed with CFLAGS/LDFLAGS to use, so let the pass-1/pass-2/final-for-build steps pass the appropriate flags. Signed-off-by: Alexey Neyman <stilor@att.net>
2016-11-21Partially revert 6f8e89cb5ca061e899bf3feaaf3fecf30d366c3e.Alexey Neyman1-27/+27
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-11-10Do not run 'make install' in parallel in GCC.Alexey Neyman1-3/+12
Signed-off-by: Alexey Neyman <stilor@att.net>
2016-10-07Fine-tune moving gcc libraries to sysroot.Alexey Neyman1-0/+12
1. Check if anything was installed outside sysroot; on some [baremetal only?] configurations GCC doesn't install anything to ${CT_PREFIX_DIR}/${CT_TARGET}/lib. 2. We need to create <sysroot>/lib/<multilib> if it doesn't exist (MUSL only installs in <sysroot>/usr/lib). 3. Do not move the linker scripts; elf2flt expects to find them in gcc's dir, not sysroot. Signed-off-by: Alexey Neyman <stilor@att.net>
2016-10-04Merge branch 'master' into x86-muslAlexey Neyman1-2/+27
2016-10-03GCC uses multi_os_dir for libgcc, not multi_dir.Alexey Neyman1-1/+1
Signed-off-by: Alexey Neyman <stilor@att.net>
2016-10-02Fix issue #449.Alexey Neyman1-2/+27
After building final gcc, place the libraries in non-sysroot libs into sysroot. Signed-off-by: Alexey Neyman <stilor@att.net>
2016-09-23Add a checkbox for libmpx build.Alexey Neyman1-0/+9
Disable libmpx for musl builds. Signed-off-by: Alexey Neyman <stilor@att.net>
2016-08-23libc/*.sh: handle combinations of multilib root/dir.Alexey Neyman1-3/+5
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-51/+167
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-31/+43
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-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-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-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-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>
2016-01-06gcc: remove CC_GCC_EXTRA_ENV_ARRAYBryan Hundven1-8/+3
I was noticing that $extra_user_env was inconsistently used in 100-gcc.sh. I don't feel comfortable having just any make flag or environment variable passed to make from a config file. If a specific option needs to be passed to make for gcc, then a specific kconfig option should be added for that make flag/option/env. Signed-off-by: Bryan Hundven <bryanhundven@gmail.com>
2016-01-06gcc: Sync backend functionsBryan Hundven1-36/+35
The two gcc backend functions are getting very close to being duplicated code. To help in the process of merging the two backends, this change syncronizes the two functions so they are easier to diff. This commit has no functional changes. Signed-off-by: Bryan Hundven <bryanhundven@gmail.com>
2016-01-03gcc: Add new linaro download pathBryan Hundven1-3/+4
It seems that linaro is changing where they release, again. Signed-off-by: Bryan Hundven <bryanhundven@gmail.com>
2015-12-08Whitespace: We don't use tabs in shell or kconfig filesBryan Hundven1-10/+10
We indent by multiples of 4. This change cleans up whitespace in offending files. Signed-off-by: Bryan Hundven <bryanhundven@gmail.com>
2015-12-08scripts: Update usage of CT_GetCustomBryan Hundven1-7/+2
This commit updates the build scripts to match the new usage of CT_GetCustom from the previous change. Signed-off-by: Bryan Hundven <bryanhundven@gmail.com>
2015-11-30gcc: Gnu OpenMP support depends on threadingBryan Hundven1-1/+0
Instead of checking if thread support is enabled during the build, move the check to kconfig-time. Since if threading support is not availble, libgomp should not be available either. Signed-off-by: Bryan Hundven <bryanhundven@gmail.com>