dmalloc: make fix_ld hack more robust
dmalloc: make fix_ld hack more robust

We sometimes see dmalloc failing to build due to a mysterious
duplicate cross compile prefix
(e.g. arm-926ejs-linux-gnueabi-arm-926ejs-linux-gnueabi-ld). This
string can appear in the Makefile if do_compile is run twice, since
the fix_ld hack is not idempotent.

I haven't found a way to reliably reproduce the actual problem, but
the wrong makefile is easy to reproduce:

  # from completely clean state
  oe bake dmalloc -y
  rm tmp/stamp/machine/arm-926ejs-linux-gnueabi/dmalloc-5.5.2/do_compile
  oe bake dmalloc -y
  less tmp/work/machine/arm-926ejs-linux-gnueabi/dmalloc-5.5.2/src/dmalloc-5.5.2/Makefile

But unfortunately, in this case, the second bake fails to fail, since
the rules containing those ld calls don't get used by make (everything
was already succesfully built). However, the buildbot definitely
experiences this from time to time, and I've also seen it locally
during an "oe bake world".

In any case, we can make the fix a little more robust by only
replacing "ld" if it's preceded by a tab character.

oe-lite/base,esben/base,oe-lite/base,moths/base,moths/base,esben/base,esben/base,esben/base,oe-lite/base,moths/base,oe-lite/base,oe-lite/base,oe-lite/base,moths/base,esben/base,moths/base,esben/base,moths/base