OPNsense Forum

Archive => 20.7 Legacy Series => Topic started by: moonmoonbird on October 26, 2020, 09:12:58 AM

Title: make kernel error
Post by: moonmoonbird on October 26, 2020, 09:12:58 AM
command: make kernel-again

result:


>>> stage 3.1: building everything
--------------------------------------------------------------
In file included from /usr/src/sys/kern/imgact_elf32.c:33:
/usr/src/sys/kern/imgact_elf.c:2682:25: error: use of undeclared identifier 'MAP_ASLR'
        if ((imgp->map_flags & MAP_ASLR) == 0)
                               ^
1 error generated.
--- imgact_elf32.o ---
*** [imgact_elf32.o] Error code 1

make[2]: stopped in /usr/obj/usr/src/amd64.amd64/sys/SMP
A failure has been detected in another branch of the parallel make

make[4]: stopped in /usr/src/sys/modules/aac
--- all_subdir_aac ---
*** [all_subdir_aac] Error code 2

make[3]: stopped in /usr/src/sys/modules
1 error

make[3]: stopped in /usr/src/sys/modules
--- modules-all ---
*** [modules-all] Error code 2

make[2]: stopped in /usr/obj/usr/src/amd64.amd64/sys/SMP
2 errors

make[2]: stopped in /usr/obj/usr/src/amd64.amd64/sys/SMP
--- buildkernel ---
*** [buildkernel] Error code 2

make[1]: stopped in /usr/src
1 error

make[1]: stopped in /usr/src
--- buildkernel ---
*** [buildkernel] Error code 2

make: stopped in /usr/src
1 error

make: stopped in /usr/src
*** Error code 2

Stop.
make: stopped in /usr/tools


how to make it right , thanks.
Title: Re: make kernel error
Post by: mimugmail on October 26, 2020, 09:30:49 AM
This thread is missing to much information. Do you use stock sources? When did it run successfully the last time?
Title: Re: make kernel error
Post by: moonmoonbird on October 26, 2020, 09:54:30 AM
i was originally doing `make prefetch-packages,base,kernel dvd VERSION=20.7`
to make build time shorter. after it successfully generated an iso image, i changed a little bit in config file under tools directory, so i thought make each stage rebuild, so i ran `make base-again`, but it took so long, i interrupt it and ran `make kernel-again`, so error just like that.
Title: Re: make kernel error
Post by: littlepepper on October 26, 2020, 01:36:35 PM
Os build from source takes a long time (also depending on your computer hardware).. make sure you do make clean between your runs especially if you had kill the process manually.
Title: Re: make kernel error
Post by: franco on October 26, 2020, 02:05:44 PM
Looks like you are trying to build HardenedBSD outside its scope (ASLR off). We really can't help with that.

https://github.com/opnsense/src/blob/master/sys/kern/imgact_elf.c#L2675


Cheers,
Franco
Title: Re: make kernel error
Post by: moonmoonbird on October 27, 2020, 02:23:40 AM
options      PAX
options      PAX_ASLR
options      PAX_HARDENING
options      PAX_SEGVGUARD
options      PAX_INSECURE_MODE
options      PAX_CONTROL_ACL
options      PAX_CONTROL_ACL_OVERRIDE_SUPPORT
options      PAX_CONTROL_EXTATTR
options      PAX_JAIL_SUPPORT


I removed these options in tools/config/20.7/SMP file, maybe it is the reason why program stopped. so we cant build opnsense without PAX, is that right?
Title: Re: make kernel error
Post by: franco on October 27, 2020, 04:41:48 PM
Yes, but you can swap for FreeBSD 12.1 code in /usr/src if you want where PAX doesn't exist.


Cheers,
Franco
Title: Re: make kernel error
Post by: moonmoonbird on November 02, 2020, 02:15:06 AM
I removed hardendedBSD options, and compiled successfully, Opnsense can run on it normally.
Title: Re: make kernel error
Post by: wilbo on February 18, 2021, 02:26:48 PM
Hi Franco & moonmoonbird

i have the same error, want to build a custom kernel.
how exactly did you go about downloading the alternative FreeBSD 12.1 sources ?

You write that you have a version without PAX compiled...

Can you tell me;
how did you do that ? via git ?

That would be very helpful,

Thanks Wilbo