The patch by Pavel worked for me (LS1021, fsl-toolchain).
When I was trying to build fsl-toolchain, I saw the following error.
--------------------
$ bitbake fsl-toolchain
Loading cache: 100% |###########################################| ETA: 00:00:00
Loaded 3442 entries from dependency cache.
NOTE: Resolving any missing task queue dependencies
Build Configuration:
BB_VERSION = "1.28.0"
BUILD_SYS = "x86_64-linux"
NATIVELSBSTRING = "Ubuntu-14.04"
TARGET_SYS = "arm-fsl-linux-gnueabi"
MACHINE = "ls1021atwr"
DISTRO = "fsl-qoriq"
DISTRO_VERSION = "2.0"
TUNE_FEATURES = "arm armv7a vfp neon callconvention-hard cortexa7"
TARGET_FPU = "vfp-neon"
meta
meta-yocto
meta-yocto-bsp = "HEAD:9a211a4a2c1bfcb292dc97d8dcac149bca9e3f1b"
meta-oe
meta-multimedia
meta-gnome
meta-networking
meta-perl
meta-python
meta-ruby
meta-filesystems
meta-webserver
meta-xfce = "HEAD:dc5634968b270dde250690609f0015f881db81f2"
meta-freescale = "HEAD:7facbdb726e2dda0515e084c2066a4b8dd99c6d2"
meta-freescale-internal = "HEAD:4829293f807e35a1111e79763294fc8b98b97810"
meta-freescale-extra = "HEAD:bee911b027e0480b034674d0ddee3fcb06d2e985"
meta-virtualization = "HEAD:042425c1d98bdd7e44a62789bd03b375045266f5"
meta-java = "HEAD:8b776ac68f9af4596be3824152bcf0bc6b67fa1d"
meta-openstack
meta-openstack-aio-deploy
meta-openstack-compute-deploy
meta-openstack-compute-test-config
meta-openstack-controller-deploy
meta-openstack-controller-test-config
meta-openstack-qemu
meta-openstack-swift-deploy
meta-cloud-services = "HEAD:d8bc0d92d0f741e2ea1e6d3d9bc6b7a091d03cfb"
meta-security = "HEAD:f9367e71f923fc7d2fb600208e2b97535ea41777"
meta-linaro-toolchain = "HEAD:10b71bed9cfe76baa22c72806ff814cf85c2f73b"
meta-nxp-npi-1703 = "jethro-sdk-v2.0-ga-17.03:d8f8d3a5d3ee18f881466938b847cef9b08c4a35"
NOTE: Preparing RunQueue
NOTE: Checking sstate mirror object availability (for 497 objects)
NOTE: Executing SetScene Tasks
NOTE: Executing RunQueue Tasks
ERROR: Function failed: do_configure (log file is located at /home/xxx/Work/QorIQ-SDK/QorIQ-SDK-V2.0-20160527-yocto/build_ls1021atwr/tmp/work/ls1021atwr-fsl-linux-gnueabi/linux-qoriq/4.1-r0/temp/log.do_configure.117644)
ERROR: Logfile of failure stored in: /home/xxx/Work/QorIQ-SDK/QorIQ-SDK-V2.0-20160527-yocto/build_ls1021atwr/tmp/work/ls1021atwr-fsl-linux-gnueabi/linux-qoriq/4.1-r0/temp/log.do_configure.117644
Log data follows:
| DEBUG: Executing python function sysroot_cleansstate
| DEBUG: Python function sysroot_cleansstate finished
| DEBUG: Executing shell function do_configure
| cp: cannot stat '/home/xxx/Work/QorIQ-SDK/QorIQ-SDK-V2.0-20160527-yocto/build_ls1021atwr/tmp/work/ls1021atwr-fsl-linux-gnueabi/linux-qoriq/4.1-r0/git/arch/arm/configs/ls1021a_defconfig': Too many levels of symbolic links
| WARNING: exit code 1 from a shell command.
| ERROR: Function failed: do_configure (log file is located at /home/xxx/Work/QorIQ-SDK/QorIQ-SDK-V2.0-20160527-yocto/build_ls1021atwr/tmp/work/ls1021atwr-fsl-linux-gnueabi/linux-qoriq/4.1-r0/temp/log.do_configure.117644)
ERROR: Task 1979 (/home/xxx/Work/QorIQ-SDK/QorIQ-SDK-V2.0-20160527-yocto/sources/meta-freescale/recipes-kernel/linux/linux-qoriq_4.1.bb, do_configure) failed with exit code '1'
NOTE: Tasks Summary: Attempted 776 tasks of which 661 didn't need to be rerun and 1 failed.
Waiting for 0 running tasks to finish:
Summary: 1 task failed:
/home/xxx/Work/QorIQ-SDK/QorIQ-SDK-V2.0-20160527-yocto/sources/meta-freescale/recipes-kernel/linux/linux-qoriq_4.1.bb, do_configure
Summary: There was 1 ERROR message shown, returning a non-zero exit code.
$
--------------------
Looking into the error message, it seemed that circular references of symbolic links was created during the bitbake.
--------------------
$ ls -l /home/xxx/Work/QorIQ-SDK/QorIQ-SDK-V2.0-20160527-yocto/build_ls1021atwr/tmp/work/ls1021atwr-fsl-linux-gnueabi/linux-qoriq/4.1-r0/
total 20
...
lrwxrwxrwx 1 xxx xxx 114 7月 8 13:12 git -> /home/xxx/Work/QorIQ-SDK/QorIQ-SDK-V2.0-20160527-yocto/build_ls1021atwr/tmp/work-shared/ls1021atwr/kernel-source
...
$ ls -l /home/xxx/Work/QorIQ-SDK/QorIQ-SDK-V2.0-20160527-yocto/build_ls1021atwr/tmp/work-shared/ls1021atwr
total 12
...
lrwxrwxrwx 1 xxx xxx 134 7月 8 13:20 kernel-source -> /home/xxx/Work/QorIQ-SDK/QorIQ-SDK-V2.0-20160527-yocto/build_ls1021atwr/tmp/work/ls1021atwr-fsl-linux-gnueabi/linux-qoriq/4.1-r0/git
--------------------
It is correct that 'git' is a symbolic link, but kernel-source should be a real kernel source tree.
During the bitbake, it was replaced by a symbolic link and circular references was created.
I applied the patch and did bitbake fsl-toolchain again, then the error was resolved.