Linux – Apply kernel patch to support PIC Mode

kali-linuxkernelpatch

I am getting an error when I try to compile drivers for a TP Link AC 600, on Kali Linux amd64 4.7.0 gcc 5.4.1 Debian 5.4.1-3.

The error is "error code model kernel does not support PIC mode"

After some flat footing I found someone whom was having similar issues and someone had posted a patch.

How do I apply the patch, and to where do I apply it?

Here is the other link: Cannot compile kernel: error, kernel does not support PIC mode

Best Answer

As far as Ubuntu and Intel drivers are concerned, Intel only tested their drivers for LTS versions of Ubuntu (see answer by Todd Fujinaka). So you need to downgrade Ubuntu from 16.10 to 16.04.1 LTS (reinstall while keeping /home).

For all other Debian-based distros like Kali, the same is true: you need to downgrade (ie reinstall) to a version that is explicitly supported by the driver vendor. A version before the gcc PIC stuff.

That may not be a pleasant answer, but it is technically correct and if you're not a kernel developer yourself, then all you can do is hang out on a kernel mailing list and very politely ask if a developer can work on the driver code. Sometimes that works, but be patient.

Related Question