Android Kernel 'Fstack-Protector-Strong Not Supported` Error

I'm running Ubuntu 14.04. I have GCC 4.9 installed on my machine. I am trying to compile the Android kernel and I'm getting the below error,

Makefile:660: Cannot use CONFIG_CC_STACKPROTECTOR_STRONG: -fstack-protector-strong not supported by compiler
  CHK     include/config/kernel.release
  CHK     include/generated/uapi/linux/version.h
  CHK     include/generated/utsrelease.h
make[1]: `include/generated/mach-types.h' is up to date.
  CC      kernel/bounds.s
arm-linux-gnueabihf-gcc: error: unrecognized command line option ‘-fstack-protector-strong’
make[1]: *** [kernel/bounds.s] Error 1
make: *** [prepare0] Error 2

Any way that I could solve this?

2 Answers

You need to edit the MakeFile in the kernel/rpi directory we're working in. See: "Makefile:660: Cannot use CONFIG_CC_STACKPROTECTOR_STRONG: -fstack-protector-strong not supported by compiler"

Go to line 660 and comment out the block of code relating to CONFIG_CC_STACKPROTECTOR_STRONG then try again :)

1

I have melt this problem. As to the output Makefile:660: Cannot use CONFIG_CC_STACKPROTECTOR_STRONG: -fstack-protector-strong not supported by compiler,the compiler doesn't support -fstack-protector-strong.

When compiling the Android Kernel,the CROSS_COMPILE env sets the gcc toolchains we used.So you can set the env to AOSP gcc toolchain position or you can download new toolchains and set the env to it.

For example:

# install toolchain,default in /usr/bin
sudo apt-get install gcc-aarch64-linux-gnu gcc-arm-linux-gnueab
export CROSS_COMPILE=/usr/bin/aarch64-linux-gnu-

or

export CROSS_COMPILE=aarch64-linux-android-
export PATH=~/data/AOSP/prebuilts/gcc/linux-x86/aarch64/aarch64-linux-android-4.9/bin:$PATH

Your Answer

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

Alexander Ross

Alexander Ross

Gaming, Esports & Interactive Media Writer

Alexander Ross has covered the video game industry for a decade, writing deep dives on game design, esports tournaments, VR developments, and gaming culture.

Share this article
Twitter Facebook Pinterest