mirror of
git://git.yoctoproject.org/poky.git
synced 2025-08-22 00:42:05 +02:00

The initial fix for localversion setting in 6.3+ broke older recipes and also broke recipes setting localversion in a kernel recipe, as make-mod-scripts (and other locations) can trigger a regeneration of files and don't have access to the variable. Moving the setting of this variable to the global namespace doesn't make sense, so we follow the example of the kernel-abiversion and save a kernel-localversion to the build artifacts. Recipes that may regenerate scripts/dynamic files, must depend on the do_shared_workedir of the kernel and use the helper function to read the file storing the localversion. (From OE-Core rev: cca0971a7d92d823cc0c2b16cf14a7b2ed8ecb61) Signed-off-by: Bruce Ashfield <bruce.ashfield@gmail.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com> cherry-picked from master b378eec156998eea55ba61e59103cb34fab0d07c Signed-off-by: Andreas Helbech Kleist <andreaskleist@gmail.com> Acked-by: Ryan Eatmon <reatmon@ti.com> Signed-off-by: Steve Sakoman <steve@sakoman.com>
68 lines
2.7 KiB
Plaintext
68 lines
2.7 KiB
Plaintext
#
|
|
# set the ARCH environment variable for kernel compilation (including
|
|
# modules). return value must match one of the architecture directories
|
|
# in the kernel source "arch" directory
|
|
#
|
|
|
|
valid_archs = "alpha cris ia64 \
|
|
i386 x86 \
|
|
m68knommu m68k ppc powerpc powerpc64 ppc64 \
|
|
sparc sparc64 \
|
|
arm aarch64 \
|
|
m32r mips \
|
|
sh sh64 um h8300 \
|
|
parisc s390 v850 \
|
|
avr32 blackfin \
|
|
microblaze \
|
|
nios2 arc riscv xtensa"
|
|
|
|
def map_kernel_arch(a, d):
|
|
import re
|
|
|
|
valid_archs = d.getVar('valid_archs').split()
|
|
|
|
if re.match('(i.86|athlon|x86.64)$', a): return 'x86'
|
|
elif re.match('arceb$', a): return 'arc'
|
|
elif re.match('armeb$', a): return 'arm'
|
|
elif re.match('aarch64$', a): return 'arm64'
|
|
elif re.match('aarch64_be$', a): return 'arm64'
|
|
elif re.match('aarch64_ilp32$', a): return 'arm64'
|
|
elif re.match('aarch64_be_ilp32$', a): return 'arm64'
|
|
elif re.match('mips(isa|)(32|64|)(r6|)(el|)$', a): return 'mips'
|
|
elif re.match('mcf', a): return 'm68k'
|
|
elif re.match('riscv(32|64|)(eb|)$', a): return 'riscv'
|
|
elif re.match('p(pc|owerpc)(|64)', a): return 'powerpc'
|
|
elif re.match('sh(3|4)$', a): return 'sh'
|
|
elif re.match('bfin', a): return 'blackfin'
|
|
elif re.match('microblazee[bl]', a): return 'microblaze'
|
|
elif a in valid_archs: return a
|
|
else:
|
|
if not d.getVar("TARGET_OS").startswith("linux"):
|
|
return a
|
|
bb.error("cannot map '%s' to a linux kernel architecture" % a)
|
|
|
|
export ARCH = "${@map_kernel_arch(d.getVar('TARGET_ARCH'), d)}"
|
|
|
|
def map_uboot_arch(a, d):
|
|
import re
|
|
|
|
if re.match('p(pc|owerpc)(|64)', a): return 'ppc'
|
|
elif re.match('i.86$', a): return 'x86'
|
|
return a
|
|
|
|
export UBOOT_ARCH = "${@map_uboot_arch(d.getVar('ARCH'), d)}"
|
|
|
|
# Set TARGET_??_KERNEL_ARCH in the machine .conf to set architecture
|
|
# specific options necessary for building the kernel and modules.
|
|
TARGET_CC_KERNEL_ARCH ?= ""
|
|
HOST_CC_KERNEL_ARCH ?= "${TARGET_CC_KERNEL_ARCH}"
|
|
TARGET_LD_KERNEL_ARCH ?= ""
|
|
HOST_LD_KERNEL_ARCH ?= "${TARGET_LD_KERNEL_ARCH}"
|
|
TARGET_AR_KERNEL_ARCH ?= ""
|
|
HOST_AR_KERNEL_ARCH ?= "${TARGET_AR_KERNEL_ARCH}"
|
|
|
|
KERNEL_CC = "${CCACHE}${HOST_PREFIX}gcc ${HOST_CC_KERNEL_ARCH} -fuse-ld=bfd ${DEBUG_PREFIX_MAP} -fdebug-prefix-map=${STAGING_KERNEL_DIR}=${KERNEL_SRC_PATH} -fdebug-prefix-map=${STAGING_KERNEL_BUILDDIR}=${KERNEL_SRC_PATH}"
|
|
KERNEL_LD = "${CCACHE}${HOST_PREFIX}ld.bfd ${HOST_LD_KERNEL_ARCH}"
|
|
KERNEL_AR = "${CCACHE}${HOST_PREFIX}ar ${HOST_AR_KERNEL_ARCH}"
|
|
TOOLCHAIN ?= "gcc"
|