Hacker Newsnew | past | comments | ask | show | jobs | submitlogin
Compiling an OpenBSD kernel 50% faster (tedunangst.com)
117 points by ingve on May 8, 2022 | hide | past | favorite | 16 comments


> the bad idea circus is in town...

What a fun post!

> The object files are so large because the kernel is initially compiled with debug symbols.

Is there a way to build without producing debug symbols in the first place?


You can pass -g0 to gcc to do so [0]

[0] https://gcc.gnu.org/onlinedocs/gcc/Debugging-Options.html


Or remove -g from the flags already passed, since the compiler actually defaults to not producing debug info.


> Is there a way to build without producing debug symbols in the first place?

Probably takes all of 15 minutes to identify the flags needed and then run the new makefile lol


It took me way too long to realize that the author was just having fun with insane ideas, not trying to solve a real problem. Great post:)


I'm a noob. Does OpenBSD not have an alternative to config (make menuconfig) on Linux that does not to compile drivers you don't need?


Yes, there was a brief humorous reference to that in the article: "The correct approach would be to run config after editing the kernel config, but the plot restricts us from doing that."


You can just edit the kernel config file before compiling.

https://github.com/openbsd/src/blob/master/sys/arch/amd64/co...


It does. The author is doing things wrong on purpose:)


For normal usage on amd64 and i386(?), it is recommended not to compile the kernel. I think the article is geared to Developers and testers of OpenBSD.


> And now I will be patenting this technique to prevent anyone else from doing something so idiotic.

For years i was searching for an answer to the question: why some company registers so many patents. It never occured to me that this might be the answer. Thanks for the hint.



I’m not sure using a build farm to dynamically relink the kernel at boot might would solve the problem.

I think the core issue is that it needs to keep two complete copies of the kernel in memory at the instant in time where it hands off from one to another.

Adding a ccache dependency to the bootup sequence would be in keeping in tone with the rest of the article though.


the point of ccache is that it reduces the need (if you're lucky) for "build farms"


> This is approximately as wise as taking off from Mars in a ragtop rocket, but don’t worry, the math all checks out

Straight outta The Martian! Kudos, I got a good laugh.


>And now I will be patenting this technique to prevent anyone else from doing something so idiotic. Should you find yourself stranded on a remote planet and your last means to reestablish communication with earth is relinking an openbsd kernel in only 32 megabytes, we can work out a license in exchange for a cut of your book deal.

Likewise with the conclusion. :)




Consider applying for YC's Fall 2026 batch! Applications are open till July 27.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: