Commit Graph

1020 Commits

Author SHA1 Message Date
Yann E. MORIN"
3714ada819 libc/glibc: run ./configure in CONFIG_SHELL
Tremendously helps when running on at least Ubuntu, with dash as
the system shell (ie. /bin/sh points to dash).

Reported by a few people, of which:
  leming, ccct and ccole on IRC

Signed-off-by: "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
(transplanted from 30c89d1f74a4fee73517b4ed67e843be6885447e)
2011-10-11 22:21:48 +02:00
Yann E. MORIN"
f68c40aa08 complibs/cloog: catch autogen.sh's output
Run autogen.sh through CT_DoExecLog to catch its output.

Signed-off-by: "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
(transplanted from fcf5c43cf30f11366d4fe16ee19d6c2143985c62)
2011-10-10 00:00:58 +02:00
Yann E. MORIN"
13b77146e7 binutils/binutils: ensure gold is staticaly-linked if needed
Signed-off-by: "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
(transplanted from 293d8334b913a86c3e5d817dd84e5bc434888251)
2011-10-09 15:34:16 +02:00
Michael Hope
1057a15040 Pass CXXFLAGS to binutils/gold.
The GOLD linker is written in C++.  Pass CT_CFLAGS_FOR_HOST as
CXXFLAGS to configure so that any host specific flags are passed
through.

It feels a bit funny passing CFLAGS as CXXFLAGS, but the PPL and GCC
target rules already do the same.

Signed-off-by: Michael Hope <michael.hope@linaro.org>
(transplanted from 9cd87d279a99bd32a364f12d4b2d6d37e1d9248b)
2011-10-05 14:15:45 +13:00
Yann E. MORIN"
6f31c85b0c kernel/linux: add alternate download locations
Since kernel.org is dead, and there is no announced or known estimated
time or return to normality, it is impossible to download any kernel at
this time.

Add a known-working mirror.

Signed-off-by: "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
(transplanted from 7df89370f80537d1b36b2fda70e3a1c6bc237a65)
2011-09-21 22:42:35 +02:00
Yann E. MORIN"
8764d8089b scripts: fix sysroot prefix dir
The sysroot prefix dir was broken in #4960f5d9f829 due to a mishap
when making the out-of-sysroot lib/ symlink: the './' was mistakenly
changed into a single '.' .

Although Jonathan suggested restoring the missing '/' to restore it to
normal operation, I prefered using an explicit pushd/popd to be extra
sure of the symlink location and target, along with a fix in the sysroot
relative directory calculation.

Reported-by: Jonathan Grundon <JGrundon@xos.com>
Signed-off-by: "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
(transplanted from e5fc5c9ea78af28d05244ba09cf718cf75470903)
2011-09-07 01:22:37 +02:00
Titus von Boxberg
3bd14bf2f0 debug/ltrace: Fix HOST_OS and ar
HOST_OS really is the target OS. Allow setting it for configure
via an environment variable.
libltrace.a should have an index:
Allow ar to be set as an environment variable, and generate
an index in this lib.

Reported-by: "Guylhem Aznar" <crossgcc@guylhem.net>
Signed-off-by: "Titus von Boxberg" <titus@v9g.de>
(transplanted from f86af11138ea2b2ecd4876d9c6c24f58ba4d68ac)
2011-08-22 09:26:02 +02:00
Titus von Boxberg
149067397e complibs/libelf: use target ranlib
For portability, the right ranlib for the target must be passed to
libelf's configure.

Signed-off-by: "Titus von Boxberg" <titus@v9g.de>
(transplanted from e4a6fefcb0f5ecbcade3ae5edbe609560843aed1)
2011-08-21 17:54:12 +02:00
Yann E. MORIN"
5cda934d4b debug/gdb: we don't care if the host tic is shared or static
Because we need our own host tic, we have to build it; and we do build
it statically for now.

But as MacOS/Darwin/Whatever-you-call-it does not support static linking
(what a shame!), it fails.

Anyway, we don't really care it being shared, in the end.

Signed-off-by: "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
(transplanted from 41bd6777fa4f767d6264db7c58986920014fd708)
2011-08-17 23:53:49 +02:00
Yann E. MORIN"
6fc6d842e8 scripts: simplify and fix the toolchain config script
The script that is installed, and which sole purpose is to dump
the .config that was used to build the toolchain, is pure insanity.

Let's make it much, much more simpler...

Signed-off-by: "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
(transplanted from 814ea73df7e0fab3db1cbe7623932714359c732b)
2011-08-19 00:52:05 +02:00
Yann E. MORIN"
ead6c9b861 libc/uClibc: force use of ctor/dtor
Although ctor/dtor do not seem strictly required, missing them proves
rather inconvenient, as ld can't link binaries.

Reported-by: John Spencer <maillist-uclibc@barfooze.de> (sh4rm4 on IRC)
Signed-off-by: "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
(transplanted from fac4018427d2920607e8f924672458be1b366551)
2011-08-13 00:05:51 +02:00
Yann E. MORIN"
f0b0c6666f libc/mingw: fix mingw source dirs
Someof the mingw32 source tarballs have an appended '-src' after the
version.

Since changeset #6e1412ba8da9 (scripts/functions: force extract folder
to archive basename), it means mingw tarballs get extracted in a directory
ending with '-src'.

Fix that.

Signed-off-by: "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
2011-08-01 00:16:12 +02:00
Yann E. MORIN"
03b1bc0302 libc/uclibc: fix src dir location
Now that we akways extract the tarballs in a sane location (see changeset
#6e1412ba8da9: scripts/functions: force extract folder to archive basename),
the uClibc snapshot dir now has the date (as version) in it, eg.:
  uClibc-20100710

Signed-off-by: "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
2011-07-31 22:07:08 +02:00
Yann E. MORIN"
6acb2ecac5 config: don't require .config.2 to save a sample
Samples should contain kconfig-parsable definitions, not script variables.
.config.2 contains bash arrays, which is definitely not kconfig-safe...

Signed-off-by: "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
2011-07-31 00:04:02 +02:00
Yann E. MORIN"
32ac6af49f debug/gdb: don;t install sample gdbinit for old versions
Only starting with gdb-7 does installing the gdbinit sample makes senses.

Signed-off-by: "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
2011-07-30 00:05:53 +02:00
Benoît THÉBAUDEAU"
6c7f5488ee scripts/functions: force extract folder to archive basename
Some archives like those of the 2011.07 revisions of Linaro GCC contain a folder
name different from the archive basename, which leads to errors afterwards, e.g.
when patching. E.g.:
gcc-linaro-4.5-2011.07.tar.bz2 extracts to gcc-linaro-4.5-2011.07-0/

This patch changes CT_Extract() to force the extraction of all archives to a
folder named like the archive basename. E.g.:
gcc-linaro-4.5-2011.07.tar.bz2 now extracts to gcc-linaro-4.5-2011.07/

Signed-off-by: "Benoît THÉBAUDEAU" <benoit.thebaudeau@advansee.com>
2011-07-29 13:04:49 +02:00
Benoît THÉBAUDEAU"
2ea05ecaa7 scripts/libc: do not build add-ons by default
Currently, no --enable-add-ons option is passed to libc configure when
"$(do_libc_add_ons_list ,)" is empty, which makes configure automatically search
for present add-ons. In that case, all present add-ons are built, although
no add-on was selected by the user in the config. Moreover, this can make the
configure fail if some non-standard add-ons like eglibc-localedef are present.

This behavior also leads to an inconsistency from a user point of view between
the following cases:
 - LIBC_ADDONS_LIST="", LIBC_GLIBC_USE_PORTS=n and THREADS="none" in the config,
   which makes "$(do_libc_add_ons_list ,)" return "", so all present add-ons
   are built.
 - LIBC_ADDONS_LIST="", LIBC_GLIBC_USE_PORTS=n and THREADS!="none" in the
   config, which makes "$(do_libc_add_ons_list ,)" return the add-on supporting
   the chosen threading implementation, e.g. "nptl", so only this add-on is
   built.

This patch disables the building of all add-ons in that case.

It is still possible to build all present add-ons by adding --enable-add-ons to
LIBC_GLIBC_EXTRA_CONFIG_ARRAY.

Signed-off-by: "Benoît THÉBAUDEAU" <benoit.thebaudeau@advansee.com>
2011-07-28 22:09:31 +02:00
Yann E. MORIN"
82ba904b90 debug/gdb: install gdbinit sample file
gdb needs to know where to find the libstdc++ helper python script
to do, well, whatever it has to do with it...

We can't install that in the user's ~/.gdbinit, it's too complex to
handle all the cases. Moreover, if the user is using more than one
toolchain, we can't put all that stuff in there...

Just provide a sample config file the user can adapt to his/her
own needs.

Thanks go to Khem RAJ for providing such a hint:
    http://sourceware.org/ml/crossgcc/2011-07/msg00026.html

Reported-by: ANDY KENNEDY <ANDY.KENNEDY@adtran.com>
CC: Khem Raj <raj.khem@gmail.com>
Signed-off-by: "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
2011-07-24 20:30:52 +02:00
Yann E. MORIN"
c4d628f257 kernel/linux: prepare to handle 3.x
The place to get 3.x has changed; the version scheme has changed.

No need to be overkill, just support 3.x; 4.x is not even dreamt of.

Signed-off-by: "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
2011-07-22 21:45:07 +02:00
Yann E. MORIN"
c009897aee misc: fix more typos here and there...
Reported-by: "Antony N. Pavlov" <antony@niisi.msk.ru>
Signed-off-by: "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
2011-07-17 16:53:40 +02:00
Yann E. MORIN"
30ad622618 misc: fix typos
Reported-by: "Antony N. Pavlov" <antony@niisi.msk.ru>
Signed-off-by: "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
2011-07-17 16:54:50 +02:00
Yann E. MORIN"
e6c749113f scripts, cc/gcc: do not fail on existing symlinks or build.log
If the user builds a toolchain over an existing one, so, without removing
CT_PREFIX_DIR, the build fails as the symlinks already exist, as does the
build.log.

This can also happen (for build.log) if the user first ran in download-
or extract-only.

Patch (with no SoB) originally from:
  Phil Wilshire <phil.wilshire@overturenetworks.com>

Modified by me as it did not apply cleanly.

Signed-off-by: "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
2011-07-12 23:52:24 +02:00
Yann E. MORIN"
76259418d3 scripts/xldd: fix missing arg to one printf
Signed-off-by: "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
2011-07-12 23:21:27 +02:00
Yann E. MORIN"
430212ffab scripts/xldd: don't pass random format to printf
Although proabaly inoffensive in our case, do not pass un-checked
formats to printf.

Signed-off-by: "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
2011-07-11 00:15:00 +02:00
Yann E. MORIN"
3f8e8754eb scripts/xldd: print end of current action
Signed-off-by: "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
2011-07-11 00:13:57 +02:00
Yann E. MORIN"
bec9bab5ad scripts/xldd: fix typo
Signed-off-by: "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
2011-07-10 23:37:58 +02:00
Yann E. MORIN"
5e3015a71c cc/gcc: do not build libgomp or libmudflap in the core steps
Signed-off-by: "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
2011-04-15 00:09:59 +02:00
Yann E. MORIN"
21247bddbf scripts/internals: do not remove lib{32,64}/ symlinks after build
During the build, we create lib{32,64}/ symlinks out of the sysroot.
In some cases (eg. mingw32 target), these symlinks are still required
when running the toolchain. For other combinations, the symlinks are
without incidence, so they can be safely kept after the build.

Signed-off-by: "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
2011-04-15 00:22:42 +02:00
Yann E. MORIN"
5de61c8032 scripts: on startup, also remove the buildtools dir
In case there's one lingering around (whether the previous build was
successful, or failed), we have to remove the buildtools directory
as well as the toochain build dir.

This should also fix the case where out makeinfo wrapper calls
itself recursively.

Signed-off-by: "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
2011-07-10 00:02:05 +02:00
Yann E. MORIN"
96ab98a14b libc/glibc: fix passing args with spaces when calling backend
Spaces in arguments to the glibc backend were not handled.

Signed-off-by: "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
2011-07-09 19:40:24 +02:00
Yann E. MORIN"
b491627228 cc/gcc: fix passing args with spaces when calling core gcc
Spaces in arguments to the core gcc backend were not handled.

Signed-off-by: "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
2011-04-15 00:05:53 +02:00
Yann E. MORIN"
887aefc742 scripts: update config.{guess,sub}
Signed-off-by: "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
2011-07-07 10:17:34 +02:00
Yann E. MORIN"
f1c0186b2f config: move multi-line shell commands from Makefile to script
Maintaining thos multi-line shell commands in a Makefile rule is
a real PITA.

Move the two affected rules (build_gen_choice_in and build_gen_menu_in
to a shell script.

Signed-off-by: "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
2011-07-03 23:02:16 +02:00
Yann E. MORIN"
69f9485343 cc/gcc: fix non-MIPS builds
The new MIPS-specific options are not valid for other targets.
Also, move the arch-specific setting lower in the extra_config setting.

Signed-off-by: "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
2011-07-03 22:32:36 +02:00
Yann E. MORIN"
d2d948a4ad cc/gcc: add MIPS spercific configure options
Add the following MIPS specific options when configuring gcc:
  --with(out)-llsc
  --with(out)-synci
  --with(out)-mips-plt
  --with-divide=type

Signed-off-by: "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
2011-06-27 18:04:50 +02:00
Yann E. MORIN"
71d5c495e9 cc/gcc: add option for linker hash style
Add an option to specify the hash type that gcc will ask the linker to use.
It is a provision for the upcoming 4.7, as no version currently supports it.

Signed-off-by: "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
2011-06-27 15:15:00 +02:00
Yann E. MORIN"
9c8bde853c cc/gcc: add build-id option
Add an option to configure gcc with --enable-linker-build-id.

Reported-by: Bryan Hundven <bryanhundven@gmail.com>
Signed-off-by: "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
2011-06-27 13:52:15 +02:00
Yann E. MORIN"
2dfb4412bf libc/eglibc: Add option that allows for getting svn over http://
Instead of getting eglibc over standard svn://svn.eglibc.org
Add an option that allows the user to get source from
http://www.eglibc.org/svn

This is useful if you are behind a firewall or proxy.
If you are behind a proxy, don't forget to configure
${HOME}/.subversion/servers

In the [global] section setup your proxy configuration.

Signed-off-by: Bryan Hundven <bryanhundven@gmail.com>
[yann.morin.1998@anciens.enib.fr: removed useless 'default n']
Signed-off-by: "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
2011-06-30 18:14:01 +02:00
Yann E. MORIN"
7197a56ae6 cc/gcc: remove --enable-symver option
That option is coming from the original crosstool, and is not entirely
understand here.

Moreover, it breaks with newer gcc-s: 4.6.1 now breaks while configuring
libjava (and probably some other libs as well, untested).

There is an related bug report to the gcc BZ:
  http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49555

If need be, the old behavior can be restored with:
  CC_CORE_EXTRA_CONFIG_ARRAY="--enable-symver=gnu"
  CC_EXTRA_CONFIG_ARRAY="--enable-symver=gnu"

Reported-by: Bryan Hundven <bryanhundven@gmail.com>
Reviewed-by: Bryan Hundven <bryanhundven@gmail.com>
Signed-off-by: "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
2011-06-28 23:46:04 +02:00
Bryan Hundven
6940a6c0eb glibc: Refactor startfiles/headers into do_libc_backend()
Refactor the contents of 'do_libc_start_files()' and 'do_libc()' into a
parameterized 'do_libc_backend()'. 'do_libc_start_files()' and 'do_libc()'
call 'do_libc_backend()' with either 'libc_mode=startfiles' or
'libc_mode=final' (respectively) so that the startfiles/headers and
the final libc builds are configured and built with the same options.

One example of where this is needed is when building a mips toolchain.
Previously, if you were building an n32 toolchain, you wouldn't have
noticed an issue, because if '-mabi' is not in CFLAGS, n32 is the
default:

http://sourceware.org/git/?p=glibc-ports.git;a=blob;f=sysdeps/mips/preconfigure;hb=HEAD

But when trying to build an o32 or n64 toolchain the build would
have failed. This is because (e)glibc expects "-mabi={o32,n32,n64}" to be
in CFLAGS, but was not previously provided in 'do_libc_start_files()'.
The build failure would happen in the shared-core gcc when it tries to
configure an n64 or o32 gcc with an n32 libc.

A simpler solution would have been to just add TARGET_CFLAGS to configure
in 'do_libc_start_files()', but this way makes configure and make
consistent for both steps.

Signed-off-by: Bryan Hundven <bryanhundven@gmail.com>
2011-06-26 03:26:54 -07:00
Yann E. MORIN"
b5225e3ff2 debug/cross-gdb: check host dependencies
Cross-gdb depends on expat and python. If either is missing, cross-gdb will
build successfully, but lacking some features.

Especially, if expat is missing, cross-gdb will be unable to parse the target
description, which may lead to runtime malfunctions and the following GDB
warning:
"Can not parse XML target description; XML support was disabled at compile time"

Hence, expat should be considered mandatory.

On the other hand, the features missing without python are not critical, so
python should not be considered mandatory.

This patch does the following:
 - At configure time, warn the user if either expat or python is missing.
 - In menuconfig, disable the static build options regarding cross-gdb if no
   static version of expat is available, and disable cross-gdb if expat is
   missing.

Signed-off-by: "Benoît THÉBAUDEAU" <benoit.thebaudeau@advansee.com>
[yann.morin.1998@anciens.enib.fr: add comment for impossible static cross-gdb]
Signed-off-by: "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
2011-06-08 15:47:43 +02:00
Yann E. MORIN"
39dedfbcb6 libc/glibc: do not try to download NPTL add-on
The NPTL add-on has always been internal, so there is no
reason to try downloading it, it will never succeed.
Add provision to skip other add-ons as well.

For consistency, do the same test in both glibc and eglibc.

Signed-off-by: "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
2011-06-04 17:15:58 +02:00
Benoît THÉBAUDEAU"
d147fbb201 kconfig: prepend CT-NG's version tag to PKGVERSION
"crosstool-NG-${CT_VERSION}" is currently the default for TOOLCHAIN_PKGVERSION,
and this options is passed as is to --with-pkgversion.

This patch prepends "crosstool-NG ${CT_VERSION}" to TOOLCHAIN_PKGVERSION before
passing it to --with-pkgversion.

Signed-off-by: "Benoît THÉBAUDEAU" <benoit.thebaudeau@advansee.com>
2011-06-03 17:21:56 +02:00
Yann E. MORIN"
7f504c6c27 functions: save & restore the static companion libraries install dir
Signed-off-by: "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
2011-06-02 22:30:55 +02:00
Yann E. MORIN"
3299aa7685 functions: fix downloading files
Signed-off-by: "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
2011-06-02 23:56:13 +02:00
Yann E. MORIN"
93b0db91b4 glibc: properly handle internal addons
Some addons are bundled with glibc/eglibc, so we should not try to
download and extract them.

This is done as thus:
 - at download time:
   - if the add-on download fails, keep going;
 - at extract time:
   - if the addon is present in the source tree, ignore it;
   - if the addon is missing in the source tree:
     - if the archive is present, extract it;
     - if the archive is missing, bail out.

Signed-off-by: "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
2011-05-30 23:05:28 +02:00
Yann E. MORIN"
3d6ce4cd3d libc/eglibc: use generic SVN functions
eglibc is only available from SVN. The script currently calls svn
in its own tortuous and convoluted way.

Use the egeneric SVN extract functions, and sinplify the eglibc
download function.

Signed-off-by: "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
2011-05-31 00:20:44 +02:00
Yann E. MORIN"
3304d5c077 scripts/functions: do not abort on failed svn
In case of eglibc, some add-ons that were previously external are
now internal (bundled with the main sources).

So we do not want to fail if an add-on can't be downloaded; we
want to post-pone the check until we can extract the main archive.

So:
 - try to retrieve the add-on
 - if it fails, print a warning instead of calling CT_Abort
 - return 1

So, components that want to catch the error and want to handle it can,
while components that do not will gracefuly fail thanks to our catching
every errors.

Bonus: it works without changing any existing retrieval procedure! :-)

Signed-off-by: "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
2011-05-31 00:57:36 +02:00
Yann E. MORIN"
1c3c90d0d4 scripts/functions: do not abort on failed extract
For glibc/eglibc, if the add-on can not be extracted, we want to catch
the error to print a meaningful error message.

So:
 - try to extract the tarball
 - if it fails, print a waring instead of calling CT_Abort
 - return 1

So, components that want to catch the error and want to handle it can,
while components that do not will gracefuly fail thanks to our catching
every errors.

Bonus: it works without changing any existing extract procedure! :-)

Signed-off-by: "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
2011-05-30 23:24:45 +02:00
Yann E. MORIN"
0c73370023 scripts/functions: do not abort on failed download
In case of glibc/eglibc, some add-ons that were previously external are
now internal (bundled with the main sources).

So we do not want to fail if an add-on tarball can't be downloaded; we
want to post-pone the check until we can extract the main archive.

So:
 - try to download the tarball
 - if it fails, print a warning instead of calling CT_Abort
 - return 1

So, components that want to catch the error and want to handle it can,
while components that do not will gracefuly fail thanks to our catching
every errors.

Bonus: it works without changing any existing retrieval procedure! :-)

Signed-off-by: "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
2011-05-30 23:24:11 +02:00