mirror of
https://github.com/openwall/john.git
synced 2026-12-03 18:45:21 +07:00
[GH-ISSUE #911] Autoconf: detect ARM NEON #513
Labels
No labels
bug
core branch
documentation
enhancement
enhancement
fixed - pending verify
fuzz bug
good first issue
invalid
invalid
maintenance/cleanup
new cracking mode
new format
new tool
non-trivial
notes/external issues
portability
question
RFC / discussion
testing
WONTFIX
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
openwall/john#513
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @magnumripper on GitHub (Dec 18, 2014).
Original GitHub issue: https://github.com/openwall/john/issues/911
http://www.openwall.com/lists/john-dev/2014/12/18/15
From Solar:
I think the current configure script won't detect NEON on ARM, even though it does detect SIMD extensions on x86. I think it should also detect NEON and pass -mfpu=neon then (like linux-arm32le-neon in Makefile.legacy does).
@jfoug commented on GitHub (Dec 18, 2014):
Should we do this with native probes, like we do for SIMD types? If so, some intrinsic instructions on how to do this would be nice.
@magnumripper commented on GitHub (Dec 18, 2014):
I guess so. We do both, depending on how we're run.
@magnumripper commented on GitHub (Dec 18, 2014):
Look in DES_bs_b.c for
__ARM_NEON__- the intrinsics should be there. But we're probably out of luck implementing this blindly.@magnumripper commented on GitHub (Dec 18, 2014):
OTOH we should be able to come fairly close, and Solar could probably do the rest.
@jfoug commented on GitHub (Dec 18, 2014):
Do you want me to take a stab at it?
@magnumripper commented on GitHub (Dec 18, 2014):
Please do, if you wish. I'm exhausted. I think I will turn off all computers and cell phones for 12h.
@jfoug commented on GitHub (Dec 18, 2014):
@magnumripper
I'm asking about the cross compiles. In the darwin* I see the original code that is in the AC_RUN_IFELSE in the active probes. Why did you do that, and not the BORK! code ?
I will add BORK! code to the cross compile section for NEON. I have sent off a configure to solar.
I also note that in the cross compile (i.e. AC_LINK_IFELSE) set of code, you do not set any ARCH_LINK values (i.e. what file to link to arch.h) Was this by choice. I really do not understand what extra things you have in the cross compile section.
@jfoug commented on GitHub (Dec 18, 2014):
I got a 'ok' (but shitty code) from solar for this:
I have made another macro to house this in, m4/jtr_arm_logic.m4 and added another host if within configure
AS_IF([test "x$cpu_family" = xarm], [JTR_ARM_SPECIAL_LOGIC])All I need to know now is if $cpu_family == arm for this type system. I am waiting right now for a Makefile and a config.log from Solar. The configure I sent him will fail for 100% sure, since it will never call the macro (it is in an AS_IF for intel, so it is not being called). BUT the config.log should give me all the other goodies that autoconf is giving us for work on that system.@magnumripper commented on GitHub (Dec 18, 2014):
If you mean line 357 down in jtr_x86_logic.m4 it's a whole different test - I'm checking that 'as' can assemble the output from the compiler. Long story.
That should be fine.
Line 248 in configure.ac sets arch.h for all targets except x86 - the latter will need to be checked for WHAT x86 it is, among x86-any.h, x86-mmx.h, x86-sse.h. All just because of legacy.
@magnumripper commented on GitHub (Dec 18, 2014):
Oh, and I do set ARCH_LINK in the cross-compile versions of MMX and SSE. Exactly as you do.
@jfoug commented on GitHub (Dec 19, 2014):
I am pretty sure I have this nailed down now. I might check this in, even before Solar has given his OK. I am still waiting on email.
NOTE, I am setting ARCH_LINK to arm32le.h in the cross compiler, since I am not sure what it is set to.
One big question. I am doing this in the block of code in configure.ac around 248. That is the case $host_cpu. Is that a PROBLEM for cross compiles???? How should cross compiles be handled (I do know how to do them today). Should we not be using $target_cpu or something ?
@jfoug commented on GitHub (Dec 19, 2014):
Here is the change I am making (not showing the macro)
@jfoug commented on GitHub (Dec 19, 2014):
d25ebd3should detect NEON.I do need to validate that HAVE_NEON will be handled properly (likely not), but this should now be 'close'
@jfoug commented on GitHub (Dec 19, 2014):
Although, possibly it will be fine, since we add the -mfpu-neon, I think the compiler will auto give us the
__ARM_NEON__define automatically, so what has been pushed now 'may' be properly working.@jfoug commented on GitHub (Dec 19, 2014):
Solar gave me an account on this box, so I should get NEON done/tested easily
@jfoug commented on GitHub (Dec 19, 2014):
good sign:
So it gets NEON, says no -xarch=native or native64 or -march=native Solar said all those were 'bad'. It picks 32 bit also (good).
One thing I may have to set is the _LARGFILE_SUPPORT or whatever it is.
But we soon will know. I think to test speed, I will simply comment out the call to check the NEON, reconfig and remake.
here is the config summary now: (shows NEON)
@jfoug commented on GitHub (Dec 19, 2014):
These may need fixed also (new code compile path gives new warnings)
@jfoug commented on GitHub (Dec 19, 2014):
With NEON
Comment out the neon macro, re-config and re-build (Note, warnings go away)
I am sticking a fork in this one. (well I will look at other defines that need to be done for ARM, and add them to the 'extra_flags' checking.
@magnumripper commented on GitHub (Dec 19, 2014):
Why would you want to do that? It's set elsewhere.
@magnumripper commented on GitHub (Dec 19, 2014):
I'd leave the DES_bs_b.c warnings for Solar to fix. Anything we do in that format will give me headaches when merging future core.
@jfoug commented on GitHub (Dec 19, 2014):
He knows about them now, but is not quite sure how to fix either. It will probably take some union work to get around the warnings. BUT since this is code specifically designed FOR that exact processor, then the warning is meaningless.BUT it still is a warning, lol.