How to compile android kernel with gcc?

623 views
Skip to first unread message

dosi

unread,
Mar 16, 2020, 1:13:58 PM3/16/20
to Android Building

The defualt compiler of android kernel is clang and I'd like to compile android kernel with gcc. I tried to follow the instructions on https://source.android.com/setup/build/building-kernels and used the command “build/build.sh CC=gcc”. I got the following mistake: 


Cannot use CONFIG_LTO_CLANG: requires clang 5.0 or later


It seems like something related to LTO, so I disabled LTO according to the instructions from the above website and tried again. Then still failed:


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


By the way, I can build kernel with clang successfully. 

Please help me T.T

malware ttt

unread,
Jul 15, 2020, 11:29:38 AM7/15/20
to Android Building
I have same error :(
Reply all
Reply to author
Forward
0 new messages