# build kernel fail



## jotawski (Mar 30, 2013)

Hi,

I am trying to build a new kernel, just do not use debug in kernel since it takes almost all root file system.

I got this error during `# make buildkernel KERNCONF=MNIHKLOM` 

```
-pointer-sign -c aicasm_macro_scan.c
cc -O2 -pipe -I. -I/usr/src/sys/modules/aic7xxx/aicasm/../../../dev/aic7xxx/aica
sm -std=gnu99  -Wsystem-headers -Werror -Wall -Wno-format-y2k -W -Wno-unused-par
ameter -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith -Wreturn-type -W
cast-qual -Wwrite-strings -Wswitch -Wshadow -Wunused-parameter -Wcast-align -Wno
-pointer-sign  -o aicasm aicasm.o aicasm_symbol.o aicasm_gram.o aicasm_macro_gra
m.o aicasm_scan.o aicasm_macro_scan.o -ll
 
--------------------------------------------------------------
>>> stage 3.1: making dependencies
--------------------------------------------------------------
cd /kaitag/obj//usr/src/sys/MNIHKLOM; MAKEOBJDIRPREFIX=/kaitag/obj/  MACHINE_ARC
H=i386  MACHINE=i386  CPUTYPE= GROFF_BIN_PATH=/kaitag/obj//usr/src/tmp/legacy/us
r/bin  GROFF_FONT_PATH=/kaitag/obj//usr/src/tmp/legacy/usr/share/groff_font  GRO
FF_TMAC_PATH=/kaitag/obj//usr/src/tmp/legacy/usr/share/tmac  _SHLIBDIRPREFIX=/ka
itag/obj//usr/src/tmp  _LDSCRIPTROOT=  VERSION="FreeBSD 9.1-STABLE i386 901503"
 INSTALL="sh /usr/src/tools/install.sh"  PATH=/kaitag/obj//usr/src/tmp/legacy/us
r/sbin:/kaitag/obj//usr/src/tmp/legacy/usr/bin:/kaitag/obj//usr/src/tmp/legacy/u
sr/games:/kaitag/obj//usr/src/tmp/usr/sbin:/kaitag/obj//usr/src/tmp/usr/bin:/kai
tag/obj//usr/src/tmp/usr/games:/sbin:/bin:/usr/sbin:/usr/bin COMPILER_TYPE=clang
 make KERNEL=kernel depend -DNO_MODULES_OBJ
machine -> /usr/src/sys/i386/include
x86 -> /usr/src/sys/x86/include
cc -c -O2 -pipe -fno-strict-aliasing -std=c99 -Wall -Wredundant-decls -Wnested-e
xterns -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith -Winline -Wcast-
qual -Wundef -Wno-pointer-sign -fformat-extensions -Wmissing-include-dirs -fdiag
nostics-show-option -Wno-error-tautological-compare -Wno-error-empty-body -Wno-e
rror-parentheses-equality -nostdinc -I. -I/usr/src/sys -I/usr/src/sys/contrib/al
tq -I/usr/src/sys/contrib/ipfilter -I/usr/src/sys/contrib/pf -I/usr/src/sys/dev/
ath -I/usr/src/sys/dev/ath/ath_hal -I/usr/src/sys/contrib/ngatm -I/usr/src/sys/d
ev/twa -I/usr/src/sys/gnu/fs/xfs/FreeBSD -I/usr/src/sys/gnu/fs/xfs/FreeBSD/suppo
rt -I/usr/src/sys/gnu/fs/xfs -I/usr/src/sys/dev/cxgb -I/usr/src/sys/dev/cxgbe -D
_KERNEL -DHAVE_KERNEL_OPTION_HEADERS -include opt_global.h -mno-aes -mno-avx -mn
o-mmx -mno-sse -msoft-float -ffreestanding -fstack-protector /usr/src/sys/i386/i
386/genassym.c
cc1: error: unrecognized command line option "-mno-aes"
cc1: error: unrecognized command line option "-mno-avx"
cc1: error: unrecognized command line option "-Wno-error-tautological-compare"
cc1: error: unrecognized command line option "-Wno-error-empty-body"
cc1: error: unrecognized command line option "-Wno-error-parentheses-equality"
*** [genassym.o] Error code 1
 
Stop in /kaitag/obj/usr/src/sys/MNIHKLOM.
*** [buildkernel] Error code 1
 
Stop in /usr/src.
*** [buildkernel] Error code 1
 
Stop in /usr/src.
root@MNIHKLOM:/usr/src #
```

My computer uname is 
	
	



```
FreeBSD MNIHKLOM.jesGroup.in.th 9.1-STABLE FreeBSD 9.1-STABLE #0 r248122: Mon Mar 11 03:29:24 ICT 2013     [email]root@MNIHKLOM.jesGroup.in.th[/email]:/kaitag/obj/usr/src/sys/GENERIC  i386
```

and file /etc/make.conf content is

```
BATCH=yes

WITH_CLANG=yes
WITH_CLANG_IS_CC=yes

gcc=clang
g++=clang++
cpp=clang-cpp

TMPDIR=/kaitag/tmp
PACKAGES=/kaitag/packages/i386
DISTDIR=/kaitag/distfiles/i386
WRKDIRPREFIX=/kaitag/MANEE

PYTHON_DEFAULT_VERSION= python2.7 
PYTHON_VERSION=	python2.7

# added by use.perl 2013-03-11 11:12:46
PERL_VERSION=5.14.2
```

What is wrong with building process?
Any helps and hints are welcome.


----------



## spag (Jan 21, 2014)

Hi I have very similar problem with FreeBSD 10.

```
or /usr/src/sys/amd64/amd64/genassym.c
cc1: error: unrecognized command line option "-mno-aes"
cc1: error: unrecognized command line option "-mno-avx"
cc1: error: unrecognized command line option "-Wno-error-tautological-compare"
cc1: error: unrecognized command line option "-Wno-error-empty-body"
cc1: error: unrecognized command line option "-Wno-error-parentheses-equality"
*** Error code 1
```

I am doing a custom kernel with additional lines:

```
options         IPSEC
options         IPSEC_NAT_T
device          crypto
options         IPSEC_FILTERTUNNEL
device          enc
options         LIBALIAS
options         IPDIVERT
```

any solutions?


----------



## lyuts (Jan 21, 2014)

I don't have my /etc/make.conf handy to doublecheck, but it seems to me you are supposed to override cc,c++,cpp, however, you are overriding gcc,g++ instead. I think that will not work.


----------



## lyuts (Jan 21, 2014)

lyuts said:
			
		

> I don't have my /etc/make.conf handy to doublecheck, but it seems to me you are supposed to override cc,c++,cpp, however, you are overriding gcc,g++ instead. I think that will not work.



Apologies, meant to say CC, CXX, CPP instead of cc, c++, cpp.


----------



## spag (Jan 24, 2014)

added to make.conf:

```
CC=clang
CXX=clang++
CPP=clang-cpp
```
and works fine now.

Thanks


----------



## trh411 (Jan 24, 2014)

spag said:
			
		

> added to make.conf:
> 
> ```
> CC=clang
> ...


You don't need any of that for FreeBSD-10.0 since that is the default. You will need them for pre-10.0 systems though.


----------



## spag (Jan 24, 2014)

I had to add this after upgrade to FreeBSD-10.0 from 9.1 . Upgrade went without any issues. Without changes to make.conf I was not able to build custom kernel, get error messages above. Is it possible that upgrade went wrong?


----------



## SirDice (Jan 24, 2014)

Try following these instructions from /usr/src/UPDATING:

```
To build a kernel
        -----------------
        If you are updating from a prior version of FreeBSD (even one just
        a few days old), you should follow this procedure.  It is the most
        failsafe as it uses a /usr/obj tree with a fresh mini-buildworld,

        make kernel-toolchain
        make -DALWAYS_CHECK_MAKE buildkernel KERNCONF=YOUR_KERNEL_HERE
        make -DALWAYS_CHECK_MAKE installkernel KERNCONF=YOUR_KERNEL_HERE
```


----------



## orthanner (Jan 25, 2014)

Can't update following these steps: `make kernel-toolchain` fails:

```
lib/ncurses/form (cleandir)
Unknown modifier 't'

Error expanding embedded variable.
*** Error code 2

Stop in /usr/src/lib/ncurses.
*** Error code 1

Stop in /usr/src/lib.
*** Error code 1

Stop in /usr/src.
*** Error code 1

Stop in /usr/src.
*** Error code 1

Stop in /usr/src.
```

My /etc/make.conf contains nothing related to compilers, it only specifies Ruby and Perl versions used.


----------

