Commit Graph

34 Commits

Author SHA1 Message Date
Richard Purdie 8ebe7be3d9 bitbake.conf/package: Collapse PKGDATA_DIR into a single machine specific directory
Currently we have a hierarchy of pkgdata directories and the code has to put together
a search path and look through each in turn until it finds the data it needs.

This has lead to a number of hardcoded paths and file globing which
is unpredictable and undesirable. Worse, certain tricks that should be
easy like a GL specific package architecture become problematic with the
curretn search paths.

With the modern sstate code, we can do better and construct a single pkgdata
directory for each machine in just the same way as we do for the sysroot. This
is already tried and well tested. With such a single directory, all the code that
iterated through multiple pkgdata directories and simply be removed and give
a significant simplification of the code. Even existing build directories adapt
to the change well since the package contents doesn't change, just the location
they're installed to and the stamp for them.

The only complication is the we need a different shlibs directory for each
multilib. These are only used by package.bbclass and the simple fix is to
add MLPREFIX to the shlib directory name. This means the multilib packages will
repackage and the sstate checksum will change but an existing build directory
will adapt to the changes safely.

It is close to release however I believe the benefits this patch give us
are worth consideration for inclusion and give us more options for dealing
with problems like the GL one. It also sets the ground work well for
shlibs improvements in 1.6.

(From OE-Core rev: 1b8e4abd2d9c0901d38d89d0f944fe1ffd019379)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-09-14 08:21:00 +01:00
Richard Purdie 9bfd92243e gcc-common: Exclude AVAILTUNES from sstate checksums
AVAILTUNES is only used as a sanity check, we don't need to
include it in the sstate checksum in this case. If included
it can cause problems when switching machines with a common
package architecture.

[YOCTO #3667]

(From OE-Core rev: b1cc5a4055c6402595eac1a93eac4c946210d130)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-03-18 13:18:21 +00:00
Matthew McClintock 8e105385e0 gcc-common.inc: handle case where tune is not defined
(From OE-Core rev: d3eab8b17f8e50f99042a7a8f43db94640c53d41)

Signed-off-by: Matthew McClintock <msm@freescale.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-03-05 13:14:51 +00:00
Constantin Musca 703b70c98a gcc: enable multilib for target gcc
- add a task to setup multilib configuration for target gcc
- this commit adapts Nitin Kamble's work to gcc 4.7
- use a hash for storing arch-dependent multilib options
- patch gcc in order to use the multilib config files from the
build directory

Tests:
root@qemux86-64:~# gcc -m64 t.c -o t
root@qemux86-64:~# file t
t: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.16, not stripped
root@qemux86-64:~# ./t
Hello World !
root@qemux86-64:~# gcc -m32 t.c -o t
root@qemux86-64:~# file t
t: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.16, not stripped
root@qemux86-64:~# ./t
Hello World !

[YOCTO #1369]

(From OE-Core rev: b26819c85881e82ee1b5c68840011e78c321f18e)

Signed-off-by: Constantin Musca <constantinx.musca@intel.com>
Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-02-01 15:54:31 +00:00
Richard Purdie 6177bfb408 gcc: Use FILESPATH instead of FILESDIR and cleanup/simplify
(From OE-Core rev: 4cb359182da00e661fda11a8b31e3611b0df03cb)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-11-21 16:56:01 +00:00
Richard Purdie 66861cce91 Revert "gcc: Use FILESPATH instead of FILESDIR and cleanup/simplify"
This reverts commit 90616875b4. It was
never meant to be applied as its an incorrect previous development
verison of a patch in progress.
2012-11-20 16:47:11 +00:00
Richard Purdie 90616875b4 gcc: Use FILESPATH instead of FILESDIR and cleanup/simplify
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-11-19 21:18:52 +00:00
Khem Raj d02f02950e gcc-common.inc: Consider multilib when renaming libgcc for debian'ness
When doing multilib builds rpm does not find libgcc1 for lib32
multilib because its not honoring the debian renaming scheme for
libgcc-multilib. Lets add MLPREFIX to fix it.

(From OE-Core rev: 9327ca868667b15f29af3123611d6f56b4249a63)

Signed-off-by: Khem Raj <raj.khem@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-09-25 10:41:27 +01:00
Khem Raj df74f8d9a8 gcc: Use 4.7.2 release tarball
This avoids the SVN or git fetcher issues for gcc
and the tar is mirrored around the world so it will
not be slow

Fixes [YOCTO #2908]

(From OE-Core rev: 5e03d1e83d0536a2fc69a88d3e5407108836203f)

Signed-off-by: Khem Raj <raj.khem@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-09-21 14:55:32 +01:00
Richard Purdie 3c101af5e3 bitbake.conf/gcc-common.inc: Fix STAMPCLEAN expression
The globs used for STAMPCLEAN were too greedy matching gcc-cross-initial
stamps for gcc-cross for example. This patch resolves that problem making
the assumption that PV starts with something numeric. This assumption
should hold in most cases and has a better failure case that the current
situation.

(From OE-Core rev: d7fbc70b6c6ac629d2a23ac16ab45461f88b4b26)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-09-21 14:20:18 +01:00
Richard Purdie 3d6229535c bitbake.conf/gcc: Add clean masks for stamp files
This takes advantage of new bitbake functionality to clean up stale stamp
files when creating new stamp files.

[YOCTO #2961]

(From OE-Core rev: e21b6c04e512a3bc2339a20045b7041f1d26e859)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-09-20 11:52:35 +01:00
Khem Raj aa31bcbbc0 gcc: Convert do_headerfix into a definitive patch
do_headerfix task is essentially editing configuration
headers in sources which can well be maintained as a
patch which is easier to spot errors (if any) than
dynamically edited source tree

(From OE-Core rev: ddd344e9acef88d614473581266569ce14716ccc)

Signed-off-by: Khem Raj <raj.khem@gmail.com>
Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-07-17 10:54:01 +01:00
Kartik Mohta d0900924a6 gcc-common: Don't use "is" for comparing strings, use "=="
Needed because the equality check was failing here even though upon
printing the LHS and RHS were the same.
As per http://stackoverflow.com/a/2987975/64537, using "is" compares the
memory addresses of the two objects which is not what we want here. We
just want to compare the values.

(From OE-Core rev: 7fd82cc90a48302ed42b6bfa962bb0de2c652b45)

Signed-off-by: Kartik Mohta <kartikmohta@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-07-09 16:58:56 +01:00
Khem Raj 4b55c928c1 gcc-common: Replace use of TARGET_ARCH with TRANSLATED_TARGET_ARCH
TARGET_ARCH is poured into TRANSLATED_TARGET_ARCH
for gcc-cross family or gcc-crosssdk family
of recipes we have to check for TRANSLATED_TARGET_ARCH

(From OE-Core rev: 03f7322b1f4e1b1cf465a46cba3b82573384ab9e)

Signed-off-by: Khem Raj <raj.khem@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-06-11 13:49:51 +01:00
Khem Raj 53981ad824 gcc-common: Enable hardfloat ABI when target is arm
We need to check target to be arm before enabling hard-float
ABI. There are crossdk targets or candian-cross targets built
for arm and we should not enable it for those class of recipes.

(From OE-Core rev: f48bb903218e14ba15dab452e8bb43ba25b9ea44)

Signed-off-by: Khem Raj <raj.khem@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-06-11 13:49:51 +01:00
Khem Raj 23fd086b6e gcc: Grok for callconvention-hard to enable hard float
If callconvention-hard is set then we build gcc defaulting
to hard-float ABI

(From OE-Core rev: 88dee5cf5265d3ea26fc9d471fc6155e48935dc7)

Signed-off-by: Khem Raj <raj.khem@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-05-24 08:51:35 +01:00
Richard Purdie b1aeaa8b0d meta: Replace bb.data.expand(xxx, d) -> d.expand(xxx)
sed \
 -e 's:bb.data.\(expand([^,()]*\), *\([^) ]*\) *):\2.\1):g' \
 -i `grep -ril bb.data.expand *`

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-03-05 10:23:53 -08:00
Richard Purdie 06f2f8ce0a meta: Convert getVar/getVarFlag(xxx, 1) -> (xxx, True)
Using "1" with getVar is bad coding style and "True" is preferred.
This patch is a sed over the meta directory of the form:

sed \
 -e 's:\(\.getVar([^,()]*, \)1 *):\1True):g' \
 -e 's:\(\.getVarFlag([^,()]*, [^,()]*, \)1 *):\1True):g' \
 -i `grep -ril getVar *`

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-03-05 10:22:56 -08:00
Lianhao Lu ab5eed4af1 gcc: Excluding the DATE/SRCDATE from do_patch dependency.
Corrected the error introduced by commit afb400e of dropping
DATE/SRCDATE out of the vardepsexlude list of do_patch.

(From OE-Core rev: 6546096d068b51cc9cf4557cdb35aee6f62838d5)

Signed-off-by: Lianhao Lu <lianhao.lu@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-02-21 17:59:36 +00:00
Lianhao Lu a2a03ba68b gcc: Ensure same sstate hashes for shared soruce directory
Ensure do_patch have the same sstate hashes for nativesdk variants of
gcc family recipes, since they share the same source directory.

(From OE-Core rev: afb400e9c3ddac604906bde44df5da29a6c134d9)

Signed-off-by: Lianhao Lu <lianhao.lu@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-02-10 14:38:46 +00:00
Richard Purdie 6b2cb82802 gcc-common.inc: Fix comment
(From OE-Core rev: a4a98b6d6273d4e716afbff0880d0ac2ff7be0a9)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-01-24 14:38:39 +00:00
Richard Purdie ef3c1dd356 gcc-common.inc: Ensure WORKDIR doesn't adversly affect sstate checksums
Changes in WORKDIR were changing the do_patch stamps between gcc-crosssdk
and gcc-cross. This excludes the variable since in this case, we don't
need want those changes to affect the signatures.

(From OE-Core rev: 0de85d2ca3bc9674323302a35995dfddb6044a71)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-01-24 12:19:01 +00:00
Richard Purdie 280e5fd212 gcc: Ensure that the shared source directory shared the same sstate hashes
The fetch/unpack/patch/headerfix tasks are shared and hence their sstate hashes
should also match. Sadly this is not the case since:

a) gcc-runtime applies an additional patch
b) The do_headerfix task was missing from libgcc
c) The do_headerfix task is a shell task and hence depends
   on all exported variables which can vary between cross and target
   recipes.

To fix this, the patch moves the patch to the common code, adds
the headerfix task to a common include file and disabled shell
dependencies on the do_headerfix task since its clear in this case
we don't need thsoe dependencies since we just call sed.

With this patch applied, all these recipes now share common sstate checksums.

(From OE-Core rev: 2c4569801a710f34a695b8d2a0ee7fc127fb34e4)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-01-23 09:01:38 +00:00
Julian Pidancet a4b7188efd Fix multiarch DISTRO_FEATURE
Make get_gcc_multiarch_setting more elegant. Use a dictionnary
to store the config options and replace bb.data.getVar with d.getVar.
Remove i686 from the architecture list because it doesn't seem
to be a valid TARGET_ARCH any more in OE.
Configure gdb (gdb and gdb-cross) with --enable-64-bit-bfd if
multiarch DISTRO_FEATURE is present

(From OE-Core rev: 0b42b2fc118bef8ce0d1473b146673182f5d1f78)

Signed-off-by: Julian Pidancet <julian.pidancet@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-11-30 23:36:08 +00:00
Julian Pidancet 7edf5cff9c Introduce multiarch DISTRO_FEATURE
This patch introduces a distro feature which enables gcc to produce
both 32bit and 64bit code, and enables binutils to operate on both
32bit and 64bit binaries. It differs from multilib toolchains in
that it does not require to compile a version of the libc for each
architecture variant. However, the code produced for the secondary
architecture will not be linkable against the libc.

v2: - Renamed the feature name from "biarch" to "multiarch". The GCC
installation manual claims that the mips-linux can be made a tri-arch
compiler (http://gcc.gnu.org/install/configure.html)
    - For x86_64, the compiler is made bi-arch by default, so nothing
has to be done in particular.
    - I analyzed the gcc/config.gcc from GCC sources and added in this
patch all the architectures that could be made biarch with the version
of gcc currently used in OE, which are powerpc, and sparc, in addition
to x86. mips and s390 will probably be supported in future versions of
gcc. For x86 and sparc, only the --enable-targets=all option is valid
to make this work (this option doesn't have any other side effects than
making the compiler bi-arch). For powerpc, I used the
--enable-targets=powerpc64 option (although 'all' also works).

Note: - Untested on powerpc and sparc. But I believe it works the same
as with x86.
      - gcc in meta-toolchain is also made multiarch.

(From OE-Core rev: 99e295ef30ba02db3966c66619807c037ef5089f)

Signed-off-by: Julian Pidancet <julian.pidancet@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-11-29 11:22:06 +00:00
Richard Purdie c8dee9b92d Convert to use direct access to the data store (instead of bb.data.*Var*())
This is the result of running the following over the metadata:

sed \
-e 's:bb.data.\(setVar([^,()]*,[^,()]*\), *\([^ )]*\) *):\2.\1):g' \
-e 's:bb.data.\(setVarFlag([^,()]*,[^,()]*,[^,()]*\), *\([^) ]*\) *):\2.\1):g' \
-e 's:bb.data.\(getVar([^,()]*\), *\([^(), ]*\) *,\([^)]*\)):\2.\1,\3):g' \
-e 's:bb.data.\(getVarFlag([^,()]*,[^,()]*\), *\([^(), ]*\) *,\([^)]*\)):\2.\1,\3):g' \
-e 's:bb.data.\(getVarFlag([^,()]*,[^,()]*\), *\([^() ]*\) *):\2.\1):g' \
-e 's:bb.data.\(getVar([^,()]*\), *\([^) ]*\) *):\2.\1):g' \
-i `grep -ril bb.data *`

(From OE-Core rev: b22831fd63164c4db9c0b72934d7d734a6585251)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-11-10 11:51:19 +00:00
Robert Yang b6bd7133c2 bitbake meta-toolchain with gcc 4.5.1 failed
Fixes bug [YOCTO #1386]

1) Add the following lines to conf/local.conf:

SDKGCCVERSION="4.5.1"
GCCVERSION="4.5.1"

2) bitbake meta-toolchain

The we will notice the error that sed can't find the directory:

${TMPDIR}/work-shared/gcc-${PV}/gcc-${PV}-${PR}

we had changed the name of S from gcc-${PV} to gcc-${PV}-${PR}, but didn't
update meta/recipes-devtools/gcc/gcc-common.inc, so fix S in gcc-common.inc
would make it work.

(From OE-Core rev: 282773ff3e0f365c08ae7e8fe759029f33e575b1)

Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-08-23 18:23:33 -07:00
Richard Purdie 8f8facbed4 gcc: Various fixups to ensure consistent gcc builds
We ensure that:
* the shared work directory contains PR and ensure PR values are consistent across gcc builds
* the regexp to handle library directories is in a specific task and run once

This avoids breakage that was seen in incremental builds after commit
be1f70d68b where the interpretor could
become corrupted. This was due to the sed expression corrupting
the source directory.

(From OE-Core rev: 970af6b09e1d69041b0d82fa56ace19543405eb1)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-08-11 19:08:02 +01:00
Kumar Gala e10a1d6cd3 gcc: Add gcc configure for PowerPC e500v2/SPE embedded floating point ABI
The e500v2 core utilizes a unique floating point programming model / ABI.
We utilize TARGET_FPU = "ppc-efd" to distinguish this choice (Embedded
scalar single-precision floating-point).  When building the toolchain for
this ABI we need configure gcc with --enable-e500_double.

(From OE-Core rev: 5136c4ad6279c1593301f6dde9b959ad26a2fd0f)

Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-07-20 15:27:34 +01:00
Robert Yang 3e08c1f078 Share gcc work directories
This patched is derived from Richard, make gcc use the shared source
directory during the different building:

1) Make gcc-cross, gcc-cross-initial, gcc-cross-intermediate and
   gcc-runtime share the same source directory.

2) The source directory is ${TMPDIR}/work-shared/gcc-${PV}, for example:
   tmp/work-shared/gcc-4.5.1

3) Fix do_clean to clean the shared source directory and stamps

4) gcc uses sed and creates config files against ${S} which means the
   directory should not be shared. Change the way to make it work:

   * The configure option --with-headers=${STAGING_DIR_TARGET}${SYSTEMHEADERS}
     can replace the sed command, see the code in configure:

        if test "x$with_headers" != x; then
          glibc_header_dir=$with_headers

    This has the same effect as the sed command:

    sed -i 's:^\([  ]*\)glibc_header_dir=\"${with_build_sysroot}/usr/include\": ...

    so add the --with-headers=${STAGING_DIR_TARGET}${SYSTEMHEADERS} to
    gcc-configure-cross.inc( not add to gcc-configure-common.inc, since
    not all the gcc building need this, the one which has its own do_configure
    doesn't need it).

   * Move t-oe from ${T} to ${B}/gcc, so that the patched Makefile.in
     can read it easily, please see the commit for gcc-4.5.1 and
     gcc-4.6.0.

   * Use the defaults.h in ${B}/gcc instead of ${S}/gcc, and the patched
     configure.ac(configure) can read it correctly, please see the
     commit for gcc-4.5.1 and gcc-4.6.0.

   * The gcc-crosssdk.inc used sed to edit ${S}/config/*/linux*.h
     to change the GLIBC_DYNAMIC_LINKER, which made the source
     incompatible. To make the source compatible:
     - Use:
	 sed -i ${S}/gcc/config/*/linux*.h -e \
		's#\(GLIBC_DYNAMIC_LINKER[^ ]*\)\( *"/lib.*\)#\1 SYSTEMLIBS_DIR\2#'

	so entries in the files that look like:
	#define GLIBC_DYNAMIC_LINKER64 "/lib64/ld-linux-x86-64.so.2"
	would become
	#define GLIBC_DYNAMIC_LINKER64 SYSTEMLIBS_DIR"/ld-linux-x86-64.so.2"
	and we define SYSTEMLIBS_DIR in defaults.h.

	NOTE:
	#define GLIBC_DYNAMIC_LINKER64 (SYSTEMLIBS_DIR "/ld-linux-x86-64.so.2")
	doesn't work in in the following define:
	#define LINUX_DYNAMIC_LINKER \
  		CHOOSE_DYNAMIC_LINKER (GLIBC_DYNAMIC_LINKER, UCLIBC_DYNAMIC_LINKER)
	so use
	#define GLIBC_DYNAMIC_LINKER64 SYSTEMLIBS_DIR"/ld-linux-x86-64.so.2"

5) Add do_configure_prepend to gcc-configure-common.inc and remove the
   one in gcc-crosssdk.inc, this makes it easy to share the source,
   otherwise we need do extra changes in gcc-configure-sdk.inc.

6) Use "cat > file <_EOF" to replace the "echo > file"

(From OE-Core rev: 934d38530c9a67562e53d4034aee5531f0f26750)

Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-06-30 20:56:33 +01:00
Richard Purdie e41671ea1d Revert "bitbake/gcc: Enable a shared common source tree"
This reverts commit 12b163dbd8 as it
was an unintended change for master
2011-03-29 00:34:11 +01:00
Richard Purdie 12b163dbd8 bitbake/gcc: Enable a shared common source tree
This patch is a quick proof of concept to show how source code could
be shared between recipes which use ${B} to have a separate build
directory compared to source directory ${S}.

Issues:

a) gcc uses sed and creates config files against ${S} which means
the directory should not be shared. Need to change the way that works.

b) Could be extended to cover eglibc except there is a patch applied
against nativesdk versions which again makes the source incompatible.

c) Need to clean up the layout in work-shared and make a directory level deeper
to ensure patch separation.

d) clean task does not remove stamps

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-03-28 15:09:50 +01:00
Richard Purdie 96aeec41bc meta: Update mirror urls to new format and update yocto project urls
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-02-11 12:04:12 +00:00
Richard Purdie 29d6678fd5 Major layout change to the packages directory
Having one monolithic packages directory makes it hard to find things
and is generally overwhelming. This commit splits it into several
logical sections roughly based on function, recipes.txt gives more
information about the classifications used.

The opportunity is also used to switch from "packages" to "recipes"
as used in OpenEmbedded as the term "packages" can be confusing to
people and has many different meanings.

Not all recipes have been classified yet, this is just a first pass
at separating things out. Some packages are moved to meta-extras as
they're no longer actively used or maintained.

Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-08-27 15:29:45 +01:00