Legato build error: failed to create symbolic link

DEBUG: Executing shell function do_patch
ln: failed to create symbolic link ‘/home/costa/sierra/yocto/build_bin/tmp/work/armv7a-neon-poky-linux-gnueabi/lk/1.3.0-r2/lk/app/aboot/sierra’: No such file or directory
WARNING: /home/costa/sierra/yocto/build_bin/tmp/work/armv7a-neon-poky-linux-gnueabi/lk/1.3.0-r2/temp/run.do_patch.200:1 exit 1 from ‘ln -sf /home/costa/sierra/yocto/kernel/.git/…/arch/arm/mach-msm/sierra /home/costa/sierra/yocto/build_bin/tmp/work/armv7a-neon-poky-linux-gnueabi/lk/1.3.0-r2/lk/app/aboot/sierra’
ERROR: Function failed: do_patch (log file is located at /home/costa/sierra/yocto/build_bin/tmp/work/armv7a-neon-poky-linux-gnueabi/lk/1.3.0-r2/temp/log.do_patch.200)

Workaround:

ln -sf $PWD/lk/ build_bin/tmp/work/armv7a-neon-poky-linux-gnueabi/lk/1.3.0-r2/lk

Used in:

Please remove lk and build_bin directories in yocto directory and issue below commands .
make clean
make

Also, May i know which module you are using? and the steps followed for building?

Done:
cd yocto
make clean
rm -rf lk
make
With the same result.

cat meta-swi-extras/meta-swi-mdm9x28*/files/fw-version
SWI9X07Y_02.16.02.00 (from Legato-Dist-Source-mdm9x28-SWI9X07Y_02.16.02.00.tar.bz2)

The problem is sill persist with Legato-Dist-Source-mdm9x28-SWI9X07Y_02.18.06.00.tar.bz2

Thanks

Did you make in customized changes in yocto?
We have tried in Release 9 (Legato-Dist-Source-mdm9x28-SWI9X07Y_02.16.02) and Release 10.1 (Legato-Dist-Source-mdm9x28-SWI9X07Y_02.18.06) without any changes in yocto and compilation is successfull.

I’ve compiled without changes with parameters:

NUM_THREADS=1 BB_NUMBER_THREADS=1 make

It looks there are broken dependencies and race condition.

Ok, We are able to compile with the command “NUM_THREADS=1 BB_NUMBER_THREADS=1 make” in the yocto path. We require more details, please let me know if any other changes made in yocto path or running other commands apart from this?

I found the problem:
I compiled with make -C yocto instead of cd yocto; make.
The root cause id that Makefile uses PWD, when it should use CURDIR.