编译器 gcc 4.8.3 不支持 -fstack-protector-strong

编译器 gcc 4.8.3 不支持 -fstack-protector-strong

在 Fedora 20 上,我需要为制造商提供的特定 PCI Express 串行端口卡安装 Linux 驱动程序。为了做到这一点,我必须编译驱动程序的源代码。当我在源代码目录中发出“make”命令时,出现以下错误:

[root@localhost driver]# make
make[1]: Entering directory `/usr/src/kernels/3.16.6-203.fc20.i686+PAE'
Makefile:649: Cannot use CONFIG_CC_STACKPROTECTOR_STRONG: -fstack-protector-strong not supported by compiler
make[1]: *** No rule to make target `Tech'.  Stop.
make[1]: Leaving directory `/usr/src/kernels/3.16.6-203.fc20.i686+PAE'
make: *** [modules] Error 2

“Makefile”文件如下:

# Comment/uncomment the following line to enable/disable debugging
DEBUG = y 

KERNEL_DIR ?= /lib/modules/$(shell uname -r)/build
PWD       := $(shell pwd)

ifeq ($(DEBUG),y)
  DEBFLAGS = -O -g -DSCULLV_DEBUG -DDEBUG # "-O" is needed to expand inlines
else
  DEBFLAGS = -O2
endif

EXTRA_CFLAGS += $(DEBFLAGS) -I$(LDDINC) -DLINUX

TARGET = cti_serial_core

get_variable = $(strip $(shell grep "^[[:space:]]*$(1)[[:space:]]*=\{1\}[[:space:]]*" $(2) | cut -d= -f2))

# NOTE: In the call there can be *no* whitespace after the comma
VERSION := $(call get_variable,VERSION,$(KERNEL_DIR)/Makefile)
PATCHLEVEL := $(call get_variable,PATCHLEVEL,$(KERNEL_DIR)/Makefile)
SUBLEVEL := $(call get_variable,SUBLEVEL,$(KERNEL_DIR)/Makefile)
EXTRAVERSION := $(call get_variable,EXTRAVERSION,$(KERNEL_DIR)/Makefile)
LOCALVERSION := $(call get_variable,LOCALVERSION,$(KERNEL_DIR)/.config)
KERNELRELEASE := $(VERSION).$(PATCHLEVEL).$(SUBLEVEL)$(EXTRAVERSION)$(LOCALVERSION)

ifneq ($(KERNELRELEASE),)

  cti_serial_core-objs :=  serial_core.o 8250_core.o 
  cti_8250_pci-objs :=  8250_pci.o 

  obj-m := cti_serial_core.o 
  obj-m += cti_8250_pci.o 

else

  KERNEL_DIR ?= /lib/modules/$(shell uname -r)/build
  PWD       := $(shell pwd)

endif

all: modules

install: modules_install

#DEPMOD : = depmod

modules modules_install clean::
    @$(MAKE) -C $(KERNEL_DIR) M=$(PWD) $@

Linux 内核版本是:

[root@localhost driver]# uname -r
3.16.6-203.fc20.i686+PAE

gcc编译器版本是:

[root@localhost driver]# gcc -v
Using built-in specs.
COLLECT_GCC=/usr/bin/gcc
COLLECT_LTO_WRAPPER=/usr/libexec/gcc/i686-redhat-linux/4.8.3/lto-wrapper
Target: i686-redhat-linux
Configured with: ../configure --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --with-bugurl=http://bugzilla.redhat.com/bugzilla --enable-bootstrap --enable-shared --enable-threads=posix --enable-checking=release --with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions --enable-gnu-unique-object --enable-linker-build-id --with-linker-hash-style=gnu --enable-languages=c,c++,objc,obj-c++,java,fortran,ada,go,lto --enable-plugin --enable-initfini-array --enable-java-awt=gtk --disable-dssi --with-java-home=/usr/lib/jvm/java-1.5.0-gcj-1.5.0.0/jre --enable-libgcj-multifile --enable-java-maintainer-mode --with-ecj-jar=/usr/share/java/eclipse-ecj.jar --disable-libjava-multilib --with-isl=/builddir/build/BUILD/gcc-4.8.3-20140911/obj-i686-redhat-linux/isl-install --with-cloog=/builddir/build/BUILD/gcc-4.8.3-20140911/obj-i686-redhat-linux/cloog-install --with-tune=generic --with-arch=i686 --build=i686-redhat-linux
Thread model: posix
gcc version 4.8.3 20140911 (Red Hat 4.8.3-7) (GCC) 

我该如何解决这个问题以便编译这个驱动程序?

相关内容