-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Makefile overhaul #5834
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
base: bleeding-jumbo
Are you sure you want to change the base?
Makefile overhaul #5834
Conversation
Some formats had an #elif or #else creatively skipped in the plugin logic, messing things up royally and slowing down the build process. It's not a good idea to write that stuff in any other way, or put anything before it (with very few exceptions, one being an outermost #if HAVE_OPENCL).
8fbd5f7
to
e3e9d0f
Compare
Thanks. This is a lot. I don't expect to have time to review it in the next 2 weeks. |
Only active with gcc/clang, for portability. See openwall#3566, openwall#3842
Notes to self as well as for your consideration, here's what I have tested:
With no re-configure:
Instead of simply disabling auto dependency generation for compilers that MAY be incompatible, we could have the configure script detect if the needed options are supported. We do that for several other things. I'll give that a try and possibly add it as a separate commit. |
Done, trivial, works like a champ. |
63765b0
to
1a4a5d6
Compare
Instead of disabling dependency generation for any compiler not claiming to be gcc compatible (but that may support the options anyway), test if the compiler supports the flags using our existing flag-check wizardry.
In this case we do not clear nvidia's caches, just the ones in our tree.
74cdcd3
to
90e1876
Compare
Move the plugin logic back to Makefile where it belongs, so we can add or remove plugins without re-running configure. Add logic for fast detection of added or removed plugins. See openwall#3566
It's needed for the dynamic format. We're supposed to be able to delete every single plugin and build should still succeed.
I still have no time for a proper review, but: I successfully built from this PR's branch in a fresh Docker container with Alpine Linux (so with musl) as a non-root user by
Hmm, but doesn't our CircleCI no-plugs job test that? If so, why is it succeeding before these changes? |
I didn't look now but possibly it only deletes plugin formats, not other files. Or maybe there's just an exception but then we should have done this earlier. Now, when I do delete all plugin sources, there will be two "errors" from building (reason being we preprocess using |
It isn't really, especially if you review commit for commit. But take your time. On another note, I realise we could make the whole dynamic format beast plugin(s) now without much effort (there are lots of |
Oh BTW I also tried with gcc 3.3.6 but that fails for other reasons than this PR.
EDIT: See #4271 Maybe we should fix that but I'm not sure I'm interested myself. Also, according to ChatGPT gcc has supported the flags needed for dependency generation since 3.0 but it may well be hallucinating. |
dd58e86
to
86f27c0
Compare
Added another commit, for building particular targets (such as unit-tests, found by a buildbot) from a distclean source directory (i.e. with |
86f27c0
to
c069e66
Compare
Drop more old fixed dependencies. Most of these were added 10 years ago and generated by the naive perl script so not great even then. Add a few dependencies for $(DEPDIR) so we can build particular stuff from a distclean source directory (i.e. with .deps directory missing). An example - that a buildbot found - is "make unit-tests". Also merely moves the symlink recipe for rar2john a little bit just for easier side to side compare with Makefile.legacy.
c069e66
to
c187fb6
Compare
Add real auto-dependency stuff (gcc's own) and drop the incompetent perl script we had for plugins only. The old support for "makedepend" is kept for non-gcc systems.
Fix bugs in format's plugin stanzas.
Have "make distclean" also clear kernel caches (the ones within our tree only).
Move plugin logic back from configure to Makefile. Having them in configure was a major brainfart. Also enhance it so we can actually move plugins (formats or not) into or out of the source tree and just "make" regardless of their timestamps. I made the logic very quick for the case of nothing changed - blindly running the preprocessor over 470 files takes time so we do not want that unless actually needed.
For the same reason, I did not add the plugins themselves as dependencies for the "format register" stuff in john.c. That would mean very slow handling of repeated edit-make with a specific plugin and it's only needed if we do things like change the format struct name.
See #3566 and #3842.