4

I am trying to upgrade my kernel to 4.5 in Linux Mint 17.3, but I get the following error:

Makefile:666: Cannot use CONFIG_CC_STACKPROTECTOR_STRONG: -fstack-protector-strong not supported by compiler

  LD      /var/lib/dkms/ndiswrapper/1.59/build/built-in.o
  MKEXPORT /var/lib/dkms/ndiswrapper/1.59/build/crt_exports.h
  MKEXPORT /var/lib/dkms/ndiswrapper/1.59/build/hal_exports.h
  MKEXPORT /var/lib/dkms/ndiswrapper/1.59/build/ndis_exports.h
  MKEXPORT /var/lib/dkms/ndiswrapper/1.59/build/ntoskernel_exports.h
  MKEXPORT /var/lib/dkms/ndiswrapper/1.59/build/ntoskernel_io_exports.h
  MKEXPORT /var/lib/dkms/ndiswrapper/1.59/build/rtl_exports.h
  MKEXPORT /var/lib/dkms/ndiswrapper/1.59/build/usb_exports.h
  MKSTUBS /var/lib/dkms/ndiswrapper/1.59/build/win2lin_stubs.h
  CC [M]  /var/lib/dkms/ndiswrapper/1.59/build/crt.o

gcc: error: unrecognized command line option ‘-fstack-protector-strong’
make[1]: *** [/var/lib/dkms/ndiswrapper/1.59/build/crt.o] Error 1
make: *** [_module_/var/lib/dkms/ndiswrapper/1.59/build] Error 2
make: Leaving directory `/usr/src/linux-headers-4.5.0-040500-generic'

I have GCC version 4.8.4.

Following is the error after upgrading gcc to 4.9. I read somewhere that this is a bug?

DKMS make.log for ndiswrapper-1.59 for kernel 4.5.0-040500-generic (x86_64)

make: Entering directory `/usr/src/linux-headers-4.5.0-040500-generic'
  LD      /var/lib/dkms/ndiswrapper/1.59/build/built-in.o
  MKEXPORT /var/lib/dkms/ndiswrapper/1.59/build/crt_exports.h
  MKEXPORT /var/lib/dkms/ndiswrapper/1.59/build/hal_exports.h
  MKEXPORT /var/lib/dkms/ndiswrapper/1.59/build/ndis_exports.h
  MKEXPORT /var/lib/dkms/ndiswrapper/1.59/build/ntoskernel_exports.h
  MKEXPORT /var/lib/dkms/ndiswrapper/1.59/build/ntoskernel_io_exports.h
  MKEXPORT /var/lib/dkms/ndiswrapper/1.59/build/rtl_exports.h
  MKEXPORT /var/lib/dkms/ndiswrapper/1.59/build/usb_exports.h
  MKSTUBS /var/lib/dkms/ndiswrapper/1.59/build/win2lin_stubs.h
  CC [M]  /var/lib/dkms/ndiswrapper/1.59/build/crt.o
  CC [M]  /var/lib/dkms/ndiswrapper/1.59/build/hal.o
  CC [M]  /var/lib/dkms/ndiswrapper/1.59/build/iw_ndis.o
  CC [M]  /var/lib/dkms/ndiswrapper/1.59/build/loader.o
/var/lib/dkms/ndiswrapper/1.59/build/loader.c: In function ‘load_sys_files’:
/var/lib/dkms/ndiswrapper/1.59/build/loader.c:157:4: error: implicit declaration of function ‘__vmalloc’ [-Werror=implicit-function-declaration]
    __vmalloc(load_driver->sys_files[i].size,
    ^
/var/lib/dkms/ndiswrapper/1.59/build/loader.c:156:19: warning: assignment makes pointer from integer without a cast
   pe_image->image =
                   ^
/var/lib/dkms/ndiswrapper/1.59/build/loader.c:207:5: error: implicit declaration of function ‘vfree’ [-Werror=implicit-function-declaration]
     vfree(driver->pe_images[i].image);
     ^
/var/lib/dkms/ndiswrapper/1.59/build/loader.c: In function ‘add_bin_file’:
/var/lib/dkms/ndiswrapper/1.59/build/loader.c:298:2: error: implicit declaration of function ‘vmalloc’ [-Werror=implicit-function-declaration]
  bin_file->data = vmalloc(driver_file->size);
  ^
/var/lib/dkms/ndiswrapper/1.59/build/loader.c:298:17: warning: assignment makes pointer from integer without a cast
  bin_file->data = vmalloc(driver_file->size);
                 ^
/var/lib/dkms/ndiswrapper/1.59/build/loader.c: In function ‘wrapper_ioctl’:
/var/lib/dkms/ndiswrapper/1.59/build/loader.c:789:15: warning: assignment makes pointer from integer without a cast
   load_driver = vmalloc(sizeof(*load_driver));
               ^
/var/lib/dkms/ndiswrapper/1.59/build/loader.c: In function ‘wrapper_ioctl_compat’:
/var/lib/dkms/ndiswrapper/1.59/build/loader.c:884:11: warning: assignment makes pointer from integer without a cast
   kdriver = vmalloc(sizeof(*kdriver));
           ^
cc1: some warnings being treated as errors
make[1]: *** [/var/lib/dkms/ndiswrapper/1.59/build/loader.o] Error 1
make: *** [_module_/var/lib/dkms/ndiswrapper/1.59/build] Error 2
make: Leaving directory `/usr/src/linux-headers-4.5.0-040500-generic'
4

Unsure if you are still looking for a response but I was running into the same problem trying to upgrade to 4.5.3 kernel. I found my system had gcc-5 installed and switching to that resolved the first problem (-fstack-protector-strong). I then received the second set of errors you listed about ndiswrapper/1.59. I believe this is a bug in that software but the solution I found was to modify the ndiswrapper code by adding two lines to one of the source files. This allowed it to compile successfully. Add these lines just prior to the existing line #include "ndiswrapper.h" in /usr/src/ndiswrapper-1.59/loader.h:

#define strnicmp strncasecmp // ndis.c fails to compile without this
#include <linux/vmalloc.h>   // loader.c fails to compile without this

Or here's a simple script to make the update for you (if you cut/paste correctly):

if ! grep -q strncasecmp /usr/src/ndiswrapper-1.59/loader.h; then
  sed -i -e '/ndiswrapper.h/i \
#define strnicmp strncasecmp \
#include <linux/vmalloc.h>' /usr/src/ndiswrapper-1.59/loader.h
fi
  • 1
    Fwiw, I also had to make another modification: there were complaints about dev->netdev->trans_start = jiffies that the field trans_start does not exist. This snippet should be modified as follows: netif_trans_update(dev->netdev). – Dmitry Frank Apr 8 '17 at 18:28
1

CONFIG_CC_STACKPROTECTOR_STRONG is a kernel config option added in 3.14 that builds with -fstack-protector-strong, which requires GCC 4.9. You either need to upgrade GCC to 4.9 or stop building the kernel with CONFIG_CC_STACKPROTECTOR_STRONG (the former would be better). There's some background info in this LWN article.

  • I have gcc4.9.4 but this does not fix anything. Same error. I also tried gcc5 and gcc6, still the same error. – Wang Nov 29 '17 at 10:38

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.