title: Linux kernel module programming - Cannot use CONFIG_CC_STACKPROTECTOR_REGULAR: -fstack-protector not supported by compiler
body: <p>I am on Linux Ubuntu 14.04. I want to start Linux Kernel Module Programming. I have hello.c (simple Hello World module) and Makefile. But, on "make" command, I get error.</p>
  
  <p>I tried <a href="https://stackoverflow.com/questions/40772003/cannot-use-config-cc-stackprotector-strong-fstack-protector-strong-not-support">Cannot use CONFIG_CC_STACKPROTECTOR_STRONG: -fstack-protector-strong not supported by compiler</a> , but it did not work for me.</p>
  
  <p>hello.c</p>
  
  <pre><code>/* hello.c − Illustrating the __init, __initdata and __exit macros. */
  
  #include &lt;linux/module.h&gt;
  /* Needed by all modules */
  #include &lt;linux/kernel.h&gt;
  /* Needed for KERN_INFO */
  #include &lt;linux/init.h&gt;
  /* Needed for the macros */
  
  static int hello3_data __initdata = 3;
  
  static int __init hello_3_init(void)
  {
    printk(KERN_INFO "Hello, world %d\n", hello3_data);
    return 0;
  }
  
  static void __exit hello_3_exit(void)
  {
    printk(KERN_INFO "Goodbye, world 3\n");
  } 
  
  module_init(hello_3_init);
  module_exit(hello_3_exit);
  </code></pre>
  
  <p>Makefile</p>
  
  <pre><code>obj-m += hello.o
  all:
      make -C /lib/modules/$(shell uname -r)/build M=$(PWD) modules
  
  clean:
      make -C /lib/modules/$(shell uname -r)/build M=$(PWD) clean
  </code></pre>
  
  <p>On "make" :-</p>
  
  <pre><code>k@k-Inspiron-3542:~/Kernel programs$ make
  make -C /lib/modules/4.2.0-27-generic/build M=/home/k/Kernel programs modules
  make[1]: Entering directory `/usr/src/linux-headers-4.2.0-27-generic'
  arch/x86/Makefile:138: CONFIG_X86_X32 enabled but no binutils support
  Makefile:662: Cannot use CONFIG_CC_STACKPROTECTOR_REGULAR: -fstack-protector not supported by compiler
  make[1]: *** No rule to make target `programs'.  Stop.
  make[1]: Leaving directory `/usr/src/linux-headers-4.2.0-27-generic'
  make: *** [all] Error 2
  </code></pre>
  
  <p>Currently, my ubuntu has 4.2 kernel. I even tried this on 3.x kernel, but there was this same error.</p>
  
  <p>Please help me in this. Thanks. :)</p>