arm-linux-gnueabihf-g ++:错误:无法识别的命令行选项'--build-id'

时间:2017-06-01 08:51:02

标签: c++ linux makefile compiler-errors linux-kernel

我正在尝试使用ARM CROSS_COMPILE

编译一个简单的模块内核
$(function(){
    $('.modal').on('show.bs.modal', function () {
      console.log( $(this).prop('id') );
    });
});

我在shell中遇到以下错误:

    obj-m := hello_dkm.o
    default:
        $(MAKE) -C $(KDIR) SUBDIRS=$(PWD) modules
    clean:
        $(MAKE) -C $(KDIR) SUBDIRS=$$PWD clean

附录

    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)

最佳,

    # 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

0 个答案:

没有答案