Commit Graph

11 Commits

Author SHA1 Message Date
Richard Purdie dab511c36d gcc: Add support for nativesdk-gcc
Being able to build a nativesdk gcc is useful, particularly in cases
where the host compiler may be of an incompatible version (or a 32
bit compiler is needed).

Sadly, building nativesdk-gcc is not straight forward. We install
nativesdk-gcc into a relocatable location and this means that its
library locations can change. "Normal" sysroot support doesn't help
in this case since the values of paths like "libdir" change, not just
base root directory of the system.

In order to handle this we do two things:

a) Add %r into spec file markup which can be used for injected paths
   such as SYSTEMLIBS_DIR (see gcc_multilib_setup()).
b) Add other paths which need relocation into a .gccrelocprefix section
   which the relocation code will notice and adjust automatically.

This patch adds tweaks to the relocation script to handle the
new section too.

(From OE-Core rev: cd3d874fced2ee4c950d9964d30c0588fd8772e7)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-07-31 10:32:37 +01:00
Andre McCurdy a1bb764921 gcc: update i586 TARGET_ARCH tests to also handle i686
(From OE-Core rev: 589bad6e9213136e7f30b4eafb7abfdd10070d1a)

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-07-08 00:01:21 +01:00
Mark Hatle fb8e2a860e gcc: Fix gcc-multilib-config comparison
Fix an issue on a multilib configuration that contains more then 1 multilib.

I.e. on MIPS64:

DEFAULTTUNE = "mips64"
MULTILIBS = "lib32n:mips64_n32 lib32:mips32"

While normally you'd use 'libn32', the above is legal.

With the startswith code, the system will look to expand the 'lib32' element
and find the 'lib32n' instead, and will result in a warning:

lib32 doesn't have a corresponding tune. Skipping...

(From OE-Core rev: ced919f6013fc0dbb8b8f75f87a8c0a4f416b1fe)

Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-08-02 09:26:17 +01:00
Richard Purdie c6211d82f6 gcc-multilib: Simply/fix MULTILIB_OPTIONS handling
MULTILIB_OPTIONS takes the parameters which trigger a given multilib to be
selected. It supports *one* option per multilib, '/' separated. Spaces
separate options used to generate additional multilib combinations.

Adding in all of CFLAGS to this is therefore clearly a really bad idea
but how do we fix things?

The best option I've come up with so far is a list of whitelist variables
to use to trigger the multilibs. Its populated with the standard multilibs
we support, anyone setting up an advanced multilib can populate the variable
with the correct trigger parameters.

This has the advantage of simplifying the code and allowing us to remove
the code filtering blocks since there is no longer option duplication. Testing
after this change shows a much improved sdk toolchain functionality.

(From OE-Core rev: 29202cd1b9d2e5d56e5b9f7a596e44e229c90492)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-07-25 15:33:58 +01:00
Ting Liu 01e556cd0d gcc: update *LIBC_* linker relocation reglex
* GLIBC_DYNAMIC_LINKER64 reglex does not work for rs6000/linux64.h,
  update it.
* it turns out that UCLIBC_DYNAMIC_LINKER reglex will strip the 32/64
  chars from UCLIBC_DYNAMIC_LINKER64/UCLIBC_DYNAMIC_LINKER32, add '\b'.
  my two PCs: Centos 6.5 (python 2.7.5) and Fedora 13 (python 2.7.3)

(From OE-Core rev: a0b408191d64804df1748163060313af31433ac8)

Signed-off-by: Ting Liu <ting.liu@freescale.com>
Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-07-19 00:09:01 +01:00
Richard Purdie 4666045677 gcc: Handle uclibc linker relocation for multilib support
We need to handle the UCLIBC_* linker variables in the same way
as we do the GLIBC_* ones to allow uclibc multilib to work properly.

(From OE-Core rev: 025ec5958b7e1fd71caa0079ec3c573126b30886)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-05-08 13:11:28 +01:00
Alexandru-Cezar Sardan 21f9cc27d7 gcc: enable multilib setup for powerpc64 arch
(From OE-Core rev: 99fadf2ff9f4379121fde6477383e7574519fba4)

Signed-off-by: Alexandru-Cezar Sardan <alexandru.sardan@freescale.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-04-04 14:26:07 +01:00
Alexandru-Cezar Sardan 7f14950927 gcc: changed multilib options handling
Duplicate parameters in the tune args are repeated in the
MULTILIB_OPTIONS variable. This leads to incorrect configurations
if the order of the parameters is bad.
(Eg. "mhard-float m32/mhard-float m64" leads to an incorrect config)
This patch finds the common parameters and removes the duplicates.

(From OE-Core rev: 90dc31c24adfa8e916a9c475ae1afc58ad179dfb)

Signed-off-by: Alexandru-Cezar Sardan <alexandru.sardan@freescale.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-04-01 23:37:01 +01:00
Richard Purdie 554c892ccf meta: Don't use deprecated bitbake API
These have been deprecated for a long time, convert the remaining
references to the correct modules and prepare for removal of the
compatibility support from bitbake.

(From OE-Core rev: 6a39835af2b2b3c7797fe05479341d71a3f3aaf6)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-09-01 15:51:42 +01:00
Constantin Musca 5f05604cdf gcc-cross-canadian: enable multilib support
(From OE-Core rev: ee7331e3e7d0b38f3e19ccf7e394537f5f653a22)

Signed-off-by: Constantin Musca <constantinx.musca@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-02-11 22:49:27 +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