Results 1 to 7 of 7

Thread: CC1 ERROR after running the make command

  1. #1
    Join Date
    Nov 2018
    Beans
    4

    CC1 ERROR after running the make command

    Hey, im building a kernel module and for some reason after a few times that it worked i get the following error:

    "cc1: error: code model kernel does not support PIC mode."

    i looked around tried all kinds of things and nothing seems to work, even installed ubuntu again because i thought i courrupted some files, help please! thank you.

  2. #2
    Join Date
    May 2014
    Location
    /home
    Beans
    10,939
    Distro
    Ubuntu 20.04 Focal Fossa

    Re: CC1 ERROR after running the make command


  3. #3
    Join Date
    Nov 2018
    Beans
    4

    Re: CC1 ERROR after running the make command

    i tried to add the EXTRA_FLAGS line it didnt work.
    about the comment with the patch - i didnt understand so idk ..

    i wierd stuff that i already build modules before and it suddenly happend.
    thanks for the quick replay!

  4. #4
    Join Date
    May 2014
    Location
    /home
    Beans
    10,939
    Distro
    Ubuntu 20.04 Focal Fossa

    Re: CC1 ERROR after running the make command

    Can you paste the contents of Makefile at paste.ubuntu.com and post a link?

  5. #5
    Join Date
    Nov 2018
    Beans
    4

    Re: CC1 ERROR after running the make command

    its the simplest module ever:


    obj-m += x.o

    all:
    make -C /lib/modules/$(shell uname -r)/build M=$(PWD) modules

    clean:
    make -C /lib/modules/$(shell uname -r)/build M=$(PWD) modules

    ------------------------------------------------------------------------------------

  6. #6
    Join Date
    May 2014
    Location
    /home
    Beans
    10,939
    Distro
    Ubuntu 20.04 Focal Fossa

    Re: CC1 ERROR after running the make command

    What kernel and Ubuntu version? Also check
    Code:
    cat /usr/src/linux-headers-$(uname -r)/Makefile | grep -i pie

  7. #7
    Join Date
    Nov 2018
    Beans
    4

    Re: CC1 ERROR after running the make command

    ok i have no idea how it happend but it fixed itself, thank for the help!

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •