Commit Graph

2037 Commits

Author SHA1 Message Date
Alexey Neyman
d6bf8e2d98 Fix symlinking to multiarch tools on Cygwin
On cygwin, creating both "foo.exe" and "foo" results in 'ln -sf'
returning an error ("File exists"). However, ln silently removes
the "foo.exe" in this case, so an attempt to re-run the same command
manually then succeeds.

Hence, make binutils.sh also create symlinks with .exe prefix,
using the new & shiny routine.

Signed-off-by: Alexey Neyman <stilor@att.net>
2017-04-01 10:12:05 -07:00
Alexey Neyman
7111f95dc3 MinGW-W64 fixes
- 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-30 19:11:33 -07:00
Alexey Neyman
a7edff1820 Merge pull request #667 from stilor/cross-gdb-deps
cross-gdb: account for canadian/crossnative toolchains
2017-03-29 23:13:08 -07:00
Alexey Neyman
6af04d822b cross-gdb: account for canadian/crossnative toolchains
... when determining if it can be linked statically, and if Python
scripting should default to y.

Prompted by a failure of i686-w64-mingw32,nios2-spico-elf sample
on a system where configure didn't report static linking support.

Signed-off-by: Alexey Neyman <stilor@att.net>
2017-03-29 18:50:09 -07:00
Alexey Neyman
d83a003618 Add symlinks from the libraries' original location to the new one.
Signed-off-by: Alexey Neyman <stilor@att.net>
2017-03-29 13:29:31 -07:00
Alexey Neyman
a596ec5b39 Fix up the sysroot issue for sh4 in a different way
(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-26 23:32:27 -07:00
Alexey Neyman
67ab129fc5 Do not create multilib symlinks if not using sysroot
Signed-off-by: Alexey Neyman <stilor@att.net>
2017-03-23 09:13:51 -07:00
Alexey Neyman
3d1678a7f6 Make creation of ld.so.conf optional
... enabled by default for multilib and disabled otherwise. Buildroot
has been complaining about /etc/ld.so.conf presence for almost a year
now and I missed that.

After the release, xldd will be modified to query the compiler for
the list of multilibs to search. This would be too invasive change
before 1.23, though.

Note that it may lead to configurations where xldd currently does not
find the libraries (if both DEMULTILIB and CREATE_LDSO_CONF are turned
off). This is not the default setting in Kconfig, though.

Signed-off-by: Alexey Neyman <stilor@att.net>
2017-03-22 10:57:45 -07:00
Alexey Neyman
de4433298a Add a release creation script
One TBD left is the signing of the tarballs.

Signed-off-by: Alexey Neyman <stilor@att.net>
2017-03-21 14:04:12 -07:00
Alexey Neyman
3906acc007 Move some scripts to a new directory, maintainer
... which are not of much interest to the end user.

Signed-off-by: Alexey Neyman <stilor@att.net>
2017-03-21 14:03:31 -07:00
Alexey Neyman
9ed513c2d8 Cross-ldd: handling e_flags is tricky and depends on arch
Signed-off-by: Alexey Neyman <stilor@att.net>
2017-03-20 14:51:17 -07:00
Alexey Neyman
89f0971391 Merge pull request #639 from stilor/tweak-gcc-movelibs
When moving gcc libs, prefer the same directory as libc
2017-03-19 00:34:51 -07:00
Alexey Neyman
63b2a19de4 Add an option to "demultilib"
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-17 14:31:17 -07:00
Alexey Neyman
b00dea9951 Check libraries for compatibility
... as we are going through various multilibs in ld.so.conf

Signed-off-by: Alexey Neyman <stilor@att.net>
2017-03-14 19:28:26 -07:00
Alexey Neyman
11b52ab6d7 Create ld.so.conf
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-13 01:08:13 -07:00
Alexey Neyman
b090e0f74d Fix up ld.so symlinks for musl
Convert absolute targets to relative so that they are valid on the host,
too. The procedure is very similar to uclibc, so it is moved into a
common function.

Signed-off-by: Alexey Neyman <stilor@att.net>
2017-03-12 19:41:09 -07:00
Alexey Neyman
8600f3ce56 Move tools alias creation to a common function
... 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-12 16:56:19 -07:00
Alexey Neyman
dd55349646 Disable Guile in make if building for host in canadian
make's configure uses pkg-config to detect if Guile should be enabled;
on ArchLinux, this picks up Guile from build machine's pkgconfig and then
it fails to compile.

A better solution might be to create a ${CT_HOST}-pkg-config in
buildtools/bin that would report "unsupported" for all packages.
However a quick grep only showed pkg-config being used by GCJ
(not sure if it will build in canadian cross - we don't have any
samples with GCJ) and Blackfin simulator in GDB (Blackfin is not
currently supported by crosstool-ng). Hence, leave such pkg-config
implementation and testing for another day.

Signed-off-by: Alexey Neyman <stilor@att.net>
2017-03-10 11:59:52 -08:00
Alexey Neyman
fc2f73fc08 When moving gcc libs, prefer the same directory as libc
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-09 19:07:21 -08:00
Alexey Neyman
55c806a360 Correct warning text to include newer glibc versions
Signed-off-by: Alexey Neyman <stilor@att.net>
2017-03-08 15:47:48 -08:00
Alexey Neyman
bfcc1e112a Merge pull request #635 from stilor/macos-skip-locales
Skip locales on macos
2017-03-07 08:51:43 -08:00
Alexey Neyman
456cccc0a7 Merge pull request #634 from stilor/macos-canadian
A couple of fixes for canadian samples on macos
2017-03-07 08:51:35 -08:00
Alexey Neyman
ea7f559ef4 Merge pull request #627 from dankm/freebsd
FreeBSD build support
2017-03-07 08:50:43 -08:00
Alexey Neyman
2ef7d36efb Disable format warnings for clang
It picks up gettext string and results in [ERROR] messages from ct-ng
when gettext strings happen inside an error() call.

Signed-off-by: Alexey Neyman <stilor@att.net>
2017-03-07 00:15:29 -08:00
Alexey Neyman
3e94b4f680 Skip building locales on macos, too
--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-06 23:12:16 -08:00
Alexey Neyman
b3b94e4807 Only add clang-specific flags to clang
I.e., only to CFLAGS_FOR_BUILD if the build is canadian.

Signed-off-by: Alexey Neyman <stilor@att.net>
2017-03-06 18:57:12 -08:00
Alexey Neyman
6cdf0df01b Use CHOST instead of CROSS_PREFIX
The latter does not prevent zlib's configure from overriding 'AR' with
/usr/bin/libtool on macos, and that breaks canadian crosses.

Signed-off-by: Alexey Neyman <stilor@att.net>
2017-03-06 18:57:12 -08:00
Dan McGregor
7f961026c1 Explicitly use gcc for GMP
GMP's configure script tries to be too smart, and if it determines
that it's not cross-compiling it chooses gcc or cc instead of the
wrapper we create at the start of the build.

Signed-off-by: Dan McGregor <dan.mcgregor@usask.ca>
2017-03-06 08:56:36 -06:00
Alexey Neyman
120792a97d Sanitize CT_PREFIX_DIR, too
Having .. in it breaks GCC's relocatability.

Signed-off-by: Alexey Neyman <stilor@att.net>
2017-03-05 16:22:40 -08:00
Alexey Neyman
2f24d5cd75 Add libiconv 1.15
Signed-off-by: Alexey Neyman <stilor@att.net>
2017-03-03 16:50:31 -08:00
Alexey Neyman
865a095d70 Do not pretend we're downloading anything
... when we're actually don't.

Signed-off-by: Alexey Neyman <stilor@att.net>
2017-03-03 16:45:05 -08:00
Dan McGregor
c88621f740 glibc: hide native c++ executable from build
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-01 22:23:39 -06:00
Dan McGregor
a0ab14c4a7 Use BUILD_PREFIX and BUILD_SUFFIX for gcc version
It's possible that "gcc" is not the compiler being used for the build,
so respect BUILD_PREFIX and BUILD_SUFFIX when finding its version.

Signed-off-by: Dan McGregor <dan.mcgregor@usask.ca>
2017-03-01 22:23:38 -06:00
Dan McGregor
6d1bcaa2f5 Use configure to find the processor count
configure.ac now finds how to count the CPUs in a system. Currently
the getconf method and sysctl methods are supported. Adding more is
easy enough.

Signed-off-by: Dan McGregor <dan.mcgregor@usask.ca>
2017-03-01 22:22:13 -06:00
Dan McGregor
f2f782dd1c Bring in FreeBSD support
Check for FreeBSD specific issues, it is mostly the same as Darwin.

Signed-off-by: Dan McGregor <dan.mcgregor@usask.ca>
2017-03-01 22:22:02 -06:00
Alexey Neyman
864d1358e0 Merge pull request #625 from stilor/skip-localedef
Skip localedef
2017-02-28 21:52:06 -08:00
Alexey Neyman
e7163a46c4 Skip locale build on Cygwin
Signed-off-by: Alexey Neyman <stilor@att.net>
2017-02-28 20:35:14 -08:00
Alexey Neyman
b04d2e84a8 Avoid -T, it is not available on macos
Signed-off-by: Alexey Neyman <stilor@att.net>
2017-02-28 18:40:51 -08:00
Alexey Neyman
439cab379e Require xz to be present
Some software starts to adopt xz-only distribution (strace,
gcc-linaro, ...). Better that than deal with cryptic errors like
"cannot find strace-.tar.bz2".

Signed-off-by: Alexey Neyman <stilor@att.net>
2017-02-27 22:55:57 -08:00
Alexey Neyman
2dae1cf816 Require GNU sed
After much struggling with macos (BSD) sed and even getting everything
work in crosstool-ng itself, I had to abandon that because some
components rely on GNU syntax. Specifically, GNU libc uses '/.../{H;g}'
(note absense of the separator after 'g').

So, revert the -r/-E detection and check for sed's being of GNU origin.
MacOS people, sorry, but you'd have to install GNU sed.

Signed-off-by: Alexey Neyman <stilor@att.net>
2017-02-26 20:42:32 -08:00
Alexey Neyman
59bab98b2d Revert "Determine whether -E/-r option selects extended regexp"
This reverts commit 7bcf18bfab.
2017-02-26 19:06:35 -08:00
Alexey Neyman
df1e3e32cf Revert "Fix breakage from sed_r change in some auxiliary scripts"
This reverts commit 5ea3f2967f.
2017-02-26 19:06:10 -08:00
Alexey Neyman
85ae00c1a6 Merge pull request #614 from stilor/elf2flt-cygwin
Fix the build of elf2flt on Cygwin
2017-02-22 22:19:28 -08:00
Alexey Neyman
8397ad2c1a Fix the build of elf2flt on Cygwin
The -lcygwin -lc actually breaks the build: elf2flt picks up the symbols for getopt/optarg via
<getopt.h> in binutils-X.Y/include, where optarg is declared without dllimport attribute.
Therefore it pulls in getopt() from libc/libcygwin, but since optarg is not prefixed with
_imp__, it is pulled from libiberty. But the object file in libiberty also contains getopt()
thus resulting in multiple definitions thereof.

While there, kill extraneous -ldl passed into configure - configure detects -ldl successfully.

Upstream: https://github.com/uclinux-dev/elf2flt/pull/6
Signed-off-by: Alexey Neyman <stilor@att.net>
2017-02-22 22:17:49 -08:00
Alexey Neyman
4de4507a65 Merge pull request #375 from jasmin-j/add_tls_config
Added new gcc config option CC_GCC_CONFIG_TLS
2017-02-22 22:00:03 -08:00
Alexey Neyman
c72f7101c9 Kill a generated file
... and add it to .gitignore.

Signed-off-by: Alexey Neyman <stilor@att.net>
2017-02-21 23:10:24 -08:00
Jasmin Jessich
c8d7d79e20 Added new gcc config option CC_GCC_CONFIG_TLS
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-21 09:10:22 +01:00
Alexey Neyman
6a1b5a3d77 Merge pull request #608 from stilor/static-no-plugins
Disable LTO for static toolchain
2017-02-19 23:27:21 -08:00
Alexey Neyman
4d723d0892 More garbage collection
Signed-off-by: Alexey Neyman <stilor@att.net>
2017-02-18 23:20:55 -08:00
Alexey Neyman
45512b003d Have LTO depend-on non-static builds
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-18 19:00:25 -08:00
Alexey Neyman
264b0c8686 More GC
Signed-off-by: Alexey Neyman <stilor@att.net>
2017-02-18 18:41:04 -08:00
Alexey Neyman
f0716643b4 Garbage collection for GCC options that are same
... on all supported versions.

Signed-off-by: Alexey Neyman <stilor@att.net>
2017-02-18 18:36:34 -08:00
Alexey Neyman
a417c31875 Add --disable-database and --with-fallbacks separately
The dependency between them has been removed in Kconfig.

Signed-off-by: Alexey Neyman <stilor@att.net>
2017-02-17 12:07:39 -08:00
Alexey Neyman
5ea3f2967f Fix breakage from sed_r change in some auxiliary scripts
... do not overquote the variables from paths.sh.

Signed-off-by: Alexey Neyman <stilor@att.net>
2017-02-16 12:45:51 -08:00
Alexey Neyman
2d1b469f88 Merge pull request #599 from stilor/avoid-gettext-for-linux-host
Skip gettext/libiconv on linux-gnu
2017-02-15 20:37:21 -08:00
Alexey Neyman
07e03aed8c Skip gettext/libiconv on linux-gnu
Previous version by Ray Donnelly was skipping them for all *linux*.
This skips it for GLIBC only.

Signed-off-by: Alexey Neyman <stilor@att.net>
2017-02-14 22:45:56 -08:00
Alexey Neyman
7bcf18bfab Determine whether -E/-r option selects extended regexp
... 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-13 22:47:40 -08:00
Alexey Neyman
f9bec4ed7c stat: determine whether it is BSD or GNU flavor
Seems like MacOS may have either in the path.

Signed-off-by: Alexey Neyman <stilor@att.net>
2017-02-12 22:02:28 -08:00
Alexey Neyman
41ba1d99c8 Update config.{guess,sub} while testing curl
Signed-off-by: Alexey Neyman <stilor@att.net>
2017-02-12 22:02:28 -08:00
Alexey Neyman
35f89c4064 Detect both wget/curl and allow user to select the agent
Signed-off-by: Alexey Neyman <stilor@att.net>
2017-02-12 22:02:23 -08:00
Alexey Neyman
c31ed45a65 Merge pull request #589 from stilor/skip-complibs-check-on-host-canadian
Skip complibs check on host for canadian
2017-02-12 11:19:31 -08:00
Alexey Neyman
7e6392a872 Remove 'relocs' from archscripts being built
... it is not needed to install headers and causes build failures
in more than one setup (cygwin, macos).

Signed-off-by: Alexey Neyman <stilor@att.net>
2017-02-11 16:20:53 -08:00
Alexey Neyman
c8e8281533 Skip comp.libs checking on host for canadian
... they all want to run the binaries they produced, which fails
when build!=host.

Signed-off-by: Alexey Neyman <stilor@att.net>
2017-02-11 12:49:48 -08:00
Alexey Neyman
57e1e7e742 Merge pull request #587 from stilor/select-uclibceavi-suffix
Allow one to select uclibceabi/uclibcgnueabi suffix
2017-02-10 23:55:47 -08:00
Alexey Neyman
4d49730711 Merge pull request #586 from stilor/restore-old-kernel-libc
Restore old kernel/glibc versions
2017-02-10 23:55:33 -08:00
Alexey Neyman
93db580091 Merge pull request #584 from stilor/disallow-gold-for-elf2flt
Require BFD linker if building for flat format
2017-02-10 23:55:16 -08:00
Alexey Neyman
0468f8daf1 Allow one to select uclibceabi/uclibcgnueabi suffix
Signed-off-by: Alexey Neyman <stilor@att.net>
2017-02-09 23:48:56 -08:00
Alexey Neyman
5920157fdd Supply --disable-build-with-cxx instead of requiring C++
... when building native GDB/gdbserver.

Suggested by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Signed-off-by: Alexey Neyman <stilor@att.net>
2017-02-09 22:14:36 -08:00
Alexey Neyman
a41978b95a Remove wrapping if in 300-gdb.sh
If GDB is turned off, the script will not be even sourced. Otherwise,
if GDB checkbox is set but none of the cross/native/gdbserver are
selected, debug.sh gives a bogus error message.

Signed-off-by: Alexey Neyman <stilor@att.net>
2017-02-09 21:21:57 -08:00
Alexey Neyman
5e0b489b12 External addons supported by glibc even now
... though none are provided by default.

Signed-off-by: Alexey Neyman <stilor@att.net>
2017-02-09 18:05:36 -08:00
Alexey Neyman
f6ef2be9f3 Revert "glibc: Remove support for downloading and extracting add-ons"
This reverts commit 39273e0843.
2017-02-09 18:05:36 -08:00
Carlos Santos
755de234cb elf2flt: use CT_ARCH to set target CPU, not CT_TARGET
CT_TARGET is composed as "${CT_ARCH}${CT_ARCH_SUFFIX}", so CT_TARGET may
become something like "armv7", for example. This is used by the configure
script to set the "CPU" variable in the Makefile, leading to a commad line
containing

    -DTARGET_armv7 -DTARGET_CPU="armv7"

In this case the compilation of elf2flt.c fails with "Don't know how to
support your CPU architecture??". Passsing "CPU=${CT_ARCH}" in the make
command line overrides the configured value and solves the problem.

Signed-off-by: Carlos Santos <casantos@datacom.ind.br>
2017-02-06 22:20:21 -08:00
Alexey Neyman
46bfc8a4dc Merge pull request #575 from stilor/ncurses-configure
Allow some tunables for ncurses
2017-02-06 00:04:33 -08:00
Alexey Neyman
a459a33936 Merge pull request #574 from stilor/uclibc-obstack
3 unrelated uClibc changes, see individual commits
2017-02-05 20:42:02 -08:00
Alexey Neyman
d91277e377 Add zlib as a companion lib
with version 1.2.11.

Signed-off-by: Alexey Neyman <stilor@att.net>
2017-02-05 14:26:02 -08:00
Alexey Neyman
ef841ea312 Allow some tunables for ncurses
- Allow user to specify configure arguments to pass through to host/target
ncurses.
- Checkbox for --disable-database
- String option for --with-fallbacks

Signed-off-by: Alexey Neyman <stilor@att.net>
2017-02-05 14:20:01 -08:00
Alexey Neyman
df68f203b4 Use 'make olddefconfig' in uClibc/uClibc-ng configuration
instead of 'make oldconfig' and responding 'y'. This avoids 'Broken pipe'
errors in the log, as well as selects default setting for all options not
explicitly set.

This requires a small fix in the old uClibc. Won't have to maintain that fix
for long though :)

Signed-off-by: Alexey Neyman <stilor@att.net>
2017-02-04 21:16:10 -08:00
Alexey Neyman
623fdf15a6 Add support for AArch64 in uClibc-ng
Signed-off-by: Alexey Neyman <stilor@att.net>
2017-02-02 23:37:57 -08:00
Alexey Neyman
1baddb19ee Merge pull request #567 from stilor/fix-build-manuals
Fix build manuals
2017-01-30 12:48:47 -08:00
Alexey Neyman
c83335c5a3 Use 'make install' to install DUMA
This serves two purposes:
- installs its manpage
- installs headers, without them it does not make sense to install a
static library

Unfortunately, there's no way to select shared-only build of DUMA.
Hence, disable selection for static library.

Also, allow user to select whether to use stock or ct-ng's wrapper.

Signed-off-by: Alexey Neyman <stilor@att.net>
2017-01-30 12:11:37 -08:00
Alexey Neyman
bd318e886b Fix installation of manuals for binutils
It was running 'make gas ld ...', which was succeeding, but didn't install
anything.

Signed-off-by: Alexey Neyman <stilor@att.net>
2017-01-30 12:11:37 -08:00
Alexey Neyman
6c9e949ae3 Fix location where libc manual is built
Signed-off-by: Alexey Neyman <stilor@att.net>
2017-01-30 12:11:37 -08:00
Alexey Neyman
7d1b203d06 Add install wrapper
... to work around Gentoo's wrapper idiosyncrasy.

Signed-off-by: Alexey Neyman <stilor@att.net>
2017-01-30 12:10:47 -08:00
Alexey Neyman
a08a4c4b88 Allow for per-tool templates when creating overrides
... 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-30 12:10:47 -08:00
Alexey Neyman
5b084c005b Merge pull request #564 from stilor/comptools-default-to-y-if-missing
Rework configure logic wrt GNU autotools
2017-01-28 13:34:14 -08:00
Alexey Neyman
7a94c81e5b Rework configure logic wrt GNU autotools
Rather than requiring them of a certain version, detect if they are present
(and have sufficient version) and select an appropriate companion tool
otherwise. The reason is that, for example, most recent gettext requires
automake 1.15, but the newest available CentOS has 1.13. Hence, the option
to "upgrade your system" does not apply, and the warning comment above
the companion tools is rather scary.

With this approach, it will work out of the box - either by using the host's
tools, or by building them as needed. Note that the user can still change
the setting in the config.

While there, propagate the new version checking macro to awk/bash/host binutils,
and switch from --with-foo=xxx to officially blessed FOO=xxx: the latter
does not require checking for bogus values (i.e., --with-foo, --without-foo)
and AC_PROG_* macros recognize the corresponding settings without further
modifications. For now, I kept --with-foo=, if only to complain and steer
people to the new way. To be cleaned up after a release.

Signed-off-by: Alexey Neyman <stilor@att.net>
2017-01-27 20:40:47 -08:00
Alexey Neyman
d7b043e360 Create <sgidefs.h> if MUSL doesn't create one
Document the status quo and work around for mips-musl.

Signed-off-by: Alexey Neyman <stilor@att.net>
2017-01-26 13:50:18 -08:00
Alexey Neyman
3fc7c1ef69 Fix handling of ltrace 0.5.3 peculiarity.
Also, remove 0.5.2 selection - no longer available for download.

Signed-off-by: Alexey Neyman <stilor@att.net>
2017-01-26 12:19:49 -08:00
Alexey Neyman
bec4647426 Support gettext in addToolVersion.sh
Signed-off-by: Alexey Neyman <stilor@att.net>
2017-01-26 12:19:49 -08:00
Alexey Neyman
59f76719e1 Update config.sub/config.guess
Signed-off-by: Alexey Neyman <stilor@att.net>
2017-01-25 23:48:05 -08:00
Alexey Neyman
e1132fc829 Merge pull request #557 from stilor/config-shell
Run all configure scripts using ${CONFIG_SHELL}
2017-01-25 22:39:21 -08:00
Alexey Neyman
eb3ae48278 Fix log saving/restoring
after the CT_Log{Enable,Disable} changes.

Signed-off-by: Alexey Neyman <stilor@att.net>
2017-01-25 15:45:37 -08:00
Alexey Neyman
7186e39f32 Run all configure scripts using ${CONFIG_SHELL}
... as its help message says in menuconfig.

Signed-off-by: Alexey Neyman <stilor@att.net>
2017-01-25 00:06:28 -08:00
Alexey Neyman
b5d0e396d9 Merge pull request #547 from stilor/separate-canadian-crosses-instdir
Simplify the pre-build actions a bit
2017-01-24 14:54:42 -08:00
Alexey Neyman
a5c48a5d0a Fix loglevel for steps in companion tools
(was EXTRA, should be INFO to be consistent with the rest).

Signed-off-by: Alexey Neyman <stilor@att.net>
2017-01-23 18:48:22 -08:00
Alexey Neyman
65e037b654 Merge pull request #552 from stilor/uclibc-ng-for-buildroot
Restore uClibc-ng usability in buildroot
2017-01-23 16:12:18 -08:00
Alexey Neyman
aa24e9d913 Add selection for RPC
So that uClibc config can be matched to Buildroot's expectations via
the menu, without the need for a saved config.

Signed-off-by: Alexey Neyman <stilor@att.net>
2017-01-23 14:37:18 -08:00
Li-Hang Lin
1f6c6d3f32 mingw: compile the mingw-w64 companion tools as well
There are some useful tools such as widl, gendef, genidl ... etc.
provided by mingw-w64 and do not waste the developers' works.

Signed-off-by: Li-Hang Lin <lihang.lin@gmail.com>
2017-01-22 18:09:49 +08:00
Alexey Neyman
832bee87c0 Make build-all rely on kconfig options.
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-19 18:08:29 -08:00
Alexey Neyman
3e4d4870c9 Simplify config saving.
Instead of hardcoding defaults in saveSample.sh.in, have the same
defaults in config. Then we can just remove them when saving the
config.
2017-01-19 18:08:29 -08:00
Alexey Neyman
955f5bc0b8 Get rid of .config.2.
Now handled by CT_LoadConfig.

Signed-off-by: Alexey Neyman <stilor@att.net>
2017-01-19 18:08:29 -08:00
Alexey Neyman
c0cc73cd6f Install canadian crosses into a separate subdir.
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-19 18:08:29 -08:00
Alexey Neyman
fb426ac912 Replace strace workaround with a patch.
The correct solution was checked in to strace GIT; will be part of the
next release. Backport patch to 4.10..4.15, and remove the workaround
from 500-strace.sh. Versions 4.9 and older should build fine even
without the workaround (they would be picking up wrong definitions,
but they need different patch and I don't feel like spending any time
on these versions).

Signed-off-by: Alexey Neyman <stilor@att.net>
2017-01-16 09:07:59 -08:00
Alexey Neyman
2b2c496f2a Merge pull request #536 from stilor/musl-update
Musl update to 1.1.16
2017-01-16 09:01:44 -08:00
Alexey Neyman
ef58f6c01c Merge pull request #535 from stilor/broke-newlib-cxx-canadian
Restore copying headers for gcc_build
2017-01-16 09:01:20 -08:00
Alexey Neyman
d47e64711e Restore copying headers for gcc_build.
Only needed in canadian configurations to build libstdc++.

Signed-off-by: Alexey Neyman <stilor@att.net>
2017-01-14 14:51:38 -08:00
Alexey Neyman
c7e2e11059 addToolVersion.sh: support musl
Signed-off-by: Alexey Neyman <stilor@att.net>
2017-01-13 23:56:19 -08:00
Alexey Neyman
c1612e9295 Use ${CT_CC} instead of gcc ...
... when refering to target's compiler.

Signed-off-by: Alexey Neyman <stilor@att.net>
2017-01-13 21:47:07 -08:00
Alexey Neyman
d34a6bd8a0 GDB 7.12 needs c++.
Also, minor fixes in 300-gdb.sh

Signed-off-by: Alexey Neyman <stilor@att.net>
2017-01-13 21:47:07 -08:00
Alexey Neyman
05d9d915aa addToolVersion.sh: Fix gdb version handling.
Signed-off-by: Alexey Neyman <stilor@att.net>
2017-01-13 21:47:07 -08:00
Alexey Neyman
949cc86ab7 Merge pull request #526 from stilor/double-include
Avoid creating include/include
2017-01-13 21:44:33 -08:00
Alexey Neyman
9f5a92a783 Unify fetching Linaro components.
Add CT_GetLinaro, use it from gcc/binutils/gdb/glibc/newlib.

Signed-off-by: Alexey Neyman <stilor@att.net>
2017-01-12 23:00:41 -08:00
Alexey Neyman
fddbf8f99e AVR32 support has been retired.
Scripts no longer download avr-headers.

Signed-off-by: Alexey Neyman <stilor@att.net>
2017-01-12 23:00:20 -08:00
Alexey Neyman
01a4bed794 install_root has no effect on newlib install.
And never had, at least since newlib 1.17 (first version added to
crosstool-ng). Apparently, copy-pasted from glibc.sh.

Signed-off-by: Alexey Neyman <stilor@att.net>
2017-01-12 23:00:20 -08:00
Alexey Neyman
ec9ddee933 Remove 2nd copy of the option.
Added above, as part of the list.

Signed-off-by: Alexey Neyman <stilor@att.net>
2017-01-12 23:00:20 -08:00
Alexey Neyman
59a784c572 No need to copy header; libc_start_file does it.
Signed-off-by: Alexey Neyman <stilor@att.net>
2017-01-12 23:00:20 -08:00
Alexey Neyman
eff79ab714 Merge pull request #519 from InfernoEmbedded/newlib-enhancements
Newlib enhancements
2017-01-10 18:17:21 -08:00
Alexey Neyman
c69e593a92 Pick up <linux/ioctl.h> and friends from TARGET.
Otherwise, cross-compiling fails on non-Linux build machines.

Signed-off-by: Alexey Neyman <stilor@att.net>
2017-01-10 10:39:37 -08:00
Alexey Neyman
37a5a09e65 Add MacOS options.
Needed for linking gettext/libiconv.

Signed-off-by: Alexey Neyman <stilor@att.net>
2017-01-10 10:39:37 -08:00
Alexey Neyman
7989e5d743 ${LD_TARGET} -> ${CT_TARGET}.
Obvious typo, worked by some miracle.

Signed-off-by: Alexey Neyman <stilor@att.net>
2017-01-10 10:39:37 -08:00
Alexey Neyman
4a138d8407 Shut clang's warning that confuses configure.
Warning causes gdb's configure to not detect <limit.h> declarations
of LONG_MIN/MAX.

Found-by: Kirill Smirnov <kirill.k.smirnov@gmail.com>
Signed-off-by: Alexey Neyman <stilor@att.net>
2017-01-10 10:39:37 -08:00
Alexey Neyman
25bc99f4d0 Darwin needs -liconv when building glibc.
Signed-off-by: Alexey Neyman <stilor@att.net>
2017-01-10 10:39:37 -08:00
Alexey Neyman
c1b7324fc3 Avoid trampling user's LDFLAGS_FOR_HOST...
... 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>
2017-01-10 10:39:37 -08:00
Alexey Neyman
36bbcf4b4f For simple cross or native pick up both build/host flags.
Signed-off-by: Alexey Neyman <stilor@att.net>
2017-01-10 10:38:08 -08:00
Alexey Neyman
9f62ca8deb Select libintl from gettext we built.
Also, require gettext for NLS, and require iconv/ncurses for gettext.

Signed-off-by: Alexey Neyman <stilor@att.net>
2017-01-10 10:38:08 -08:00
Alexey Neyman
1f84e9caf4 Point FOR_BUILD flags to buildtools/{include,lib}.
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>
2017-01-10 10:38:08 -08:00
Alexey Neyman
8e7ac5fcd9 Change when libiconv/gettext are built.
Make them configurable, default to y when build!=host (i.e.
canadian or cross-native) because we don't know what libraries the host
will provide. GLIBC, as previously, selects them explicitly.

Signed-off-by: Alexey Neyman <stilor@att.net>
2017-01-10 10:38:08 -08:00
Alexey Neyman
ca0700010e Simplify a bit, no functional changes.
Signed-off-by: Alexey Neyman <stilor@att.net>
2017-01-10 10:38:08 -08:00
Alexey Neyman
11f87cfa5d Kill CT_COMPLIBS_SHARED.
There is no such option so the check is always true.

Signed-off-by: Alexey Neyman <stilor@att.net>
2017-01-10 10:38:08 -08:00
Alastair D'Silva
14896a2600 Support building Newlib with Link Time Optimisation
Signed-off-by: Alastair D'Silva <alastair@d-silva.org>
2017-01-10 10:51:32 +11:00
Alastair D'Silva
2ac39621bc Add more newlib options 2017-01-10 09:47:35 +11:00
Alastair D'Silva
92c33fe46d Bump binutils to 2.27
Signed-off-by: Alastair D'Silva <alastair@d-silva.org>
2017-01-06 12:05:16 +11:00
Alexey Neyman
a2d49174df Merge pull request #512 from stilor/kill-install-dir
Kill CT_INSTALL_DIR.
2016-12-19 11:58:39 -08:00
Alexey Neyman
5c985041fd Kill CT_INSTALL_DIR.
We now use CT_PREFIX and expect the resulting toolchain to be relocatable.

Signed-off-by: Alexey Neyman <stilor@att.net>
2016-12-19 11:45:24 -08:00
Alexey Neyman
b30e779d8e Catch more make errors.
Some errors from make(1) do not include a file reference in brackets.

Signed-off-by: Alexey Neyman <stilor@att.net>
2016-12-18 10:14:40 -08:00
Alexey Neyman
cccb8d8481 Merge pull request #508 from stilor/drop-dmalloc
Drop dmalloc
2016-12-17 14:26:13 -08:00
Alexey Neyman
b1ac2e7a7d Pass original multi_os_dir to iterator.
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-12-17 12:10:10 -08:00
Alexey Neyman
53758f34ef Avoid host libs when compiling gettext.
On Travis, old libxml2 is picked up from host and breaks the build.

Signed-off-by: Alexey Neyman <stilor@att.net>
2016-12-17 12:05:23 -08:00
Alexey Neyman
83d9e6a49a Kill dmalloc.
- No new releases in almost 10 year.
- No public bug tracker or VCS.
- No responses from maintainer over sent patches.

RIP, dmalloc.

Signed-off-by: Alexey Neyman <stilor@att.net>
2016-12-16 16:10:32 -08:00
Alexey Neyman
3dbb576c17 Make companion libs static.
This follows the trend set by 1*.sh scripts that configure ISL, GMP,
MPFR, CLooG, etc. Building with shared libraries presents all kinds
of problems:
- The shared libraries need to be installed into ${CT_PREFIX_DIR}.
- The binaries linked against companion libs need to have proper
RPATH, or they're looking for shared libs in
.build/${CT_PREFIX}/buildtools/lib.
- All libraries must agree as to whether they're built shared,
static, or both. Otherwise, gettext tries to link in static libncurses.a
into a shared library and fails (since libncurses was compiled without
the -fPIC switch and hence contains relocations that cannot be handled
in a shared library).

So this fixes the current mess. If we decide to re-enable building
the companion libs shared, we should probably make this dependent on
a separate suboption of CT_STATIC_TOOLCHAIN.

Add a config loosely based on one reported in the issue 274.

Signed-off-by: Alexey Neyman <stilor@att.net>
2016-12-11 00:46:06 -08:00
Alexey Neyman
7e44983388 Work around Cygwin idiosyncrasy.
Cygwin doesn't like directory names ending with a dot, e.g. "multilib_."

Signed-off-by: Alexey Neyman <stilor@att.net>
2016-12-06 10:33:20 -08:00
Alexey Neyman
f5a375e407 Merge pull request #443 from KirillSmirnov/gdb-native
debug/gdb: properly link with expat
2016-12-05 18:24:05 -08:00
Kirill K. Smirnov
ee1c04378c debug/gdb: restore comments
There are two separate issues with gdb configure usage:
1) inspecting build system libraries while cross-compiling;
2) preferring a shared library over static one.

The first usage issue is described and fixed now.
The second issue was described but the notes were removed
for some reason. This patch restores those notes.

Suggested-by: Alexey Neyman <stilor@att.net>
Signed-off-by: Kirill K. Smirnov <kirill.k.smirnov@gmail.com>
2016-12-05 23:39:55 +03:00
Alexey Neyman
4042269de6 Merge pull request #487 from stilor/host-comp-tools
Allow for installation of companion tools for host
2016-12-02 19:18:56 -08:00
Alexey Neyman
cf86df688a Add 'companion tools for host' step.
Signed-off-by: Alexey Neyman <stilor@att.net>
2016-12-02 15:03:15 -08:00
Alexey Neyman
3f7fbd7bed Move companion tool build into a separate step.
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-12-02 15:03:15 -08:00
Alexey Neyman
51a3606b17 Fix use of custom location if it is a directory.
In that case, CT_GetCustom just creates a symlink to the original.
In that case, 'cp -a <path> .' gives an error and 'cp -a <path> <newdir>'
creates <newdir> as a symlink (which will then run the build inside
the shared directory, .build/src/<package>).

Signed-off-by: Alexey Neyman <stilor@att.net>
2016-12-02 15:02:58 -08:00
Alexey Neyman
2091c5dd2d Pass FOR_BUILD flags when building the pass-1/2 core GCC.
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-28 22:55:54 -08:00
Max Filippov
6c6829a061 xtensa: fix endianness support
To build uClibc correctly we need correct endianness selected in the
crosstool-NG. Xtensa cores may be little- or big-endian, but this
property is static. The toolchain knows the core endianness and doesn't
need options to select it.
Enable ARCH_SUPPORTS_BOTH_ENDIAN and select LE by default. Specify empty
CT_ARCH_ENDIAN_CFLAG so that -m{big,little}-endian don't get added to
the TARGET_CFLAGS, as it's not supported by gcc. Specify empty
CT_ARCH_ENDIAN_LDFLAG so that -EB/-EL don't get added to the
TARGET_LDFLAGS as they are ignored. Select big-endian in the example
xtensa-unknown-linux-uclibc configuration.

This fixes uClibc toolchain build for little-endian cores.

Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
2016-11-22 10:48:34 -08:00
Alexey Neyman
87bfd55b3b Give companion tools some love.
Allow selection of make/m4/... version. Support imports of new versions
via addToolVersion.sh. Import newest versions of the companion tools.

One non-trivial change is the handling of make versions. Existing code
was not handling make companion tool as described (see the previous
commit). However, since most modern systems have make 4.x, that previous
commit made crosstool-ng always build make as a companion tool.

This traces back to the commit dd15c93 from 2014. That commit's log message
says that actually it was 3.81 which broke the build for certain component
(it was originally breaking eglibc, but I noticed it was breaking current
glibc on powerpc64), and introduced an option to force using 3.81 by
"components that really need it". It looks like in 2.5 years we haven't
seen any such components that really need make 3.81, and (given that make
has already had a few releases since 3.81) we're unlikely to see them
in the future.

Hence, the configure check is changed from "exactly 3.81" to "3.81 or newer".
In its current form, configure will accept make 3.80+, and will not require
make as a companion tool for 3.81+. We might want to bump the latter check
to even newer version given the claim from dd15c93. Killed
COMP_TOOLS_make_3_81_NEEDED.

Anyway, I retained 3.81 just in case; ditto for m4 1.14.3, autoconf 2.65
and automake 1.11.1.

Signed-off-by: Alexey Neyman <stilor@att.net>
2016-11-21 23:03:03 -08:00
Alexey Neyman
488b27f58b Partially revert 6f8e89cb5c.
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-20 23:50:17 -08:00
Bernhard Walle
6cb9e62f6c comptools/make: Fix CT_COMP_TOOLS_make_gmake option
Commit 6f8e89cb5c broke that option.
Since ${make} points to /usr/bin/make, making the symlink from gmake
to /usr/bin/make is obviously the wrong decision. gmake should link to
our (old-versioned) self-built make.

Signed-off-by: Bernhard Walle <bernhard@bwalle.de>
2016-11-19 12:40:47 -08:00
Dmitry Pankratov
0d17d26005 Merge remote-tracking branch 'upstream/master' 2016-11-11 21:03:11 +01:00
Bryan Hundven
6a1bf36b48 Merge pull request #472 from stilor/unparallel-make-install
Do not run 'make install' in parallel in GCC.
2016-11-09 18:52:30 -08:00
Alexey Neyman
a76c549823 Merge pull request #452 from KirillSmirnov/janitorial
Janitorial: update patches
2016-11-09 17:35:27 -08:00
Alexey Neyman
f4c7688946 Do not run 'make install' in parallel in GCC.
Signed-off-by: Alexey Neyman <stilor@att.net>
2016-11-09 16:46:01 -08:00
Bryan Hundven
dc280e477d Merge branch 'master' into janitorial 2016-10-24 10:07:16 -07:00
Alexey Neyman
91575d02c4 Merge branch 'master' into static-libgcc-more-fixes 2016-10-12 11:58:28 -07:00
Alexey Neyman
3330ad7197 Fine-tune moving gcc libraries to sysroot.
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-07 10:34:33 -07:00
Alexey Neyman
8121be5b21 Fix m68k with uClibc-ng >= 1.0.15.
1.0.15 only kept a single LINUXTHREADS option, and renamed it, making it
no longer option-compatible with uClibc.

The option for "1.0.14 or later" version of uClibc-ng is not currently
used; rename it to "1.0.15 or later" and use it to handle newer
uClibc-ng's linuxthreads.

m68k happens to be the only sample using linuxthreads.

Signed-off-by: Alexey Neyman <stilor@att.net>
2016-10-04 17:47:15 -07:00
Alexey Neyman
f35c62daf0 Add uClibc-ng 1.0.17.
Also, support uClibc-ng in addToolVersion.sh

Signed-off-by: Alexey Neyman <stilor@att.net>
2016-10-04 17:47:15 -07:00
Kirill Smirnov
c7cb030fd5 Merge branch 'master' into janitorial 2016-10-05 02:59:48 +03:00
Alexey Neyman
33fccf9838 Merge branch 'master' into x86-musl 2016-10-04 11:43:42 -07:00
Alexey Neyman
96338beeca GCC uses multi_os_dir for libgcc, not multi_dir.
Signed-off-by: Alexey Neyman <stilor@att.net>
2016-10-02 18:50:41 -07:00
Alexey Neyman
75dee86653 Fix issue #449.
After building final gcc, place the libraries in non-sysroot libs
into sysroot.

Signed-off-by: Alexey Neyman <stilor@att.net>
2016-10-02 15:23:53 -07:00
Dmitry Pankratov
34ca68e3b0 Merge branch 'master' of https://github.com/crosstool-ng/crosstool-ng 2016-10-01 22:43:56 +02:00
Alexey Neyman
651567ff90 Add a checkbox for libmpx build.
Disable libmpx for musl builds.

Signed-off-by: Alexey Neyman <stilor@att.net>
2016-09-22 17:01:43 -07:00
Kirill Smirnov
8c04681a99 Merge branch 'master' into janitorial 2016-09-23 00:56:46 +03:00
Kirill K. Smirnov
3362272d40 elf2flt: do not treat warnings as errors
elf2flt is configured with -Werror flag by default. Disable it.

Signed-off-by: Kirill K. Smirnov <kirill.k.smirnov@gmail.com>
2016-09-20 23:28:29 +03:00
Kirill K. Smirnov
d84501b980 build/glibc: Improve confusing comment
Up until cset 4e2227e8a5 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-09-15 01:31:45 +03:00
Kirill K. Smirnov
10972baa20 binutils: make symlinks in a consistent way
On the stage "core gcc pass-2" the following layout is created:

1) buildtools/bin/TARGET-{ar,as,elf2flt,flthdr,ld,ld.bfd,ranlib,strip}
2) buildtools/TARGET/bin/{ar,as,elf2flt,flthdr,ld,ld.bfd,ranlib,strip}
3) x-tools/TARGET/bin/TARGET-{ar,as,elf2flt,flthdr,ld,ld.bfd,ranlib,strip}
4) x-tools/TARGET/TARGET/bin{ar,as,elf2flt,flthdr,ld,ld.bfd,ranlib,strip}

where both (1) and (2) are symlinks to (3). This effectively renders
core pass-2 gcc with elf2flt linker unusable.

Related elf2flt discussion:
https://github.com/crosstool-ng/crosstool-ng/pull/443

Signed-off-by: Kirill K. Smirnov <kirill.k.smirnov@gmail.com>
2016-09-13 22:07:14 +03:00
Kirill K. Smirnov
f64f561e6f debug/gdb: Add comments for untrivial flags.
The necessity of --without-libexpat-prefix is not
obvious and needs comments.

Signed-off-by: Kirill K. Smirnov <kirill.k.smirnov@gmail.com>
2016-09-12 01:13:55 +03:00
Kirill K. Smirnov
1a2024f96a internals: properly strip gdbserver
On mingw target gdbserver is suffixed with '.exe', thus
plain 'strip gdbserver' fails.

Signed-off-by: Kirill K. Smirnov <kirill.k.smirnov@gmail.com>
2016-09-10 12:48:35 +03:00
Kirill K. Smirnov
5fd69f7652 complibs: let mingw-gcc find target companion libs
mingw-gcc searches for include and libs in <sysroot>/mingw
directory while non-mingw-gcc uses <sysroot>/usr. This patch
sets an appropriate prefix for target companion libs.

Signed-off-by: Kirill K. Smirnov <kirill.k.smirnov@gmail.com>
2016-09-10 03:35:53 +03:00
Kirill Smirnov
5d5465307b debug/gdb: properly link with expat
This patch fixes libexpat detection for gdb-native and
gdb-cross static builds.

For gdb-native build configure should not touch system
/usr/{lib,include} directories while looking for libexpat.
To fix this we pass --without-libexpat-prefix flag
to configure script.

For gdb-cross build configure is allowed to investigate
system /usr/{lib,include} directories, but it does not
hurt to disable this behavior. In this case configure
falls back to -lexpat, which works as expected.

For more info:
http://marc.info/?l=gnulib-bug&m=129660262901148&w=2

Signed-off-by: Kirill Smirnov <kirill.k.smirnov@gmail.com>
2016-09-09 21:25:53 +03:00
Bryan Hundven
62331c9023 Merge pull request #435 from KirillSmirnov/uclibc
uClibc: improve managing shared libs
2016-08-30 17:12:09 -07:00
Bryan Hundven
a833c5596d Merge pull request #429 from pedronavf/patch-1
Update x86.sh
2016-08-30 17:09:50 -07:00
Kirill K. Smirnov
41cd6542a7 uClibc: propagate SHARED_LIBS option.
This patch synchronizes crosstool CT_SHARED_LIBS and uclibc
HAVE_SHARED options.

Signed-off-by: Kirill K. Smirnov <kirill.k.smirnov@gmail.com>
2016-08-30 01:54:08 +03:00
Kirill K. Smirnov
7120d81f48 uClibc: install native utils
This change adds native ldd and ldconfig utils to sysroot.
For glibc just 'make install' installs everything including utils.
For uclibc there exists a separate goal 'install_utils'. Make it.

Signed-off-by: Kirill K. Smirnov <kirill.k.smirnov@gmail.com>
2016-08-30 01:54:08 +03:00
Bryan Hundven
2b887e417a Merge pull request #431 from bhundven/fix_cross_build_tools
cross: Only make 'build tools' for the 'build'
2016-08-26 10:47:23 -07:00
Bryan Hundven
effd8be643 Update config.guess and config.sub
Signed-off-by: Bryan Hundven <bryanhundven@gmail.com>
2016-08-26 08:54:13 -07:00
Bryan Hundven
a7b8cb3f58 cross: Only make 'build tools' for the 'build'
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-26 08:48:32 -07:00
Pedro Navarro
31c8645b37 Update x86.sh
Added additional x86 architectures, like core2, that also map to i686
2016-08-25 18:00:56 -07:00
Bryan Hundven
11cb2ddd43 Merge pull request #410 from jmlemetayer/fix_populate
populate: Fix undefined awk
2016-08-23 14:26:16 -07:00
Bryan Hundven
b18469054d Merge pull request #422 from datacom-teracom/master
scripts/functions: fix log level in call to CT_DoLog
2016-08-23 14:25:48 -07:00
Bryan Hundven
19fdf86ab6 Merge pull request #402 from lundmar/fix_elf2flt_repo
Update elf2flt git repository location
2016-08-23 14:25:22 -07:00
Alexey Neyman
d2af095eb2 musl: Add multilib support.
Signed-off-by: Alexey Neyman <stilor@att.net>
2016-08-23 11:00:27 -07:00
Alexey Neyman
49d1d8f513 uClibc: move ldso check to post_cc.
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-23 11:00:27 -07:00
Alexey Neyman
98e556d386 Support multilib in sh/uClibc.
Signed-off-by: Alexey Neyman <stilor@att.net>
2016-08-23 11:00:27 -07:00
Alexey Neyman
258394c19f Treat multiroots differently.
'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-23 11:00:27 -07:00
Alexey Neyman
f2ffdf798d First stab at multilib/uClibc.
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-23 11:00:27 -07:00
Alexey Neyman
bf3eceb5d9 uClibc: Split configuration tweaker into per-arch functions.
Signed-off-by: Alexey Neyman <stilor@att.net>
2016-08-23 11:00:27 -07:00
Alexey Neyman
0fdc1887a7 Change multilib functions to set the variable.
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-23 11:00:27 -07:00
Alexey Neyman
3ebc5d0c1e libc/*.sh: Deprecate libc_check_config step.
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-23 11:00:27 -07:00
Alexey Neyman
4ee22d66a8 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
<file> <defines>'.

Signed-off-by: Alexey Neyman <stilor@att.net>
2016-08-23 11:00:27 -07:00
Alexey Neyman
28c24f5034 uClibc.sh: typo, local -> locale.
Signed-off-by: Alexey Neyman <stilor@att.net>
2016-08-23 11:00:27 -07:00
Alexey Neyman
d58e740be8 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 <stilor@att.net>
2016-08-23 11:00:27 -07:00
Alexey Neyman
43c303c946 libc/*.sh: handle combinations of multilib root/dir.
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-23 11:00:27 -07:00
Alexey Neyman
82072d0cbc multilib: Determine which options may pass through.
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-23 11:00:27 -07:00
Ray Donnelly
cc86d80da2 glibc: Build manuals and locales last
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-23 11:00:27 -07:00
Ray Donnelly
27fed7e5f0 crosstool-NG.sh.in: Don't make lots of symlinks to lib folder
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-23 11:00:27 -07:00
Alexey Neyman
098bd01f81 glibc.sh: Use --print-multi-os-directory
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-08-23 11:00:27 -07:00
Carlos Santos
29df8cccf4 scripts/functions: fix log level in call to CT_DoLog
It must be "DEBUG", not "Debug"

Signed-off-by: Carlos Santos <casantos@datacom.ind.br>
2016-08-16 23:56:23 -03:00
Jean-Marie Lemetayer
a2d6572b45 populate: Fix undefined awk
Fix minor issue introduced by 6f8e89cb5c
2016-07-26 16:07:58 +02:00
Dmitry Pankratov
91b8280e8c Merge remote-tracking branch 'upstream/master' 2016-06-18 16:02:15 +02:00
Martin Lund
b06f5ab689 Update elf2flt git repository location
The elf2flt git repository has been moved to GitHub. Updated the script
accordingly.

Signed-off-by: Martin Lund <martin.lund@keep-it-simple.com>
2016-06-10 22:11:39 +02:00
Alexey Neyman
dc8f2d1c04 glibc.sh: build dummy libc.so with correct extra flags
Signed-off-by: Alexey Neyman <stilor@att.net>
2016-06-09 17:12:49 -07:00
Ray Donnelly
c7da54edf4 glibc: Use common arch call to get multilib targets
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-09 17:12:49 -07:00
Alexey Neyman
67b314a051 arch/x86: add a sanity check
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-09 17:12:49 -07:00
Alexey Neyman
34ecc718d9 arch/all: Add common function to return multilib target
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-09 17:12:49 -07:00
Ray Donnelly
aa30d0bc4f gcc: Add --with-multilib-list option
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-09 17:12:49 -07:00
Alexey Neyman
a65d8841ec Enable multiarch support in pass-1 GCC.
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-09 17:12:49 -07:00
Alexey Neyman
55879ed1d8 glibc: do not add bogus options
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-09 17:12:49 -07:00
Alexey Neyman
a60946eb24 arch/sparc: better default CPU when targetting Linux
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-06-09 17:12:49 -07:00
Bryan Hundven
cd39285ff8 Merge pull request #373 from stilor/unbreak-ppc-uclibc
Unbreak samples
2016-05-12 20:34:42 -07:00
Bryan Hundven
2b0cc92fab addToolVersion: Fix syntax issues
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-05-12 11:34:34 -07:00
Alexey Neyman
2162cbbdb7 Work-around another quirk in GDB configure.
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-01 18:15:39 -07:00
Alexey Neyman
712b617a74 Unbreak sparc-unknown-linux-gnu.
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-01 18:15:39 -07:00
Alexey Neyman
62d357d3c0 Unbreak static cross-gdb.
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-04-01 18:15:39 -07:00
Dmitry Pankratov
f6d8dc4411 Merge remote-tracking branch 'upstream/master' 2016-03-30 05:41:36 +02:00
Bryan Hundven
e1d494a248 Merge pull request #320 from bhundven/newlib_updates
Newlib updates
2016-03-26 09:11:43 -07:00
Dmitry Pankratov
78c683c356 Merge remote-tracking branch 'upstream/master' 2016-03-17 22:55:51 +01:00
Max Filippov
02d8e4a514 scripts/build/cc: pass FLAGS_FOR_TARGET in do_gcc_core_backend
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-15 17:14:16 +03:00
Bryan Hundven
6476f8a940 newlib: add option to enable nano formatted io
Signed-off-by: Bryan Hundven <bryanhundven@gmail.com>
2016-03-08 04:48:27 -08:00
Bryan Hundven
929e027500 newlib: add option to enable nano malloc
Signed-off-by: Bryan Hundven <bryanhundven@gmail.com>
2016-03-08 04:48:27 -08:00
Bryan Hundven
9d5fc3fd9b newlib: disable multilib if it is not enabled
Signed-off-by: Bryan Hundven <bryanhundven@gmail.com>
2016-03-08 04:48:27 -08:00
Dmitry Pankratov
6e3e735680 MinGW: add C++11 posix threads support 2016-03-07 23:57:29 +01:00
Bryan Hundven
637fbae755 config.{sub,guess}: Ran ct-ng updatetools
Signed-off-by: Bryan Hundven <bryanhundven@gmail.com>
2016-03-03 09:16:48 -08:00
Bryan Hundven
9820e4eea5 musl-libc: Rewrite musl.sh build script
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-29 17:20:28 -08:00
Bryan Hundven
ec9af46847 glibc: Mirror extra_config flags from do_libc_backend_once
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-23 23:34:38 -08:00
Bryan Hundven
21d15e0fd6 glibc: remove do_libc_locales_extract; it's empty
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-23 23:28:22 -08:00
Bryan Hundven
39273e0843 glibc: Remove support for downloading and extracting add-ons
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-23 17:27:54 -08:00
Bryan Hundven
cb87833b7b glibc: reformat glibc build script
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-23 17:27:54 -08:00
Bryan Hundven
a9e5d4a12d functions: use 'ln -sf' for softlinks
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-19 01:24:19 -08:00
Bryan Hundven
12d24ee33b functions: Softlink custom directory
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-08 16:06:39 -08:00
Bryan Hundven
1cfc160f9d Merge pull request #322 from modbw/libelf
Remove GCC dependency to libelf
2016-02-08 15:59:21 -08:00
Bryan Hundven
2241a42415 binutils: Add binutils-2.26
Signed-off-by: Bryan Hundven <bryanhundven@gmail.com>
2016-02-04 22:55:08 -08:00
Bryan Hundven
10af186f5c env: Bail out if CPATH and friends are set
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-02-04 02:29:18 -08:00
Matthias Weisser
3f05fcb52b Remove GCC dependency to libelf
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-18 16:08:23 +01:00
Bryan Hundven
b44effbc0e linux: allow arm* to build headers for no-mmu
Signed-off-by: Bryan Hundven <bryanhundven@gmail.com>
2016-01-13 06:03:27 -08:00
Bryan Hundven
72f3b9196a elf2flt: Use openadk version of elf2flt
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-13 05:58:28 -08:00
Bryan Hundven
0d4275e0dd gcc: fix previous commit
In a5057713a0
...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-07 10:45:33 -08:00
Bryan Hundven
a5057713a0 gcc: Fix CC_GCC_ENABLE_CXX_FLAGS for mode=baremetal
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-06 11:22:58 -08:00
Bryan Hundven
225b96ebc8 gcc: remove CC_GCC_EXTRA_ENV_ARRAY
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-06 11:07:06 -08:00
Bryan Hundven
311a78d6e1 gcc: Sync backend functions
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-06 10:59:26 -08:00
Bryan Hundven
ce74282be4 Merge pull request #309 from bhundven/remove_old_binutils_versions
Remove old binutils versions
2016-01-05 21:45:48 -08:00
Ray Donnelly
24d17220a1 libelf: Cygwin fix for UNC paths
If destdir was / and prefix began with /
then we would attempt to install libelf
to a path beginning with // which is a
UNC path on Cygwin. This is generally
incorrect.

Signed-off-by: Ray Donnelly <mingw.android@gmail.com>
2016-01-03 15:53:09 +00:00
Ray Donnelly
644522fcd0 libiconv: configure with --disable-nls
On Windows a build failure can be triggered during the
build of the static iconv if a dynamic iconv is already
present:

There's a circular dependency between libiconv and gettext
which (on a system with a dynamic gettext (and thus iconv)
installed in the system prefix) causes a failure to build
iconv.exe statically if it is built with nls ..

.. Which needs gettext
.. which depends on libiconv
.. so libtool finds a dynamically linked libgettext.la
.. and therefore presents ld with the dll import library
     libiconv.dll.a when linking iconv.exe
.. as well as the static libiconv.a that it has just built!
.. leading to multiply defined symbols from iconv.

Therefore, we build it without nls. If it later turns out
that we need it to be built with nls, then I will have to
build it in two passes (common practice when bootstrapping
GNU/Linux distros, MSYS2 and probably Cygwin and Homebrew).

Signed-off-by: Ray Donnelly <mingw.android@gmail.com>
2016-01-03 15:53:07 +00:00
Ray Donnelly
44ee416289 expat: Tidy up and correct configure flags
Build shared builds for host unless CT_STATIC_TOOLCHAIN.
In all other situations, build statically, as before.

It is necessary that the static/shared-ness of expat matches
that of gettext on Cygwin/MinGW-w64 as they can't be linked
together if they don't match, so we follow the same logic.

Signed-off-by: Ray Donnelly <mingw.android@gmail.com>
2016-01-03 15:52:23 +00:00
Bryan Hundven
5543f85feb binutils: Remove older versions of binutils
Since older GCC versions have been removed, older versions of binutils
are not needed.

This commit removes these older versions.

Signed-off-by: Bryan Hundven <bryanhundven@gmail.com>
2016-01-03 01:18:32 -08:00
Bryan Hundven
7c7bcecd2e gcc: Add new linaro download path
It seems that linaro is changing where they release, again.

Signed-off-by: Bryan Hundven <bryanhundven@gmail.com>
2016-01-02 22:33:23 -08:00
Bryan Hundven
84486b46d3 binutils: Fix installing libiberty for target
If CT_BINUTILS_FOR_TARGET_IBERTY is set, then it seems that we also must
set `--enable-install-libiberty` for configure to pickup that it needs
to be installed.

This closes #302

Signed-off-by: Bryan Hundven <bryanhundven@gmail.com>
2016-01-02 03:15:07 -08:00
Bryan Hundven
9f89e082c5 Whitespace: We don't use tabs in shell or kconfig files
We indent by multiples of 4.
This change cleans up whitespace in offending files.

Signed-off-by: Bryan Hundven <bryanhundven@gmail.com>
2015-12-08 10:55:17 -08:00
Bryan Hundven
4e2227e8a5 scripts: Update usage of CT_GetCustom
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-12-08 10:55:13 -08:00
Bryan Hundven
1b31314488 CT_GetCustom: Rewrite function to meet expectations
The previous version of CT_GetCustom was a bit... funky.
It didn't handle custom versions to location very well.

This new version is exactly as it appears:

CT_GetCustom <name> <version> <location>

The name is the beginning of the archive (file or directory).
The version is the second half of the archive.
The location is where it can be found. This should be made an absolute
path, but this version is expecting the path in kconfig to be absolute.

A file should extract to a directory: <name>-<version>
A directory will be copied to: <name>-<version>

This keeps our expectations of what we should get.

Signed-off-by: Bryan Hundven <bryanhundven@gmail.com>
Reviewed-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
2015-12-08 07:20:35 -08:00
Bryan Hundven
5d967e8b39 Linux: Remove obsolete Linux custom headers
This option allowed you to use a custom headers directory/tarball to use
in your sysroot.

Not to be confused with using a custom source, that option is the
preferred method.

Signed-off-by: Bryan Hundven <bryanhundven@gmail.com>
Reviewed-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
2015-12-08 07:20:35 -08:00
Bryan Hundven
83f8efa61f xtensa: Remove support for CT_CUSTOM_LOCATION_ROOT_DIR
Since CUSTOM_LOCATION_ROOT_DIR was removed from config/global/paths.in
in commit c499ccb, xtensa should depend only on it's
ARCH_XTENSA_CUSTOM_OVERLAY_LOCATION.

Signed-off-by: Bryan Hundven <bryanhundven@gmail.com>
Reviewed-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
2015-12-08 07:20:35 -08:00
Bryan Hundven
0041a8b105 CT_Extract: Move check extracted up
If we are using a custom location, and that custom location is a
directory that does not have an associated tarball, then we shouldn't
warn about not finding a tarball in CT_TARBALLS_DIR if
CT_SRC_DIR/.<basename>.extracted is found.

If the extracted file is not found, then we can warn that the tarball
was not found then error out that the tarball is missing.

Signed-off-by: Bryan Hundven <bryanhundven@gmail.com>
Reviewed-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
2015-12-08 07:20:16 -08:00
Bryan Hundven
2d3c70dd3d Merge pull request #282 from bhundven/less_gcc_versions_part2
Less gcc versions part2
2015-12-07 18:41:02 -08:00
Bryan Hundven
ed21bcaf89 binutils: Fix LDFLAGS for static toolchain
If building a static toolchain, the ldflags option passed to
do_binutils_backend is overridden when we set `LDFLAGS=-all-static`.

We should pass `LDFLAGS=${ldflags} -all-static` in this case.

This fixes #297

Signed-off-by: Bryan Hundven <bryanhundven@gmail.com>
2015-12-07 11:21:34 -08:00
Bryan Hundven
d06cb88596 binutils: Fix binutils manuals_install variable
In commit: 74d555b2
A regex in a parameter subsitution replaces a '#' hash symbol, but it is
not made literal '\#', so from the hash to the end of the line is a
comment.

Signed-off-by: Bryan Hundven <bryanhundven@gmail.com>
2015-12-05 06:45:08 -08:00
Bryan Hundven
cfd2a6b69c gcc: Gnu OpenMP support depends on threading
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>
2015-11-29 17:40:08 -08:00
Bryan Hundven
8b40ab0d6e gcc: CLooG should be optional for configure
Because >= gcc-5.x does not require cloog, it should not be forced on
the command line arguments for configure if graphite is enabled.

Make CLooG optionally added, if it is needed (aka: <= gcc-4.9).

Signed-off-by: Bryan Hundven <bryanhundven@gmail.com>
2015-11-29 17:36:58 -08:00
Bryan Hundven
0e0ecc8bcf PPL: Remove support for PPL and CLooG/PPL
Now that versions of gcc that required PPL are no longer supported
( >= gcc-4.5.x AND <= gcc-4.7.x )
...we no longer require PPL or CLooG/PPL.

This commit:

* Removes PPL
* Removes CLooG/PPL
* Updates the documentation
* Updates build script for CLooG and GCC
* Removes PPL and CLooG/PPL from scripts/addToolVersion.sh and
  scripts/showSamples.sh
* Adds ISL to scripts/addToolVersion.sh and scripts/showSamples.sh

I know that sounds like a lot for one commit, but it was all kind of
inter-tangled.

Signed-off-by: Bryan Hundven <bryanhundven@gmail.com>
2015-11-29 17:36:58 -08:00
Bryan Hundven
2a89c32193 gcc: Remove gcc <= 4.7.x
As per #222, in crosstool-NG >= 1.23.0, we will only support:

 [upstream supported gcc versions] - 1

As of this writing, these versions are:

* 5.2.0
* 4.9.3
* 4.8.5 (the -1, since development on 4.8.x is now closed)

I plan to keep 4.8.5 around because of some architectures having issues
with over-optimization or just faulty optimization in the 4.9.x and
possibly newer versions.

I also cleaned up a requirement for glibc to depend on >= gcc-4.6.x for
>= glibc-2.20, but since the lowest gcc we support after this change is
>= 4.8.5, this condition can go away.

Patches for older gcc versions are removed in the next commit.

This closes #222

Signed-off-by: Bryan Hundven <bryanhundven@gmail.com>
2015-11-29 17:36:58 -08:00
Bryan Hundven
3c072d6206 binutils/gdb: Fix configure options when building from binutils-gdb repo
When building from:
{git,http}://sourceware.org/git/binutils-gdb.git

and setting BINUTILS_CUSTOM or GDB_CUSTOM, they could be the same
source.

These config options should not affect normal released versions.

Signed-off-by: Bryan Hundven <bryanhundven@gmail.com>
2015-11-24 20:40:44 -08:00
Bryan Hundven
8478376a86 uClibc: Add kconfig option to enable IPv6 support
This commit adds a kconfig option to enable IPv6 support.

Signed-off-by: Bryan Hundven <bryanhundven@gmail.com>
2015-11-22 22:18:08 -08:00
Ray Donnelly
b0743fdcda Clang: Use {C,CXX}FLAG -fbracket-depth=512 for GCC build
https://llvm.org/bugs/show_bug.cgi?id=19650
https://gcc.gnu.org/ml/gcc/2014-05/msg00014.html

Signed-off-by: Ray Donnelly <mingw.android@gmail.com>
2015-11-22 14:39:26 +00:00
Bryan Hundven
d5eb7360d5 uClibc: remove references to sh64*
As per the change notes of GCC-6:

https://gcc.gnu.org/gcc-6/changes.html

and conversations I've had with the buildroot folks, there is no need
to support sh5/sh64.

Signed-off-by: Bryan Hundven <bryanhundven@gmail.com>
2015-11-21 01:26:42 -08:00
Bryan Hundven
6a6968cc8f showSamples: Fix uClibc-ng name and Mingw-w64 versions
Some LIBCs need some love in showSamples.sh.

uClibc-ng is of type of uClibc, so output uClibc-ng if
CT_LIBC_UCLIBC_NG=y.

mingw-w64 doesn't have a CT_LIBC_VERSION, but it does have a
CT_WINAPI_VERSION. So output that instead.

Signed-off-by: Bryan Hundven <bryanhundven@gmail.com>
2015-11-17 13:18:14 -08:00
Bryan Hundven
5739495c35 showSamples.sh: Fix how we get gcc and version for showSamples.sh
I'm not even sure how the previous loop was supposed to work.
The config variables are not exported to the environment.
Now we properly get which cc we are using and grab the version to
display it correctly with the output of wiki-samples.

Signed-off-by: Bryan Hundven <bryanhundven@gmail.com>
2015-11-17 11:41:08 -08:00
Bryan Hundven
3c1d8625e6 Merge pull request #268 from bhundven/consistent_usage_of_found_apps
consistency: Use exported variables of required tools
2015-11-17 04:13:26 -08:00
Bryan Hundven
6f8e89cb5c consistency: Use exported variables of required tools
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-17 02:48:09 -08:00
Bryan Hundven
20f69f3240 ncurses: bump to ncurses-6.0
This commit removes ncurses-5.9 and adds 6.0.
I also provide the stable patch updates in patches/ncurses/6.0.
I have also added an experimental toggle for enabling the new ABI
support.

Signed-off-by: Bryan Hundven <bryanhundven@gmail.com>
2015-11-16 13:35:56 -08:00
Bryan Hundven
7bca67bbb2 file modes: Fix file modes... again.
These files are sourced, not executed, and do not need to be executable.

Signed-off-by: Bryan Hundven <bryanhundven@gmail.com>
2015-11-14 20:22:55 -08:00
Bryan Hundven
465e5a8b9f Merge pull request #249 from stilor/expat_ncurses
Promote expat/ncurses to 'companion libs'
2015-11-14 17:40:21 -08:00
Alexey Neyman
6744ff68e4 Do not log state saving/restoring as ERROR.
These are not errors.

Signed-off-by: Alexey Neyman <stilor@att.net>
2015-11-14 15:26:46 -08:00
Alexey Neyman
847d1d8abf Update new companion libs with *_for_target.
Signed-off-by: Alexey Neyman <stilor@att.net>
2015-11-13 10:34:13 -08:00
Alexey Neyman
be2203be68 Pass CFLAGS/LDFLAGS to backends.
Signed-off-by: Alexey Neyman <stilor@att.net>
2015-11-13 10:32:26 -08:00
Alexey Neyman
16f7a9578f Clean up 300-gdb.sh a bit.
Now that expat/curses have migrated into separate script, no need for
do_debug_gdb_parts() and need_gdb_src checks.

Signed-off-by: Alexey Neyman <stilor@att.net>
2015-11-13 10:32:26 -08:00
Alexey Neyman
4d2d2ba954 Enable building expat/ncurses for host.
Then re-enable cross-gdb for nios2-spico-elf sample, previously
disabled.
2015-11-13 10:31:46 -08:00
Alexey Neyman
6102726147 Change ncurses to a companion library.
Currently, builds for build and target (matching the current
implementation). Need to add building for host for canadian crosses.

TIC_PATH is removed - configure in ncurses searches $PATH, so it finds
'tic' in buildtools anyway. Arguably unneeded code for MacOS also
removed, with a FIXME comment for validation by someone using MacOS.

Signed-off-by: Alexey Neyman <stilor@att.net>
2015-11-13 10:31:46 -08:00
Alexey Neyman
ac7ce38475 Convert expat for target into a companion lib.
Expat-for-host to be done.

Signed-off-by: Alexey Neyman <stilor@att.net>
2015-11-13 10:28:44 -08:00
Alexey Neyman
6f7e6b9969 Build companion libs for target.
Currently, only libelf has a for-target step - but it generalizes
the step to hook other libraries into this step.

Signed-off-by: Alexey Neyman <stilor@att.net>
2015-11-13 10:24:22 -08:00
Bryan Hundven
e78251b751 Merge pull request #253 from jcmvbkbc/xtensa-for-mainline-20151113
Add support for Xtensa architecture
2015-11-13 01:47:08 -08:00
Bryan Hundven
e4bb360748 file modes: Set files to be non-executable
I was going to start doing some autoconf work, and noticed that
configure.in was executable. Then I noticed Makefile.in was executable.

o.O

So, I ran ```find . -type f -executable``` and found a bunch of files
that shouldn't be set executable.

This commit makes them normal files again.

Signed-off-by: Bryan Hundven <bryanhundven@gmail.com>
2015-11-12 23:18:04 -08:00
Chris Zankel
81328ed1cb xtensa: add support for the configurable Xtensa architecture.
The Xtensa processor architecture is a configurable, extensible,
and synthesizable 32-bit RISC processor core. Processor and SOC vendors
can select from various processor options and even create customized
instructions in addition to a base ISA to tailor the processor for
a particular application.

Because of the configurability, the build process requires one additional
step for gcc, binutils, and gdb to update the default configuration.
These configurations are packed into an 'overlay' tar image, and are
simply untarred on top of the default configuration during the build.

Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
2015-11-13 09:08:53 +03:00
Bryan Hundven
57de8dcf22 Merge pull request #239 from diorcety-ctng/cc-cygwin-mingw-linux
Canadian cross build = x86_64 Cygwin host = x86_64 MinGW_W64 target = x86_64 GNU/Linux
2015-11-12 21:50:31 -08:00
Bryan Hundven
4c9218d51d Merge pull request #245 from villytiger/install-strip
Use install-strip target for gcc optionally
2015-11-12 21:50:08 -08:00
Bryan Hundven
377493fc5d Merge pull request #221 from bhundven/uclibc-ng
Add support for uClibc-ng
2015-11-12 21:46:34 -08:00
Ray Donnelly
06855ab27e libtool: Update to 2.4.6 and patch for Cygwin
Signed-off-by: Ray Donnelly <mingw.android@gmail.com>
2015-11-13 02:17:46 +00:00
Ray Donnelly
9e81836b81 Add gettext and libiconv as companion libs
.. they're needed for the RPC generation in glibc
on both Cygwin and MinGW-w64.

Neither are built on GNU/Linux and iconv is not
built on Darwin.

Two patches for gettext are needed, one so that
-O0 works and one so that static builds can be
made.

They can take a good while to build, so if not
needed for_host or for_build then they are not
built.

Signed-off-by: Ray Donnelly <mingw.android@gmail.com>
2015-11-13 02:17:45 +00:00
Bryan Hundven
a173dfa939 uClibc: Fall back to default configs if not provided
I've added the .config files to contrib/uClibc-defconfigs from buildroot
to use as default configs if they are not provided in the sample.

If a particular architecture really needs an option set, it should be
either updated in the manange_uClibc_config function in
scripts/build/libc/uClibc.sh or a custom ${uclibc_name}.config should be
added to the sample (usually via `ct-ng saveconfig`).

Signed-off-by: Bryan Hundven <bryanhundven@gmail.com>
2015-11-12 16:15:41 -08:00
Bryan Hundven
21a448516e uClibc: Add support for uClibc-ng
This commit adds uClibc-ng 1.0.8.

Signed-off-by: Bryan Hundven <bryanhundven@gmail.com>
2015-11-12 16:15:41 -08:00
Bryan Hundven
1c924f06fa uClibc: rewrite mungeuClibcConfig to manage_uClibc_config
This commit updates uClibc to use the new CT_Kconfig options from the
previous commit. The older sed method of sanity checking the uClibc
.config was error prone and clumsy.

Signed-off-by: Bryan Hundven <bryanhundven@gmail.com>
2015-11-12 16:15:41 -08:00
Bryan Hundven
c4d14a97ad functions: Add global functions for manipulating kconfig options
This commit adds 4 new functions to aid in the process of managing a
kconfig .config file:

* CT_KconfigSetOption <option> <value> <file>
* CT_KconfigEnableOption <option> <file>
* CT_KconfigDisableOption <option> <file>
* CT_KconfigDeleteOption <option> <file>

(akin to how buildroot manages the uClibc.config)

These functions are global so that we can manage any component that also
uses kconfig, or to be able to use it internally on Crosstool-NG's
kconfig files.

Last but not least, be consistent and update sed to be ${sed}!

Signed-off-by: Bryan Hundven <bryanhundven@gmail.com>
2015-11-12 16:15:39 -08:00
Bryan Hundven
ad0d71d287 mpfr: Swap primary mirror to gnu.org
mpfr.org has been less then reliable, so lets make gnu.org the primary
instead of the secondary source.

This closes #250

Signed-off-by: Bryan Hundven <bryanhundven@gmail.com>
2015-11-11 17:19:51 -08:00
Bryan Hundven
930fa77076 uClibc: Reduce supported versions
This commit reduces the number of supported versions to:

* 0.9.33.2
* custom location

Signed-off-by: Bryan Hundven <bryanhundven@gmail.com>
2015-11-11 08:27:33 -08:00
Ilya Lyubimov
69405c3b32 Use install-strip target for gcc optionally 2015-11-11 12:29:54 +03:00
Alexey Neyman
f3e62e0c09 Disable parallel build of mingw-w64-crt.
Unfortunately, parallel build issue is not yet fixed in current
mingw-w64 sources.

Signed-off-by: Alexey Neyman <stilor@att.net>
2015-11-10 18:21:43 -08:00
Alexey Neyman
bea0cde305 Support mingw-w64 in addToolVersion.sh.
... and add 4.0.4 release.

Signed-off-by: Alexey Neyman <stilor@att.net>
2015-11-10 18:18:57 -08:00
Bryan Hundven
e9e29e7a46 blackfin: Remove blackfin support
This commit removes blackfin support.

I'm open to re-adding blackfin after crosstool-1.23.0 is released, but
it is currently too difficult to port forward to newer versions of gcc
and uclibc.

Signed-off-by: Bryan Hundven <bryanhundven@gmail.com>
2015-11-09 22:30:45 -08:00
Bryan Hundven
85f98147f5 Merge pull request #233 from stilor/fix-build-all
Fix build-all
2015-11-04 02:50:05 -08:00
Bryan Hundven
5ffc9ecd10 Merge pull request #235 from stilor/ctng-source
ctng source
2015-11-03 00:35:30 -08:00
Bryan Hundven
3b854d4939 uClibc: Don't use CROSS, use CROSS_COMPILE instead
As per:
http://cgit.uclibc-ng.org/cgi/cgit/uclibc-ng.git/commit/Makefile.help?id=044843f002f666db3bc06c513ed6291a00ad1225

CROSS= is for compatibility, but we plan on dropping older uClibc
versions, and adding uClibc-ng and uClibc-snapshot support.

Use CROSS_COMPILE instead.

Signed-off-by: Bryan Hundven <bryanhundven@gmail.com>
2015-11-02 17:01:20 -08:00
Bryan Hundven
bb821551c5 linux: Set CROSS_COMPILE while building/checking headers
Some architectures, like arc and blackfin set CROSS_COMPILE to a default
if it is not set on the command-line.

Since we are building the cross-compiler, we need to ALWAYS set
CROSS_COMPILE, since building/checking headers is done after the GCC
PASS1 step.

Signed-off-by: Bryan Hundven <bryanhundven@gmail.com>
2015-11-02 16:55:44 -08:00
Bryan Hundven
1a25115a18 gcc: Support only the latest branch releases of gcc
This change, as per #222, reduces the number of supported releases of
gcc to the latest branch releases.

I noticed while doing this work that gcc-4.5.4 was never added, so I
moved patches for gcc-4.5.3 to 4.5.4 and updated the
bfin-unknown-linux-uclibc example. Also, 120-siginfo.patch was fixed
upstream in the 4.5.4 release, so this patch is omitted.

I also bumped the avr sample to 4.9.3 from 4.9.2.

With the addition of gcc-5.x, the gcc release team now releases the
major.minor.0 versions, while updates to the branch are available in
svn/git. We'll address that when we get to issue #219. This change just
removes CC_GCC_5_1 and moves CC_GCC_5_2 to CC_GCC_5, and removes
CC_GCC_5_1_or_later and moves CC_GCC_5_2_or_later to CC_GCC_5_or_later.

This is the first of two part changes, as mentioned in #222.
This change is slated for release in 1.22.0. The next change will be
slated for 1.23.0, and will limit gcc versions to what is on
https://gcc.gnu.org under "Release Series and Status", which is
currently 4.9.3 and 5.2.0, although I will also support the previous
supported version. In this example that would be 4.8.5.

Last, but not least, this change also retires AVR32 support.

Signed-off-by: Bryan Hundven <bryanhundven@gmail.com>
2015-10-31 12:17:35 -07:00
Alexey Neyman
b2f8afef85 Interpret escape sequences in CT_DoLog.
Otherwise, CT_Abort messages with \n are not displayed properly.

Signed-off-by: Alexey Neyman <stilor@att.net>
2015-10-30 16:24:52 -07:00
Alexey Neyman
5844514e74 Fix samples using GMP 4.3.2.
Some older versions of configure (including the one in GMP 4.3.2)
interpret the $ECHO environment variable as the `echo' utility to
use. CT-NG sets the variable to `:' and exports it if V=0 or V=1
is supplied, breaking the samples using such configure. This currently
includes bfin-unknown-linux-uclibc and powerpc-unknown-linux-uclibc.

Also, correct the description of the V= variable - V=0 is *not* the
default; in fact, default does not correspond to any of the V=[012]
values.

Signed-off-by: Alexey Neyman <stilor@att.net>
2015-10-30 16:24:52 -07:00
Alexey Neyman
1d6bed6254 Only create backtrace stamp if dir exists.
If the build is aborted before the working directory is created,
there's also an induced error message about inability to create
a 'backtrace' file. But in that case, there is no subshells executing
yet.

Signed-off-by: Alexey Neyman <stilor@att.net>
2015-10-30 16:24:52 -07:00
Alexey Neyman
80cbfb9da7 Make show-config consistent with sample name.
'ct-ng show-config' will prepend host for canadian builds; otherwise,
the name is different from the name used to configure the build
(and indistinguishable from a simple cross).

Signed-off-by: Alexey Neyman <stilor@att.net>
2015-10-30 16:24:52 -07:00
Alexey Neyman
f849505ac9 Sanity check for number of parallel jobs.
Signed-off-by: Alexey Neyman <stilor@att.net>
2015-10-30 13:53:53 -07:00
Alexey Neyman
319023c7af Implement 'ct-ng source'.
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-10-30 01:23:53 -07:00
Bryan Hundven
f7c312b240 scripts/config.{sub,guess}: Update from upstream
Update config.sub and config.guess from:
* git://git.sv.gnu.org/config.git

See their gitweb:
* http://git.savannah.gnu.org/gitweb/?p=config.git

Signed-off-by: Bryan Hundven <bryanhundven@gmail.com>
2015-10-29 15:13:33 -07:00
Alexey Neyman
0a050d3390 Clean up *.la after installing compiler/libraries.
Having *.la in the installation directory breaks ltrace: in ltrace,
libtool somehow considers libsupc++ to be an "accessory library" and
does not add -lsupc++ to the link flags. Neither Ubuntu, nor RedHat
include *.la files into their packages for libstdc++.

Signed-off-by: Alexey Neyman <stilor@att.net>
2015-10-26 18:34:06 -07:00
Jasmin Jessich
3bd86362ab Using "all" and "install" targets in do_gcc_core_backend if configured.
- New configurations:
  - CC_GCC_TARGET_FINAL:
    Use the default targets "all" and "install" for the final compiler for
    bare metal.
- Adding parameter "build_step" to function do_gcc_core_backend:
  do_gcc_core_backend is used for the core compiler and in case of bare metal
  for the final compiler, too. To have better control over the parameters for
  the final compiler "build_step" is used.
  - Used for proper logging.
  - Use CT_CC_GCC_CORE_EXTRA_CONFIG_ARRAY or CT_CC_GCC_EXTRA_CONFIG_ARRAY.
  - If CT_CC_GCC_TARGET_FINAL is set and the final compiler is build then the
    make targets for the final compiler are used ("all", "install").

  Signed-off-by: Jasmin Jessich <jasmin@anw.at>
2015-10-10 00:24:42 +02:00
Bryan Hundven
625f7e66b4 Merge pull request #187 from jasmin-j/sync_lto
Synchronize CC_GCC_USE_LTO parameter setting II
2015-10-07 13:35:44 -07:00
Bryan Hundven
9e9b9bd195 Merge pull request #184 from jasmin-j/add_gcc_env_array
Add additional environment variables for gcc build.
2015-10-07 13:32:53 -07:00
Bryan Hundven
866bff1307 Merge pull request #182 from jasmin-j/add_missing_lib_opts
Adding missing if/else blocks in do_gcc_core_backend.
2015-10-07 13:31:19 -07:00
Jasmin Jessich
9bce2dc540 Synchronize CT_CC_GCC_USE_LTO parameter setting in do_gcc_backend with the one
from do_gcc_core_backend, by adding "--enable-lto"/"--disable-lto".

Signed-off-by: Jasmin Jessich <jasmin@anw.
2015-09-25 01:32:27 +02:00
Jasmin Jessich
931248f1aa Added additional environment variables for gcc build (make) with new option
GCC_EXTRA_ENV_ARRAY.

Signed-off-by: Jasmin Jessich <jasmin@anw.at>
2015-09-22 00:21:36 +02:00
Jasmin Jessich
64a158f932 Removed doubled setting of --disable-libmudflap in do_gcc_core_backend.
Signed-off-by: Jasmin Jessich <jasmin@anw.at>
2015-09-22 00:20:19 +02:00
Jasmin Jessich
9c3248af89 Adding missing if/else blocks in do_gcc_core_backend for CT_CC_GCC_LIBSSP,
CT_CC_GCC_HAS_LIBQUADMATH and CT_CC_GCC_LIBQUADMATH (--en/disable-libssp,
--en/disable-libquadmath, --en/disable-libquadmath-support) from function
do_gcc_backend.

Signed-off-by: Jasmin Jessich <jasmin@anw.at>
2015-09-22 00:19:10 +02:00
Jasmin Jessich
9e905afb56 Added additional newlib specific target flags with new option
LIBC_NEWLIB_TARGET_CFLAGS.

Signed-off-by: Jasmin Jessich <jasmin@anw.at>
2015-09-14 23:32:07 +02:00
Bryan Hundven
f189762245 glibc: Fix applying addons to glibc => 2.17
glibc-2.17 and above no longer have external addons or ports.
So if we are => 2.17, don't even think about trying to mess with ports
or addons.

Signed-off-by: Bryan Hundven <bryanhundven@gmail.com>
2015-09-01 20:14:00 -07:00
Bryan Hundven
6ac93ed03b Merge pull request #144 from jasmin-j/fix_142
Fix for issue #142:
2015-08-31 22:15:37 -07:00
Jasmin Jessich
c6f30f67f0 Fix for issue #142:
Configure for for core GCC did not use Core gcc extra config.
Use now config variable CT_CC_GCC_CORE_EXTRA_CONFIG_ARRAY.

Signed-off-by: Jasmin Jessich <jasmin@anw.at>
2015-09-01 02:46:38 +02:00
Jasmin Jessich
25dc2d4470 Added new config ISL_V_0_14_or_later and ISL_V_0_12_or_later to select
proper configure options for isl 0.14.x and 0.12.x in 121-isl.sh.

Signed-off-by: Jasmin Jessich <jasmin@anw.at>
2015-09-01 02:18:35 +02:00
Erico Nunes
14cc1cb28e functions: write permission in config.{guess,sub}
avr-libc doesn't have write permissions in these by default in the 1.8.1
tar release, this caused an error during build with
CT_OVERIDE_CONFIG_GUESS_SUB enabled.

chmod u+w them before overriding to avoid an this error.

Signed-off-by: Erico Nunes <nunes.erico@gmail.com>
2015-06-21 20:54:16 -03:00
Erico Nunes
219c5e932f functions: add support for arch-specific patch
Add support for applying arch-specific patches found in
"patches/${pkgname}/${version}/${CT_ARCH}".

This is needed for applying a popular binutils patch specific for the
AVR architecture but which isn't isolated for AVR in binutils' code.
In this case, applying it for every architecture would end up bloating
binutils' "size" options with AVR specifics.

This feels like a bit of a hack but it is easy enough to support with
current crosstool-ng infrastructure, seems like worth it for this case.

Signed-off-by: Erico Nunes <nunes.erico@gmail.com>
2015-06-21 20:53:43 -03:00
Erico Nunes
b8e64a0c08 avr-libc: add support for avr-libc C library
This commit adds support for the avr-libc C library.
According to the project page at http://www.nongnu.org/avr-libc , the
avr-libc package provides a subset of the standard C library for Atmel
AVR 8-bit RISC microcontrollers. In addition, the library provides the
basic startup code needed by most applications.

Support for this library in crosstool-ng is only enabled for the AVR
8-bit target.

The avr-libc manual and most distributions build the AVR 8-bit gcc
toolchain with the "avr" (non-canonical) target.
Some experimentation also led to the conclusion that other (canonical)
targets are not very well supported, so we force the "avr" target for
crosstool-ng as well.

The manual also recommends building avr-libc after the final gcc build.
To accomplish this with crosstool-ng, a new do_libc_post_cc step is
added, in which currently only avr-libc performs its build, and is a
no-op for the other libc options.

Signed-off-by: Erico Nunes <nunes.erico@gmail.com>
2015-06-21 20:53:06 -03:00
Erico Nunes
230dc12285 avr: add support for AVR 8-bit architecture
This commit adds support for the Atmel AVR 8-bit RISC architecture.
This is the first 8-bit architecture to be added to crosstool-ng so the
configuration options for 8-bit architectures are added here as well.

gcc has had support for AVR for quite a while, at least since the 4.3
series for the currently popular ATmega microcontroler series.
The AVR architecture only supports bare-metal toolchains.

gcc for the AVR 8-bit architecture, usually referred to as avr-gcc, is
commonly used in conjunction with the avr-libc library which provides
additional resources for the Atmel AVR 8-bit microcontrollers.

avr-gcc can also be found as a supported package in some recent Linux
distributions.

This commit also closes #66

Signed-off-by: Erico Nunes <nunes.erico@gmail.com>
2015-06-21 20:49:10 -03:00
Bryan Hundven
728b410657 gcc: Remove --enable-c99
This option is old. GCC 4.3.x old. It isn't supported anymore, and just
confuses me. I'm not planning to support 4.3.x, or really anything older
then 4.7. So this option is gone to the wind.

Signed-off-by: Bryan Hundven <bryanhundven@gmail.com>
Acked-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
2015-06-03 12:26:10 -07:00
Bryan Hundven
c28b4f1ceb Merge pull request #107 from bhundven/remove_experimental_musl_patches
Remove support for experimental patches and musl patches
2015-06-02 12:00:59 -07:00
Bryan Hundven
f680c00283 Merge pull request #58 from dirkhusemann/master
Update functions to grok symlinks
2015-06-02 12:00:49 -07:00
Bryan Hundven
67e6896c2b Remove support for experimental patches and musl patches
This functionality was provided so that crosstool-ng could have a
further set of patches considered experimental and unsupported.
Now that musl-libc support is making it's way upstream in gcc, I'm
removing this support and the experimental musl patches.

In later commits, backports from gcc upstream will be added to the
supported patch sets to support musl-libc.

Signed-off-by: Bryan Hundven <bryanhundven@gmail.com>
2015-06-02 10:47:58 -07:00
Bryan Hundven
2cac85710d Merge pull request #103 from bhundven/update_addtoolversion
addToolVersion: multi_cc: update addToolVersion
2015-06-02 09:36:55 -07:00
Bryan Hundven
f3975693b0 addToolVersion: multi_cc: update addToolVersion
Since gcc moved from CC_ to CC_GCC_, addToolVersion neeeded to be
updated.

Signed-off-by: Bryan Hundven <bryanhundven@gmail.com>
2015-06-02 09:35:23 -07:00
Dirk Husemann
0130065c0a Update functions to grok symlinks
when specifying a custom kernel provided as a tar ball, the tar ball gets symlinked. the -e test will fail.

Signed-off-by: Dirk Husemann <dirk@d2h.net>
2015-06-02 07:45:57 +02:00
Bryan Hundven
a2adc4386e Merge pull request #102 from yann-morin-1998/yem/populate
populate: also search for gconv modules
2015-06-01 19:38:06 -07:00
Ray Donnelly
00e7d4fd7b test_suite: Update gcc test_suite for multiple compilers
This commit updates gcc's test suite to use the new config options.

Signed-off-by: Ray Donnelly <mingw.android@gmail.com>
Reviewed-by: Bryan Hundven <bryanhundven@gmail.com>
Reviewed-by: Yann Diorcet <diorcetyann@gmail.com>
2015-06-02 00:01:36 +01:00
Ray Donnelly
cfd4437bf7 gdb: Update 300-gdb.sh for multiple compilers
Update 300-gdb.sh to use the new config options.

Signed-off-by: Ray Donnelly <mingw.android@gmail.com>
Reviewed-by: Bryan Hundven <bryanhundven@gmail.com>
Reviewed-by: Yann Diorcet <diorcetyann@gmail.com>
2015-06-02 00:01:34 +01:00
Ray Donnelly
8ce2abf57d cc: Update 100-gcc.sh for multiple compilers
Update 100-gcc.sh to use the new config option names.

Signed-off-by: Ray Donnelly <mingw.android@gmail.com>
Reviewed-by: Bryan Hundven <bryanhundven@gmail.com>
Reviewed-by: Yann Diorcet <diorcetyann@gmail.com>
2015-06-02 00:01:32 +01:00
Ray Donnelly
afbd17874a scripts: Update crosstool-NG internals for multiple compilers.
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-06-02 00:01:31 +01:00
Ray Donnelly
9cdbc7b199 showSamples: Update showSamples.sh for multiple compilers
This change adds support to show samples for multiple compilers.

Signed-off-by: Ray Donnelly <mingw.android@gmail.com>
Reviewed-by: Bryan Hundven <bryanhundven@gmail.com>
Reviewed-by: Yann Diorcet <diorcetyann@gmail.com>
2015-06-02 00:01:22 +01:00
Yann E. MORIN
fb321268f7 populate: also search for gconv modules
The gconv modules are present in the (e)glibc toolchains, and some
applications directly link with one or more of those modules (even
though the classic way of using them is by dlopen()ing them).

So, also look in /usr/lib/gconv when searching for libraries.

Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
2015-05-31 21:23:36 +02:00
Ray Donnelly
541199de3a config: Add config support for multiple compilers
This change updates the config to support multiple compilers by moving
CC_.* to CC_GCC_.* to make room for other compilers.

We also update gen_in_frags.sh to check for a default cc.

Signed-off-by: Ray Donnelly <mingw.android@gmail.com>
Reviewed-by: Yann Diorcet <diorcetyann@gmail.com>
Reviewed-by: Bryan Hundven <bryanhundven@gmail.com>
2015-05-29 21:49:33 +01:00
Ray Donnelly
3049c4c1e2 multi_cc: Prepare ct-ng for multiple compilers
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-29 21:49:32 +01:00
Ray Donnelly
b39fb4b1b4 mingw-w64: Add 'devel' version to use git 'master' branch
Signed-off-by: Ray Donnelly <mingw.android@gmail.com>
2015-05-12 23:48:53 +01:00
Ray Donnelly
f95b34d52f CT_GetGit: Allow cset to be a ref (branch or tag)
Pass cset as ref=somename to use this feature. CT_GetGit echos
the cset sha1 on exit since the caller will need to know that
information as it forms part of the downloaded tarball name.

Signed-off-by: Ray Donnelly <mingw.android@gmail.com>
2015-05-12 23:32:21 +01:00