# Kernel rebuild error



## Surya (Apr 3, 2018)

Hi Team,

I am trying to rebuild kernel but process is not going through and getting following errors. Could you please help me with this please.

FreeBSD version: 

```
root@:/usr/src # uname -a
FreeBSD  12.0-CURRENT FreeBSD 12.0-CURRENT #0 9c0b8085dc4(master): Thu Mar 22 18:40:22 IST 2018     root@:/usr/obj/usr/home/ssebasti/selwin/freebsd/amd64.amd64/sys/GENERIC  amd64
```

Error:


```
99  -Werror /usr/src/sys/amd64/amd64/support.S
/usr/src/sys/amd64/amd64/support.S:855:2: error: unknown directive
 .altmacro
 ^
<instantiation>:1:13: error: invalid register name
handle_ibrs_%(ll):
            ^~
<instantiation>:3:2: note: while in macro instantiation
 ibrs_seq_label %(ll)
 ^
<instantiation>:2:2: note: while in macro instantiation
 .rept 32
 ^
/usr/src/sys/amd64/amd64/support.S:884:2: note: while in macro instantiation
 ibrs_seq 32
 ^
<instantiation>:1:13: error: invalid register name
handle_ibrs_%(ll):
            ^~
<instantiation>:8:2: note: while in macro instantiation
 ibrs_seq_label %(ll)
 ^
<instantiation>:2:2: note: while in macro instantiation
 .rept 32
 ^
/usr/src/sys/amd64/amd64/support.S:884:2: note: while in macro instantiation
 ibrs_seq 32
 ^
<instantiation>:1:13: error: invalid register name
handle_ibrs_%(ll):
            ^~
<instantiation>:13:2: note: while in macro instantiation
 ibrs_seq_label %(ll)
 ^
<instantiation>:2:2: note: while in macro instantiation
 .rept 32
 ^
/usr/src/sys/amd64/amd64/support.S:884:2: note: while in macro instantiation
 ibrs_seq 32
 ^
<instantiation>:1:13: error: invalid register name
handle_ibrs_%(ll):
            ^~
<instantiation>:18:2: note: while in macro instantiation
 ibrs_seq_label %(ll)
 ^
<instantiation>:2:2: note: while in macro instantiation
 .rept 32
 ^
/usr/src/sys/amd64/amd64/support.S:884:2: note: while in macro instantiation
 ibrs_seq 32
 ^
<instantiation>:1:13: error: invalid register name
handle_ibrs_%(ll):
            ^~
<instantiation>:23:2: note: while in macro instantiation
 ibrs_seq_label %(ll)
 ^
<instantiation>:2:2: note: while in macro instantiation
 .rept 32
 ^
/usr/src/sys/amd64/amd64/support.S:884:2: note: while in macro instantiation
 ibrs_seq 32
 ^
<instantiation>:1:13: error: invalid register name
handle_ibrs_%(ll):
            ^~
<instantiation>:28:2: note: while in macro instantiation
 ibrs_seq_label %(ll)
 ^
<instantiation>:2:2: note: while in macro instantiation
 .rept 32
 ^
/usr/src/sys/amd64/amd64/support.S:884:2: note: while in macro instantiation
 ibrs_seq 32
 ^
<instantiation>:1:13: error: invalid register name
handle_ibrs_%(ll):
            ^~
<instantiation>:33:2: note: while in macro instantiation
 ibrs_seq_label %(ll)
 ^
<instantiation>:2:2: note: while in macro instantiation
 .rept 32
 ^
/usr/src/sys/amd64/amd64/support.S:884:2: note: while in macro instantiation
 ibrs_seq 32
 ^
<instantiation>:1:13: error: invalid register name
handle_ibrs_%(ll):
            ^~
<instantiation>:38:2: note: while in macro instantiation
 ibrs_seq_label %(ll)
 ^
<instantiation>:2:2: note: while in macro instantiation
 .rept 32
 ^
/usr/src/sys/amd64/amd64/support.S:884:2: note: while in macro instantiation
 ibrs_seq 32
 ^
<instantiation>:1:13: error: invalid register name
handle_ibrs_%(ll):
            ^~
<instantiation>:43:2: note: while in macro instantiation
 ibrs_seq_label %(ll)
 ^
<instantiation>:2:2: note: while in macro instantiation
 .rept 32
 ^
/usr/src/sys/amd64/amd64/support.S:884:2: note: while in macro instantiation
 ibrs_seq 32
 ^
<instantiation>:1:13: error: invalid register name
handle_ibrs_%(ll):
            ^~
<instantiation>:48:2: note: while in macro instantiation
 ibrs_seq_label %(ll)
 ^
<instantiation>:2:2: note: while in macro instantiation
 .rept 32
 ^
/usr/src/sys/amd64/amd64/support.S:884:2: note: while in macro instantiation
 ibrs_seq 32
 ^
<instantiation>:1:13: error: invalid register name
handle_ibrs_%(ll):
            ^~
<instantiation>:53:2: note: while in macro instantiation
 ibrs_seq_label %(ll)
 ^
<instantiation>:2:2: note: while in macro instantiation
 .rept 32
 ^
/usr/src/sys/amd64/amd64/support.S:884:2: note: while in macro instantiation
 ibrs_seq 32
 ^
<instantiation>:1:13: error: invalid register name
handle_ibrs_%(ll):
            ^~
<instantiation>:58:2: note: while in macro instantiation
 ibrs_seq_label %(ll)
 ^
<instantiation>:2:2: note: while in macro instantiation
 .rept 32
 ^
/usr/src/sys/amd64/amd64/support.S:884:2: note: while in macro instantiation
 ibrs_seq 32
 ^
<instantiation>:1:13: error: invalid register name
handle_ibrs_%(ll):
            ^~
<instantiation>:63:2: note: while in macro instantiation
 ibrs_seq_label %(ll)
 ^
<instantiation>:2:2: note: while in macro instantiation
 .rept 32
 ^
/usr/src/sys/amd64/amd64/support.S:884:2: note: while in macro instantiation
 ibrs_seq 32
 ^
<instantiation>:1:13: error: invalid register name
handle_ibrs_%(ll):
            ^~
<instantiation>:68:2: note: while in macro instantiation
 ibrs_seq_label %(ll)
 ^
<instantiation>:2:2: note: while in macro instantiation
 .rept 32
 ^
/usr/src/sys/amd64/amd64/support.S:884:2: note: while in macro instantiation
 ibrs_seq 32
 ^
<instantiation>:1:13: error: invalid register name
handle_ibrs_%(ll):
            ^~
<instantiation>:73:2: note: while in macro instantiation
 ibrs_seq_label %(ll)
 ^
<instantiation>:2:2: note: while in macro instantiation
 .rept 32
 ^
/usr/src/sys/amd64/amd64/support.S:884:2: note: while in macro instantiation
 ibrs_seq 32
 ^
<instantiation>:1:13: error: invalid register name
handle_ibrs_%(ll):
            ^~
<instantiation>:78:2: note: while in macro instantiation
 ibrs_seq_label %(ll)
 ^
<instantiation>:2:2: note: while in macro instantiation
 .rept 32
 ^
/usr/src/sys/amd64/amd64/support.S:884:2: note: while in macro instantiation
 ibrs_seq 32
 ^
<instantiation>:1:13: error: invalid register name
handle_ibrs_%(ll):
            ^~
<instantiation>:83:2: note: while in macro instantiation
 ibrs_seq_label %(ll)
 ^
<instantiation>:2:2: note: while in macro instantiation
 .rept 32
 ^
/usr/src/sys/amd64/amd64/support.S:884:2: note: while in macro instantiation
 ibrs_seq 32
 ^
<instantiation>:1:13: error: invalid register name
handle_ibrs_%(ll):
            ^~
<instantiation>:88:2: note: while in macro instantiation
 ibrs_seq_label %(ll)
 ^
<instantiation>:2:2: note: while in macro instantiation
 .rept 32
 ^
/usr/src/sys/amd64/amd64/support.S:884:2: note: while in macro instantiation
 ibrs_seq 32
 ^
<instantiation>:1:13: error: invalid register name
handle_ibrs_%(ll):
            ^~
<instantiation>:93:2: note: while in macro instantiation
 ibrs_seq_label %(ll)
 ^
<instantiation>:2:2: note: while in macro instantiation
 .rept 32
 ^
/usr/src/sys/amd64/amd64/support.S:884:2: note: while in macro instantiation
 ibrs_seq 32
 ^
<instantiation>:1:13: error: invalid register name
handle_ibrs_%(ll):
            ^~
<instantiation>:98:2: note: while in macro instantiation
 ibrs_seq_label %(ll)
 ^
<instantiation>:2:2: note: while in macro instantiation
 .rept 32
 ^
/usr/src/sys/amd64/amd64/support.S:884:2: note: while in macro instantiation
 ibrs_seq 32
 ^
<instantiation>:1:13: error: invalid register name
handle_ibrs_%(ll):
            ^~
<instantiation>:103:2: note: while in macro instantiation
 ibrs_seq_label %(ll)
 ^
<instantiation>:2:2: note: while in macro instantiation
 .rept 32
 ^
/usr/src/sys/amd64/amd64/support.S:884:2: note: while in macro instantiation
 ibrs_seq 32
 ^
<instantiation>:1:13: error: invalid register name
handle_ibrs_%(ll):
            ^~
<instantiation>:108:2: note: while in macro instantiation
 ibrs_seq_label %(ll)
 ^
<instantiation>:2:2: note: while in macro instantiation
 .rept 32
 ^
/usr/src/sys/amd64/amd64/support.S:884:2: note: while in macro instantiation
 ibrs_seq 32
 ^
<instantiation>:1:13: error: invalid register name
handle_ibrs_%(ll):
            ^~
<instantiation>:113:2: note: while in macro instantiation
 ibrs_seq_label %(ll)
 ^
<instantiation>:2:2: note: while in macro instantiation
 .rept 32
 ^
/usr/src/sys/amd64/amd64/support.S:884:2: note: while in macro instantiation
 ibrs_seq 32
 ^
<instantiation>:1:13: error: invalid register name
handle_ibrs_%(ll):
            ^~
<instantiation>:118:2: note: while in macro instantiation
 ibrs_seq_label %(ll)
 ^
<instantiation>:2:2: note: while in macro instantiation
 .rept 32
 ^
/usr/src/sys/amd64/amd64/support.S:884:2: note: while in macro instantiation
 ibrs_seq 32
 ^
<instantiation>:1:13: error: invalid register name
handle_ibrs_%(ll):
            ^~
<instantiation>:123:2: note: while in macro instantiation
 ibrs_seq_label %(ll)
 ^
<instantiation>:2:2: note: while in macro instantiation
 .rept 32
 ^
/usr/src/sys/amd64/amd64/support.S:884:2: note: while in macro instantiation
 ibrs_seq 32
 ^
<instantiation>:1:13: error: invalid register name
handle_ibrs_%(ll):
            ^~
<instantiation>:128:2: note: while in macro instantiation
 ibrs_seq_label %(ll)
 ^
<instantiation>:2:2: note: while in macro instantiation
 .rept 32
 ^
/usr/src/sys/amd64/amd64/support.S:884:2: note: while in macro instantiation
 ibrs_seq 32
 ^
<instantiation>:1:13: error: invalid register name
handle_ibrs_%(ll):
            ^~
<instantiation>:133:2: note: while in macro instantiation
 ibrs_seq_label %(ll)
 ^
<instantiation>:2:2: note: while in macro instantiation
 .rept 32
 ^
/usr/src/sys/amd64/amd64/support.S:884:2: note: while in macro instantiation
 ibrs_seq 32
 ^
<instantiation>:1:13: error: invalid register name
handle_ibrs_%(ll):
            ^~
<instantiation>:138:2: note: while in macro instantiation
 ibrs_seq_label %(ll)
 ^
<instantiation>:2:2: note: while in macro instantiation
 .rept 32
 ^
/usr/src/sys/amd64/amd64/support.S:884:2: note: while in macro instantiation
 ibrs_seq 32
 ^
<instantiation>:1:13: error: invalid register name
handle_ibrs_%(ll):
            ^~
<instantiation>:143:2: note: while in macro instantiation
 ibrs_seq_label %(ll)
 ^
<instantiation>:2:2: note: while in macro instantiation
 .rept 32
 ^
/usr/src/sys/amd64/amd64/support.S:884:2: note: while in macro instantiation
 ibrs_seq 32
 ^
<instantiation>:1:13: error: invalid register name
handle_ibrs_%(ll):
            ^~
<instantiation>:148:2: note: while in macro instantiation
 ibrs_seq_label %(ll)
 ^
<instantiation>:2:2: note: while in macro instantiation
 .rept 32
 ^
/usr/src/sys/amd64/amd64/support.S:884:2: note: while in macro instantiation
 ibrs_seq 32
 ^
<instantiation>:1:13: error: invalid register name
handle_ibrs_%(ll):
            ^~
<instantiation>:153:2: note: while in macro instantiation
 ibrs_seq_label %(ll)
 ^
<instantiation>:2:2: note: while in macro instantiation
 .rept 32
 ^
/usr/src/sys/amd64/amd64/support.S:884:2: note: while in macro instantiation
 ibrs_seq 32
 ^
<instantiation>:1:13: error: invalid register name
handle_ibrs_%(ll):
            ^~
<instantiation>:158:2: note: while in macro instantiation
 ibrs_seq_label %(ll)
 ^
<instantiation>:2:2: note: while in macro instantiation
 .rept 32
 ^
/usr/src/sys/amd64/amd64/support.S:884:2: note: while in macro instantiation
 ibrs_seq 32
 ^
/usr/src/sys/amd64/amd64/support.S:917:2: error: unknown directive
 .noaltmacro
 ^
*** Error code 1

Stop.
make[2]: stopped in /usr/obj/usr/src/amd64.amd64/sys/MYKERNEL
*** Error code 1

Stop.
make[1]: stopped in /usr/src
*** Error code 1

Stop.
make: stopped in /usr/src
```


----------



## SirDice (Apr 3, 2018)

Topics about unsupported FreeBSD versions


----------



## t1066 (Apr 15, 2018)

I am tracking 11-stable and I also had this problem. Instead of the usual


```
buildworld
buildkernel
installkernel
installworld
```

I had to


```
buildworld
installworld
buildkernel
installkernel
```


----------



## ShelLuser (Apr 15, 2018)

Both STABLE and CURRENT are developer snapshots. Ergo: it's always possible that something doesn't work right because of debug code and other stuff.

t1066  What I can say is that your sequence is rather poorly chosen, and I'd strongly recommend against using it. Instead of trying to work your way around a problem try to find the cause of said problem and actually solve it. Otherwise you'll only risk ending up with an instable system (or worse) which can cause much bigger issues at a later time.

Of course in the end the best solution is not to rely on developer snapshots and instead start by using an officially supported release, my suggestion would be 11.1 at the time of writing. Then perform the whole building procedure, this will ensure that you don't have to worry about bugs and/or debug code and such, but can fully focus on the actual building process.

If that goes as planned then you might want to try and take on a snapshot. Remember: the idea behind those snapshots is to test upcoming versions and to help find bugs. It is somewhat implied that you'll be able to spot bugs, find their origin and optionally solve 'm (and report back).


----------

