We now have added "--sysroot" to CLFAGS and CXXFLAGS, but some program uses LDFLAGS instead during the link time, so we need to add --sysroot into the LDFALGS in the environment files.
http://git.pokylinux.org/cgit/cgit.cgi/poky/commit/?id=b43e5d302969fb0a21eb5b9f97e78797af00b9a2
verified in bernard branch.