# cc: error: unknown argument: '-fformat-extensions' while buildkernel



## dridrikos (May 3, 2022)

Hello, I have this error and the process stopped while build a custom kernel, does anyone knows what is going wrong?
I am using FreeBSD 13.0


----------



## T-Daemon (May 4, 2022)

Besides following build errors

```
unknown option "PROCDESC"
unknown option ACPI_DMAR
unknown device random
unknown device tun
unknown device faith
```
and after excluding affected options and devices, no problem here:

```
--------------------------------------------------------------
>>> Kernel build for CONF_anis completed on Wed May  4 01:50:34 +02 2022
--------------------------------------------------------------
```
System and source is 13.0-RELEASE-p11 amd64.

Have you set something in /etc/make.conf or /etc/src.conf ?

Which source version are you trying to build on 13.0 host? Is the source tree a fresh one or updated? If updated, try a fresh one.


----------



## dridrikos (May 4, 2022)

Thank you for replying!! I downloaded freebsd 13.0-RELEASE amd64 and I am running it through virtualbox. I have not make any changes to these two files but I noticed that I wrote 2 extra lines in /etc/rc.conf, so I deleted them. I have still the same problem  , do you run it and worked?


----------



## T-Daemon (May 4, 2022)

dridrikos said:


> do you run it and worked?


Yes, the CONF_anis kernel configuration builds just fine, without those options and devices unknown.

How did you fetched the source tree?


----------



## Alain De Vos (May 4, 2022)

Don't attach files in this forum but just paste them eg between  CODE /CODE  [blocks].

Running freebsd under virtualbox or bare-metal makes no difference.
rc.conf has no influence on compilation,it is for starting services.
Use "su -" to go to root in order to have no cluttered environment variables.
Can you paste your "make.conf" ?


----------



## dridrikos (May 4, 2022)

T-Daemon said:


> Yes, the CONF_anis kernel configuration builds just fine, without those options and devices unknown.
> 
> How did you fetched the source tree?


By writting this:  sudo svn co https://svn0.us-east.FreeBSD.org/base/stable/10 /usr/src

I have done by steps:
1) sudo pkg install subversion
2)rehash
3)sudo svn co https://svn0.us-east.FreeBSD.org/base/stable/10 /usr/src
4)cd /usr/src/sys/amd64/conf
5)sudo nano CONF_anis
   --And fill the nano text with options/devices
6)cd /usr/src
7)sudo make buildkernel KERNCONF=CONF_anis
  -- Which has the problem

Oh, wait you mean I have to delete those options from the nano?


----------



## T-Daemon (May 4, 2022)

dridrikos said:


> By writting this: sudo svn co https://svn0.us-east.FreeBSD.org/base/stable/10 /usr/src


FreeBSD 10.* is EoL since October 31, 2018 and unsupported.


----------



## T-Daemon (May 4, 2022)

In case if you are asking if the CONF_anis (13.0-RELEASE) kernel is functional, I have it running in Virtualbox:


----------



## dridrikos (May 4, 2022)

T-Daemon said:


> FreeBSD 10.* is EoL since October 31, 2018 and unsupported.


Thanks, so which one should me use, or which one do you use that builds the kernel properly


----------



## T-Daemon (May 4, 2022)

dridrikos said:


> Thanks, so which one should me use, or which one do you use that builds the kernel properly


I used my systems 13.0-RELEASE source code.

To get the source for your system check its version first: `uname -r`

If the host system is 13.0-RELEASE then get its source as described below. If it's some other version please ask before proceeding.

The procedure to populate /usr/src:

Delete old  /usr/src: `rm -r /usr/src`

Install devel/git if not installed, e.g. lite version:

Package:
`pkg install git-lite`

Port:
`cd /usr/ports/devel/git`
`make FLAVOR=lite install clean`

Clone the source from the FreeBSD remote repository:
`git clone --branch releng/13.0 https://git.FreeBSD.org/src.git /usr/src`

Edit CONF_anis, clean those unknown options and devices, build kernel.

To reduce the build time of future builds from source enable META_MODE before the first build. To make the "filemon" kernel module load automatically on reboot add `kld_list="filemon"` to /etc/rc.conf. In case there is a `kld_list` line already, add "filemon" whitespace-separated besides present entries.


----------

