Commit Graph

46 Commits

Author SHA1 Message Date
Joshua Lock c4e2c59088 meta: remove True option to getVar calls
getVar() now defaults to expanding by default, thus remove the True
option from getVar() calls with a regex search and replace.

Search made with the following regex: getVar ?\(( ?[^,()]*), True\)

(From OE-Core rev: 7c552996597faaee2fbee185b250c0ee30ea3b5f)

Signed-off-by: Joshua Lock <joshua.g.lock@intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-12-16 10:23:23 +00:00
Zubair Lutfullah Kakakhel 559f52fe9c gcc-configure: Add mipsisa{32, 64}r6{el, } support
Add support for MIPS Release 6 ISA

(From OE-Core rev: 4c694d5bd29c406009332e3bd388e3f6a504d103)

Signed-off-by: Zubair Lutfullah Kakakhel <Zubair.Kakakhel@imgtec.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-10-07 16:43:57 +01:00
Saul Wold 1fe48d03f8 gcc-configure: Enable initfini-array
This adds the correct support for initfini-array which replaces .init
and .fini with .init-array and .fini-array.  There is no appreciable
size difference with this change.

The change is needed since configure will not correctly detect support
when building cross-compilers.

(From OE-Core rev: 9f8a075ab46691534e2b22d0a363b3c847394215)

Signed-off-by: Haitao Huang <haitao.huang@intel.com>
Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-09-20 15:11:09 +01:00
Andre McCurdy 4d80f7af9a gcc-configure-common.inc: drop --enable-target-optspace from configure
Configuring gcc with --enable-target-optspace (which causes gcc to
append "-g -Os" to the default CFLAGS_FOR_TARGET and so force libgcc
etc target libraries to always be optimised for size) dates back to
the very first commit in oe-core git in 2005 (for gcc 3.4.3).

Configuring gcc with --enable-target-optspace is not done widely
elsewhere (it's not used for Ubuntu or Fedora host gcc, the Linaro
binary toolchain or in Buildroot since early 2015). Sometime around
gcc 4.5.x it caused problems for powerpc and so was disabled for that
architecture:

  https://gcc.gnu.org/bugzilla/show_bug.cgi?id=43810

This patch removes --enable-target-optspace completely (ie powerpc is
no longer a special case) and allows optimisation of libgcc etc to be
controlled directly by the flags present in TARGET_CFLAGS.

(From OE-Core rev: 686b266506a1a56fb68ab0f00d658787dd7fe4ce)

Signed-off-by: Andre McCurdy <armccurdy@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-02-02 14:44:16 +00:00
Andre McCurdy 654eddce35 machine/include: drop tune-cortexm*.inc and tune-cortexr4.inc
The Cortex M1, M3 and R4 CPU tuning files are poorly tested (if at
all). They have no obvious users either inside or outside oe-core.

Until OE officially gains support for CPUs without an MMU, these
tuning files are probably better maintained outside of oe-core (e.g.
in a separate meta-nommu layer).

(From OE-Core rev: 7a1445c55de904115b950c8e50432a9f11f02208)

Signed-off-by: Andre McCurdy <armccurdy@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-02-02 14:44:16 +00:00
Andre McCurdy 102dfa15ab gcc-configure-common.inc: duplicate armv7a over-ride for armv7ve
(From OE-Core rev: 02c3ac6f066ccd1cbb6e457080bf10db5d6abfe0)

Signed-off-by: Andre McCurdy <armccurdy@gmail.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-01-15 11:54:48 +00:00
Andre McCurdy cae0e0fc60 gcc-configure-common.inc: add gcc-runtime ABI fixes for armv7m and armv7r
(From OE-Core rev: 55beb07da9120a2444fcc53bbe1b8f418dafb5aa)

Signed-off-by: Andre McCurdy <armccurdy@gmail.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-12-22 16:08:50 +00:00
Mark Hatle 920fb964d6 gcc: Update default Power GCC settings to use secure-plt
The gcc default, bss-plt, will cause errors when using the prelinker.  All
other distributions that I am aware of are using the the secure-plt.  For an
explanation of the differences, the gcc docs:

  Current PowerPC GCC accepts a `-msecure-plt' option that generates code
  capable of using a newer PLT and GOT layout that has the security
  advantage of no executable section ever needing to be writable and no
  writable section ever being executable. PowerPC ld will generate this
  layout, including stubs to access the PLT, if all input files (including
  startup and static libraries) were compiled with `-msecure-plt'.
  `--bss-plt' forces the old BSS PLT (and GOT layout) which can give
  slightly better performance.

The security of the new PLT and ability to run the prelinker outweigh
any performance penalty.

The secure-plt is enabled by default.  The old bss-plt can be enabled by
selecting 'bssplt' in the DISTRO_FEATURES.

(From OE-Core rev: 70c55aada1101a5c687cdaa79f370fa4530b39d9)

Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-11-16 11:39:34 +00:00
Robert Yang f1bf0b4cc1 gcc: remove EXTRA_OECONF_INTERMEDIATE
The gcc-intermediate had been gone, so remove EXTRA_OECONF_INTERMEDIATE.

(From OE-Core rev: 00ffc14c57598e845281e151589292573905b03c)

Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-07-12 22:55:46 +01:00
Robert Yang 775d467fe2 gcc-configure-common.inc: remove ac_cv_path_SED
It is not needed any more since sed-native had been dropped.

(From OE-Core rev: 289e433f8d0e4b5a710094e3a3c0d8e77e82e50d)

Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-02-08 08:00:25 +00:00
Mark Hatle 3bf5b6de3e arch-mips.inc: Change definition of TRANSLATED_TARGET_ARCH
[YOCTO #7230]

In certain system configurations TRANSLATED_TARGET_ARCH will not
expand in the right order for gcc-cross-candian-mips64n32 to be
generated properly.

This will cause SDKs to fail to generate properly.

Changing the global definition of TRANSLATED_TARGET_ARCH always
expands the ABIEXTENSION, which causes the OVERRIDES to pick it up
as well.  This effectively defines a new class of overrides for the 'n32'.

The side effect is that we need to duplicate some mips64 overrides, and
redefine others that were previously 'n32' or 'mips64' exclusive to have
the correct semantics.

(From OE-Core rev: 4b3a2b703b20583bd107f00a297d972e9bfb514a)

Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-01-29 15:36:49 +00:00
Richard Purdie f82156640b gcc: Rework shared work
The current implementation of shared work for gcc is at best confusing. It relies
on the fetch/unpack/patch tasks having exactly the same stamps and if this gets
broken for some reason, its hard to figure out what the problem is. It also
leads to complex code in bitbake.

The benefits of shared work for gcc are clear but a better approach is needed. This
patch adjusts things so that a single new recipe (gcc-source) provides the
fetch/unpack/patch/preconfigure tasks, the rest of gcc simply depends on these tasks
and have no fetch/unpack/patch tasks of their own.

This means we should get the significant benefits (disk usage/performance) of the
single source tree but in a way which has less potential for problems and is
easier for people to understand. The cost is an extra recipe/some inc files
which is probably a good tradeoff.

(From OE-Core rev: ceaa0a448dc5ebddb4f7fb94fb8a503a1c0248c3)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-12-03 12:23:56 +00:00
Richard Purdie 14ace86d50 gcc-configure/gcc-common: Move preconfigure definition to common include
There is a race where:

NOTE: recipe libgcc-initial-4.9.1-r0: task do_configure: Started
NOTE: recipe gcc-runtime-4.9.1-r0: task do_preconfigure: Started

| checking build system type... /home/pokybuild/yocto-autobuilder/yocto-worker/nightly-deb/build/build/tmp/work-shared/gcc-4.9.1-r0/gcc-4.9.1/libgcc/../config.sub: line 1711: syntax error near unexpected token `;;'
| /home/pokybuild/yocto-autobuilder/yocto-worker/nightly-deb/build/build/tmp/work-shared/gcc-4.9.1-r0/gcc-4.9.1/libgcc/../config.sub: line 1711: `		;;'
| configure: error: /bin/bash /home/pokybuild/yocto-autobuilder/yocto-worker/nightly-deb/build/build/tmp/work-shared/gcc-4.9.1-r0/gcc-4.9.1/libgcc/../config.sub x86_64-linux failed
| WARNING: exit code 2 from a shell command.

so we need to make sure the preconfigure task executes in all shared
work contexts.

(From OE-Core rev: 3c30331d6eaf804b83a6d27189a12efc94310e91)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-09-16 22:14:12 +01:00
Peter A. Bigot c0a071e16e gcc: update compiler architecture to match gcc-runtime (armv6, armv7a)
The gcc-runtime recipe builds the gcc libraries including libstdc++ with
$TARGET_CC_ARCH flags, which include -march=FOO flags that affect
whether atomic instructions are available.  This causes an ABI
incompatibility when the compiler by default generates code for less
capable architectures.  For example, gcc-runtime libraries on a
Cortex-A8 are built with a different C++11/C++14 mutex implementation
than is used code compiled outside OE and without architecture-specific
flags.

This commit fixes the problem specifically for ABI issues related to
atomic instructions available in ARMV6 and subsequent architectures.
Other ABI incompatibilities may remain in other architectures.

See: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=62100

(From OE-Core rev: 0ba6ab39f187ecd4261f08e768f365f461384a3a)

Signed-off-by: Peter A. Bigot <pab@pabigot.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-08-15 18:21:50 +01:00
Khem Raj 75191fcd7e gcc: Abstract long double configuration into python function
musl does not support IBM 128 long double for ppc, instead of
doing complex overrides move it into a pythong snippet which
is easier to read and more compact.

(From OE-Core rev: e7011429e40ae96b9c9f1e7f3c6f4c1f1102607f)

Signed-off-by: Khem Raj <raj.khem@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-08-15 18:21:50 +01:00
Peter A. Bigot 14a2d1eaa1 sdk: change EXTRA_OECONF_FPU to EXTRA_OECONF_GCC_FLOAT
This variable is used to ensure the proper version of --with-float=FOO
is passed to gcc's configure script.  gcc also has a --with-fpu=FOO
option that means something different.  To avoid confusion, change the
names to be consistent.

(From OE-Core rev: c17d883fa99b6967d83c3796d22fc0c1dbe704e6)

Signed-off-by: Peter A. Bigot <pab@pabigot.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-08-15 18:21:50 +01:00
Peter A. Bigot 6d78f392f5 gcc: recipe whitespace changes
Consistent use of whitespace in multi-line assignment, with special
focus on OECONF modifications.  Quotes on separate lines, four-space
indentation, one value per line.

(From OE-Core rev: d971db8b2259e4c35b871cccf130fba193849560)

Signed-off-by: Peter A. Bigot <pab@pabigot.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-08-15 18:21:49 +01:00
Richard Purdie 79a3a77680 gcc-configure-common: Address problems with gengtype
The gengtype patch we apply to gcc aims to ensure that the build and host
config headers don't get confused. We're seeing build failures where
both headers have been included, likely due to a race over the configuration
files.

It seems the gengtype-lex.c file isn't being regenerated when it should
and the unconditional inclusion of bconfig.h is resulting in these issues.

The fix is therefore to remove the file, forcing its regeneration.

[YOCTO #6393]

(From OE-Core rev: dd649374b30eb2d9980dce6eae95db0563593ef7)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-06-17 08:59:03 +01:00
Richard Purdie fe5bc386f6 gcc: Clean up configure_prepend and fix for mingw
The do_configure_prepend was duplicated in gcc-4.X.inc and
gcc-configure-common.inc leading to confusion when reading the resulting
do_configure task where the file was processed twice.

The only difference was the removal of the include line for gcc 4.8/4.9.

On mingw were were seeing two issues, firstly that the if statements meant
the values we wanted weren't being set, the second that the include
paths were still wrong as there was no header path set.

To fix the first issue, the #ifdef conditionals were removed, we want
to set these things unconditionally. The second issue is addressed by
setting the NATIVE_SYSTEM_HEADER_DIR variable here (it was already
set in t-oe).

(From OE-Core rev: db44be06c75f2ac17a55dd1764471e869e872b8b)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-06-01 14:29:30 +01:00
Richard Purdie 075e2884ce gcc-common: Only apply fpu settings to target gcc
Within the OE build environment, we supply the correct fpu settings. These
only need to be spelt out for the on-target gcc.

Doing this means the checksums for the core compiler don't depend on the fpu
settings. We exclude the compiler tunes for similar reasons, it doesn't need
to influence the compiler build.

(From OE-Core rev: ce1f3fd20d81545d6d5dfc68f86f9fddf8ac9bbf)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-05-02 20:46:58 +01:00
Richard Purdie ecf2a8cecf gcc: Drop ARCH_FLAGS_FOR_TARGET usage
As far as I can tell this variable is now completely unneeded. It would
only ever get used in target builds and these are now correctly done
in the target environment namespace, not any of our cross environments.
As such, CC and other variables contain the correct compilers and other
tune options and these are correctly picked up when building libgcc,
libstdc++ and others.

I tried to figure out where else these would make any sense and couldn't
find anything. Builds appear fine without them so lets drop the complexity
including the patch adding in this flag to gcc.

(From OE-Core rev: 5484596f4252e707ff791feedf143a72dbb613f6)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-04-30 16:39:06 +01:00
Richard Purdie f07b7c0da1 gcc-common/gcc-configure-common: Move gnu-configize to its own shared task
This command modifies ${S} and can race against other tasks running do_configure and
having the scripts disappear from under them. To avoid this move to its own
task and work on the shared work directory as a common task.

It needs to be a python task to avoid lots of shell exported variables as
dependencies.

(From OE-Core rev: 55ed9ffbab5118140baac5d0d29dcc919e1f1668)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-04-30 16:39:06 +01:00
Otavio Salvador 4c14b09498 Globally replace 'base_contains' calls with 'bb.utils.contains'
The base_contains is kept as a compatibility method and we ought to
not use it in OE-Core so we can remove it from base metadata in
future.

(From OE-Core rev: d83b16dbf0862be387f84228710cb165c6d2b03b)

Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-04-25 17:19:19 +01:00
Richard Purdie 32edeb391f gcc/libtool/perl: Fix various path to sed-native problems
If sed-native is built before these programs, hardcoded paths to sed-native
can end up in scripts and other parts of the system which may cause issues
if they are later used from sstate and sed-native is not installed.

To avoid this, this patch changes the global site configuration to
specify that plain "sed" is fine to be used. We need to spell this
out for gcc since it doesn't see the site files since we don't autoreconf
it. We can remove the values from libtool. We tell perl to use "/bin/sed"
since it requires a path and the system sed should be just fine for it.

[YOCTO #4971]

(From OE-Core rev: 2ec171cb188601bf18c6c2895870907024b1c52a)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-09-26 16:37:56 +01: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
Phil Blundell 0c340611de gcc-configure-cross: factor out --enable-threads argument into ${GCCTHREADS}
This allows BSPs for architectures with no thread support to set (for
example) "GCCTHREADS=no" without having to override all the other configure
parameters.

(From OE-Core rev: 6bb0d37529a82b953d374f2d76c2412d7cee587b)

Signed-off-by: Phil Blundell <pb@pbcl.net>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-09-26 15:02:26 +01:00
Matthew McClintock fd9a9a2a9a gcc-configure-common.inc: use --with-long-double-128 on powerpc to comply with ABI
(From OE-Core rev: 243539efec94e79dade2525d0ab3586eea48c529)

Signed-off-by: Matthew McClintock <msm@freescale.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-07-11 11:35:52 +01:00
Richard Purdie e3b3aaf4c7 gcc: fix collect2 host contamination problem properly
We added the autoconf cache line a while back to ensure that configure doesn't
poke into some hardcoded host paths looking for things it shouldn't. Applying
it as part of do_configure wasn't getting it to the do_compile tasks
where much of the configure scripts are run by gcc. This changes it to a simple
export to ensure it reaches the places it needs to and truly gets rid of
the cross compile badness messages from the logs.

(From OE-Core rev: af58d5c3a5c5e632aa20b1d007d47dbbfb4ed6e6)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-07-05 12:36:45 +01:00
Khem Raj 6174900a0e gcc-4.6, gcc-4.7: Add support for building mips64 cross compiler
Defaults to n64 ABI

(From OE-Core rev: 253f1f3aebd1a90c55efcc6d1f585204e7f3c371)

Signed-off-by: Khem Raj <raj.khem@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-05-21 09:59:02 +01:00
Khem Raj 173f424808 gcc-configure-common.inc: Use libc-uclibc override
Its better than duplicating the overrides

(From OE-Core rev: 7159dad19f8cfd3e7e95523da63e91370744da7f)

Signed-off-by: Khem Raj <raj.khem@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-04-30 11:37:24 +01:00
Khem Raj 9ce94ea4a4 gcc-configure: Render --with-local-prefix harmless
this option by default points to /usr/local no matter
what so we cant let it sit on sidelines otherwise it
will access host machine's /usr/local which may not
be desired. So disable this option. This also helps in making
gcc's shared state more consistent

(From OE-Core rev: eee3658366e1ae9d3e429b3d3c968938d8d0f00e)

Signed-off-by: Khem Raj <raj.khem@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-04-30 11:37:23 +01:00
Khem Raj f66cc57e72 gcc-configure: Pass distinct target flags
When building gcc-cross-canadian libgcc is built using
headers from gcc-crosssdk and not the target sysroot
because we do not pass proper CFLAGS for target bits
so it ends up using CFLAGS that were meant for compiling
canadian gcc itself. It does not show up as a problem
when building SDK with eglibc because eglibc-nativesdk
and eglibc have identical headers. The problem shows
up clearly when you try to build uclibc based meta-toolchain
since then nativesdk libc and target libc are different

(From OE-Core rev: 0e904103e9bd7fdb31bfcc129067511f9f45701b)

Signed-off-by: Khem Raj <raj.khem@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-04-30 11:37:23 +01:00
Richard Purdie 2ddf7d3e83 gcc-configure-common.inc: Stop gcc looking at build system paths
There were puzzling failures when you make a force recompile of any gcc
component. The error was in do_configure with cross-compilation badness
being detected in config.log files.

gcc is different in that many of the config.log files are generated during
the do_compile phase. This means this host contamination issue has always
been present but only shows up on a rebuild.

The fix is to force the appropriate configuration variable to "none required"
then gcc won't look in the bad locations.

[YOCTO #2279]

(From OE-Core rev: e7135f14f3ef37f93f5c28b319464f3d6dd9b8da)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-04-15 18:09:57 +01: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
Richard Purdie 36e918b8a8 Quoting fixes
We have various variables which are either not quoted at all or are half
quoted. This patch fixes the bad exmaples so everything is consistent.

(From OE-Core rev: 30253358f5e76fb7b25be27198b4c125e0dbdf2c)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-02-26 12:52:12 +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 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
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 be1f70d68b gcc: Fix setting of GLIBC_DYNAMIC_LINKER
The sed regex in do_configure_prepend was producing the following result:

 #define GLIBC_DYNAMIC_LINKER64 SYSTEMLIBS_DIR "/lib64/ld-linux-x86-64.so.2"

instead of removing the leading "/lib" or "/lib64".

Now we have it do:

 #define GLIBC_DYNAMIC_LINKER64 SYSTEMLIBS_DIR "ld-linux-x86-64.so.2"

Additionally, with the regex fixed the manipulation of SYSTEMLIBS_DIR
needs to be removed.

(From OE-Core rev: b343436d03fa5690b16ee8ef5d4a738c5194b301)

Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-08-03 17:46:47 +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
Khem Raj 3909b764b7 recipes: Use -uclibceabi instead of -uclibcgnueabi
(From OE-Core rev: 3aa429406184d27bdb8a771c4c12bde1dcccb95b)

Signed-off-by: Khem Raj <raj.khem@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-04-04 14:09:33 +01:00
Kevin Tian 2a066e7ca9 gcc: fix check for target libc ssp support
gcc uses hardcoded path "${with-build-sysroot}/usr/include" to check target
libc ssp support. Based on GLIBC version strings in features.h in that search
path, gcc knows whether target (e)glibc implements stack protector itself.

However this breaks meta-toolchain, which actually has target libc headers
installed under {with-build-sysroot}/opt/... This way features.h is not found
and thus gcc-crosssdk-intermediate thinks that target (e)glibc doesn't support ssp.

Later when building eglibc-nativesdk, undefined reference to "__stack_chk_guard"
occurs which was caused by:

  o eglibc do_configure found that gcc-crosssdk-intermediate supports ssp,
    and thus enable -fstack-protector for nscd

  o eglibc itself supports stack smash proctection for some architectures such
    as i386, x86-64, etc. It's expected to use its own method to provide stack
    protection, instead of relying on gcc. So eglibc rtld.os doesn't export
    __stack_chk_guard to other modules

  o then when installing nscd objects, gcc-crosssdk-intermediate sees the
    flag "-fstack-protector", while it thought this eglibc doesn't implement
    ssp itself, so gcc turns to the alternative to find a valid
    __stack_chk_guard exported. eglibc doesn'g export it, while
    gcc-crosssdk-intermediate itself disables libssp.

Then the undefined reference happens. If enabling libssp for gcc-crosssdk-
intermediate, it may also work-around this issue. But the ideal fix is still
to replace hard coded path with the actual one where target libc gets installed.

glibc-nativesdk doesn't encounter this issue because it thinks gcc doesn't
support ssp, and thus doesn't enable "-fstack-protector" for nscd. Don't know
the reason yet

This fix [BUGID #366]

Signed-off-by: Dexuan Cui <dexuan.cui@intel.com>
Signed-off-by: Kevin Tian <kevin.tian@intel.com>
2010-09-30 10:18:00 -07:00
Dongxiao Xu ce456306da gcc: enable poison parameters detection
If not configured with --enable-target-optspace, gcc will report
errors if there is '-Os' optimization in parameters.

This fixes [BUGID #342]

Also add "--enable-target-optspace" option to arm gcc configuration.

Signed-off-by: Dongxiao Xu <dongxiao.xu@intel.com>
2010-09-27 08:59:15 -07:00
Dongxiao Xu 0ff070bbf1 gcc: upgrade gcc for powerpc to version 4.5.0
Fix one parameter order issue for base_contains function,
which impacts glibc build under new gcc.

Add new judge code to determine whether <altivec.h> is needed.
This fixes the mpeg2dec build failure under new gcc.

Use O2 as the optimization flag to tinylogin as it will meet
segfault if compiled by gcc-4.5.0 when enable both frename-registers
and Os options. Use O2 instead.

Signed-off-by: Dongxiao Xu <dongxiao.xu@intel.com>
2010-09-17 11:41:58 -07: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