title: arm-linux-gnueabihf-g++: error: unrecognized command line option ‘--build-id’
body: <p>I am trying to compile a simple module kernel with an ARM CROSS_COMPILE </p>
  
  <pre><code>    obj-m := hello_dkm.o
      default:
          $(MAKE) -C $(KDIR) SUBDIRS=$(PWD) modules
      clean:
          $(MAKE) -C $(KDIR) SUBDIRS=$$PWD clean
  </code></pre>
  
  <p>I have got the error below in the shell:</p>
  
  <pre><code>    make -C $(KDIR) SUBDIRS = $$PWD
         LD /drv-hello-world/src/impl/built-in.o
         CC [M] /drv-hello-world/src/impl/hello_dkm.o
         Building modules, stage 2.
         MODPOST 1 modules
         CC   ~/drv-hello-world/src/impl/hello_dkm.mod.o
         LD [M]  ~/drv-hello-world/src/impl/hello_dkm.ko
         arm-linux-gnueabihf-g++: error: unrecognized command line option ‘--
         build-id’
  
      my comments: --build-id is an LD flag added in the kernel makefile as below:
     # Use --build-id when available. (Linux Makefile - line ~613)
     LDFLAGS_BUILD_ID = $(patsubst -Wl$(comma)%,%,\
                $(call cc-ldoption, -Wl$(comma)--build-id,)) #--build-id
     KBUILD_LDFLAGS_MODULE += $(LDFLAGS_BUILD_ID)
     LDFLAGS_vmlinux += $(LDFLAGS_BUILD_ID)
  </code></pre>
  
  <p>Appendix</p>
  
  <pre><code>    # The C compiler.
      CC = arm-linux-gnueabihf-gcc
      # The linker.
      LD = arm-linux-gnueabihf-ld
      ARCH = arm
      kernel target: Linux socfpga_cyclone5 3.7.0 #1 SMP Thu Apr 25 18:36:58 CDT 2013 armv7l GNU/Linux
      host : Opensuse linux 4.4.36-5-default
  </code></pre>
  
  <p>Best,</p>
  
  <pre><code>    EDIT solved: I had to modify the LD def to $(CROSS_COMPILE)ld
  </code></pre>