Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add make to third_party #305

Merged
merged 3 commits into from Oct 26, 2021
Merged

Add make to third_party #305

merged 3 commits into from Oct 26, 2021

Conversation

ahgamut
Copy link
Collaborator

@ahgamut ahgamut commented Oct 26, 2021

No description provided.

@ahgamut
Copy link
Collaborator Author

ahgamut commented Oct 26, 2021

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.

Copy link
Owner

@jart jart left a comment

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
Copy link
Owner

jart commented Oct 27, 2021

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
Copy link
Collaborator Author

ahgamut commented Oct 27, 2021

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.

None yet

2 participants