mirror of
https://github.com/openwall/john.git
synced 2026-12-03 18:45:21 +07:00
[GH-ISSUE #575] Autoconf #248
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#248
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 (May 2, 2014).
Original GitHub issue: https://github.com/openwall/john/issues/575
Originally assigned to: @jfoug on GitHub.
In progress by @jfoug (and me). Topic branch autoconf
Tests to add/use:
-framework OpenCL, on all others-lOpenCL)-march=native? If so, use it! But also use what we auto-detected.Most or all of the above should default to be used if available, but have
--disable-featureoptions.Other options (configure):
MD5_SSE_PARA)X32 is more or less a cross compile. Either we support it specifically using
--with-X32or something, or you'll have to sayCFLAGS=-mx32 ASFLAGS=-mx32 LDFLAGS=-mx32 ./configure(which should already be supported)New targets (Makefile)
-DDEBUG -O0. For-gsee next comment)Things to do within configure instead of make:
@magnumripper commented on GitHub (May 2, 2014):
We should always build with -g (debug) and not -s (strip), and then we'll strip within the install target. This will be a great enhancement for developers.
@magnumripper commented on GitHub (May 2, 2014):
Here's a list of what is used today:
DONE: These are all in autoconfig.h. They 'still' are in os.h. We may need a little work there. I do include autoconfig.h, but probably should be VERY careful about setting these. Probably ONLY systems without autoconfig (VC) should use the defines in OS.h.
@magnumripper commented on GitHub (May 2, 2014):
We also have these, enumerated by current "make generic" (results shown for OSX/amd64)
Edit: All but the last one are autoconf now.
@magnumripper commented on GitHub (May 2, 2014):
Error handling:
If we don't have optional stuff like libgmp, we build without it. But what if we lack openssl? I guess configure should bail out and explain the problem. We could also opt to build everything we can without OpenSSL, I think there's not much things really depending on it.
Summary:
configure could end with listing what was enabled and what was not (so user sees that eg. installing librexgen would enhance JtR).
@jfoug edit:
Right now, several libs will cause ./configure to bail with a message. oSSL is one of them. There simply is too many issues. Also libm and libz cause this. These were all from 'default' LDFLAGS from old makefile. We probably want to look at some of them.
Things like lack of libgmp will issue a mesage on screen, during the ./configure. I would love to accumulate a summary message, but have not figured that out yet. But at least there is 'some' message telling a user they might want an enhanced lib, and why.
@jfoug commented on GitHub (May 2, 2014):
Added HAVE_CRYPT --> HAVE_LIBCRYPT. This was a larger change.
I had to patch john.c and loader.c to use the new define. I then had to add a include "autoconfig.h" to c3_fmt.c as a wrapper, add the c3_fmt.o to the 'normal' objects, remove it from all rules, and remove -lcrypt from all rules. Now c3 will 'always' be build. It will be disabled if the lib it NOT found.
This is GOOD stuff. I now get fmt_crypt for my cygwin (IF I have installed libcrypt). Yea. We have needed an autoconf process for SOOOOOO long. It will be a long ugly process, mostly removing all the existing crap. But when done, I think this should be so much better.
@magnumripper commented on GitHub (May 2, 2014):
Using git, I'd do it like this (safest with pwd == base dir but in this case src/ should be fine):
The
git grepis about the same asgrep <all files under git's control>(but only from current directory and down)@jfoug commented on GitHub (May 2, 2014):
What should we CHECK IN. I have added a distclean target to makefile. That does a clean, then removes these:
Makefile
autoconfig.h
config.status
config.cache
config.log
I 'think' a simple ./configure will rebuild all of those, so they likely SHOULD NOT be there. But I am not 100% sure yet.
@magnumripper commented on GitHub (May 2, 2014):
@jfoug please commit your changes to the autoconf branch (if you remember how to do it 😉) I'd like to follow progress and perhaps wedge in some fixes.
Failing that, just send me a patch 😎
Edit:
If you pull the minor commits I did to that branch, the
.gitignorewill take care of it.@jfoug commented on GitHub (May 2, 2014):
working on a patch right now. I notice that you did not put any of the Makefile.orig files in there. Was that by design? I think those should stay there, at the bare minimun as a reference. I have actually had to use one (have not figured out problem, though). The luks2john fails to link. It can not find the BIO_* functions, which are found in the libcrypto (ossl stuff). But the -lcrypto is on the command line. I have fought with it, and have not figured it out. So at this time, that target is commented out of Makefile.in (in ./src) until I get that done.
I have also added new makefile targets One of them is distclean. This is what I think we should do, prior to diffs or checking anything in.
We need to add all the cache crap into .gitignore. Some is there (I added more), but there is still stuff missing.
Jim.
@jfoug commented on GitHub (May 2, 2014):
I can also do this from command line. NOTE, many times, it is more complex than this, so I really think it takes grep to find the files, and hand editing, and often editing OTHER files where this is not even defined. The 'easy' ones, (such as if a header is there), already should be done. We will also need to look HARD at things like #ifdef _MSC_VER, #if CYGWIN etc. Some of those should be removed (possibly A LOT of them).
@jfoug commented on GitHub (May 2, 2014):
Here are the header includes. I need to make sure that all of these are handled already within autoconfig.h
Here is my 'current' autoconfig.h (time to cross off what is handled)
$ grep HAVE_ | grep _H autoconfig.h (once matched, I removed this list)
signals.c:#if HAVE_DOS_H
NETLMv2_fmt_plug.c:#if !defined(uint16) && !defined(HAVE_UINT16_FROM_RPC_RPC_H)
NETNTLMv2_fmt_plug.c:#if !defined(int16) && !defined(HAVE_INT16_FROM_RPC_RPC_H)
unicode.c:#if !defined(int16) && !defined(HAVE_INT16_FROM_RPC_RPC_H)
sysendian.h:#undef HAVE_SYS_ENDIAN_H
sysendian.h:#ifdef HAVE_SYS_ENDIAN_H
sysendian.h:#endif /* !HAVE_SYS_ENDIAN_H */
NETLMv2_fmt_plug.c:#if !defined(uint16) && !defined(HAVE_UINT16_FROM_RPC_RPC_H)
NETNTLMv2_fmt_plug.c:#if !defined(uint16) && !defined(HAVE_UINT16_FROM_RPC_RPC_H)
unicode.c:#if !defined(uint16) && !defined(HAVE_UINT16_FROM_RPC_RPC_H)
gpg2john.c:#ifdef HAVE_UNIXLIB_LOCAL_H
@magnumripper commented on GitHub (May 2, 2014):
Oh, that was a mistake. I bet
*.origis in .gitignore@jfoug commented on GitHub (May 2, 2014):
If you have not checked in #2 yet, hold up. I am doing #3 against the current git tree
@magnumripper commented on GitHub (May 2, 2014):
I just committed but that's no problem, this is a topic branch. I'll just force commit patch 3 upon patch 1.
@ghost commented on GitHub (May 3, 2014):
Hi. Below a POC patch that will avoid a few warnings I'm seeing here!
@magnumripper commented on GitHub (May 3, 2014):
Thanks, I'm not sure we should keep the printf() in the end. Do we actually get a SIPdump but it only prints "sorry"? I don't quite like that.
@jfoug commented on GitHub (May 3, 2014):
The problem is, this is in the makefile for now. Having 40 targets done the way the fat makefile is done, will have to also be addressed. Several of them on not simply ln -s of john, but full builds. These 2 are a pair of them, that are fat, full exe files. For the time being, I needed something that would address this. The compile knows there will be no pcap lib, so nothing with pcap can be used. But without that, the entire exe file is moot.
Btw, I am getting horrible failures on cygwin with my last patch. I am going to make sure that the v1 (last patch I am calling v3) works. If that works, then likely it was some change between v1 and v3 (os.h, stripping down makefile, etc), that is the problem. A -test=0 runs fine until it hits dyna-70. That is the first format using SHA2 64 bit functions. All of a sudden, it is listed as using openssl code, the format fails, and a crash happens. If I build x86-any, then it crashes sooner (but in dyna). I need to make sure that patch-1 is working (I was pretty sure it was). Most of patch-3 was simply trying to start using the results from ./configure and not things like os.h, and also adding more headers, and more lib checks into configure. But I am 100% sure that I will have to get something changed.
@magnumripper commented on GitHub (May 3, 2014):
Actually in this branch we could ditch all build targets already, and re-start from scratch. Just start with one "all" target (that is also default). If we try to fix the current targets, I think we'll solve problems that are only temporary anyway.
@jfoug commented on GitHub (May 3, 2014):
I do not feel confident starting from scratch.
Right now, on my laptop, the v3 builds a garbage file. It cores all over the place. But that version on a 64 bit ubuntu VM (both at my office and at home), works fine. To make matters worse, the v3 works fine on my office cygwin install. I think it is #defines having gotten scrambled, OR how ossl is installed, or something. But this is the type of problem I am worried about. Where it 'works on my machine',, but then fails at other places. Those type issues are a nitemare to figure out. I think starting clean might make it worse (it might make it better, i do not know). I am still 'learning' autoconf. I only know a couple of baby steps.
I think next thing, is to try to add some --with-SSE2i type things (to control the (-64i vs -64 and sse2 vs sse2i). Once I figure out things like this, then I need to start learning variables, and changing lib path and allowing user to provide optional lib/header path, etc. But one thing at a time. I would like to get ALL of the libs that are there now, to use 'real' functions, instead of main() when using main(), it simply links a int main() {return 1;} type file with the lib. If a file is produced, it says the lib is there. That does work, at least the linker found the lib. But a better test is to have something like int main() { __gmpz_init; return 1; } That way, the linker will be forced to link against an actual function FROM the lib. If the lib does not provide that linkage, the build will fail, and configure script will mark that lib as not being found. Sometimes this is not suitable, if a lib may have different externals, depending upon what type OS built it, if static or dynamic, etc, etc. GMP would be a good example. I 'think' I have it done, but I am not 100% sure. GMP has a header that maps all the real functions, to the documented external things using macros. I think the one I have chosen (listed above), works, but there might be versions of GMP, where that is NOT the 'real' naming convention (since they use a #define to hide the 'common name'). The common name for that function is mpz_init But who is to say that version 4.1.3 does not use _gmpz_init, or that the static lib on 4.1.3 does that. I really do not know yet. Each of these, will have to be researched. One way to 'research' is to look at other more stable GNU packages, and dissect their configure.in files, looking for things like this.
Harder issues will be where it is not just a library, BUT also compiler command line switches. And where the command line switches vary. OMP is a prime example. But I am not sure that we need to do that. I think we 'might' be able to get by, without the command line switch, but I am not fully sure.
But for now, I need to research WHY my laptop is having problems, on the v3 build (but not the v1 autoconf code). And only for cygwin. grrr. I may not get to this for a couple days. I am moving large items today (have 3 strong young men to help). So I will NOT be playing with computer much today. Work, work, work.
---- magnum notifications@github.com wrote:
@magnumripper commented on GitHub (May 3, 2014):
Obviously you don't actually have to delete the legacy targets. Just create a new one that is NOT bound to any specific platform. It will not use any hard-coded stuff, just the autoconf input. Actually this should be a lot safer than first running autoconf and then getting hardcoded stuff (which might conflict) passed within the build target.
The problems are very likely some mismatch between SSE_PARA or the like.
@jfoug commented on GitHub (May 3, 2014):
I have a 'start' on NSS. There are ways to do the pkg-cfg.. I do not know how to 'use' the information yet, but it is getting there:
This is configure.in:
check packages:
PKG_CHECK_MODULES([nss], [nss])
AM_CFLAGS = $(nss_CFLAGS)
LIBS += $(nss_LIBS)
Now, the AM_CFLAGS autoconf does not know about. I think that is automake. I have started down that path, but I do not have a step by step guide to idiots guide to automake like I found for autoconf.
When I ran autoconf, i see this:
checking for pkg-config... /usr/bin/pkg-config
checking pkg-config is at least version 0.9.0... yes
checking for nss... yes
./configure: line 5582: nss_CFLAGS: command not found
./configure: line 5582: AM_CFLAGS: command not found
./configure: line 5583: nss_LIBS: command not found
./configure: line 5583: LIBS: command not found
So I know I am on to something. I just have to figure it out. It would be nice to do this for oSSL, and some others also, AS LONG AS pkg-config is standard enough. It might be that if we get down to where we find missing libs by themselves, we try pkg-config to see if the user put the crap in non standard locations.
Well, I am beat. Did 4 pickup loads, and 2 trailer loads of stuff today. I am beat.
---- magnum notifications@github.com wrote:
@magnumripper commented on GitHub (May 4, 2014):
We also need something like "PROJ += file.c" (in some file or stage). In old Makefile we have PROJ, PROJ_PCAP, CUDA_OBJS and OCL_OBJS. For mozilla_fmt.c there are defines so we always have Mozilla in PROJ. But for CUDA et. al., we need something like
This is crucial for not having separate make targets.
@jfoug commented on GitHub (May 4, 2014):
Easy enough to do, using current Makefile standards we have. Configure would just be used to make sure the machine HAS cuda, and that the user did not disable cuda. Same goes for sse2/sse4 and sse2i
I did find this function for OMP. I just have to figure out how to make it work:
http://git.savannah.gnu.org/gitweb/?p=autoconf-archive.git;a=blob_plain;f=m4/ax_openmp.m4
I may have that one working. Wow. Now that I see how to do new macros, and have started to learn some M4 coding (and how to quote, quote, quote), I may take a stab at some others things. Good stuff.
Good resource with lots of autoconf macros already done (includeing openmp and MPI)
http://www.gnu.org/software/autoconf-archive/
@magnumripper commented on GitHub (May 4, 2014):
Here's one for OpenCL that takes care of that OSX oddity:
http://www.hardtailmaniac.nl/imagemagick/m4/ax_opencl.m4
Wow, M4 was some time ago. I administered SMTP servers using Sendmail back in the 90's.
@jfoug commented on GitHub (May 4, 2014):
lib nss is now 100% controlled by autoconf. I need to add a --without-nss however, and figure out how to do that. For nss, this was is:
added to configure.in:
PKG_CHECK_MODULES([NSS], [nss], AC_SUBST(HAVE_NSS,[-DHAVE_NSS]) )
Added to Makefile.in replaced the 3 NSS setup flags with this:
NSS_CFLAGS = @NSS_CFLAGS@
HAVE_NSS = @HAVE_NSS@
NSS_LDFLAGS = @NSS_LIBS@
and the pkg-cfg stuff in Makeifle.in was removed. Works the same as before, does not use pkg_cfg inside the makefile. ./configure does all of that, setting the proper values, and then when it writes the makefile, it replaces the @val@ with what was computed.
@magnumripper commented on GitHub (May 4, 2014):
So IMHO drop the intermediate variables - instead of:
...make it just:
@magnumripper commented on GitHub (May 4, 2014):
Here's things to consider for a portable Makefile.in:
http://www.gnu.org/software/autoconf/manual/autoconf.html#Portable-Make
@magnumripper commented on GitHub (May 4, 2014):
OK, so if I download eg. the ax_prog_cc_mpi macro, as a file, where do I place it? Do I add it to some existing file? I'm a n00b again 🍼
Edit: http://stackoverflow.com/questions/5298830/how-to-include-m4-files-in-autoconf
@jfoug commented on GitHub (May 4, 2014):
The reason I had kept it there, was the RELEASE BUILD stuff. But I have scrapped that section,a nd put it inline.
I also have OMP working. I had to add some things to the macro. I could not figure out how to do it in the success actions part, but I 'may' have once I made the edits. I think $1 was -fopenmp I could not figure out how to get it. But I trimmed down the macro. Removed all the language crap, and we now only care about C language. It is working, and adds -fopenmp to the compiler flags, linker flags and asm flags.
Jim.
---- magnum notifications@github.com wrote:
@magnumripper commented on GitHub (May 4, 2014):
Did you put the macro in src/m4 directory? I made a commit where I add a couple macros we'll need and I put them there.
But does it change to
-xopenmpfor Sun and-opencmpfor icc? I guess it does and we don't have to test all that yet. BTW our legacy Makefile had-fopenmp -D_FORTIFY_SOURCE=0for OSX using llvm-gcc.@magnumripper commented on GitHub (May 4, 2014):
Generally speaking, I would think if you have to edit a macro from that repo, you are doing something wrong. But we can revisit that later.
The description seems easy enough:
http://www.gnu.org/software/autoconf-archive/ax_openmp.html#ax_openmp
@jfoug commented on GitHub (May 4, 2014):
How I did the OMP, was to simply put the macro code into the configure.in file (near top, before lib checks). Then at bottom of lib check, I added the AX_OPENMP line (that calls the macro). There were args to the AX_OPENMP for if found and if not found, but I could not get them working. I had to add the SOMETHING=-fopenmp I was getting only the -DHAVE_OPENMP in the autoconfigure.h file, which does no good in the make file. That is why I hand edited the macro, so it does what I wanted. I knew that it output the -fopenmp during the run of ./configure, so I simply found where it did that, and added a new rule AC_SUBST to the section where the part that writes to the autoconfigure.h does it's thing. The -fopenmp appears to be $1 in the context of where this code runs. So this AC_SUBST(OPENMP_CFLAGS,[$1]) gave me @OPENMP_CFLAGS@ within the makefile (actually PATCHED from makefile.in to makefile, so we really see the 'literal' -fopenmp switch, or WHATEVER switch is correct).
This probably is not the best way to do it, but I look at it this way. If we can hack together something that works, it works, and then some kind sole may help us fix the few areas that are overly rough.
@magnumripper commented on GitHub (May 4, 2014):
I think you should put it in a file in src/m4/ though. Stacking macros into configure.in will be a pig to maintain even short term.
@magnumripper commented on GitHub (May 5, 2014):
Note to self: OSX fails the HAVE_LIBCRYPT test, presumably because it has crypt() within its libc or something like that. If I add -DHAVE_LIBCRYPT to the target after running ./configure, it builds fine (without -lcrypt in the linking stage) and --format=crypt works. So some tweak needs to be added for this situation.
Edit: Here's the fix from @jfoug:
Edit 2: Apparently you don't need to include "c":
http://lists.gnu.org/archive/html/guile-devel/2004-02/msg00043.html
The latter may be slightly better. First, we actually need crypt() and not encrypt(). Also, defining this as HAVE_CRYPT is more logical since we don't necessarily need any library.
@magnumripper commented on GitHub (May 5, 2014):
Eventually we should look for crypt_r() too, as well as test for Solaris' thread-safe crypt().
@magnumripper commented on GitHub (May 5, 2014):
That "global search/replace" need anchoring to not hit longer words. For example, this is needed for not affecting HAVE_LIBCRYPTO but just HAVE_LIBCRYPT
No, it works just fine provided I double-check it afterwards using git gui :-) I do this kind of search/replace often and there's usually no problem at all, except sometimes I need to narrow the search term down to not give false hits. Like in this case.
@jfoug commented on GitHub (May 5, 2014):
Here is my 'new' OMP checking code.
Ok, this adds a --with-omp, the default (auto), and a --without-omp or --with-omp=no. The default (auto) will build with OMP support, if it is there. if --with-omp is used it will build with OMP support, but configure will die if omp support is not there. if --without-omp (or with=no) is used, then omp support will not be checked.
I have debugged all cases, and I think I have it nailed down. Now that I have this one, I can easily do others. NOTE, the MPI had a command switch to auto use the --with variable. The OMP macro did not, so I had to add it. I saw other ways to do this logic (main logic is to fail if it can not be done and 'yes' is the choice). This may not be the pertiest way, BUT it works.
We now have --with-packages for MPI and OMP. I am not sure the MPI stuff works properly. I have never built with it, nor used it, so I am not 100% sure how to test, but it 'says' my cygwin can do it.
Btw, mpi is 'no' for default. omp is 'auto'. I think we should make sse2 auto, sse4 'no' icc-asm 'no' and now that I know how, I will start on these. these just add some makefile params. I am still working for a single target when done. The one big issue, is figuring out WHICH arch.h to copy, OR building it within configure, or simply making a 'junk' one that simply includes autoconfig.h and make sure that IT contains everything.
@magnumripper commented on GitHub (May 5, 2014):
Cool. Maybe time for a commit?
Why on earth would we want to disable features like SSE4? Or did I misunderstand? Only a packager would want that, they are a fraction of the user base and very used to enable/disable features anyway. Actually we should enable MPI if installed too IMHO. Joe Random doesn't have any MPI libs anyway. People who has MPI installed will very likely want to enable it.
@magnumripper commented on GitHub (May 5, 2014):
I was playing with the idea of using the name
arch.hinstead ofautoconfig.h. This would mean if you use a legacy target, it will work as before (symlink to static file). If not, we'll have the autoconf stuff already included in most files. We just need to generate all needed stuff in ./configure.@jfoug commented on GitHub (May 5, 2014):
I now get this with ./configure on cygwin (and I am pretty sure i installed mpi-devel
checking whether to compile using MPI... yes
checking for gcc... (cached) gcc
checking whether we are using the GNU C compiler... (cached) yes
checking whether gcc accepts -g... (cached) yes
checking for gcc option to accept ISO C89... (cached) none needed
checking whether gcc understands -c and -o together... (cached) yes
checking for function MPI_Init... no
checking for function MPI_Init in -lmpi... yes
checking for mpi.h... yes
Now ,I did not set a 'special' cc like I see in makefile. Please give me the 'low' down on mpi build, how to tell it is there, and how to use it. I have never used it. I actually prefer a simple non-omp build. I can run multiples, give them affinity, they do not slow down like the OMP build, I can work on different wordsets on different CPU's, etc, of I can run 3 of them on a 4 core, and have the system be super responsive.
But I 'think' I have MPI there, just not sure how to test. I did make it auto by default (instead of no). Also, it has to define @HAVE_MPI@ to -DHAVE_MPI so that the makefile 'works' the way it did before
I am not 100% sure I want to 'replace' arch.h. I think there should be a generic one. Why put in shit that does not need to be there (there is stuff in arch that could be done other ways, and will be). But the harry stuff, like SSE4/SSE2, etc detection, word size, endiantity, etc, should be done in configure, and we should get a 'generic' make target
---- magnum notifications@github.com wrote:
@magnumripper commented on GitHub (May 5, 2014):
All systems I have used supporting MPI (only Linux and OSX) had an 'mpicc' wrapper to gcc (or clang or whatever) and that's more or less it. For such machines, you just set CC=mpicc and use -DHAVE_MPI and that's all there is to it, for JtR. I'm sure there are systems out there with some other name of CC or perhaps just needing -lmpi (the mpicc wrapper implies -lmpi). Hopefully that prefab macro takes care of that better than we'd be able to come up with ourselves.
Now, an MPI build behaves just like a normal build until you use the "mpirun" (a.k.a mpiexec) wrapper. That is:
./john -test -form:raw-md5behaves just like a vanilla build, whereasmpirun -np 4 ./john -test -form:raw-md5will use MPI. This will just be on the local host though, and very similar to just using -fork=4. For actually running across several hosts, you'd pass their names like this:mpirun -host alpha,bravo,charlie ./john -test -form:raw-md5but you don't really have to test this; if it works on your local host it will be fine.@magnumripper commented on GitHub (May 5, 2014):
This will work on some systems, not on others. It will fail on my OSX laptop unless lots of other stuff just happen to be right.
@jfoug commented on GitHub (May 6, 2014):
This works like a champ also:
CC=mpicc ./configure
Builds an MPI version. Here configure detects mpi function without having to add -lmpi, which I assume mpicc does by itself. On my cygwin gcc, it works either way (seems to at least). My testing has been minimal, nothing other than doing a quick mpirun 2 core on test. John was happy.
@magnumripper commented on GitHub (May 8, 2014):
Right now, MPI, OMP, CUDA and OpenCL works fine on OSX and on Linux. But on Linux (Ubuntu), the MPI tests fail so you need to use
CC=mpicc ./configureto get it built.@magnumripper commented on GitHub (May 8, 2014):
We can (should) drop JOHN_CFLAGS, JOHN_ASFLAGS and JOHN_LDLAGS. They were created because the fat Makefile did not allow passing eg. CFLAGS to make (it was just overwritten)
@ghost commented on GitHub (May 9, 2014):
Just in case you guys want to know, I'm seeing strange things here. For example,
@magnumripper commented on GitHub (May 9, 2014):
Are you sure? SSE4.1 is old stuff. What exact CPU is this? What does /proc/cpuinfo say?
What are the locations of headers and libs? Is environment variables AMDAPPSDKROOT and/or ATISTREAMSDKROOT set? If so, what do they say? Can you find anything in config.log that explains why it fails?
@ghost commented on GitHub (May 9, 2014):
SSE4.1
Using bleeding-jumbo and and linux-x86-64-opencl (-native), I can see.
If I try to force -msse4, I get a "ilegal instruction" error.
@jfoug commented on GitHub (May 9, 2014):
I will rework the SSE detection code. It uses 'real' instructions, and should core the app during the configure probing. However, it is often hard to get the compiler to not optimize out the instructions in -O2 mode. I will have to write something that is actually 'useful'. It should not be too hard.
I also got much better instructions on my laptop, which was a bottom of the middle end model. It gave me XOP, and works, and the speed is MUCH better than it was before. My desktop at work, I got AVX, even though I was not able to get them properly before. Now, a VM running on that same work desktop only gets 4.1, not AVX, so it may be that virtualbox does not properly utilize that, I do not know. But where I have tested up to now, the detection was working. Initially it was a problem, due to things being optimized out. I thought I had fixed that, but I guess not.
@ghost commented on GitHub (May 9, 2014):
OpenCL
Notice: this is a CPU only instalation. Anything OpenCL related is using the default configuration provided by AMD installer. Ubuntu 14.04 LTS, clean install. It works with bleeding.
@ghost commented on GitHub (May 9, 2014):
Thanks Jim.
Magnum,
https://gist.github.com/claudioandre/619e002b63fc8c57dcf3
I guess I can see strange things on log. Missing (e. g. -I$(OCLROOT)/include)? No?
@jfoug commented on GitHub (May 9, 2014):
Please do this:
This source (the new probe source for SSE4.1)
compile that the gcc on your machine, by
gcc -msse4.1 -O2and then run that file. It should core. If so, then the test when I get all the newer configure stuff checked in, should cause only SSE2 to be found on your system.@ghost commented on GitHub (May 9, 2014):
Done:
$ ./test
bar
@jfoug commented on GitHub (May 9, 2014):
Then you should have SSE4.1 on that system. hmmmm. the _mm_round_pd is sse4.1, and if you do NOT have sse4.1, it should core with INVALID INSTRUCTION.
Magnum, any ideas?????
Btw, I have checked in all new configuration scripts. It has all new probes. There were also many BE system fixes, and one fix to configure which was not properly setting the ARCH_LITTLE_ENDIAN on a BE system.
As for your SSE2 only system, I am really unsure. Could this be something that the OS and how it was installed is doing, BUT if a program force uses the instructions, they really 'are' there??? Can you perform some CPU id on this thing, to see what is up. Could it be that a few 4.1 instructions can be leaked through, on older silicon, prior to the 'official' 4.1 release. I really do not know.
@ghost commented on GitHub (May 9, 2014):
I have SSE4a, not 4.1. I don't have Bulldozer. Seems it is a subset.
Starting with Barcelona-based processors, AMD introduced the SSE4a instruction set, which has 4 SSE4 instructions and 4 new SSE instructions. These instructions are not found in Intel's processors supporting SSE4.1 and AMD processors only started supporting Intel's SSE4.1 and SSE4.2 (the full SSE4 instruction set) in the Bulldozer-based FX processors.
It is not a big problem, if you guys keep the check for 4.1 inside rawSHA1_ng_fmt.c, otherwise, JtR will fails with illegal instruction error, as we see a few comments above.
@jfoug commented on GitHub (May 9, 2014):
No, it is actually a big problem. NOTE, my tests are failing now. I am getting XOP on my system. I think I will fall back, and simply use gcc inline asm, and not intrinsic code..
As for this:
The problem is that your build would have -msse4.1 and thus SSE4.1 (or whatever it is), WILL be set.
I may have to 'audit' all the code, find all SSE4.1 specific instructions JtR is using, and asm emit ALL of them, or possibly use intrisics. I am not sure why I get success now, it should fail.
This is being worked on. We can take this offlist if we need to.
@jfoug commented on GitHub (May 9, 2014):
Ok, I 'THINK' I have it now. all source was compiled to ASM, with gcc -O2 -S -mcputype and the resultant .s file was checked for having the proper SIMD instruction. They all do, so I believe the check is now working. The only question I have is in the xop. The header I used was different. I am not quite sure where I got that header. When I get home, I will check again. That may have been from AMD's site.
I 'believe' this code should get detection working.
Please try the new configure script (just uploaded).
@magnumripper commented on GitHub (May 9, 2014):
Why are you not using
-O0for these tests? It seems to me it should be safer in many ways.-O2won't do any good here anyway.@magnumripper commented on GitHub (May 9, 2014):
@claudioandre
But
-msse4is not the same as-msse4.1. What if you just force the latter (eg. in bleeding)? Does it still fail?@magnumripper commented on GitHub (May 9, 2014):
For the OpenCL problem, the 'gurus' tell me we should never enumerate directories to find libs and headers that sit in non-standard places. It is up to the user to supply them to
./configure.I am not sure I agree in this case (and it depends on how you define "non-standard"). I tend to think we should look in eg. /opt/AMDAPP and /usr/local/cuda - and/or look at those environment variables.
Maybe we should abandon this mega thread and start separate issues for separate issues...
@magnumripper commented on GitHub (May 9, 2014):
Oh btw @claudioandre, try this magic spell:
gcc -dM -E -x c /dev/null -march=native | grep -E "SSE|AVX|XOP"That will list exactly what gcc thinks you've got (and it's likely 100% right).
@jfoug commented on GitHub (May 9, 2014):
-msse4.1 implies -msse4, so it it was crashing at -msse4, it would also not be good at -msse4.1
I probably will, once I get to move these into a macro. NOTE, there is still a TON of stuff in the macro. First thing, is the macro will have to base detect the system type. If this was a sparc (and not an x86 sparc), then there will be 'unique' .o files needed (well, currently none). Then doing things like checking for SSE is ridiculous. But in thier place, there would be other probes. My 32 vs 64 bit probe, is x86 compiler specific.
The biggest things we need to probe for, are bit size, endianity, if there are any 'special' asm files (or intrinsic files), etc. Also, some systems use different 'default' paths for libs, etc.
But like we talked about, it is best to handle the hugest group as quickly as possible, and to do it right. All the while, we keep the legacy 'fat' makefile. At this time, I think we should DROP all the make targets from the Makefile.in. They exist in Makefile.orig, so 'can' be obtained. Makefile.in should drop down to about 300-400 lines or less. We might also want to keep the original x86-64.h file intact, and make a new file x86-64.h.in which the configure script links to arch.h. I really do not think we are going to ever 'fully' get rid of these files. There simply is TOO much logic, more than can be done with a probe suite.
AGREED
Jim.
@magnumripper commented on GitHub (May 9, 2014):
Are you sure? It must be the other way round:
-msse4should imply-msse4.1because the latter is a subset of the former.I do not have SSE4 (I think only AMD has that) but I do have SSE4.1 and SSE4.2
EDIT: The last statement was wrong: Having both SSE4.1 and SSE4.2 means I have all of SSE4 but not SSE4a 😖 . Still,
-msse4should imply-msse4.1and not the other way round.@magnumripper commented on GitHub (May 9, 2014):
Agreed! Let's chop Makefile.in!
@ghost commented on GitHub (May 9, 2014):
I see the same error message.
@ghost commented on GitHub (May 9, 2014):
@ghost commented on GitHub (May 9, 2014):
Seems to be working fine. Commit: Missed updating configure.
@magnumripper commented on GitHub (May 9, 2014):
That is very odd. How could that (previous) autoconf test survive if the CPU does not have SSE4.1?! It's impossible. I think you should try the same with
-O0just for the sake of it.@magnumripper commented on GitHub (May 9, 2014):
Is
__SSE3__the same as SSSE3? In that case there's still a discrepancy between gcc and autoconf.@jfoug commented on GitHub (May 9, 2014):
Nope. SSSE3 is an extension to SSE3.
@ghost commented on GitHub (May 9, 2014):
Should I change the configure file in order to put the -O0 to test it?
@jfoug commented on GitHub (May 9, 2014):
No, a CPU with SSE4 may not have SSE4.1 BUT a machine with SSE4.1 will have SSE4. They are distinct extensions over.
Same thing with AVX. That implies SSE4 (and SSE4.1???). Also XOP implies AVX, I think, however AVX does not imply XOP.
The whole heiarchy it an ugly thing.
To top it off, when I compile with '-native' on a 64 bit VM, I get SSSE3, but that is as high as it goes. But if I build with configure, doing the probing, I get SSE4.1 instructions, which when I compile JtR, the _ng functions DO use SSE4.1 and do not crash. So in that case, the probing beats -native.
Jim.
@magnumripper commented on GitHub (May 9, 2014):
This is not correct according to the wikipedia page. SSE4 consists of the two subsets SSE4.1 and SSE4.2.
@magnumripper commented on GitHub (May 9, 2014):
Ah, don't bother. I just though it was strange. Jim used the intrinsic
_mm_round_pd()and I can't see how that could possibly be OK if your CPU lacks SSE4.1.But yes, if you check out
37494fc5cand manage to get the CPU test for 4.1 within configure.ac to compile with -O0 it would be very interesting if something changed.@jfoug commented on GitHub (May 9, 2014):
I is wrong. There is no SSE4. The family of SSE4 instructions are:
SSE4.1
SSE4.2
(now we hear about SSE4a which is some AMD adding a couple functions, but I do not think it is related).
I am not sure what -msse4 gives us. We specifically use -msse4.1 Reading --help=target, -msse4 gives you both 4.1 and 4.2 so it sounds like -msse4 and -msse4.2 are the same command flag. -msse4.1 is NOT the same.
I would take this as a source, vs wiki.
https://software.intel.com/en-us/articles/performance-tools-for-software-developers-intel-compiler-options-for-sse-generation-and-processor-specific-optimizations/
However, AMD may make this even more complex (it does make it much more complex).
@magnumripper commented on GitHub (May 9, 2014):
gcc manpage specifically lists -msse4 as an alternative (as well as -msse4.1 and -msse4.2) but it doesn't give the slightest clue to what it really implies.
@jfoug commented on GitHub (May 9, 2014):
--help=target shows the exact same strings for -msse4 and msse4.2 however, -msse4.1 does not list SSE4.2 instructions. I thought there were 3 variants of SSE4. Possibly I had heard about the SSE4a from AMD, and had 3 flavors in my mind, and then thought sse4, sse4.1 and sse4.2 were the 3. It looks like there are 2 flavors 'only' from Intel. But we look specifically for 4.1, as that is what is coded into JtR at the moment.
@jfoug commented on GitHub (May 9, 2014):
Btw, I got the luks2john to work now with the autoconf stuff. It is SUPER strange.
I had to put the ssl libs in there TWICE.
$(LD) .... -lcrypto -lssl .... luks2john.o -s -lcrypto -lssl memdbg.o -o ../run/luks2john
That works. Hmmmmm.... I will not ask why, but that is what I had to do. Before, I was getting linkage errors for all those BIO_*. functions.
@jfoug commented on GitHub (May 9, 2014):
makefile.in will be trimmed down to 885. We DID lose a lot. All of the benchmark stuff, the para gen, etc. We will need to take a look, and see if we might want to have these put into a 'special' directory. So we may make a benchmark directory, that has that. And a para-bench that has that, etc.
@magnumripper commented on GitHub (May 9, 2014):
WAT. Well I know the order of -l commands might matter, I always hated that. So using some other ordering (maybe write a brute forcer for it?) you might get away with just saying it once.
@jfoug commented on GitHub (May 9, 2014):
the old one (fat make) had them in there twice (in reverse order). I now have them in twice (not sure about reverse).
Again, like I mentioned, now that we have proper testing, we easily can pull these x2john files into the john 'proper' format anyway, eliminating them. Then they would simply be ln -s or for cygwin, symlink files. I hate symlink because they do NOT work as well as solar thinks they do, BUT ln -s totally fails to work at all if you do that in cygwin and try to run from a windows command prompt (not cygwin bash shell). I prefer the way it is now, where the unix ln -s is being used, but I bet by the time we release this, solar will want the symlink method.'
But now with configure, we could do both ;) Have a enable flag (no as default, and ONLY valid for cygwin/mingw configures), that allows ln -s to be used. I put a comment in the new stripped down makefile.in listing that the ../run/*.exe should be used as the proj, IF building cyg/mingw. I think that is the only difference.
@magnumripper commented on GitHub (May 10, 2014):
@jfoug you pushed a local merge. Never do that.
When you try pushing and there are new stuff "in the way" you should
git pull --rebaseand then trygit pushagain. This way we don't get local merges in the repo.@jfoug commented on GitHub (May 10, 2014):
Did not mean to. Did numerous git add, then a commit, then a push. Push failed. Did a pull then push. I did not do a git pull --rebase.
Jim.
@magnumripper commented on GitHub (May 10, 2014):
Try
git config --global pull.rebase truefor doing the right thing automagically. This will always imply "rebase" to "git pull". This is not always wanted but I think for your use, and even mine, it is.@magnumripper commented on GitHub (May 10, 2014):
Right now (
93ce2732ae) everything works on my OSX: MPI, OMP, CUDA, OpenCL, PCAP, crypt(3) and I get AVX instructions. All of it just from./configurewith no extra options.@jfoug commented on GitHub (May 11, 2014):
I am working on getting several things done (will be quite a few changed files)
NOTE, this will be easy first time, but every time we edit autoconf stuff (adding vars, etc), we may have to 'patch' the makefile.orig, changing defines to 'match' what we are doing in autoconf, if they are not the same. It will have to be a 2 way street, keeping that up to date. It should not be 'too' hard, but will take a little maint work.
I will get 1 to 4 checked in shortly (after a little testing).
@jfoug commented on GitHub (May 11, 2014):
Now all changes are tracked. makefile -f Makefile.orig work. There is only one caveat that i know about. I can not get the -j4 to work any more on the older makefile. There is some warning message emiitted about something not being passed in, and to use a + switch or something, and that -j1 will be used. Other than that, make -f Makefile.orig sometarget and make -f Makefile.orig clean and make -f Makefile.orig (no args) all work fine.
Now, when we do autoconf changes, we need to keep in mind the -DAC_BUILT flag, and 'hide' things from Makefile.orig, while keeping that working at the same time.
@magnumripper commented on GitHub (May 11, 2014):
Great, everything seems to work (I committed a minor PCAP fix). In a year or so (at most) I suppose we can ditch the old fat Makefile and these workarounds, but it's good to have it around.
@magnumripper commented on GitHub (May 11, 2014):
I added a default Makefile that is a symlink to Makefile.stub. The only thing it really does is print this:
When you run ./configure, this stub is just overwritten with the generated Makefile. A 'make distclean' will symlink it back to Makefile.stub. This is somewhat experimental but seems to work fine and users will get need-to-know info no matter their expertise in ignoring docs and mailing lists :-)
@jfoug commented on GitHub (May 12, 2014):
the x86 compiler stuff is now in a macro in the m4 directory (moved it from configure.ac) I still need to add cache logic to that code, AND to add --disable-type for all things, to allow a user to build for lesser systems on his 'better' system (sort of cross compiling ???)
@magnumripper commented on GitHub (May 12, 2014):
There is absolutely no need for disabling specific tests, it's an all or nothing thing: See #585. You can always disable all checks and manually say -mavx or whatever you want. Hardcore guys with long beards would say all our tests are moot and the only Right Thing[tm] is to add such things manually at invocation time. I think we should make the best of both worlds.
@jfoug commented on GitHub (May 13, 2014):
creation of fmt_externs.h, fmt_registers.h and john_build_rule.h added to configure script, and removed from makefile.
There is one caveat, There is a *_plug.c: john.c Makefile rule. It is still there and commented out. We need to make SURE that if you edit a plug.c file, that it properly builds. If so, then that commented rule can be deleted from Makefile.in. This has been tested, found to not be needed, and removed from Makefile.in
@rofl0r commented on GitHub (May 13, 2014):
x32 can be detected by testing for existence of the
__ILP32__cpp macrohttp://git.etalabs.net/cgit/musl/commit/?id=8c820231edc91da57abff4b9a92187ada7fb1928
@rofl0r commented on GitHub (May 13, 2014):
memory.h is a non-standard header, instead of testing for its existence, just remove the include and use string.h instead.
@rofl0r commented on GitHub (May 13, 2014):
you shouldnt test for standard headers like stdlib.h, string.h. fcntl.h etc - those are headers defined by the C standard - without them nothing would work anyway
@rofl0r commented on GitHub (May 13, 2014):
what do you do in case HAVE_SYS_SOCKET_H is not available ? disable all socket code ?
in my experience all those tests are wasted time - even when compilation works (i.e. all code using the header is properly deactivated), this doesnt last for long - as soon as other ppl not aware of the restriction will commit code, this will break anyway, as nobody without sys/socket.h will ever test the code.
@magnumripper commented on GitHub (May 13, 2014):
Yes but it does not make sense since there are no native X32 systems. You'd always sit on a x86_64 build host and pass -mx32 to ./configure anyway.
Regarding the other stuff, some/all of it are pulled in by prefab macros we use (I think). We are just getting warm here, Jim and I had no autotools experience at all.
@magnumripper commented on GitHub (May 13, 2014):
Hmm on another thought that is a surefire way to detect that someone did pass -mx32 (or used --target=x32-linux-gnu or whatever it would be named), without trying to parse CFLAGS (which is dirty as hell). But currently we don't need to explicitly know that it's an X32 build iirc.
@rofl0r commented on GitHub (May 13, 2014):
"You'd always sit on a x86_64 build host and pass -mx32 to ./configure anyway."
not entirely true - yes you always have a x86_64 kernel, but you can build a toolchain that targets just x32 without any additional command line options.
https://github.com/GregorR/musl-cross/issues/19
even with -mx32 the cpp defines
__ILP32__@magnumripper commented on GitHub (May 13, 2014):
True. But still, we do not have to be explicitly aware of that. We already detect it as 64-bit (we already include
__ILP32__in that test) with 32-bit pointers and longs.@magnumripper commented on GitHub (May 13, 2014):
Hmm wtf should we really include
__ILP32__alone in the "64-bit test"? I think not. That macro only tells us we have 32-bit int, long and pointers. It does NOT say we have a 64-bit anything.@magnumripper commented on GitHub (May 13, 2014):
I guess it should be
(defined(__x86_64__) && defined(__ILP32__))for detecting X32 reliably (if we ever need it). And__ILP32__should simply be removed from that 64-bit test.@magnumripper commented on GitHub (May 13, 2014):
That last problem was fixed in
d03dc2430. Thanks @rofl0r for making me find it 😃@magnumripper commented on GitHub (May 13, 2014):
http://sourceforge.net/p/predef/wiki/Home/ is a damn good collection
@magnumripper commented on GitHub (May 13, 2014):
Found another incorrect macro included in the 32/64-bit test.
_M_IX86is only for 32-bit archs. And I added a bunch of others (non-x86) now too, like PPC and ARM.@jfoug commented on GitHub (May 13, 2014):
That code was written to ONLY be called on x86 systems. Other systems should detect 32/64 bit in other ways.
Hmm, I also see that the reply 'may' be fixed on github. I will test later from my webmail and see if it works there also. that is good.
Jim.
@magnumripper commented on GitHub (May 13, 2014):
That has changed. This is now a generic 64/32 test. The x86 specifics come afterwards.
@jfoug commented on GitHub (May 14, 2014):
We still need to use alpha.S or a ln -s to digipaq-alpha.s, (lower case s) for Digital/Compaq alpha.
I will work on AVX2 (if not done yet), and work on getting caching variables done for the x86 selection items.
In reality, I think we are NOT far from being able to merge this with bleeding. It appears pretty darn robust right now. It might not hurt to clean up a bit and organize, but we can always do that later. I am sure there will be some growing pains, once we release this.
@magnumripper commented on GitHub (May 14, 2014):
Yes, any assembler targets are still omitted for non-x86. I'll look into that today. Things like alpha.S can hopefully be added with ease to the $host_cpu switch in ax_jtr_generic_logic.m4. At that time, we now $host_cpu as well as 32/64-bit operation.
Also, any special features like -faltivec are to-do but they can always be given as input to ./configure.
Yes, I think we are really close now! Hopefully we'll merge this right after that nearby contest (or once they establish a contest tarball).
@jfoug commented on GitHub (May 14, 2014):
oSSL now done with pkg-config calls. I left the original 2 AC_CHECK_LIB calls in there (commented out). The only reason I would want to go back to them would be if users start to complain about pkg-config. NOTE, we should also do the same for libz i.e. AC_CHECK_LIB(z) -> PKG_CHECK_MODULES(ZLIB, zlib, , exit_error(required zlib))
@jfoug commented on GitHub (May 14, 2014):
I fully agree. The one thing I was concerned with was pkg-config for oSSL. That IS the way it should be done. It works slick on my sparc. The only way I got things working before was to start understanding how things are laid out, then doing
pkg-config --libs opensslandpkg-config --cflags opensslby hand and adding them to the configure command line. Now that it is in a proper autoconfig macro, all libs, includes, linkage paths, etc get loaded (as long as pkg-config was done properly during the install). I have tested on cygwin, ubuntu and they work just as well as before, and now that strange 'busted' sparc system hums along.It would be nice to nail down that rrarwhatever.c compiler hangup bug we have. I might give that a shot later today, if I have time. I figure a binary search with #if 0 in the source file should find what line or set of lines is the problem, and then maybe something will jump out. Now, on my sparc, I still do have ONE problem, that autoconf will not work around. That is the -R flag (linker flag that adds the lib path into the search path to resolve .so files), is NOT present for the -NSS. However, I could build using --without-nss, or put that path into my ld_library_path, so it is not a complete failure.
This autoconf project has actually surpassed my expectations. Yes, it would be good to add the MMX_COEF logic also, but that can wait. It 'is' there, just in a arch.h file. It would be nice if we could put that logic into a shell script that autoconf could read, and then build a para_best script that would 'compute' a new script file (with best values). That way we could provide a 'base' set, and the user could spend the time to re-gen for his compiler/OS, which may be different. But again, pipe dream for now. But something to think about over time.
@ghost commented on GitHub (May 16, 2014):
I'm seeing errors here. Should I report new issues? For example.
This works:
make --file Makefile.orig -sj6 linux-x86-64-opencl
This fails (same directory, after a make clean):
./configure
make -sj4
@magnumripper commented on GitHub (May 16, 2014):
raw-sha1-ng does have intermittent OMP problems, even in bleeding-jumbo branch (I'm almost certain). We should open an issue for that.
Other than that, was there other problems with autoconf? Does it do what it's supposed to do? Do you now get OpenCL without extra measures or do you have to pass anything to ./configure?
@jfoug commented on GitHub (May 16, 2014):
Magnum, did you add code specific to testing for GNU compliant malloc and realloc? I now get these to test as no, there is a WITH_MALLOC set to 0, and malloc is redefined to rpl_malloc. This totally fails. We do not have any rpl_malloc. What gives? Or was this some new package, like one of the things for openCL or Cuda? This has turned a good working system into something that will not build any more (cygwin).
checking for fork... no
checking for vfork... no
checking for stdlib.h... (cached) yes
checking for GNU libc compatible malloc... nochecking for stdlib.h... (cached) yes
checking for unistd.h... (cached) yes
checking for sys/param.h... (cached) yes
checking for getpagesize... no
checking for working mmap... no
checking for stdlib.h... (cached) yes
checking for GNU libc compatible realloc... nochecking for atexit... no
@jfoug commented on GitHub (May 16, 2014):
Also, openmp is no longer working on cygwin, even though openmp is easy to set.
configure: WARNING: NSS not found - Mozilla format will be omitted.
checking for gcc option to support OpenMP... unsupportedchecking for cudaGetDeviceCount in -lcudart... no
configure: No CUDA found, disabling
Also, I am getting -lrexgen AND -llibrexgen I do not have librexgen.so on my system, only liblibrexgen.so
@jfoug commented on GitHub (May 16, 2014):
A lot of these problems MAY be due to having -lrexgen along with the proper -llibrexgen in my system. It seems like that carries forward. Investigating further.....
@jfoug commented on GitHub (May 16, 2014):
The last 3 items were fixed with
14ec2d8PLEASE test this on systems where rexgen is the lib. Also, doing LIBS += inside of configure might not be what we want to do. We might want to have our own variable, that in the end of config, we do LIBS += that variable. There ARE (can be) side effects to adding during the initial configure compiles.@magnumripper commented on GitHub (May 16, 2014):
I can't recall having changed anything lately that should have such side effects but sometimes you just change the position of a variable definition and autoconf avalanches and reorders stuff :)
I take it all is good now after
14ec2d8. Did that little thing have such bad side effects?!@jfoug commented on GitHub (May 16, 2014):
Yes, all is well after that.
The side effects were that ALL c compiling within the configure script from that point on failed, due to gcc complaining that it could not find libregex.so, even though no functions were being used from within that library. gcc had no way of knowing it was 'safe' to not exist.
So configure started thinking all sorts of things were wrong, not installed, or non-compliant.
NOTE, we need to look at how to work around that non-compliant malloc and realloc. If we hit a system that triggers that situation. I think we need to have some functions ready to go (rpl_malloc and rpl_realloc)
@ghost commented on GitHub (May 17, 2014):
No, but I can say what is failing inside configure (I analysed and hand edited Makefile). To offer a patch I have to understand where OpenCL stuff is.
Anyone online to help me finding it?
@ghost commented on GitHub (May 17, 2014):
The patch below fix the problem. I tried to check how bull behaves, but it is failing at git clone. Anyway, it is mandatory here (notice, for a 32 bits system, it is not correct).
@ghost commented on GitHub (May 17, 2014):
Why GMP support (below) has no (blank) information?
@magnumripper commented on GitHub (May 17, 2014):
The blank GMP is a bug in configure.ac. Not sure when it happens, I'm pretty sure I have seen both yes and no emitted too (yet I too have seen it blank on some host)
@magnumripper commented on GitHub (May 17, 2014):
Thanks, knowing this I'll be able to fix configure.ac (tomorrow). I'll add some logic for 32/64 bit and then run-time checks so we don't add directories that does not exist.
Hmm bull fails at clone? This works for me (read only, I never push from bull):
@jfoug commented on GitHub (May 17, 2014):
I have this and many other things fixed. When I get tem checked in, I will list.
@ghost commented on GitHub (May 17, 2014):
Something related to "refused by host" (I mean, seems to be a intermittent error).
@jfoug commented on GitHub (May 17, 2014):
These items have been 'fixed' and or changed.
Added a new 'utility' macros file to m4. It contains a macro for testing gcc command line switches (and some other macros). This may end up being the kitchen sink for macros, to keep configure.ac thinner and smoother.
The get cc argument works, but the only problem with it, is it depends upon -Werror being valid (which causes a warning to be treated as an error). We likely need to come up with tests for -Werror not being present, and what other switches to try, or find a way to detect the PROPER switch to do this. Now, testing for these have been moved into using this code: -O2 (we should test -O4, -O3, -O2, -O1, -O until one of them works, and then go with that one), -Wall, -funroll-loops, -finline-functions, -Os, -Wdeclaration-after-statement, and -fomit-frame-pointer. Now CFLAGS, OPT_NORMAL and OPT_INLINE all get set from these tests
Fixed GMP being blank
Fixed --disable-openmp still showing Yes on the status
Moved the include and lib path search code into the 'Generic' macros file.
Added OpenCL lib test for $AMD/lib/x86_64 or $AMD/lib/x86 to happen after we determine 32 or 64 bit (NOTE, I now get OpenCL in cygwin also!!). I think this is usually where the Win32 installs of AMD libs put the libs.
This patch
11f0390contains all of these changes.@jfoug commented on GitHub (May 17, 2014):
@claudioandre Please try now, and see if a 'raw' configure, with no fixups works properly for you. It should have the -O2 and find openCL properly (I hope).
@magnumripper commented on GitHub (May 17, 2014):
If you mean we build all of john with the highest -O that works I think that might be inappropriate. Even -O3 seems to do more bad than good (at least last time I tested). I assume we get regressions from code no longer fitting in caches.
@jfoug commented on GitHub (May 17, 2014):
I have made no change other than to look for O2 if it works. The comment was just talking out loud
@ghost commented on GitHub (May 17, 2014):
It is working fine, but I noticed a few glitches:
Thanks.
@jfoug commented on GitHub (May 18, 2014):
openmp will likely need work. I added code, so that when you do a --disable-openmp, that it does not show Yes. But when I ran it, without the --disable, it DID show yes. I am sure there is something still not right. Magnum had to add some 'special' code at the bottom of config.ac to figure out when OMP was set, I changed that to try to detect when it is forced off. Likely I am a little aggressive, and need to change it slightly.
I will look at other warnings when I feel up to it. Was moving today, so am very exhausted right now. I think the next time I move, it will be where I have 2 EMT's moving me, and there is a sheet over my head. This really sux.
@magnumripper commented on GitHub (May 18, 2014):
The OpenMP output was working for me, with and without --disable on Sparc, Linux and OSX. But I did recognize it as not quite foolproof. Maybe we should be slightly less reluctant to change the imported macro files. We should be reluctant, but sometimes it's better to change it than not to.
@jfoug commented on GitHub (May 18, 2014):
These warnings have been fixed. It was bash test logic that was working fine on cygwin, but failed on linux (LOLOLOLOL :) Well, it is fixed, and working fine now. The warnings were all from the if statement computing whether to show 'yes' or 'no' for openmp. But again, we need to test. I used the -a 'and' in the test statement instead of multiple test statements strung together with && Possibly the -a is not as compatible, and I will need to revert. But the important part now, is that the omp logic is working pretty solidly in being set, and this was just a visual probblem within the summary. HOWEVER, if the -a of test is something that should not be used, then I will need to make changes to the LOGIC of the x86_64 vs x86 lib addition logic for OpenCL detection. If those libs are not added, then my cygwin fails to find OpenCL, as @claudioandre also found out.
@magnumripper commented on GitHub (May 18, 2014):
I'm pretty sure
-ais portable. But last time I tried, I failed to find what syntax to use (for the whole line) - nothing seemed to work so I reverted totest this && test that.Just now I tried it again and there seems to be no problems at command line:
I did not try this in configure.ac this time though (I think I tried that syntax before and it failed?)
@magnumripper commented on GitHub (May 18, 2014):
Latest commit (
445ad39a) works fine on OSX. However, I see you use "==" with 'test'. While it seems to work it's not mentioned in my man page. I presume it's safer to use a single = for string comparisons and-eqfor numeric ones.@magnumripper commented on GitHub (May 18, 2014):
af08a8echanges all '==' to '=' and replaces 'test this && test that' with 'test this -a that'. Works fine on OSX and should be more portable.@jfoug commented on GitHub (May 18, 2014):
I have changes also, but not committed. The == to = was one of them. I'm at my daughters graduation today, so my time is not really avail. But I will look also. We are getting very close. If we get a few more alpha testers, we might be able to call it done enough for the masses
@magnumripper commented on GitHub (May 18, 2014):
Found a case where a multi-word $CL_LIBS lead to errors because it was not protected with quotes, fixed in
c449787e. So I ended up unifying the syntax so we use "x$variable" in most places, as opposed to x"$variable" or x${variable}, unprotected.Also, ax_jtr_utility macros.m4 had DOS linefeeds and lots of bogus whitespace. All fixed in
17599987.I'll merge this branch to bleeding-jumbo in about 22h from now, after Hash Runner ends (I'll merge contest patches too at the same time).
@ghost commented on GitHub (May 18, 2014):
Everything seems to be ok here.
@magnumripper commented on GitHub (May 19, 2014):
I get these ugly warnings. In the end all is right but I wonder why I see those warnings.
Could it be that CPPFLAGS should be filled with the
-I/path/oclincludes -I/path/cudaincludestoo?@ghost commented on GitHub (May 19, 2014):
Me too (BTW: it is not new, I'm seeing this for a while).
Since things works, never bother. Anyway, if you want to try this, I can test it for you!
@magnumripper commented on GitHub (May 19, 2014):
It was CPPFLAGS. How odd is that, I thought it would be using CFLAGS' -I. Fixed in
e3c7c87@magnumripper commented on GitHub (May 19, 2014):
As of
539cb8cabull, well and super configures & builds correctly just from./configure && make. As does my MBPR.@ghost commented on GitHub (May 19, 2014):
Everything is Ok here too.
@magnumripper commented on GitHub (May 19, 2014):
Let's stop this thread right here. Look at #580 instead, it's auto-updated (and comments can still be added).