]> code.ossystems Code Review - openembedded-core.git/commitdiff
kernel: make copying of crtsavres.o conditional
authorBruce Ashfield <bruce.ashfield@windriver.com>
Tue, 6 Mar 2018 18:11:17 +0000 (13:11 -0500)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Thu, 8 Mar 2018 23:27:58 +0000 (15:27 -0800)
As of the 4.13 kernel, there are configuration + linker combinations
that do not need (or build) crtsavres.o for ppc64 targets. The commit
of interest is:

    commit efe0160cfd40a99c052a00e174787c1f4158a9cd
    Author: Nicholas Piggin <npiggin@gmail.com>
    Date:   Fri May 12 01:56:52 2017 +1000

        powerpc/64: Linker on-demand sfpr functions for modules

        For final link, the powerpc64 linker generates fpr save/restore
        functions on-demand, placing them in the .sfpr section. Starting with
        binutils 2.25, these can be provided for non-final links with
        --save-restore-funcs. Use that where possible for module links.

        This saves about 200 bytes per module (~60kB) on powernv defconfig
        build.

Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
As such, our arch test for crtsavres.o is not enough, we add a secondary
existence check before trying the copy.

[YOCTO #12576]

Signed-off-by: Bruce Ashfield <bruce.ashfield@windriver.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/classes/kernel.bbclass

index 321c0a47bb2eab23389d25eb802664584af897be..9bc0e4125124c3a5aadd97ff9bde2cf146ba1d5f 100644 (file)
@@ -466,8 +466,10 @@ do_shared_workdir () {
        # arch/powerpc/lib/crtsavres.o which is present in
        # KBUILD_LDFLAGS_MODULE, making it required to build external modules.
        if [ ${ARCH} = "powerpc" ]; then
-               mkdir -p $kerneldir/arch/powerpc/lib/
-               cp arch/powerpc/lib/crtsavres.o $kerneldir/arch/powerpc/lib/crtsavres.o
+               if [ -e arch/powerpc/lib/crtsavres.o ]; then
+                       mkdir -p $kerneldir/arch/powerpc/lib/
+                       cp arch/powerpc/lib/crtsavres.o $kerneldir/arch/powerpc/lib/crtsavres.o
+               fi
        fi
 
        if [ -d include/generated ]; then