Commit Graph

541 Commits

Author SHA1 Message Date
Anuj Mittal ce6e49a01f gcc: make sure header path is set correctly
We're setting the native header paths in do_configure_prepend,
and don't need to set them again here.

This results in gcc-target not being able to locate the headers
and not being able to detect glibc version, which in turn
results in SSP support not getting detected even though it's available
in libc.

(From OE-Core rev: 85630aa894278e7818c867179dc19ca2fbd994fc)

Signed-off-by: Anuj Mittal <anujx.mittal@intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-06-15 18:05:22 +01:00
Alexander Kanavin 02d0933bf5 gcc: fix upstream check for 5.x version
(From OE-Core rev: 831ef4c6d6975adc586b035b6a228df2e68d18b6)

Signed-off-by: Alexander Kanavin <alexander.kanavin@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-06-04 14:13:34 +01:00
Marek Vasut a0acd705ba gcc: Backport nios2 gcc ICE fix
Backport a patch from mainline gcc 5 branch to fix ICE triggered
when cross-compiling libdrm for nios2 architecture. The same ICE
is fixed in gcc6 already.

(From OE-Core rev: d603a6abf5abff2d1ccee902e0eb9f651aeb121e)

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Khem Raj <raj.khem@gmail.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-05-30 15:58:10 +01:00
Armin Kuster a906a09c73 gcc: Security fix CVE-2016-4490
(From OE-Core rev: 2fef37fab6967410aff33744c8843bcae028de56)

Signed-off-by: Armin Kuster <akuster@mvista.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-05-17 14:43:30 +01:00
Armin Kuster a1928c81e6 gcc: Security fix CVE-2016-2226
(From OE-Core rev: 9b85d69584fdb0d2c607fa820b4515ee38202ab9)

Signed-off-by: Armin Kuster <akuster@mvista.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-05-17 14:43:30 +01:00
Armin Kuster 23f00321e9 gcc: Security fix CVE-2016-4489
(From OE-Core rev: 84a1642f89801648728c61d3af42926b95533e07)

Signed-off-by: Armin Kuster <akuster@mvista.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-05-17 14:43:30 +01:00
Armin Kuster 02321b6d63 gcc: Security fix CVE-2016-4488
(From OE-Core rev: 4d8096d77139e31f80b4cb54b6b747bbf19bb959)

Signed-off-by: Armin Kuster <akuster@mvista.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-05-17 14:43:30 +01:00
Daniel McGregor 9b25b35456 gcc 4.9: backport gperf fixes
gperf was being used in a way that generated files don't conform to
the language standard. Backport the fix from upstream.

This is required to build these GCC versions when the host compiler
is GCC 6.

(From OE-Core rev: 42178d1b19f8055434194aa09dcec5006414fab4)

Signed-off-by: Daniel McGregor <daniel.mcgregor@vecima.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-05-14 23:05:12 +01:00
Daniel McGregor efe59dbec5 gcc-5.3: backport gperf fixes
gperf was being used in a way that generated files don't conform to
the language standard. Backport the fix from upstream.

This is required to build these GCC versions when the host compiler
is GCC 6.

(From OE-Core rev: 28a53355d7bf490f974500131d7827e3f65674ef)

Signed-off-by: Daniel McGregor <daniel.mcgregor@vecima.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-05-14 23:05:12 +01:00
Khem Raj 9a309684cf gcc-runtime, libgcc: Symlink c++ header and startup files in target_triplet for SDK use
We build SDKs such that gcc-cross-candian is built for only one
target *-*-linux and then use -muclibc or -mmusl to let it compile
code for other libc variants. This works fine when libc = glibc
however it does not work for c++ programs when libc != glibc since
there are c++ headers installed under ${includedir}/c++/${BINV}/${TARGET_SYS}
which is fine when gcc-runtime and gcc-cross-candian uses same --target options
gxx includedir searches in right triplet, but it fails with musl/uclibc
since gcc will look for glibc based triplet but gcc-runtime will install
them under musl/uclibc triplet.

This patch symlinks the musl/uclibc triplet to glibc triplet when libc != glibc

This fixes SDKs for musl/uclibc

(From OE-Core rev: fcaaabb401fffcda4db9a7d1f927a2a404e4776d)

Signed-off-by: Khem Raj <raj.khem@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-05-13 13:41:32 +01:00
Khem Raj af6bfedb00 libgcc: Ensure that gcc configure options are passed to libgcc too
libgcc uses certain options from EXTRA_OECONF as well, curently we are
ignoring them, as a result we do not configure libgcc to match cross gcc
in some cases e.g. ppc/musl should have used 64bit long doubles but
it went for 128-ldbls which is default, works on glibc but not on musl

(From OE-Core rev: d7799a17d5e802db3f8d16bdc824aae81538e675)

Signed-off-by: Khem Raj <raj.khem@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-05-13 13:41:31 +01:00
Khem Raj fb6ee2225b libgcc: Ensure that gcc configure options are passed to libgcc too
libgcc uses certain options from EXTRA_OECONF as well, curently we are
ignoring them, as a result we do not configure libgcc to match cross gcc
in some cases e.g. ppc/musl should have used 64bit long doubles but
it went for 128-ldbls which is default, works on glibc but not on musl

(From OE-Core rev: d774bb2d10f2c05900f87dcc53f073433ca02121)

Signed-off-by: Khem Raj <raj.khem@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-05-13 13:41:30 +01:00
Khem Raj 6ea164c208 gcc: Add gcc6 recipes
(From OE-Core rev: 93226e8c74be438781df79f0be5cbf563c79df8b)

Signed-off-by: Khem Raj <raj.khem@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-05-13 13:41:28 +01:00
Peter Kjellerstedt 9390701f11 gcc-target.inc: Use SYSROOT_DIRS_BLACKLIST to exclude dirs from sysroot
(From OE-Core rev: 3eb358d97f84e3d909986b7168e7384ae8db4126)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-05-13 13:41:28 +01:00
Christopher Larson 33330021a1 gcc: obey ldflags in the link of libgcc
Explicitly obey it, the way it should, rather than only relying on
--with-linker-hash-style.

(From OE-Core rev: 9095742d1468477baefe69098817f38a8d2dd750)

Signed-off-by: Christopher Larson <chris_larson@mentor.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-05-11 10:33:42 +01:00
Jussi Kukkonen cb613904fd gcc-sanitizers: Depend on target gcc
Without this the target gcc might not be in the sysroot
leading to configure failure.

(From OE-Core rev: 329c532db4b2124fa3f4b3ab8c4c6d6c93ca7c2f)

Signed-off-by: Jussi Kukkonen <jussi.kukkonen@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-04-29 07:58:43 +01:00
noel eck a8c8e811ee gcc-common.inc: String format tweak for available tunes
Small change to python string formatting for error logging.
Previously, tune and availtunes would print out at the end of
the log message.  This change allows them to print out in the
correct locations of the error string.

(From OE-Core rev: 65fb2a4af127d32f31fbe696c80de5bafd953200)

Signed-off-by: noel eck <kceleon@gmail.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-04-14 10:58:34 +01:00
Khem Raj 53b5dc0dda gcc: Fix musl ldso name for mips64
Now we have mips64 port of musl and there is
a name for ldso, backport the fix from upstream
gcc master

(From OE-Core rev: fd37da3a559e0c494c7481849746ec12d492a7b2)

Signed-off-by: Khem Raj <raj.khem@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-03-30 21:24:02 +01:00
Hongxu Jia 326fc2916e gcc-5.3/gcc-4.9: -fdebug-prefix-map support to remap relative path
For relative path in DWARF, -fdebug-prefix-map could not remap it,
so translate to real path before mapping.

[YOCTO #9305]

(From OE-Core rev: e50d23c30cd8259941b25e336b11cd96e4f6cd31)

Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-03-30 12:01:29 +01:00
Khem Raj 6dff6392d8 gcc: Backport fixes for musl ssp configuration
We were trying to inject cached configure variables via
EXTRA_OECONF, but that was not working due to the fact
that gcc configure is called recursively via makefiles
and hence these were getting lost.

These backports from master fixes the problem by
defining the options in configure itself

dl_iterate_phdr is provided by musl as well, so lets
not depend on glibc defines like inhibit_libc alone

(From OE-Core rev: b3f80743cd1b9a15a8ee4d20c2a54c2f6cbcd13c)

Signed-off-by: Khem Raj <raj.khem@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-03-29 23:20:13 +01:00
Hongxu Jia 79850060c3 gcc-5.3/gcc-4.9:Reuse -fdebug-prefix-map to replace -ffile-prefix-map
The oe-core may use external toolchain for compiling,
which did not support -ffile-prefix-map.

Since we use -fdebug-prefix-map to do the same thing,
so we could reuse it to replace -ffile-prefix-map.

[YOCTO #7058]

(From OE-Core rev: cec9ee4d32d96e8717f63268a00888260eae1b30)

Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-03-20 23:12:31 +00:00
Hongxu Jia 2faa718c8b gcc-5.3/gcc-4.9:replace build path with target path in __FILE__
Similar -fdebug-prefix-map, add option -ffile-prefix-map to map one
directory name (old) to another (new) in __FILE__, __BASE_FILE__and
__builtin_FILE ().

With this patch, it fixes build path issue which caused by __FILE__.
We do not need to use relative path to compile any more.

[YOCTO #7058]

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

(From OE-Core rev: 5e3dd820df41ab032893497a9ccea2160c07fe66)

Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-03-20 23:12:30 +00:00
Andre McCurdy 068e898001 gcc-runtime.inc: set LICENSE for all gcc-runtime packages
LICENSE_${PN} doesn't apply to all gcc-runtime packages. Set LICENSE
instead. Without this fix, gcc-runtime packages such as libstdc++ are
excluded from rootfs for builds which blacklist GPLv3.

(From OE-Core rev: 9406a8ab8fd166b9d90b33b84b6d44f8672ab623)

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-03-20 23:12:29 +00:00
Helio Chissini de Castro 681a45200a gcc: Fix the license on GNU OpenMP
Poky jethro has libgomp ( GNU OpenMP ) license marked as GPL-3.0,
where's in fact the correct is GPL-3.0 with GCC Library Runtime Exception

As stated on https://github.com/gcc-mirror/gcc/blob/master/libgomp/libgomp.h
header license:
 ...
   Under Section 7 of GPL version 3, you are granted additional
   permissions described in the GCC Runtime Library Exception, version
   3.1, as published by the Free Software Foundation.
 ...

(From OE-Core rev: 07db569a91e2aa8456624b340830c0e027cc6ead)

Signed-off-by: Helio Chissini de Castro <helio.castro@bmw-carit.de>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-03-12 22:11:48 +00:00
Ross Burton 15c5b2afcb Revert "gcc: Fix the license on GNU OpenMP"
This reverts commit 892fbe373c5cff7b2f28b58aa2508b47e53d3e63.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-03-12 22:11:48 +00:00
Nathan Rossi 7f27713f27 gcc: Disable libitm for MicroBlaze
Disable libitm as it is not supported on MicroBlaze.

(From OE-Core rev: 18f127765f1cdcf531f29c58641a256c199d888c)

Signed-off-by: Nathan Rossi <nathan@nathanrossi.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-03-11 16:50:45 +00:00
Helio Chissini de Castro 39e1351cba gcc: Fix the license on GNU OpenMP
Poky jethro has libgomp ( GNU OpenMP ) license marked as GPL-3.0,
where's in fact the correct is GPL-3.0 with GCC Library Runtime Exception

(From OE-Core rev: e24c8be86080bd67ef1c5aa3b9885396dc2774b2)

Signed-off-by: Helio Chissini de Castro <helio.castro@bmw-carit.de>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-03-11 16:50:44 +00:00
Marek Vasut 001bdefca0 gcc: Disable libitm for nios2
The libitm is not supported on nios2, so disable it.

(From OE-Core rev: 9c67db02d89b48fe151a292faf65db81dd3baf50)

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Ley Foon Tan <lftan@altera.com>
Cc: Richard Purdie <richard.purdie@linuxfoundation.org>
Cc: Ross Burton <ross.burton@intel.com>
Cc: Thomas Chou <thomas@wytron.com.tw>
Cc: Walter Goossens <waltergoossens@home.nl>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-03-10 23:13:54 +00:00
Andre McCurdy 82a80645f8 gcc-runtime.inc: disable libitm for little endian MIPS too
libitm is already disabled for big endian MIPS, but needs to be
disabled for little endian MIPS targets too.

(From OE-Core rev: 421e8ac60ff6eb87e66ebeab6f14d74216386578)

Signed-off-by: Andre McCurdy <armccurdy@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-03-07 00:11:38 +00:00
Mark Hatle 0138874196 gcc: Add support for atomic opertions (libitm) where available
GCC 4.7 and newer have supported various automic operation directives,
however these have not been previously enabled.

(From OE-Core rev: 8cb4ac49677b1eae4047fc1abbd728f093a24b72)

Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-03-02 22:39:45 +00:00
Hongxu Jia b14e2ae9bc gcc: use relative path for configure script
The absolute path (/path/to/configure) caused __FILE__ to be
an absolute path.

If 'assert' invoked, it uses __FILE__, and build path would be in elf files.
In assert.h
...
.# define assert(expr)                                                   \
  ((expr)                                                               \
   ? __ASSERT_VOID_CAST (0)                                             \
   : __assert_fail (__STRING(expr), __FILE__, __LINE__, __ASSERT_FUNCTION))
...

Which triggered buildpaths QA issue:
...
| libgcc-5.3.0: File work/core2-64-poky-linux/libgcc/5.3.0-r0/packages-split/
libgcc-dev/usr/lib64/x86_64-poky-linux/5.3.0/libgcc.a in package contained
reference to tmpdir [buildpaths]
...

Use relative path to run configure can fix the problem.

[YOCTO #7058]

(From OE-Core rev: b806e4c004a7e10461fe7428fc130a5aa2528039)

Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-02-28 11:32:58 +00:00
Khem Raj 91a1baaf57 glibc: Upgrade to 2.23
Drop kconfig and options-group support
Forward port cross-localedef support
Assume ssp support in libc when building gcc-initial

(From OE-Core rev: 9c3d461c4d54d684b38ec4c038a1c3c2fb9923f0)

Signed-off-by: Khem Raj <raj.khem@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-02-21 09:32:43 +00:00
Martin Jansa 51fc30472f gcc-5.3: backport fix for PR-target-65358
(From OE-Core rev: f8616c30870670992c00be349bedf64b35833c34)

Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-02-19 15:33:02 +00:00
Marek Vasut c9e5e347f7 gcc: Backport nios2 r31 fix
Backport a fix from GCC mainline, which fixes libpcre 8.38 and expat 2.1.0
build on nios2. The example of the fixed error follows:

| ./nios2-poky-linux-libtool --silent --mode=compile nios2-poky-linux-gcc  -mel -mhw-div  -mhw-mul  --sysroot=/mnt/work/Yocto/build-nios2/tmp/sysroots/10m50 -I../expat-2.1.0/lib -I. -O2 -pipe -g -feliminate-unused-debug-types -Wall -Wmissing-prototypes -Wstrict-prototypes -fexceptions  -DHAVE_EXPAT_CONFIG_H -o lib/xmltok.lo -c ../expat-2.1.0/lib/xmltok.c
| {standard input}: Assembler messages:
| {standard input}:4988: Error: r31 cannot be used with jmp; use ret instead
| {standard input}:9703: Error: r31 cannot be used with jmp; use ret instead
| {standard input}:20068: Error: r31 cannot be used with jmp; use ret instead
| {standard input}:24020: Error: r31 cannot be used with jmp; use ret instead
| Makefile:196: recipe for target 'lib/xmltok.lo' failed
| make: *** [lib/xmltok.lo] Error 1
| WARNING: exit code 1 from a shell command.

(From OE-Core rev: 24b0f08ae4fbaf285d494ab53a3b168a6dd17b20)

Signed-off-by: Marek Vasut <marex@denx.de>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-02-18 07:39:30 +00:00
Hongxu Jia 351039f21a gcc-4.9/5.3: Ignore -fdebug-prefix-map in producer string
Backport from upstream master. The discussion detail:
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=69821

Compile without this fix:
objdump -g packages-split/lib32-glibc-dev/usr/lib/gcrt1.o
...
|    <5f>   DW_AT_producer    : (indirect string, offset: 0x1b): GNU C99 5.3.0
-m32-march=core2 -mtune=core2 -msse3 -mfpmath=sse -mpreferred-stack-boundary=4
-g -O2 -std=gnu99 -fgnu89-inline -fdebug-prefix-map=/buildarea/raid0/hjia/buil
d-20160127-yocto-buildpath-2/tmp/sysroots/lib32-qemux86-64=
-feliminate-unused-debug-types -fmerge-all-constants -frounding-math
-ftls-model=initial-exec
...

Compile with this fix:
objdump -g packages-split/lib32-glibc-dev/usr/lib/gcrt1.o
...
|    <5f>   DW_AT_producer    : (indirect string, offset: 0xa1): GNU C99 5.3.0
-m32 -march=core2 -mtune=core2 -msse3 -mfpmath=sse -mpreferred-stack-boundary=4
-g -O2 -std=gnu99 -fgnu89-inline -feliminate-unused-debug-types -fmerge-all-constants
-frounding-math -ftls-model=initial-exec
...

[YOCTO #7058]

(From OE-Core rev: a0d444a2e3e1b6b095f30b7fe1c9cfd8bce5a845)

Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-02-18 07:39:29 +00:00
Khem Raj 92ae4e2902 gcc: musl related fixes for ppc/secure-plt and gthr
These issues are fixing building gcc for target, ppc issue
helps in fixing discrepency between gcc cmdline and linker cmdline

(From OE-Core rev: 6af50d8865335aed68fb4f9b319edb81ce93a04e)

Signed-off-by: Khem Raj <raj.khem@gmail.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-02-07 17:30:00 +00:00
Khem Raj 9e5222c532 gcc: Assume libssp and dl_iterate_phdr on musl
gcc configure fails to set these settings correctly
on musl based builds

(From OE-Core rev: f1cdd7bf1d9351005867b5c77c05fdddfc9656fd)

Signed-off-by: Khem Raj <raj.khem@gmail.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-02-07 17:29:59 +00:00
Khem Raj 8d57d1d8de gcc: Fix build on musl with -fstack-protector
When enabling the secutity flags on musl based targets the builds fail
due to libssp(gcc-runtime) build asking to link with libssp and
libssp_nonshared.a when configuring libssp itself. This does not work
with musl since it does provide ssp implementation but not like glibc
where these libraries are separate to libc

Fix the nios2 patch with upstream status while at it and generate the
patch after applying to my tree

(From OE-Core rev: 77fb841f2e747dc7fb5e9234d870a7a32a74d09b)

Signed-off-by: Khem Raj <raj.khem@gmail.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-02-07 17:29:59 +00: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
Khem Raj f4f9f2f4d9 gcc, qemuppc: Explicitly disable forcing SPE flags
G4 does not have SPE, so we make that explicit in the tune files and
since we emulate G4 when building Qemu, we ensure it for qemuppc as
well.

GCC config for powerpc-linux is made to include SPE by default which is
equivalent if the tripet was powerpc-linux*spe, this forces gcc to
configure assembler to enable -mspe by default, when we do that then the
kernel fails to compile with binutils 2.26, since newer assembler is
smart to detect the tlbia instructions are not compatible with SPE and
hence the kernel build breaks rightly. We configure the kernel for G4 as
well where it enables tlbia instrucitons rightly so because it thinks
its being configured for power4. So we keep the options but do not force
-mspe down to assembler as default.

(From OE-Core rev: 7a51776a830167e43cbd185505f62f328704e271)

Signed-off-by: Khem Raj <raj.khem@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-01-31 13:29:48 +00:00
Andre McCurdy dfb9d41b7c gcc-cross.inc: drop pruning of PATCH_GET from the testgcc script
PATCH_GET is no longer exported by bitbake.conf, so no longer needs
to be pruned from the gcc-cross do_compile() environment.

(From OE-Core rev: 386d1617f1e6e293506b751faa41ff8c37348973)

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-30 11:37:03 +00:00
Mathieu Desnoyers 3ed566e100 gcc: fix hidden weak symbols by removing buggy gcc patch
We are noticing the presence of the following patch in various
openembedded gcc versions:

0024-PR-target-32219.patch

However, contrarily to its "Backport" status, that patch is
not upstream in gcc, and it breaks handling of start/stop automatic
weak hidden symbols we use in lttng-ust.

We are only experiencing problems on the various openembedded
compilers, but on no other distro (with same compiler versions),
which led us to suspect a buggy distro-specific gcc patch.

We've been testing with openembedded gcc-4.9.2-r0. Rebuilding the gcc
compiler with this patch removed fixes the lttng-ust issue.

Link: http://lists.openembedded.org/pipermail/openembedded-core/2016-January/116306.html
Link: http://lists.lttng.org/pipermail/lttng-dev/2014-May/023112.html
Link: https://gcc.gnu.org/ml/gcc-help/2014-05/msg00042.html
Link: http://cgit.openembedded.org/openembedded-core/commit/?id=3cb2b003db7371b3a47d02c08352a262e1e419b4
Link: https://sourceware.org/bugzilla/show_bug.cgi?id=15435

(From OE-Core rev: 3e98ba4d6c1d1e4919ce373ec031d41c2538f10b)

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-01-30 11:37:01 +00:00
Richard Purdie c2231ded4b gcc-cross-canadian: Add missing DEPENDS on virtual/${HOST_PREFIX}gcc-crosssdk
The cross-canadian compiler needs the nativesdk compiler to build
but for some reason this was missing. Add the missing dependency.

(From OE-Core rev: 77fcdfdc83f01f1ff0ae310ebb7bffbdb4330156)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-01-26 18:05:13 +00:00
Ioan-Adrian Ratiu 1013385b2f gcc-runtime.inc: provide libquadmath
libgfortran's build fails with "ld: cannot find -lquadmath" unless
libquadmath is added to gcc-runtime's RUNTIMETARGET

(From OE-Core rev: 80333155db8fa53fb52898c4312daa656de89c3b)

Signed-off-by: Ioan-Adrian Ratiu <adrian.ratiu@ni.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-01-20 17:07:16 +00:00
Joshua Lock 32eeb004f9 gcc-runtime: switch to removal override syntax to modify CXXFLAGS
The use of immediate expansion can cause issues when trying to
override variables, further the removal override syntax is clearer
than oe_filter_out () — switch to using removal override syntax
instead.

(From OE-Core rev: 19995268da27af93af6f718fab0434178a1079ce)

Signed-off-by: Joshua Lock <joshua.g.lock@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-01-19 17:40:19 +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
Marek Vasut c8fef7fb2d gcc5: Fix build on NIOS2
The gcc 5.3 does not build on NIOS2 due to a missing MUSL_DYNAMIC_LINKER
definition in it's config file. Add the definition to fix the build issue.
The output produced during the failing build is as follows:

g++    -isystem/b/tmp/sysroots/x86_64-linux/usr/include -O2 -pipe -DIN_GCC  -DCROSS_DIRECTORY_STRUCTURE  -fno-exceptions -fno-rtti -fasynchronous-unwind-tables -W -Wall -Wno-narrowing -Wwrite-strings -Wcast-qual -Wmissing-format-attribute -Woverloaded-virtual -pedantic -Wno-long-long -Wno-variadic-macros -Wno-overlength-strings   -DHAVE_CONFIG_H -static-libstdc++ -static-libgcc -L/b/tmp/sysroots/x86_64-linux/usr/lib -L/b/tmp/sysroots/x86_64-linux/lib -Wl,-rpath-link,/b/tmp/sysroots/x86_64-linux/usr/lib -Wl,-rpath-link,/b/tmp/sysroots/x86_64-linux/lib -Wl,-rpath,/b/tmp/sysroots/x86_64-linux/usr/lib -Wl,-rpath,/b/tmp/sysroots/x86_64-linux/lib -Wl,-O1 gcc-ar.o -o gcc-ar \
        file-find.o libcommon.a ../libcpp/libcpp.a   ../libbacktrace/.libs/libbacktrace.a ../libiberty/libiberty.a ../libdecnumber/libdecnumber.a
In file included from ./tm.h:27:0,
                 from /b/tmp/work-shared/gcc-5.3.0-r0/gcc-5.3.0/gcc/gcc.c:34:
./config/linux.h:92:28: error: expected ',' or ';' before 'MUSL_DYNAMIC_LINKER'
     BIONIC_DYNAMIC_LINKER, MUSL_DYNAMIC_LINKER)
                            ^
./config/linux.h:59:60: note: in definition of macro 'CHOOSE_DYNAMIC_LINKER1'
   "%{" LIBC2 ":" LD2 ";:%{" LIBC3 ":" LD3 ";:%{" LIBC4 ":" LD4 ";:" LD1 "}}}"
                                                            ^
./config/linux.h:91:3: note: in expansion of macro 'CHOOSE_DYNAMIC_LINKER'
   CHOOSE_DYNAMIC_LINKER (GLIBC_DYNAMIC_LINKER, UCLIBC_DYNAMIC_LINKER, \
   ^
./config/nios2/linux.h:40:25: note: in expansion of macro 'GNU_USER_DYNAMIC_LINKER'
       -dynamic-linker " GNU_USER_DYNAMIC_LINKER "} \
                         ^
/b/tmp/work-shared/gcc-5.3.0-r0/gcc-5.3.0/gcc/gcc.c:884:32: note: in expansion of macro 'LINK_SPEC'
 static const char *link_spec = LINK_SPEC;
                                ^
<command-line>:0:27: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]
/b/tmp/work-shared/gcc-5.3.0-r0/gcc-5.3.0/gcc/gcc.c:1295:48: note: in expansion of macro 'STANDARD_STARTFILE_PREFIX'
 static char *const standard_startfile_prefix = STANDARD_STARTFILE_PREFIX;

(From OE-Core rev: c8ec931b07c08e27027b38313e6776875db12acb)

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Khem Raj <raj.khem@gmail.com>
Cc: Ross Burton <ross.burton@intel.com>
Cc: Richard Purdie <richard.purdie@linuxfoundation.org>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-01-11 23:26:30 +00:00
Ross Burton d462b70b29 gcc-sanitizers: link directly against sysroot libstc++
Instead of building a shadow libstdc++-v3 directory with symlinks to the sysroot
libstdc++-v3.la, fiddle the Makefiles so that it doesn't attempt to link to a
in-tree library at all.

This fixes builds where .la files are not being installed into the sysroot at
all.

(From OE-Core rev: f0f814a674faef2160fb8a041b63169c74da108e)

Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-01-07 13:40:15 +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
Khem Raj 4b83f1fef9 gcc5: Upgrade gcc-5.2 -> gcc-5.3
Minor bugfix upgrade to gcc 5.3 for detailed list of fixes in 5.3 see

https://gcc.gnu.org/bugzilla/buglist.cgi?bug_status=RESOLVED&list_id=132738&resolution=FIXED&target_milestone=5.3

(From OE-Core rev: 8b664a7d6bba89a8221d7fd1a52915fef0002d71)

Signed-off-by: Khem Raj <raj.khem@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:49 +00:00
Ross Burton 455ff32426 meta: more removals of redunant FILES_${PN}-dbg
In some recipes overly-split -dbg packages were merged into PN-dbg.  Unless
there's a very good reason, recipes should have a single -dev and -dbg package.

(From OE-Core rev: a3b000643898d7402b9e57c02e8d10e677cc9722)

Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-12-16 11:56:30 +00:00
Richard Purdie e0890b662e meta: Drop now pointless manual -dbg packaging
With the autodebug package generation logic, specifically setting FILES_${PN}-dbg
isn't needed in most cases, we can remove them.

(From OE-Core rev: 3ab59d49dd7c18e194b58d1248b4b87709b5a738)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-12-16 11:56:30 +00:00
Richard Purdie 0da1d71809 nopackages: Add class for recipes which don't generate packages
It turns out writing the same list of packaging tasks multiple
times in multiple places is error prone. Move this to a new class
'nopackages", migrate existing users and add glibc-initial and
libgcc-initial since we don't want packages for those recipes.

This means the sstate for those recipes won't be installed, saving
small amounts of build time and bandwidth.

A reference to the old package_write task is also dropped.

(From OE-Core rev: cece583d58f82a50c3a4eac876eb326ac3b8f5e5)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-12-14 22:30:57 +00:00
Khem Raj a2ea58bbd7 gcc: Add support for building musl configuration
Most of these patches are already in gcc 6.0/master but we still need them for
older gcc, they have been tested in meta-musl for quite some time

(From OE-Core rev: 30a0cc2ef72399b84da4903e697f258f79852fc9)

Signed-off-by: Khem Raj <raj.khem@gmail.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-12-12 23:42:54 +00:00
Dmitry Eremin-Solenikov c7ad779289 gcc-4.9: import patch fixing compilation in thumb mode
Import patch fixing a bug that caused ICE when compiling some packages
(e.g. ICU) in Thumb-1 model.

(From OE-Core rev: 68062674b853af750d0fdafb06090ed2f75fa0a4)

Signed-off-by: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-12-12 23:42:52 +00:00
Dmitry Eremin-Solenikov 1260ded611 gcc-5.2: import patch fixing compilation in thumb mode
Import patch fixing a bug that caused ICE when compiling some packages
(e.g. ICU) in Thumb-1 model.

(From OE-Core rev: 3c8ad9e008a1786ff95202f413e267756a5e783f)

Signed-off-by: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-12-12 23:42:52 +00:00
Yuanjie Huang e0162c1f8c gcc-cross-initial: make dependency on gnu-config-native and autoconf-native explicit
When a project is configure to use sstate cache and has the host tool sysroot
cleaned, gcc-cross-initial may fail to be configured due to lack of
gnu-configize tool.

gcc-cross-initial recipe has autotools dependency inhibited, and the same flag
variable also excludes the gnu-config-native.  Though there is an indirect
dependency through libmpc-native, it's not safe with sstate cache being used.

Moreover, gnu-config-native requires a perl package from autoconf-native to
run, otherwise it will fail with "Can't locate Autom4te/ChannelDefs.pm in @INC"
message.

This patch makes both dependencies explicit for gcc-cross-initial's
configuration.

(From OE-Core rev: 18a913e54b40a1654d0967290088be5e7fcdd6f6)

Signed-off-by: Yuanjie Huang <yuanjie.huang@windriver.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-12-12 23:42:52 +00:00
Alexander Kanavin 74bfa62f85 package_regex.inc: split entries which blacklist specific versions to their recipes
(From OE-Core rev: 1eb9e190ef3bb1170b3eaabd9f7900e7ce176624)

Signed-off-by: Alexander Kanavin <alexander.kanavin@linux.intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-12-08 10:20:52 +00:00
Martin Jansa dee2a8c82b guile, mailx, gcc, opensp, gstreamer1.0-libav, libunwind: disable thumb where it fails for qemuarm
(From OE-Core rev: 981626d8cee345d27b7c9d96e941fd6622f47792)

Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-12-01 21:32:06 +00:00
Juro Bystricky d8adfd28f7 gcc-4.9: Fix various _FOR_BUILD and related variables
This patch is based on the patch for gcc-5.2 (41cbfd7af6)

When doing a FOR_BUILD thing, you have to override CFLAGS with
CFLAGS_FOR_BUILD. And if you use C++, you also have to override
CXXFLAGS with CXXFLAGS_FOR_BUILD.
Without this, when building for mingw, you end up trying to use
the mingw headers for a host build.

The same goes for other variables as well, such as CPPFLAGS,
CPP, and GMPINC.

(From OE-Core rev: e6dc4b2ac0cc6417c0e0ddcdcbe3f334581af8fc)

Signed-off-by: Juro Bystricky <juro.bystricky@intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-11-25 08:08:09 +00:00
Robert Yang 0ae52c8b2c gcc-multilib-config: make aarch64 support multilib
Fixed:
MACHINE = qemuarm64
require conf/multilib.conf
MULTILIBS = "multilib:lib32"
DEFAULTTUNE_virtclass-multilib-lib32 = "armv7at-neon"

$ bitbake core-image-minimal -cpopulate_sdk

WARNING: gcc multilib setup is not supported for TARGET_ARCH=aarch64
WARNING: gcc multilib setup is not supported for TARGET_ARCH=aarch64

[YOCTO #8638]

(From OE-Core rev: 9e0cad83eefae4c1a5e5e0334cc1cfdfc1f51057)

Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-11-25 08:08:08 +00:00
Richard Purdie d9aabf9639 gcc: Drop 4.8
We have 5.2 and 4.9, we don't really need 4.8 now and it can be moved
out to other layers if anyone still wants/needs it.

(From OE-Core rev: 6f98c39418c60b7c0b25b30983d2e5257158a6a4)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-11-16 14:59:18 +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
Mark Hatle 54b7471be7 gcc-target.inc: Add support for executable thats may have a suffix
In the past GCC has used a wildcard to permit generating executables
that may have a suffix, such as .exe.  This wild card was lost in one
of the updates.  Adding the wild card back in fixes a number of issues
when generating a mingw gcc.

(From OE-Core rev: 1003e93a1b3359a98fb631eeeda3fda184832288)

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-10-27 07:24:27 +00:00
Mark Hatle 41cbfd7af6 gcc-5.2: Fix various _FOR_BUILD and related variables
When doing a FOR_BUILD thing, you have to override CFLAGS with
CFLAGS_FOR_BUILD. And if you use C++, you also have to override
CXXFLAGS with CXXFLAGS_FOR_BUILD.
Without this, when building for mingw, you end up trying to use
the mingw headers for a host build.

The same goes for other variables as well, such as CPPFLAGS,
CPP, and GMPINC.

(From OE-Core rev: 85ca40c42950315f2783b98f57df16b261d2826e)

Signed-off-by: Peter Seebach <peter.seebach@windriver.com>
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-10-21 22:56:04 +01:00
Kai Kang b1a7405688 gcc-4.x: fix wrong warning when using the universal zero initializer {0}
When I upgrade efivar to 0.21, it fails to compile with error messages:

| linux.c:850:9: error: missing braces around initializer
[-Werror=missing-braces]
|   struct ifreq ifr = { 0, };
|          ^

It is a known issue of gcc. Backport patch from

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

to fix wrong warning when using the universal zero initializer {0}.

(From OE-Core rev: ef16c20e6936218ff96c599cce0200c34f5017dd)

Signed-off-by: Kai Kang <kai.kang@windriver.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-10-19 17:57:57 +01:00
Richard Purdie 71fdb36d77 gcc-multilib-config: Ensure SDK_ARCH doesn't change target sigs
Changing SDKMACHINE (which changes SDK_ARCH) shouldn't cause
target task signatures to change. Exclude the dependency
on SDK_ARCH for this reason. It only affects nativesdk builds
and those already account for SDK_ARCH in the build WORKDIR paths.

(From OE-Core rev: dae7c45fac1d877203f173842d43abc4883b808b)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-10-01 07:43:35 +01:00
Yuanjie Huang 218d9f480f gcc-multilib-config: Expand ccargs variable
The ccargs obtained from get_tune_parameters may not be fully expanded,
so that the gcc_multilib_setup function can be confused, and generates
invalid MULTILIB_OPTIONS in GCC Makefile fragment, which will break the
multilib feature of target gcc.

To address problems above, this patch modifies gcc_multilib_setup
function to expand ccargs before use.

Upstream-Status: Inappropriate [configuration]

(From OE-Core rev: 02eddf9a0b89b0cbe0c83d95cedb3431899197d0)

Signed-off-by: Yuanjie Huang <yuanjie.huang@windriver.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-09-28 12:00:29 +01:00
Richard Purdie 79e3418cad gcc-runtime: Add multilib C++ header mapping
The SDK was unable to find the C++ header pieces correctly since its
using a generic compiler, not one specifically targeting the multilib
vendor prefix. This adds in the right mapping to ensure multilib SDKs
work as expected. This fixes multilib SDK automated tests.

(From OE-Core rev: 823ce9555ee78aa460d0560b8fd9b309cfd36997)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-09-28 12:00:18 +01:00
Richard Purdie ce7bc121c5 gcc-shared-source: Set empty SRC_URI
gcc-source is the only gcc recipe meant to handle the fetch/unpack/patch
tasks, the other gcc recipes then depend on this.

This approach has been creating some confusion for tools like the archiver.
The simplest way to signal to these processes that there is no source
is to empty SRC_URI at the same time we disable the other tasks.

(From OE-Core rev: 0df9d45e0be59e55e585e6d25dedbf0fc55c490c)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-09-24 17:54:31 +01:00
Juro Bystricky 47ef2015a4 libgcc.inc: package baremetal multilib libraries
When building libgcc some files and libraries may be built but not packaged.
The original code packaged only some explicitly specified files targeting mostly x86.
This patch does not discriminate between various targets.
It fixes errors such as these:

ERROR: QA Issue: libgcc: Files/directories were installed but not shipped in any package:
  /usr/lib/arm-poky-eabi/4.9.3/thumb
  /usr/lib/arm-poky-eabi/4.9.3/fpu
  /usr/lib/arm-poky-eabi/4.9.3/thumb/libgcov.a
  /usr/lib/arm-poky-eabi/4.9.3/thumb/crtn.o
  /usr/lib/arm-poky-eabi/4.9.3/thumb/crtend.o
  /usr/lib/arm-poky-eabi/4.9.3/thumb/crtbegin.o
  /usr/lib/arm-poky-eabi/4.9.3/thumb/libgcc.a
  /usr/lib/arm-poky-eabi/4.9.3/thumb/crti.o
  /usr/lib/arm-poky-eabi/4.9.3/fpu/libgcov.a
  /usr/lib/arm-poky-eabi/4.9.3/fpu/crtn.o
  /usr/lib/arm-poky-eabi/4.9.3/fpu/crtend.o
  /usr/lib/arm-poky-eabi/4.9.3/fpu/crtbegin.o
  /usr/lib/arm-poky-eabi/4.9.3/fpu/libgcc.a
  /usr/lib/arm-poky-eabi/4.9.3/fpu/crti.o
Please set FILES such that these items are packaged. Alternatively if they are unneeded,
avoid installing them or delete them within do_install. [installed-vs-shipped]

(From OE-Core rev: 603b2f3ef400ec66a6899a7b407cbfecd3da5910)

Signed-off-by: Juro Bystricky <juro.bystricky@intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-09-24 17:54:30 +01:00
Richard Tollerton d70c5cb9ca gcc-5.2: disable isl
We presently don't package isl. Unfortunately, if the host is already
using gcc-5.2 (as is presently the case on Arch Linux), configure will
autodetect the host's libisl, and do_compile will break because the
system isl headers aren't pulled in. In lieu of packaging isl, disable
it for now.

[YOCTO #8376]

(From OE-Core rev: 555e8d110435cf4af1e1ab4699c2fa55898e9d80)

Signed-off-by: Richard Tollerton <rich.tollerton@ni.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-09-24 17:54:27 +01:00
Roy Li 75bad1b64b gcc: reformat 0063-nativesdk-gcc-support.patch
0063-nativesdk-gcc-support.patch can not be applied to source code due to
the buggy patch command on sled11, so reformat it, nothing is changed.

(From OE-Core rev: 2c8c3d9c4b65d2a5c7976d530138ebcaac2b1447)

Signed-off-by: Roy Li <rongqing.li@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-09-12 23:01:53 +01:00
Ross Burton 1c914a844b meta: Fix Upstream-Status statements
Fix a variety of problems such as typos, bad punctuations, or incorrect
Upstream-Status values.

(From OE-Core rev: bd220fe6ce8c3a0805f13a14706d3130ea872604)

Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-09-12 23:01:53 +01:00
Robert Yang 1f868877f1 gcc-5.2: remake 0040-nativesdk-gcc-support.patch
It couldn't be applied by sled11's patch, now fix it.

(From OE-Core rev: e01b450a419aba2164a86510ca1ae402ec86aff0)

Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-09-12 22:48:36 +01:00
Leonardo Sandoval 1efd172dd8 gcc-target.inc: Remove non-related gcc headers from include_fixed folder
Without this patch, the D's include_fixed folder may change after building it
(due to the gcc's fixinc.sh script, executed on the do_compile task) and changes
depend on the current sysroot headers, making the gcc's builds non-deterministic.

[YOCTO #7882]

(From OE-Core rev: e0af4b2c8f8e29ac6f8eccef401c7c004355359d)

Signed-off-by: Leonardo Sandoval <leonardo.sandoval.gonzalez@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-09-04 16:23:51 +01:00
Juro Bystricky 443c59b74a libgcc-common.inc: overrides for libc-baremetal
Added TCLIBC="baremetal" specific overrides.

(From OE-Core rev: 044f989b34e46f919e6b28860d7a1b396b2c3808)

(From OE-Core rev: 53153b9fd1ba56ca3df19d895d365054a5ecd50f)

Signed-off-by: Juro Bystricky <juro.bystricky@intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-08-30 12:35:52 +01:00
Juro Bystricky 466684e61b gcc-cross.inc: overrides for libc-baremetal
Modifications to to support build for TCLIBC="baremetal"

(From OE-Core rev: 9e7da158e0e7628c22013fbee34270f7d2db621f)

(From OE-Core rev: 92eb54c6b7424770f96a8e14e792cbe5124968c3)

Signed-off-by: Juro Bystricky <juro.bystricky@intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-08-30 12:35:51 +01:00
Juro Bystricky 260aa5203d gcc-cross-canadian.inc: overrides for libc-baremetal
Modify configure arguments (EXTRA_OECONF) to support build for
TCLIBC="baremetal"

(From OE-Core rev: 87e81e469fd941fa1b41ded3e02644695cafd2dc)

(From OE-Core rev: 1a79426dabf9237fa2cdd5908ff370bf1d9fa2df)

Signed-off-by: Juro Bystricky <juro.bystricky@intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-08-30 12:35:51 +01:00
Randy MacLeod 70b45d6216 gcc-source: exlude from world
Exclude all versions of gcc-source from world builds so that:
   bitbake -c <stage> world
will work. gcc-source deletes most bitbake build stages
since it is a source-only package.

(From OE-Core rev: 0eda7b4d889b926ab97d60fcbb1c0d12d730f8ea)

Signed-off-by: Randy MacLeod <Randy.MacLeod@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-08-29 13:38:06 +01:00
Richard Purdie f494fc25ea gcc-multilib-config: Adapt mips for mips64 and different gcc versions
The location of some files for mips varies between gcc 4.9 and 5.2. Ensure
that we cover both cases (and allow specified files to be optional).

(From OE-Core rev: 5c33b0a752e6168200776da61dee7d4d807ddbb0)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-08-01 07:34:06 +01:00
Richard Purdie c125ef12ae cross-canadian/gcc: Various mips64 fixes
"n32" is a mips64 variant we need to consider when processing the TARGET_OS
extensions. Also add the multilib extensions for mips64.

(From OE-Core rev: fe26f809aaad5d5d608e841c99b817316c5a59a0)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-08-01 07:34:05 +01:00
Richard Purdie c1148330a1 libgcc: Fix symlink handling in cross-arch multilib cases
The symlink being generated needs to match both the current arch (e.g. mips
or mips64) but also use the underlying TARGET_SYS without multilib extensions
to TARGET_VENDOR or extensions to TARGET_OS.

The way multilib changes TARGET_VENDOR meant this code did not have
a way of removing that change. The method of removing some TARGET_OS
suffixes was also not working.

By using immediate expansion to run this code, we can run before the
multilib code changes it and get the original values.

We then use the *current* TARGET_ARCH value in case this does get changed
by the multilib since we need to point at the right compiler (32 bit one
for 32 bit code).

(From OE-Core rev: 89cd6c244b6bc0a8cb52ec84d378d5b305df030f)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-08-01 07:34:05 +01:00
Richard Purdie 6c4b21d7af gcc-multilib-config: Tweak naming of options to match gcc's expectations
gcc itself does not add the '-' of options to its multilib configuration.
We should follow its example.

(From OE-Core rev: e742eef3e1016a29f744341c17d1b421d318b40f)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-08-01 07:34:04 +01:00
Richard Purdie cc21092c6d gcc-cross-canadian: Add symlink to real-ld alongside other symlinks
In some cases such as cross architecture configurations (using mips-X-linux
on mips64-X-linux), gcc can get confused about finding a 'real' version
of ld. Adding a symlink to 'real-ld' allowed these configurations
to work properly.

(From OE-Core rev: cdd86896c8d29135f937968e9aa07f919cf543d3)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-08-01 07:34:04 +01:00
Richard Purdie c4e40a48fb gcc: Add patch to handle on target multilibs better
On target multilibs did not work properly since gcc-cross-canadian
was only searching a limited number of sysroot directories to
find multilib target binaries.

This adds an extra search path to ensure those binaries are found
and our gcc-cross-canadian works everywhere we need it to, e.g.
with mips trilib configurations.

(From OE-Core rev: b928d92bb9f76c118846d6c495dc57c149368f0f)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-08-01 07:34:04 +01:00
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
Robert Yang e86dc1a182 gcc-target 5.1: fix for libcc1
Fixed:
* gcc 5 introduces a plugin libcc1.so, which is used by gdb, the target
gcc didn't build it in the past because gcc_cv_objdump is null, and
the error was:
gcc-5.2.0/libcc1/configure: line 14531: -T: command not found

This only happens for tar gcc as the code shows:
  if test x$build = x$host; then
    export_sym_check="objdump${exeext} -T"
  elif test x$host = x$target; then
    export_sym_check="$gcc_cv_objdump -T"
  else
    export_sym_check=
  fi

* Install libcc1.so and libcc1plugin.so to
  $(libexecdir)/gcc/$(target_noncanonical)/$(gcc_version) as lto-plugin did.

* Use sed command to fix bad RPATH iussue.

[YOCTO #7956]

(From OE-Core rev: f6e47aa9b12f9ab61530c40e0343f451699d9077)

Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-07-27 12:28:00 +01:00
Khem Raj fd91e71077 gcc5: Upgrade from 5.1 to 5.2
This is second bugfix release in gcc5 series
All backported patches are dropped
no other patches needed any rework

(From OE-Core rev: 2a212e56a814e5dc8a8bae4974b91109ed0486ef)

Signed-off-by: Khem Raj <raj.khem@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-07-27 12:28:00 +01: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
Khem Raj 671a00b977 gcc-5: Backport patches for -Wno-narrowing behaviour fixes
Chromium/CEF reveals these warnings which are then treated as errors
which has been fixed on gcc_5 branch upsteam. We backport the relevant
commits

Change-Id: I088a1480d49cdb439c72f0e159bee6de8ba94258
(From OE-Core rev: a8a5c58ec753a8bddc824eb15b06ad4cc8bd021e)

Signed-off-by: Khem Raj <raj.khem@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-07-12 22:55:39 +01:00
Khem Raj ee9e365eca gcc-4.9: Upgrade to 4.9.3
Drop upsteamed patch for
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66483 which is already in
4.9.3

rename 0063-Use-SYSTEMLIBS_DIR-replacement-instead-of-hardcoding.patch
to 0062-Use-SYSTEMLIBS_DIR-replacement-instead-of-hardcoding.patch to
keep the sequence

(From OE-Core rev: 626f7c1b848defe1fb34c2b2c3f0664dca2a8366)

Signed-off-by: Khem Raj <raj.khem@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-07-12 22:55:39 +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
Robert Yang e53c8719ba gcc-source.inc: fix STAMPCLEAN to avoid race issue
Fixed race issue when build more than one gcc-source and inherit
rm_work, for example:
$ bitbake gcc-source-4.9.2 gcc-source-5.1.0

File "/path/to/bitbake/lib/bb/build.py", line 512, in exec_task
  return _exec_task(fn, task, d, quieterr)
File "/path/to/bitbake/lib/bb/build.py", line 489, in _exec_task
  make_stamp(task, localdata)
File "/path/to/bitbake/lib/bb/build.py", line 599, in make_stamp
  os.unlink(name)
OSError: [Errno 2] No such file or directory: '/path/to/tmp/stamps/work-shared/gcc-4.9.2-r0.do_rm_work_all.02cf1ed9b79d4edb0a51d3b913b7f9ba'

This is because make_stamp() uses glob.glob() to remove the old stamps
before create the new one, when gcc-source-5.1.0 removes gcc-4.9.2-r0's
stamp, we may get the error.

We can't use deltask do_rm_work_all as do_rm_work since it is a
recrdeptask, otherwise:
ERROR: Command execution failed: Traceback (most recent call last):
  File "/path/to/bitbake/lib/bb/command.py", line 102, in runAsyncCommand
    commandmethod(self.cmds_async, self, options)
  File "/path/to/bitbake/lib/bb/command.py", line 324, in generateDotGraph
    command.cooker.generateDotGraphFiles(pkgs_to_build, task)
  File "/path/to/bitbake/lib/bb/cooker.py", line 847, in generateDotGraphFiles
    depgraph = self.generateTaskDepTreeData(pkgs_to_build, task)
  File "/path/to/bitbake/lib/bb/cooker.py", line 672, in generateTaskDepTreeData
    rq.rqdata.prepare()
  File "/path/to/bitbake/lib/bb/runqueue.py", line 587, in prepare
    generate_recdeps(dep)
  File "/path/to/bitbake/lib/bb/runqueue.py", line 575, in generate_recdeps
    add_resolved_dependencies([taskData.tasks_fnid[t]], tasknames, newdeps)
TypeError: list indices must be integers, not NoneType

Update STAMPCLEAN to contain ${PV} to fix the problem.

(From OE-Core rev: 9099d46a46ee511d1b7e496472c5b973e8e8feaf)

Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-06-11 23:59:18 +01:00
Andre McCurdy 7a4c52c7ae gcc-source.inc: set PATH for gnu-configize, not for cd
Setting OE's PATH for the 'cd' command has no real effect.

In the normal case it has no effect for the gnu-configize command
either (since OE's PATH is already set in the context which runs
do_preconfigure) but it may be useful when manually re-running a
failed gnu-configize commandline copied from an error log, etc.

(From OE-Core rev: 4321fce801daea50baaaae9ed6a141c6e7712834)

Signed-off-by: Andre McCurdy <armccurdy@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-05-29 10:17:15 +01:00
Robert Yang a3eda321a6 gcc-5: fix installed-vs-shipped
gcc-5.1.0: gcc: Files/directories were installed but not shipped in any package:
  /usr/bin/i586-poky-linux-gcov-tool

(From OE-Core rev: 3e2ca755624c13a8249ac66672ebf4d8d7217e62)

Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-05-14 11:43:56 +01:00
Richard Purdie f65a6821f4 gcc5: Add back g++ sysroot patch
Without this, g++/c++ compilation doesn't work on target due to missing
header files. Automated sanity tests fail. Add back the gcc4 patch to
address this.

(From OE-Core rev: 93d8becf19cc72df650d3aaff7e3ea188bd6e09e)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-05-14 11:43:56 +01:00
Richard Purdie 2d09cb28f2 gcc5: Add PR65779 patch to fix powerpc compile issues
This fixes compile issues on powerpc with gcc 5 which show up with
errors like:

| make[2]: Entering directory '/media/build1/poky/build/tmp/work/ppc7400-poky-linux/xprop/1_1.2.2-r0/build'
| powerpc-poky-linux-gcc  -m32 -mhard-float -mcpu=7400 --sysroot=/media/build1/poky/build/tmp/sysroots/qemuppc -Wall -Wpointer-arith -Wmissing-declarations -Wformat=2 -Wstrict-prototypes -Wmissing-prototypes -Wnested-externs -Wbad-function-cast -Wold-style-definition -Wdeclaration-after-statement -Wunused -Wuninitialized -Wshadow -Wmissing-noreturn -Wmissing-format-attribute -Wredundant-decls -Wlogical-op -Werror=implicit -Werror=nonnull -Werror=init-self -Werror=main -Werror=missing-braces -Werror=sequence-point -Werror=return-type -Werror=trigraphs -Werror=array-bounds -Werror=write-strings -Werror=address -Werror=int-to-pointer-cast -Werror=pointer-to-int-cast -fno-strict-aliasing  -O2 -pipe -g -feliminate-unused-debug-types  -Wl,-O1 -Wl,--hash-style=gnu -Wl,--as-needed -o xprop dsimple.o clientwin.o xprop.o -lX11
| /media/build1/poky/build/tmp/sysroots/qemuppc/usr/lib/../lib/libX11.so: undefined reference to `.LCL2'
| collect2: error: ld returned 1 exit status

[YOCTO #7721]

(From OE-Core rev: 1702f52b5860336d36fb912fbe2851437e74a7d5)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-05-12 13:10:17 +01:00
Khem Raj 4e5d6c71c8 gcc-4.9, gcc-5: Use variable SYSTEMLIBS_DIR instead of hardcoding it for aarch64
Change-Id: I54dc82a569f02d489137d88f16d6b768c4ab779b
(From OE-Core rev: dd45caac51868263bc7e7911a9c1ac96141ed474)

Signed-off-by: Khem Raj <raj.khem@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-05-09 22:26:44 +01:00