Commit Graph

33 Commits

Author SHA1 Message Date
Juro Bystricky 7f0f7df8b3 kernel-arch.bbclass: conditional error message
The single purpose of "map_kernel_arch" is to set

   export ARCH = "some-arch"

The case when "some-arch" is not a valid Linux architecture results in an error.
This makes sense if the TARGET_OS is Linux, but that is not always the case.
kernel-arch is also inherited by toolchain-script, which may be used to build
toolchains for architectures not supported by Linux.

Rather than modifying toolchain-script to provide its own version of "map_arch"
this patch bypasses the error if the TARGET_OS is not linux.

(From OE-Core rev: 0b931e983b1f663d5d7dc65f1db7687334dd3ef2)

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>
2017-04-20 07:55:26 +01:00
Khem Raj dc80d4f4bc kernel-arch: Lock the toolchain to use gcc compiler
kernel and external modules are still using gcc to build

(From OE-Core rev: 75cf0f0690c9c192e4cbffb71015866f967c2e1f)

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>
2017-03-08 11:52:57 +00:00
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
Juro Bystricky ca3c782964 kernel-arch.bbclass: Add xtensa and arc into valid_archs table
Both "arc" and "xtensa" are valid Linux architectures, add
them into valid_archs table.

(From OE-Core rev: 20d511cd1b7fe4891f7842be12f13a92da433c46)

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>
2016-10-15 10:01:43 +01:00
Zubair Lutfullah Kakakhel caf7e849c9 kernel-arch.bbclass: Add mipsisa{32, 64}r6{el, } support
Add support for MIPS Release 6 ISA

(From OE-Core rev: aecb57f2fd65a1bfbc2e9a23fba4984d44055c4c)

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
Ioan-Adrian Ratiu 3fa1c54a69 Revert "kernel/kernel-arch: Explicitly mapping between i386/x86_64 and x86 for kernel ARCH"
This reverts commit 8d310b24927d0f348fb431895f0583733db2aad0.

That commit completely breaks KBUILD_DEFCONFIG because it relies on
$ARCH to match between the target OE arch and the kernel subdirectory
containing the defconfigs. In the kernel all defconfigs for everything
x86-based (including x86_64) is stored in dir arch/x86/configs/

kernel-yocto.bbclass correctly searches for all the defconfigs inside
${S}/arch/${ARCH}/configs/${KBUILD_DEFCONFIG}

Commit 8d310b249 makes it search in wrong places and _only_ if you
define TARGET_ARCH = "athlon" will it search x86 which is nonsensical.

The commit further adds an if clause to hack the mungled kernel arches
back to their original values (ugh) in do_shared_workdir which is run
after do compile, but of course the build breaks before that in
do_kernel_metadata because of the KBUILD_DEFCONFIG mentioned above (so
that hack is useless).

Please fix that corner case bug in another way which does not completely
screw up the kernel arch mapping & defconfig logic. If 64bit configs are
generated in the kernel for 32bit machines because the host is asked,
then it it a bug in the kernel, it is of no use to hack around it in OE.

(From OE-Core rev: bc02a478a5d4a5de7b3943ed809d5c22711f5b1f)

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-02-04 23:39:02 +00:00
Jianxun Zhang c0e9f2d2b6 kernel/kernel-arch: Explicitly mapping between i386/x86_64 and x86 for kernel ARCH
For a bare-bone kernel recipe which specifies 32 bit x86 target,
a 64 bit .config will be generated from do_configure task when
building 32-bit qemux86, once all of these conditions are true:

* arch of host is x86_64
* kernel source tree used in build has commit ffee0de41 which
  actually chooses i386 or x86_64 defconfig by asking host when
  ARCH is "x86" (arch/x86/Makefile)
* bare-bone kernel recipe inherits directly from kernel without
  other special treatments.

Build will fail because of the mismatched kernel architecture.

The patch sets ARCH i386 or x86_64 explicitly to configure
task to avoid this host contamination. Kernel artifact is also
changed so that it can map i386 and x64 back to arch/x86 when
needed.

(From OE-Core rev: 8d310b24927d0f348fb431895f0583733db2aad0)

Signed-off-by: Jianxun Zhang <jianxun.zhang@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-01-15 15:44:56 +00:00
Marek Vasut 8efff24775 kernel-arch: Add nios2 to valid archs
Add nios2 target to valid arch list definition.

Based on previous work by Walter Goossens <waltergoossens@home.nl>
at https://github.com/wgoossens/meta-nios2 .

(From OE-Core rev: f0af7d0d9316a6eeacc0686b8c4640491f255883)

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Walter Goossens <waltergoossens@home.nl>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-09-23 09:53:07 +01:00
Khem Raj aced11f4dc kernel-arch: Force BFD kernel when using gcc for linking
We redefine LD to point to ld.bfd when building kernel, which works in
most cases since kbuild system calls out for bare LD most of the time,
however some of newer kernels e.g. 4.1+ have some code added which can
call gcc directly to do the linking job e.g. arm vdso code

This causes build failures when we have configured the default cross
toolchain to use gold linker as default. Errors like

BFD: arch/arm/vdso/vdso.so: Not enough room for program headers, try
linking with -N
| arm-angstrom-linux-gnueabi-objcopy:arch/arm/vdso/vdso.so[.hash]: Bad
value

start happening.

With this patch we force gcc to choose bfd linker as well

(From OE-Core rev: 5724e4d245f142ac6fb1ea211503fd220683354d)

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-08-24 23:46:57 +01:00
Nathan Rossi 55c96db259 kernel-arch: Update mapping for MicroBlaze architectures
* Add pattern matching for the 'microblazeeb' architecture which maps to
  'microblaze' in the same way as 'microblazeel'

(From OE-Core rev: c2f488f629b3dd604db171772b762d46a28c2895)

Signed-off-by: Nathan Rossi <nathan.rossi@xilinx.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-05-05 22:15:17 +01:00
Nathan Rossi 76c8fadec9 Revert "kernel-arch.bbclass: add arm64 support to U-Boot architecture map"
This reverts commit 0b891265716c414ade29d587fc1a3c4ea7beadbe.

U-Boot does support AArch64, this however was only added to newer
versions of U-Boot and at the time of this original commit the U-Boot in
OE-Core did not support the 'arm64' architecture. OE-Core now has a
newer version of U-Boot for the mkimage recipe and thus supports the
'arm64' architecture.

(From OE-Core rev: fd8158134f3d7a7c795c818cc50eb2858a6cae06)

Signed-off-by: Nathan Rossi <nathan.rossi@xilinx.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-02-21 22:05:35 +00:00
Fathi Boudra 54beec100e kernel-arch.bbclass: add arm64 support to U-Boot architecture map
to define UBOOT_ARCH, we map kernel architectures to U-Boot architectures.
In the case of arm64 kernel, we should map to arm U-boot architecture.

This patch add the exception rule to the map_uboot_arch function.

(From OE-Core rev: 0b891265716c414ade29d587fc1a3c4ea7beadbe)

Signed-off-by: Fathi Boudra <fathi.boudra@linaro.org>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-03-21 12:05:54 +00:00
Victor Kamensky 5c63fc7a67 classes: add aarch64_be target
Add big endian ARMv8 target to OE infrastructure

(From OE-Core rev: 570ae1afecc88b12a11e62a4341069c125d18403)

Signed-off-by: Victor Kamensky <victor.kamensky@linaro.org>
Signed-off-by: Koen Kooi <koen.kooi@linaro.org>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-10-14 16:55:32 +01:00
Phil Blundell 5652086c75 kernel-arch: Always use ld.bfd to link the kernel
The kernel's penchant for custom linker scripts means that it doesn't
generally get on very well with gold.  Make sure we are using the BFD
linker here no matter what the distro default is set to.

(From OE-Core rev: 5c8277610ae84740e0724b27f10dba3895d40c05)

Signed-off-by: Phil Blundell <philb@gnu.org>
Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-04-28 12:12:21 +01:00
Matthew McClintock db1d22ab38 kernel-arch.bbclass: don't pass extra args to KERNEL_{CC, LD, AR}
Commit a3ca06c3b4 added extra args to
KERNEL_CC, these revert that bit while maintaining machine additions
in TARGET_??_KERNEL_ARCH

Producing incorrect instructions and generating the following errors:

   CC      arch/powerpc/kernel/init_task.o
| {standard input}: Assembler messages:
| {standard input}:384: Error: junk at end of line: `1'
| {standard input}:949: Error: junk at end of line: `1'
| {standard input}:1428: Error: junk at end of line: `1'
| {standard input}:1526: Error: junk at end of line: `1'
| {standard input}:1626: Error: junk at end of line: `1'
| {standard input}:1685: Error: junk at end of line: `1'
| {standard input}:1973: Error: junk at end of line: `1'
| {standard input}:2001: Error: junk at end of line: `1'
| {standard input}:2100: Error: junk at end of line: `1'
| {standard input}:2168: Error: junk at end of line: `1'
| {standard input}:2520: Error: junk at end of line: `1'
|   CC      arch/powerpc/lib/locks.o

(From OE-Core rev: 6ed278ab93e9c3bb291dd37837c27e120954afc7)

Signed-off-by: Matthew McClintock <msm@freescale.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-03-05 13:14:52 +00:00
Khem Raj a3ca06c3b4 kernel.bbclass, module-base.bbclass: Use CC to form KERNEL_CC
kernel compiler is not special and we currently have it so
we want to pass -march and -mtune options as CFLAGS to kernel
build so that compiler picks the right subarch flags when
compiling assembly files in particular. Otherwise defaults
are chosen which may not be right in many case e.g. when
compiling kernel for collie machine we should use arch=armv4
but it uses toolchain/as defaults which is armv5te

in some case e.g. thumb1 we know that kernel can not be compiled
in thumb1 mode so we can provide that information e.g. -marm
option through KERNEL_HOST_CC_ARCH variable as we do now

(From OE-Core rev: c49f967384ccbfe131bbb33ee518014f3fc4b38f)

Signed-off-by: Khem Raj <raj.khem@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-01-20 12:58:56 +00:00
Marcin Juszkiewicz 128c3903cd kernel-arch.bblass: add AArch64 support
(From OE-Core rev: 9583a46221580ba46ebfd6d561d3a4d6b0d42eea)

Signed-off-by: Marcin Juszkiewicz <marcin.juszkiewicz@linaro.org>
Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-10-18 12:13:37 +01:00
Richard Purdie bfd279de32 Convert tab indentation in python functions into four-space
(From OE-Core rev: 604d46c686d06d62d5a07b9c7f4fa170f99307d8)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-07-19 10:24:50 +01:00
Robert P. J. Day 1d9e129c25 kernel-arch: Remove test for long-dead arm26 architecture.
(From OE-Core rev: ff3f912eed0270afa14d706fc1e57f8a1de2614b)

Signed-off-by: Robert P. J. Day <rpjday@crashcourse.ca>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-07-02 16:47:44 +01:00
Khem Raj 8bc899a1b8 kernel-arch.bbclass: Map mips64{el} to mips KARCH
(From OE-Core rev: 22ce249a814f750bc47ead9ce281fcbd63c775c8)

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
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 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
Kumar Gala dcedeff5fe kernel-arch: Add handling of powerpc64
(From OE-Core rev: ed6b9934b33cff3173d327b09e05ee02aa3a68c8)

Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-07-22 11:56:50 +01:00
Adrian Alonso b358424bb0 kernel-arch: microblaze little endian fix kernel arch
* In map_kernel_arch function return valid arch for
  microblazeel target arch.
  if TARGET_ARCH = "microblazeel" return "microblaze"

(From OE-Core rev: 86e36055dc61279c9c3616ad4bc47695f83bad06)

Signed-off-by: Adrian Alonso <aalonso@secretlab.ca>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-07-07 13:45:30 +01:00
Adrian Alonso 49d21ed99e kernel-arch: add microblaze to valid archs
* Add Microblaze target to valid arch list definition

(From OE-Core rev: 709a199bd18478b5d7af6bf6130e5210793c7ad2)

Signed-off-by: Adrian Alonso <aalonso@secretlab.ca>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-05-10 09:56:19 +01:00
Joshua Lock 1c4cc60e28 kernel-arch: x86-64 is no longer a valid architecture, map it to x86
Also use the exported (and re-mapped) ARCH rather than TARGET_ARCH in the
linux-wrs recipe.

Signed-off-by: Joshua Lock <josh@linux.intel.com>
2010-08-13 17:16:19 +01:00
Bruce Ashfield ae6c323a0b qemu: update kernel mapping to return x86 for i586 TARGET_ARCH
Signed-off-by: Bruce Ashfield <bruce.ashfield@windriver.com>
2010-07-19 11:59:51 -04:00
Joshua Lock 2c3437d0ae kernel-arch.bbclass: merge improved arch detection from OE.dev
Signed-off-by: Joshua Lock <josh@linux.intel.com>
2010-05-20 15:15:55 +01:00
Richard Purdie c54117458a classes: Remove and sanitise import statements
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2009-11-13 12:15:28 +00:00
Richard Purdie 1803f03b91 kernel-arch.bbclass: Sync with OE.dev
git-svn-id: https://svn.o-hand.com/repos/poky/trunk@4210 311d38ba-8fff-0310-9ca6-ca027cbcb966
2008-04-08 15:37:41 +00:00
Richard Purdie 720e0b144c classes: Sync various classes with OE for various bugfixes
git-svn-id: https://svn.o-hand.com/repos/poky/trunk@2407 311d38ba-8fff-0310-9ca6-ca027cbcb966
2007-08-08 20:41:55 +00:00
Richard Purdie 93a8d0662e classes: Sync with OE
git-svn-id: https://svn.o-hand.com/repos/poky/trunk@651 311d38ba-8fff-0310-9ca6-ca027cbcb966
2006-08-27 16:01:33 +00:00
Richard Purdie b2f192faab Rename /openembedded/ -> /meta/
git-svn-id: https://svn.o-hand.com/repos/poky/trunk@530 311d38ba-8fff-0310-9ca6-ca027cbcb966
2006-07-21 10:10:31 +00:00