Skip to content

Add make to third_party#305

Merged
jart merged 3 commits into
jart:masterfrom
ahgamut:thirdparty-make
Oct 26, 2021
Merged

Add make to third_party#305
jart merged 3 commits into
jart:masterfrom
ahgamut:thirdparty-make

Conversation

@ahgamut

@ahgamut ahgamut commented Oct 26, 2021

Copy link
Copy Markdown
Collaborator

No description provided.

@ahgamut

ahgamut commented Oct 26, 2021

Copy link
Copy Markdown
Collaborator Author

make.com builds on MODE= and MODE=tiny

I tried using make.com to build Cosmopolitan itself, but segfault.
make.com works for simple Makefiles though.

@jart jart left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for doing this. GNU is famous for their ifdefs. I'll help troubleshoot the segfault as soon as I have time.

@jart jart merged commit 3616f2a into jart:master Oct 26, 2021
@jart

jart commented Oct 27, 2021

Copy link
Copy Markdown
Owner

OK so I added ShowCrashReports() to GNU Make's main() function and look at this beauty it printed out.

image

We now have perfect stack overflow reporting for C code in addition to Python. It just has to be enabled. It appears GNU Make uses alloca() quite frequently. We can address this by adding a STATIC_STACK_SIZE() decl to its main.c file.

I've written documentation for how this works in 226aaf3 and I intend to create a page on the website for it soon.

What surprises me is that you didn't need to use STACK_FRAME_UNLIMITED which should have been the warning to hint at this as the possible cause. Also the backtrace doesn't look that deep. It's strange. I guess we'll learn more soon.

@ahgamut

ahgamut commented Oct 27, 2021

Copy link
Copy Markdown
Collaborator Author

Yup its a stack size issue, doesn't happen with STATIC_STACK_SIZE as 2mb.

I just used o/dbg/third_party/make/make.com to build o//third_party/make/make.com!!
Could use only a single process though: make.com -j works for simple recipes but otherwise fails with read jobs pipe EINVAL.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants