[GH-ISSUE #575] Autoconf #248

Closed
opened 2026-10-14 02:58:00 +07:00 by bsakaguchi · 146 comments
Owner

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:

  • HAVE_LIBGMP
  • HAVE_LIBKRB5, HAVE_LIBK5CRYPTO
  • HAVE_LIBREXGEN
  • dlopen()
  • mmap()
  • NSS
  • SSE2
  • SSE4
  • XOP
  • AVX
  • AVX2
  • other CPU types
  • Big/Little Endian
  • ARCH_INT_GT_32
  • Arch allows unaligned
  • OMP (--without-omp has been added)
  • MPI (--without-mpi added). This doesn't work very well on Ubuntu despite us using prefab stuff.
  • OpenCL (on OSX it links with -framework OpenCL, on all others -lOpenCL)
  • CUDA
  • HAVE_SKEY
  • Does compiler support -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-feature options.

Other options (configure):

  • JOHN_SYSTEMWIDE option (--with-systemwide[=directory], see params.h)
  • CPU_FALLBACK options (--with-cpu-fallback, see params.h)
  • OMP_FALLBACK option (--with-omp-fallback, see params.h) - or should we always build it?
  • tuning option (set things like MD5_SSE_PARA)
  • X32 as an option for linux-x86-64 targets.

X32 is more or less a cross compile. Either we support it specifically using --with-X32 or something, or you'll have to say CFLAGS=-mx32 ASFLAGS=-mx32 LDFLAGS=-mx32 ./configure (which should already be supported)

New targets (Makefile)

  • default target
  • install target
  • debug target (using -DDEBUG -O0. For -g see next comment)
  • possibly we could add packaging targets too

Things to do within configure instead of make:

  • Plugin enumeration
  • john_build_rules.h file (may need extra coding for cross compiles, etc)
  • Enumerate bash-completion target directory
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](https://github.com/magnumripper/JohnTheRipper/commits/autoconf) Tests to add/use: - [x] HAVE_LIBGMP - [x] HAVE_LIBKRB5, HAVE_LIBK5CRYPTO - [x] HAVE_LIBREXGEN - [x] dlopen() - [x] mmap() - [x] NSS - [x] SSE2 - [x] SSE4 - [x] XOP - [x] AVX - [x] AVX2 - [ ] other CPU types - [x] Big/Little Endian - [x] ARCH_INT_GT_32 - [x] Arch allows unaligned - [x] OMP (--without-omp has been added) - [x] MPI (--without-mpi added). This doesn't work very well on Ubuntu despite us using prefab stuff. - [x] OpenCL (on OSX it links with `-framework OpenCL`, on all others `-lOpenCL`) - [x] CUDA - [x] HAVE_SKEY - [x] Does compiler support `-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-feature` options. Other options (configure): - [ ] JOHN_SYSTEMWIDE option (--with-systemwide[=directory], see params.h) - [ ] CPU_FALLBACK options (--with-cpu-fallback, see params.h) - [ ] OMP_FALLBACK option (--with-omp-fallback, see params.h) - or should we always build it? - [ ] tuning option (set things like `MD5_SSE_PARA`) - [x] X32 as an option for linux-x86-64 targets. X32 is more or less a cross compile. Either we support it specifically using `--with-X32` or something, or you'll have to say `CFLAGS=-mx32 ASFLAGS=-mx32 LDFLAGS=-mx32 ./configure` (which should already be supported) New targets (Makefile) - [x] default target - [ ] install target - [ ] debug target (using `-DDEBUG -O0`. For `-g` see next comment) - [ ] possibly we could add packaging targets too Things to do within configure instead of make: - [x] Plugin enumeration - [x] john_build_rules.h file (may need extra coding for cross compiles, etc) - [ ] Enumerate bash-completion target directory
bsakaguchi 2026-10-14 02:58:00 +07:00
Author
Owner

@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.

<!-- gh-comment-id:41997763 --> @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.
Author
Owner

@magnumripper commented on GitHub (May 2, 2014):

Here's a list of what is used today:

$ grep -Eho '\bOS_[^ \)=]+' *.[ch] | awk '{print $1}' | sort -u
  • OS_FLOCK
  • OS_FORK
  • OS_TIMER
$ grep -Eho 'HAVE_[^ \)=]+' *.[ch] | awk '{print $1}' | sort -u
  • HAVE_AVX
  • HAVE_AVX2
  • HAVE_CUDA
  • HAVE_DECL_BE64ENC
  • HAVE_DOS_H
  • HAVE_INT16_FROM_RPC_RPC_H
  • HAVE_JOHN_OMP_FALLBACK
  • HAVE_LIBBZ2
  • HAVE_LIBZ
  • HAVE_MPI
  • HAVE_NSS
  • HAVE_OPENCL
  • HAVE_OPENSSL
  • HAVE_PTHREADS
  • HAVE_SKEY
  • HAVE_SSE2
  • HAVE_SSE41
  • HAVE_SSSE3
  • HAVE_STRUCT_TM_TM_ZONE
  • HAVE_TZNAME
  • HAVE_XOP
  • HAVE_GMP (now HAVE_LIBGMP)
  • HAVE_CRYPT (and c3_fmt.o always 'built')
  • HAVE_DL (now HAVE_LIBDL, and plug.c and Makefile also changed)
  • HAVE_KRB5 now HAVE_LIBKRB5 and HAVE_LIBK5CRYPTO
  • HAVE_REXGEN. HAVE_REXGEN still used, but HAVE_LIBLIBREXGEN and HAVE_LIBREXGEN tell the header file when to set it true or not.

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.

  • HAVE_STRINGS_H
  • HAVE_SYS_ENDIAN_H
  • HAVE_SYS_FILE_H
  • HAVE_SYS_TIMES_H
  • HAVE_SYS_TIME_H
  • HAVE_UINT16_FROM_RPC_RPC_H
  • HAVE_UNISTD_H
  • HAVE_UNIXLIB_LOCAL_H
  • HAVE_WINDOWS_H
<!-- gh-comment-id:42018111 --> @magnumripper commented on GitHub (May 2, 2014): Here's a list of what is used today: ``` $ grep -Eho '\bOS_[^ \)=]+' *.[ch] | awk '{print $1}' | sort -u ``` - [ ] OS_FLOCK - [x] OS_FORK - [ ] OS_TIMER ``` $ grep -Eho 'HAVE_[^ \)=]+' *.[ch] | awk '{print $1}' | sort -u ``` - [x] HAVE_AVX - [x] HAVE_AVX2 - [x] HAVE_CUDA - [ ] HAVE_DECL_BE64ENC - [ ] HAVE_DOS_H - [ ] HAVE_INT16_FROM_RPC_RPC_H - [ ] HAVE_JOHN_OMP_FALLBACK - [ ] HAVE_LIBBZ2 - [x] HAVE_LIBZ - [x] HAVE_MPI - [x] HAVE_NSS - [x] HAVE_OPENCL - [x] HAVE_OPENSSL - [x] HAVE_PTHREADS - [x] HAVE_SKEY - [x] HAVE_SSE2 - [x] HAVE_SSE41 - [x] HAVE_SSSE3 - [ ] HAVE_STRUCT_TM_TM_ZONE - [ ] HAVE_TZNAME - [x] HAVE_XOP - [x] HAVE_GMP (now HAVE_LIBGMP) - [x] HAVE_CRYPT (and c3_fmt.o always 'built') - [x] HAVE_DL (now HAVE_LIBDL, and plug.c and Makefile also changed) - [x] HAVE_KRB5 now HAVE_LIBKRB5 and HAVE_LIBK5CRYPTO - [x] HAVE_REXGEN. HAVE_REXGEN still used, but HAVE_LIBLIBREXGEN and HAVE_LIBREXGEN tell the header file when to set it true or not. 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. - [x] HAVE_STRINGS_H - [x] HAVE_SYS_ENDIAN_H - [x] HAVE_SYS_FILE_H - [x] HAVE_SYS_TIMES_H - [x] HAVE_SYS_TIME_H - [x] HAVE_UINT16_FROM_RPC_RPC_H - [x] HAVE_UNISTD_H - [x] HAVE_UNIXLIB_LOCAL_H - [x] HAVE_WINDOWS_H
Author
Owner

@magnumripper commented on GitHub (May 2, 2014):

We also have these, enumerated by current "make generic" (results shown for OSX/amd64)

#define ARCH_WORD                       long
#define ARCH_SIZE                       8
#define ARCH_BITS                       64
#define ARCH_BITS_LOG                   6
#define ARCH_BITS_STR                   "64"
#define ARCH_LITTLE_ENDIAN              1
#define ARCH_INT_GT_32                  0
#define ARCH_ALLOWS_UNALIGNED           1
#define ARCH_INDEX(x)                   ((unsigned int)(unsigned char)(x))

Edit: All but the last one are autoconf now.

<!-- gh-comment-id:42018554 --> @magnumripper commented on GitHub (May 2, 2014): We also have these, enumerated by current "make generic" (results shown for OSX/amd64) ``` #define ARCH_WORD long #define ARCH_SIZE 8 #define ARCH_BITS 64 #define ARCH_BITS_LOG 6 #define ARCH_BITS_STR "64" #define ARCH_LITTLE_ENDIAN 1 #define ARCH_INT_GT_32 0 #define ARCH_ALLOWS_UNALIGNED 1 #define ARCH_INDEX(x) ((unsigned int)(unsigned char)(x)) ``` **Edit**: All but the last one are autoconf now.
Author
Owner

@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.

<!-- gh-comment-id:42021519 --> @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.
Author
Owner

@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.

<!-- gh-comment-id:42052185 --> @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.
Author
Owner

@magnumripper commented on GitHub (May 2, 2014):

Is there some standard unix way to globally edit all data, safely replacing one string with another?
Example would be: HAVE_GMP -> HAVE_LIBGMP (note that one is already done)

Using git, I'd do it like this (safest with pwd == base dir but in this case src/ should be fine):

$ git grep -l HAVE_GMP | xargs sed -ri s/HAVE_GMP/HAVE_LIBGMP/g

The git grep is about the same as grep <all files under git's control> (but only from current directory and down)

<!-- gh-comment-id:42060107 --> @magnumripper commented on GitHub (May 2, 2014): > Is there some standard unix way to globally edit all data, safely replacing one string with another? > Example would be: HAVE_GMP -> HAVE_LIBGMP (note that one is already done) Using git, I'd do it like this (safest with pwd == base dir but in this case src/ should be fine): ``` $ git grep -l HAVE_GMP | xargs sed -ri s/HAVE_GMP/HAVE_LIBGMP/g ``` The `git grep` is about the same as `grep <all files under git's control>` (but only from current directory and down)
Author
Owner

@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.

<!-- gh-comment-id:42063530 --> @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.
Author
Owner

@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:

What should we CHECK IN

If you pull the minor commits I did to that branch, the .gitignorewill take care of it.

<!-- gh-comment-id:42065523 --> @magnumripper commented on GitHub (May 2, 2014): @jfoug please commit your changes to the autoconf branch (if you remember how to do it :wink:) I'd like to follow progress and perhaps wedge in some fixes. Failing that, just send me a patch :sunglasses: Edit: > What should we CHECK IN If you pull the minor commits I did to that branch, the `.gitignore`will take care of it.
Author
Owner

@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.

<!-- gh-comment-id:42068852 --> @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.
Author
Owner

@jfoug commented on GitHub (May 2, 2014):

$ git grep -l HAVE_GMP | xargs sed -ri s/HAVE_GMP/HAVE_LIBGMP/g

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).

<!-- gh-comment-id:42079272 --> @jfoug commented on GitHub (May 2, 2014): ``` $ git grep -l HAVE_GMP | xargs sed -ri s/HAVE_GMP/HAVE_LIBGMP/g ``` 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).
Author
Owner

@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

  • HAVE_ARPA_INET_H
  • HAVE_FCNTL_H
  • HAVE_INTTYPES_H
  • HAVE_LIMITS_H
  • HAVE_LOCALE_H
  • HAVE_MEMORY_H
  • HAVE_NETDB_H
  • HAVE_NETINET_IN_H
  • HAVE_OS_H
  • HAVE_STDDEF_H
  • HAVE_STDINT_H
  • HAVE_STDLIB_H
  • HAVE_STRING_H
  • HAVE_STRINGS_H
  • HAVE_SYS_FILE_H
  • HAVE_SYS_PARAM_H
  • HAVE_SYS_SOCKET_H
  • HAVE_SYS_STAT_H
  • HAVE_SYS_TIMEB_H
  • HAVE_SYS_TIME_H
  • HAVE_SYS_TIMES_H
  • HAVE_SYS_TYPES_H
  • HAVE_TERMIOS_H
  • HAVE_UNISTD_H
  • HAVE_VFORK_H
  • HAVE_WCHAR_H
  • HAVE_WINDOWS_H (handled in os.h)
  • HAVE_DOS_H (handled in os.h)
  • HAVE_INT16_FROM_RPC_RPC_H
  • HAVE_SYS_ENDIAN_H
  • HAVE_UINT16_FROM_RPC_RPC_H
  • HAVE_UNIXLIB_LOCAL_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

<!-- gh-comment-id:42079673 --> @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 - [x] HAVE_ARPA_INET_H - [x] HAVE_FCNTL_H - [x] HAVE_INTTYPES_H - [x] HAVE_LIMITS_H - [x] HAVE_LOCALE_H - [x] HAVE_MEMORY_H - [x] HAVE_NETDB_H - [x] HAVE_NETINET_IN_H - [x] HAVE_OS_H - [x] HAVE_STDDEF_H - [x] HAVE_STDINT_H - [x] HAVE_STDLIB_H - [x] HAVE_STRING_H - [x] HAVE_STRINGS_H - [x] HAVE_SYS_FILE_H - [x] HAVE_SYS_PARAM_H - [x] HAVE_SYS_SOCKET_H - [x] HAVE_SYS_STAT_H - [x] HAVE_SYS_TIMEB_H - [x] HAVE_SYS_TIME_H - [x] HAVE_SYS_TIMES_H - [x] HAVE_SYS_TYPES_H - [x] HAVE_TERMIOS_H - [x] HAVE_UNISTD_H - [x] HAVE_VFORK_H - [x] HAVE_WCHAR_H - [x] HAVE_WINDOWS_H (handled in os.h) - [x] HAVE_DOS_H (handled in os.h) - [ ] HAVE_INT16_FROM_RPC_RPC_H - [ ] HAVE_SYS_ENDIAN_H - [ ] HAVE_UINT16_FROM_RPC_RPC_H - [x] HAVE_UNIXLIB_LOCAL_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
Author
Owner

@magnumripper commented on GitHub (May 2, 2014):

I notice that you did not put any of the Makefile.orig files in there. Was that by design?

Oh, that was a mistake. I bet *.orig is in .gitignore

<!-- gh-comment-id:42084310 --> @magnumripper commented on GitHub (May 2, 2014): > I notice that you did not put any of the Makefile.orig files in there. Was that by design? Oh, that was a mistake. I bet `*.orig` is in .gitignore
Author
Owner

@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

<!-- gh-comment-id:42085225 --> @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
Author
Owner

@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.

<!-- gh-comment-id:42085376 --> @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.
Author
Owner

@ghost commented on GitHub (May 3, 2014):

Hi. Below a POC patch that will avoid a few warnings I'm seeing here!


diff --git a/src/SIPdump.c b/src/SIPdump.c
index 1bc0519..a6e5c42 100644
--- a/src/SIPdump.c
+++ b/src/SIPdump.c
@@ -8,9 +8,10 @@
  * gcc -Wall SIPdump.c -o SIPdump -lpcap */

 #include "autoconfig.h"
+#include <stdio.h>
+
 #if HAVE_PCAP_H

-#include <stdio.h>
 #include <string.h>
 #include <stdlib.h>
 #include <unistd.h>
diff --git a/src/vncpcap2john.c b/src/vncpcap2john.c
index aca1f0b..333fc16 100644
--- a/src/vncpcap2john.c
+++ b/src/vncpcap2john.c
@@ -30,12 +30,13 @@
  */

 #include "autoconfig.h"
+#include <stdio.h>
+
 #if HAVE_NETINET_IF_ETHER_H && HAVE_PCAP_H

 #define _BSD_SOURCE
 #define _GNU_SOURCE
 #include <stdbool.h>
-#include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
 #include <unistd.h>

<!-- gh-comment-id:42092874 --> @ghost commented on GitHub (May 3, 2014): Hi. Below a POC patch that will avoid a few warnings I'm seeing here! ``` diff --git a/src/SIPdump.c b/src/SIPdump.c index 1bc0519..a6e5c42 100644 --- a/src/SIPdump.c +++ b/src/SIPdump.c @@ -8,9 +8,10 @@ * gcc -Wall SIPdump.c -o SIPdump -lpcap */ #include "autoconfig.h" +#include <stdio.h> + #if HAVE_PCAP_H -#include <stdio.h> #include <string.h> #include <stdlib.h> #include <unistd.h> diff --git a/src/vncpcap2john.c b/src/vncpcap2john.c index aca1f0b..333fc16 100644 --- a/src/vncpcap2john.c +++ b/src/vncpcap2john.c @@ -30,12 +30,13 @@ */ #include "autoconfig.h" +#include <stdio.h> + #if HAVE_NETINET_IF_ETHER_H && HAVE_PCAP_H #define _BSD_SOURCE #define _GNU_SOURCE #include <stdbool.h> -#include <stdio.h> #include <stdlib.h> #include <string.h> #include <unistd.h> ```
Author
Owner

@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.

<!-- gh-comment-id:42100005 --> @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.
Author
Owner

@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.

<!-- gh-comment-id:42103287 --> @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.
Author
Owner

@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.

<!-- gh-comment-id:42104021 --> @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.
Author
Owner

@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:

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.


Reply to this email directly or view it on GitHub:
https://github.com/magnumripper/JohnTheRipper/issues/575#issuecomment-42104021

<!-- gh-comment-id:42104899 --> @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: > 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. > > --- > > Reply to this email directly or view it on GitHub: > https://github.com/magnumripper/JohnTheRipper/issues/575#issuecomment-42104021
Author
Owner

@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.

<!-- gh-comment-id:42106667 --> @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.
Author
Owner

@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:

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 stuff passed within the build target.

The problems are very likely some mismatch between SSE_PARA or the like.


Reply to this email directly or view it on GitHub:
https://github.com/magnumripper/JohnTheRipper/issues/575#issuecomment-42106667

<!-- gh-comment-id:42119421 --> @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: > 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 stuff passed within the build target. > > The problems are very likely some mismatch between SSE_PARA or the like. > > --- > > Reply to this email directly or view it on GitHub: > https://github.com/magnumripper/JohnTheRipper/issues/575#issuecomment-42106667
Author
Owner

@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

if (LIBCUDA)
    PROJ += CUDA_OBJS

This is crucial for not having separate make targets.

<!-- gh-comment-id:42128885 --> @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 ``` if (LIBCUDA) PROJ += CUDA_OBJS ``` This is crucial for not having separate make targets.
Author
Owner

@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/

<!-- gh-comment-id:42133359 --> @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/
Author
Owner

@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.

<!-- gh-comment-id:42135113 --> @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.
Author
Owner

@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.

<!-- gh-comment-id:42136395 --> @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.
Author
Owner

@magnumripper commented on GitHub (May 4, 2014):

So IMHO drop the intermediate variables - instead of:

NSS_CFLAGS = @NSS_CFLAGS@
HAVE_NSS = @HAVE_NSS@
NSS_LDFLAGS = @NSS_LIBS@
CFLAGS = -O2 blabla $(HAVE_NSS) $(NSS_CFLAGS)
LDFLAGS = -g -L/usr/local/lib blabla $(NSS_LDFLAGS)

...make it just:

CFLAGS = -O2 blabla @HAVE_NSS@ @NSS_CFLAGS@
LDFLAGS = -g -L/usr/local/lib blabla @NSS_LDFLAGS@
<!-- gh-comment-id:42142157 --> @magnumripper commented on GitHub (May 4, 2014): So IMHO drop the intermediate variables - instead of: ``` NSS_CFLAGS = @NSS_CFLAGS@ HAVE_NSS = @HAVE_NSS@ NSS_LDFLAGS = @NSS_LIBS@ CFLAGS = -O2 blabla $(HAVE_NSS) $(NSS_CFLAGS) LDFLAGS = -g -L/usr/local/lib blabla $(NSS_LDFLAGS) ``` ...make it just: ``` CFLAGS = -O2 blabla @HAVE_NSS@ @NSS_CFLAGS@ LDFLAGS = -g -L/usr/local/lib blabla @NSS_LDFLAGS@ ```
Author
Owner

@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

<!-- gh-comment-id:42143058 --> @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
Author
Owner

@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

<!-- gh-comment-id:42143940 --> @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 :baby_bottle: Edit: http://stackoverflow.com/questions/5298830/how-to-include-m4-files-in-autoconf
Author
Owner

@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:

So drop the intermediate variables - instead of:

NSS_CFLAGS = @NSS_CFLAGS@
HAVE_NSS = @HAVE_NSS@
NSS_LDFLAGS = @NSS_LIBS@
CFLAGS = -O2 blabla $(HAVE_NSS) $(NSS_CFLAGS)
LDFLAGS = -g -L/usr/local/lib blabla $(NSS_LDFLAGS)

...make it just:

CFLAGS = -O2 blabla @HAVE_NSS@ @NSS_CFLAGS@
LDFLAGS = -g -L/usr/local/lib blabla @NSS_LDFLAGS@

Reply to this email directly or view it on GitHub:
https://github.com/magnumripper/JohnTheRipper/issues/575#issuecomment-42142157

<!-- gh-comment-id:42145342 --> @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: > So drop the intermediate variables - instead of: > > ``` > NSS_CFLAGS = @NSS_CFLAGS@ > HAVE_NSS = @HAVE_NSS@ > NSS_LDFLAGS = @NSS_LIBS@ > CFLAGS = -O2 blabla $(HAVE_NSS) $(NSS_CFLAGS) > LDFLAGS = -g -L/usr/local/lib blabla $(NSS_LDFLAGS) > ``` > > ...make it just: > > ``` > CFLAGS = -O2 blabla @HAVE_NSS@ @NSS_CFLAGS@ > LDFLAGS = -g -L/usr/local/lib blabla @NSS_LDFLAGS@ > ``` > > --- > > Reply to this email directly or view it on GitHub: > https://github.com/magnumripper/JohnTheRipper/issues/575#issuecomment-42142157
Author
Owner

@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.

It is working, and adds -fopenmp to the compiler flags

But does it change to -xopenmp for Sun and -opencmp for icc? I guess it does and we don't have to test all that yet. BTW our legacy Makefile had -fopenmp -D_FORTIFY_SOURCE=0 for OSX using llvm-gcc.

<!-- gh-comment-id:42147420 --> @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. > It is working, and adds -fopenmp to the compiler flags But does it change to `-xopenmp` for Sun and `-opencmp` for icc? I guess it does and we don't have to test all that yet. BTW our legacy Makefile had `-fopenmp -D_FORTIFY_SOURCE=0` for OSX using llvm-gcc.
Author
Owner

@magnumripper commented on GitHub (May 4, 2014):

I had to add some things to the macro.

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

<!-- gh-comment-id:42147565 --> @magnumripper commented on GitHub (May 4, 2014): > I had to add some things to the macro. 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
Author
Owner

@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.

<!-- gh-comment-id:42148371 --> @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.
Author
Owner

@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.

<!-- gh-comment-id:42149981 --> @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.
Author
Owner

@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:

-AC_CHECK_LIB([crypt],[encrypt])
+AC_SEARCH_LIBS([encrypt],[crypt c],[AC_DEFINE(HAVE_LIBCRYPT,1,[Define to 1 if you have the `crypt' library (-lcrypt).])])

Edit 2: Apparently you don't need to include "c":
http://lists.gnu.org/archive/html/guile-devel/2004-02/msg00043.html

AC_SEARCH_LIBS(crypt, crypt, AC_DEFINE(HAVE_CRYPT, 1, [Define if you have the 
crypt function.]))

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.

<!-- gh-comment-id:42151786 --> @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: ``` -AC_CHECK_LIB([crypt],[encrypt]) +AC_SEARCH_LIBS([encrypt],[crypt c],[AC_DEFINE(HAVE_LIBCRYPT,1,[Define to 1 if you have the `crypt' library (-lcrypt).])]) ``` Edit 2: Apparently you don't need to include "c": http://lists.gnu.org/archive/html/guile-devel/2004-02/msg00043.html ``` AC_SEARCH_LIBS(crypt, crypt, AC_DEFINE(HAVE_CRYPT, 1, [Define if you have the crypt function.])) ``` 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.
Author
Owner

@magnumripper commented on GitHub (May 5, 2014):

Eventually we should look for crypt_r() too, as well as test for Solaris' thread-safe crypt().

<!-- gh-comment-id:42163183 --> @magnumripper commented on GitHub (May 5, 2014): Eventually we should look for crypt_r() too, as well as test for Solaris' thread-safe crypt().
Author
Owner

@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

git grep -l "\bHAVE_LIBCRYPT\b"  | xargs sed -ri 's/\bHAVE_LIBCRYPT\b/HAVE_CRYPT/g'
Comment by jfoug
Using a global replace is a BAD idea.  There has been almost no change I have made yet, that did
not require some hand editing.  I know that sux, but this whole process is full of errors, if things
get a minor change and we do not catch it, we will spend a LONG time tracking down those bugs.

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.

<!-- gh-comment-id:42163622 --> @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 ``` git grep -l "\bHAVE_LIBCRYPT\b" | xargs sed -ri 's/\bHAVE_LIBCRYPT\b/HAVE_CRYPT/g' ``` ``` Comment by jfoug Using a global replace is a BAD idea. There has been almost no change I have made yet, that did not require some hand editing. I know that sux, but this whole process is full of errors, if things get a minor change and we do not catch it, we will spend a LONG time tracking down those bugs. ``` 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.
Author
Owner

@jfoug commented on GitHub (May 5, 2014):

Here is my 'new' OMP checking code.

##################################
# check for openMP
##################################
AC_ARG_WITH(omp, [AS_HELP_STRING([--with-omp],
   [compile with OpenMP (multi-thread) support. If none is found,
    OMP is not used. Default: auto])
],,with_omp=auto)
#
# OMP auto check.  Just try to find OMP, but do not fail if it is not there
AS_IF([test x"$with_omp" = "xauto"],[AX_OPENMP(AC_SUBST(OPENMP_CFLAGS,${ax_cv_c_openmp}))])
#
# OMP yes check (--with-omp or --with-omp=yes).  Try to find OMP, If not there, fail
AS_IF([test x"$with_omp" = "xyes"], 
    [AX_OPENMP([AC_SUBST(OPENMP_CFLAGS,${ax_cv_c_openmp})],
              [AC_MSG_FAILURE([OMP requested, but could not use OMP.])])])
##################################
# END of check for openMP
##################################

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.

<!-- gh-comment-id:42186840 --> @jfoug commented on GitHub (May 5, 2014): Here is my 'new' OMP checking code. ``` ################################## # check for openMP ################################## AC_ARG_WITH(omp, [AS_HELP_STRING([--with-omp], [compile with OpenMP (multi-thread) support. If none is found, OMP is not used. Default: auto]) ],,with_omp=auto) # # OMP auto check. Just try to find OMP, but do not fail if it is not there AS_IF([test x"$with_omp" = "xauto"],[AX_OPENMP(AC_SUBST(OPENMP_CFLAGS,${ax_cv_c_openmp}))]) # # OMP yes check (--with-omp or --with-omp=yes). Try to find OMP, If not there, fail AS_IF([test x"$with_omp" = "xyes"], [AX_OPENMP([AC_SUBST(OPENMP_CFLAGS,${ax_cv_c_openmp})], [AC_MSG_FAILURE([OMP requested, but could not use OMP.])])]) ################################## # END of check for openMP ################################## ``` 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.
Author
Owner

@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.

<!-- gh-comment-id:42209523 --> @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.
Author
Owner

@magnumripper commented on GitHub (May 5, 2014):

I was playing with the idea of using the name arch.h instead of autoconfig.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.

<!-- gh-comment-id:42210256 --> @magnumripper commented on GitHub (May 5, 2014): I was playing with the idea of using the name `arch.h` instead of `autoconfig.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.
Author
Owner

@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:

I was playing with the idea of using the name arch.h instead of autoconfig.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.


Reply to this email directly or view it on GitHub:
https://github.com/magnumripper/JohnTheRipper/issues/575#issuecomment-42210256

<!-- gh-comment-id:42234360 --> @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: > I was playing with the idea of using the name `arch.h` instead of `autoconfig.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. > > --- > > Reply to this email directly or view it on GitHub: > https://github.com/magnumripper/JohnTheRipper/issues/575#issuecomment-42210256
Author
Owner

@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-md5 behaves just like a vanilla build, whereas
mpirun -np 4 ./john -test -form:raw-md5 will 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-md5 but you don't really have to test this; if it works on your local host it will be fine.

<!-- gh-comment-id:42239948 --> @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-md5` behaves just like a vanilla build, whereas `mpirun -np 4 ./john -test -form:raw-md5` will 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-md5` but you don't really have to test this; if it works on your local host it will be fine.
Author
Owner

@magnumripper commented on GitHub (May 5, 2014):

Now ,I did not set a 'special' cc like I see in makefile.

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.

<!-- gh-comment-id:42243046 --> @magnumripper commented on GitHub (May 5, 2014): > Now ,I did not set a 'special' cc like I see in makefile. 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.
Author
Owner

@jfoug commented on GitHub (May 6, 2014):

Now ,I did not set a 'special' cc like I see in makefile.

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.

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.

<!-- gh-comment-id:42283838 --> @jfoug commented on GitHub (May 6, 2014): > > Now ,I did not set a 'special' cc like I see in makefile. > > 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. 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.
Author
Owner

@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 ./configure to get it built.

<!-- gh-comment-id:42615480 --> @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 ./configure` to get it built.
Author
Owner

@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)

<!-- gh-comment-id:42619807 --> @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)
Author
Owner

@ghost commented on GitHub (May 9, 2014):

Just in case you guys want to know, I'm seeing strange things here. For example,

  • I only have SSE2. So SSE4.1 should be: no.
  • OpenCL stuff is missing something.

checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables... 
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking whether gcc understands -c and -o together... yes
checking whether ln -s works... yes
checking for grep that handles long lines and -e... /bin/grep
checking for g++... g++
checking whether we are using the GNU C++ compiler... yes
checking whether g++ accepts -g... yes
checking whether make sets $(MAKE)... yes
checking how to run the C preprocessor... gcc -E
checking for SSE2... yes
checking for SSSE3... yes
checking for SSE4.1... yes
checking for AVX... no
checking for XOP... no
checking for 32/64 bit... 64-bit
checking for extra ASFLAGS... 
checking for unaligned memory access... allowed
checking for egrep... /bin/grep -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking whether byte ordering is bigendian... no
checking for SSL_library_init in -lssl... yes
checking for MD5_Update in -lcrypto... yes
checking for sqrt in -lm... yes
checking for deflate in -lz... yes
checking for library containing crypt... -lcrypt
checking for krb5_c_string_to_key_with_params in -lk5crypto... yes
checking for krb5_c_string_to_key_with_params in -lkrb5... yes
checking for __gmpz_init in -lgmp... no
configure: WARNING: Installing libgmp will speed up some hash formats
checking for main in -lkernel32... no
checking for dlopen in -ldl... yes
checking for library containing c_regex_iterator_cb... no
configure: WARNING: Installing librexgen would enable a powerful new wordlist mode
checking for main in -lnsl... yes
checking for main in -lpthread... yes
checking for main in -lrt... yes
checking for main in -lsocket... no
checking for main in -lwsock32... no
checking for main in -llws2_32... no
checking for main in -lwst... no
checking for pcap_compile in -lpcap... no
checking for pkg-config... /usr/bin/pkg-config
checking pkg-config is at least version 0.9.0... yes
checking for NSS... no
configure: WARNING: NSS not found - Mozilla format will be omitted.
checking for gcc option to support OpenMP... -fopenmp
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... no
checking for function MPI_Init in -lmpich... no
configure: WARNING: No MPI compiler found, won't use MPI.
checking for cudaGetDeviceCount in -lcudart... no
checking build system type... x86_64-unknown-linux-gnu
checking host system type... x86_64-unknown-linux-gnu
checking for a sed that does not truncate output... /bin/sed
checking if compiler needs -Werror to reject unknown flags... no
checking for the pthreads library -lpthreads... no
checking whether pthreads work without any flags... yes
checking for joinable pthread attribute... PTHREAD_CREATE_JOINABLE
checking if more special flags are required for pthreads... no
checking for PTHREAD_PRIO_INHERIT... yes
./configure: line 8008: AX_LANG_COMPILER_MS: command not found
checking CL/cl.h usability... no
checking CL/cl.h presence... no
checking for CL/cl.h... no
checking OpenCL/cl.h usability... no
checking OpenCL/cl.h presence... no
checking for OpenCL/cl.h... no
checking windows.h usability... no
checking windows.h presence... no
checking for windows.h... no
checking for OpenCL library... no
checking OS.h usability... no
checking OS.h presence... no
checking for OS.h... no
checking arpa/inet.h usability... yes
checking arpa/inet.h presence... yes
checking for arpa/inet.h... yes
checking sys/times.h usability... yes
checking sys/times.h presence... yes
checking for sys/times.h... yes
checking fcntl.h usability... yes
checking fcntl.h presence... yes
checking for fcntl.h... yes
checking limits.h usability... yes
checking limits.h presence... yes
checking for limits.h... yes
checking locale.h usability... yes
checking locale.h presence... yes
checking for locale.h... yes
checking netdb.h usability... yes
checking netdb.h presence... yes
checking for netdb.h... yes
checking netinet/in.h usability... yes
checking netinet/in.h presence... yes
checking for netinet/in.h... yes
checking stddef.h usability... yes
checking stddef.h presence... yes
checking for stddef.h... yes
checking for stdint.h... (cached) yes
checking for stdlib.h... (cached) yes
checking for string.h... (cached) yes
checking for strings.h... (cached) yes
checking sys/file.h usability... yes
checking sys/file.h presence... yes
checking for sys/file.h... yes
checking sys/param.h usability... yes
checking sys/param.h presence... yes
checking for sys/param.h... yes
checking sys/socket.h usability... yes
checking sys/socket.h presence... yes
checking for sys/socket.h... yes
checking sys/time.h usability... yes
checking sys/time.h presence... yes
checking for sys/time.h... yes
checking sys/timeb.h usability... yes
checking sys/timeb.h presence... yes
checking for sys/timeb.h... yes
checking termios.h usability... yes
checking termios.h presence... yes
checking for termios.h... yes
checking for unistd.h... (cached) yes
checking wchar.h usability... yes
checking wchar.h presence... yes
checking for wchar.h... yes
checking unixlib/local.h usability... no
checking unixlib/local.h presence... no
checking for unixlib/local.h... no
checking netinet/if_ether.h usability... yes
checking netinet/if_ether.h presence... yes
checking for netinet/if_ether.h... yes
checking pcap.h usability... no
checking pcap.h presence... no
checking for pcap.h... no
checking for stdbool.h that conforms to C99... yes
checking for _Bool... yes
checking for inline... inline
checking for int32_t... yes
checking for int64_t... yes
checking for off_t... yes
checking for size_t... yes
checking for ssize_t... yes
checking for uint16_t... yes
checking for uint32_t... yes
checking for uint64_t... yes
checking for uint8_t... yes
checking for ptrdiff_t... yes
checking for error_at_line... yes
checking for pid_t... yes
checking vfork.h usability... no
checking vfork.h presence... no
checking for vfork.h... no
checking for fork... yes
checking for vfork... yes
checking for working fork... yes
checking for working vfork... (cached) yes
checking for stdlib.h... (cached) yes
checking for GNU libc compatible malloc... yes
checking for stdlib.h... (cached) yes
checking for unistd.h... (cached) yes
checking for sys/param.h... (cached) yes
checking for getpagesize... yes
checking for working mmap... yes
checking for stdlib.h... (cached) yes
checking for GNU libc compatible realloc... yes
checking for atexit... yes
checking for endpwent... yes
checking for floor... yes
checking for ftruncate... yes
checking for gethostbyname... yes
checking for gettimeofday... yes
checking for inet_ntoa... yes
checking for isascii... yes
checking for memchr... yes
checking for memmove... yes
checking for memset... yes
checking for mkdir... yes
checking for munmap... yes
checking for pow... yes
checking for rmdir... yes
checking for select... yes
checking for setenv... yes
checking for setlocale... yes
checking for socket... yes
checking for strcasecmp... yes
checking for strchr... yes
checking for strcspn... yes
checking for strdup... yes
checking for strerror... yes
checking for strncasecmp... yes
checking for strrchr... yes
checking for strspn... yes
checking for strstr... yes
checking for strtol... yes
checking for strtoul... yes
configure: creating ./config.status
config.status: creating Makefile
config.status: creating aes/Makefile
config.status: creating aes/aesni/Makefile
config.status: creating aes/openssl/Makefile
config.status: creating escrypt/Makefile
config.status: creating autoconfig.h
config.status: autoconfig.h is unchanged
config.status: linking x86-64.h to arch.h
config.status: executing default commands
Done - Makefile generated.

<!-- gh-comment-id:42626676 --> @ghost commented on GitHub (May 9, 2014): Just in case you guys want to know, I'm seeing strange things here. For example, - I only have SSE2. So SSE4.1 should be: no. - OpenCL stuff is missing something. ``` checking for gcc... gcc checking whether the C compiler works... yes checking for C compiler default output file name... a.out checking for suffix of executables... checking whether we are cross compiling... no checking for suffix of object files... o checking whether we are using the GNU C compiler... yes checking whether gcc accepts -g... yes checking for gcc option to accept ISO C89... none needed checking whether gcc understands -c and -o together... yes checking whether ln -s works... yes checking for grep that handles long lines and -e... /bin/grep checking for g++... g++ checking whether we are using the GNU C++ compiler... yes checking whether g++ accepts -g... yes checking whether make sets $(MAKE)... yes checking how to run the C preprocessor... gcc -E checking for SSE2... yes checking for SSSE3... yes checking for SSE4.1... yes checking for AVX... no checking for XOP... no checking for 32/64 bit... 64-bit checking for extra ASFLAGS... checking for unaligned memory access... allowed checking for egrep... /bin/grep -E checking for ANSI C header files... yes checking for sys/types.h... yes checking for sys/stat.h... yes checking for stdlib.h... yes checking for string.h... yes checking for memory.h... yes checking for strings.h... yes checking for inttypes.h... yes checking for stdint.h... yes checking for unistd.h... yes checking whether byte ordering is bigendian... no checking for SSL_library_init in -lssl... yes checking for MD5_Update in -lcrypto... yes checking for sqrt in -lm... yes checking for deflate in -lz... yes checking for library containing crypt... -lcrypt checking for krb5_c_string_to_key_with_params in -lk5crypto... yes checking for krb5_c_string_to_key_with_params in -lkrb5... yes checking for __gmpz_init in -lgmp... no configure: WARNING: Installing libgmp will speed up some hash formats checking for main in -lkernel32... no checking for dlopen in -ldl... yes checking for library containing c_regex_iterator_cb... no configure: WARNING: Installing librexgen would enable a powerful new wordlist mode checking for main in -lnsl... yes checking for main in -lpthread... yes checking for main in -lrt... yes checking for main in -lsocket... no checking for main in -lwsock32... no checking for main in -llws2_32... no checking for main in -lwst... no checking for pcap_compile in -lpcap... no checking for pkg-config... /usr/bin/pkg-config checking pkg-config is at least version 0.9.0... yes checking for NSS... no configure: WARNING: NSS not found - Mozilla format will be omitted. checking for gcc option to support OpenMP... -fopenmp 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... no checking for function MPI_Init in -lmpich... no configure: WARNING: No MPI compiler found, won't use MPI. checking for cudaGetDeviceCount in -lcudart... no checking build system type... x86_64-unknown-linux-gnu checking host system type... x86_64-unknown-linux-gnu checking for a sed that does not truncate output... /bin/sed checking if compiler needs -Werror to reject unknown flags... no checking for the pthreads library -lpthreads... no checking whether pthreads work without any flags... yes checking for joinable pthread attribute... PTHREAD_CREATE_JOINABLE checking if more special flags are required for pthreads... no checking for PTHREAD_PRIO_INHERIT... yes ./configure: line 8008: AX_LANG_COMPILER_MS: command not found checking CL/cl.h usability... no checking CL/cl.h presence... no checking for CL/cl.h... no checking OpenCL/cl.h usability... no checking OpenCL/cl.h presence... no checking for OpenCL/cl.h... no checking windows.h usability... no checking windows.h presence... no checking for windows.h... no checking for OpenCL library... no checking OS.h usability... no checking OS.h presence... no checking for OS.h... no checking arpa/inet.h usability... yes checking arpa/inet.h presence... yes checking for arpa/inet.h... yes checking sys/times.h usability... yes checking sys/times.h presence... yes checking for sys/times.h... yes checking fcntl.h usability... yes checking fcntl.h presence... yes checking for fcntl.h... yes checking limits.h usability... yes checking limits.h presence... yes checking for limits.h... yes checking locale.h usability... yes checking locale.h presence... yes checking for locale.h... yes checking netdb.h usability... yes checking netdb.h presence... yes checking for netdb.h... yes checking netinet/in.h usability... yes checking netinet/in.h presence... yes checking for netinet/in.h... yes checking stddef.h usability... yes checking stddef.h presence... yes checking for stddef.h... yes checking for stdint.h... (cached) yes checking for stdlib.h... (cached) yes checking for string.h... (cached) yes checking for strings.h... (cached) yes checking sys/file.h usability... yes checking sys/file.h presence... yes checking for sys/file.h... yes checking sys/param.h usability... yes checking sys/param.h presence... yes checking for sys/param.h... yes checking sys/socket.h usability... yes checking sys/socket.h presence... yes checking for sys/socket.h... yes checking sys/time.h usability... yes checking sys/time.h presence... yes checking for sys/time.h... yes checking sys/timeb.h usability... yes checking sys/timeb.h presence... yes checking for sys/timeb.h... yes checking termios.h usability... yes checking termios.h presence... yes checking for termios.h... yes checking for unistd.h... (cached) yes checking wchar.h usability... yes checking wchar.h presence... yes checking for wchar.h... yes checking unixlib/local.h usability... no checking unixlib/local.h presence... no checking for unixlib/local.h... no checking netinet/if_ether.h usability... yes checking netinet/if_ether.h presence... yes checking for netinet/if_ether.h... yes checking pcap.h usability... no checking pcap.h presence... no checking for pcap.h... no checking for stdbool.h that conforms to C99... yes checking for _Bool... yes checking for inline... inline checking for int32_t... yes checking for int64_t... yes checking for off_t... yes checking for size_t... yes checking for ssize_t... yes checking for uint16_t... yes checking for uint32_t... yes checking for uint64_t... yes checking for uint8_t... yes checking for ptrdiff_t... yes checking for error_at_line... yes checking for pid_t... yes checking vfork.h usability... no checking vfork.h presence... no checking for vfork.h... no checking for fork... yes checking for vfork... yes checking for working fork... yes checking for working vfork... (cached) yes checking for stdlib.h... (cached) yes checking for GNU libc compatible malloc... yes checking for stdlib.h... (cached) yes checking for unistd.h... (cached) yes checking for sys/param.h... (cached) yes checking for getpagesize... yes checking for working mmap... yes checking for stdlib.h... (cached) yes checking for GNU libc compatible realloc... yes checking for atexit... yes checking for endpwent... yes checking for floor... yes checking for ftruncate... yes checking for gethostbyname... yes checking for gettimeofday... yes checking for inet_ntoa... yes checking for isascii... yes checking for memchr... yes checking for memmove... yes checking for memset... yes checking for mkdir... yes checking for munmap... yes checking for pow... yes checking for rmdir... yes checking for select... yes checking for setenv... yes checking for setlocale... yes checking for socket... yes checking for strcasecmp... yes checking for strchr... yes checking for strcspn... yes checking for strdup... yes checking for strerror... yes checking for strncasecmp... yes checking for strrchr... yes checking for strspn... yes checking for strstr... yes checking for strtol... yes checking for strtoul... yes configure: creating ./config.status config.status: creating Makefile config.status: creating aes/Makefile config.status: creating aes/aesni/Makefile config.status: creating aes/openssl/Makefile config.status: creating escrypt/Makefile config.status: creating autoconfig.h config.status: autoconfig.h is unchanged config.status: linking x86-64.h to arch.h config.status: executing default commands Done - Makefile generated. ```
Author
Owner

@magnumripper commented on GitHub (May 9, 2014):

I only have SSE2. So SSE4.1 should be: no.

Are you sure? SSE4.1 is old stuff. What exact CPU is this? What does /proc/cpuinfo say?

OpenCL stuff is missing something.

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?

<!-- gh-comment-id:42639292 --> @magnumripper commented on GitHub (May 9, 2014): > I only have SSE2. So SSE4.1 should be: no. Are you sure? SSE4.1 is old stuff. What exact CPU is this? What does /proc/cpuinfo say? > OpenCL stuff is missing something. 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?
Author
Owner

@ghost commented on GitHub (May 9, 2014):

SSE4.1

Using bleeding-jumbo and and linux-x86-64-opencl (-native), I can see.

rawSHA1_ng_fmt.c:580:3: warning: #warning not using optimized sse4.1 compare because -msse4 was not specified [-Wcpp]
 # warning not using optimized sse4.1 compare because -msse4 was not specified

If I try to force -msse4, I get a "ilegal instruction" error.

Benchmarking: Raw-SHA1-ng, (pwlen <= 15) [SHA1 128/128 SSE4.1 4x]... Instrução ilegal (imagem do núcleo gravada)
<!-- gh-comment-id:42660339 --> @ghost commented on GitHub (May 9, 2014): SSE4.1 - cat /proc/cpuinfo - https://gist.github.com/claudioandre/bd7050fbe77771296657 Using bleeding-jumbo and and linux-x86-64-opencl (-native), I can see. ``` rawSHA1_ng_fmt.c:580:3: warning: #warning not using optimized sse4.1 compare because -msse4 was not specified [-Wcpp] # warning not using optimized sse4.1 compare because -msse4 was not specified ``` If I try to force -msse4, I get a "ilegal instruction" error. ``` Benchmarking: Raw-SHA1-ng, (pwlen <= 15) [SHA1 128/128 SSE4.1 4x]... Instrução ilegal (imagem do núcleo gravada) ```
Author
Owner

@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.

<!-- gh-comment-id:42660818 --> @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.
Author
Owner

@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.

$ echo $AMDAPPSDKROOT
/opt/AMDAPP

$ ls -la /opt/AMDAPP
total 20
drwxrwxr-x 5  501  502 4096 Abr 17 17:39 .
drwxr-xr-x 8 root root 4096 Mai  5 13:05 ..
drwxrwxr-x 6  501  502 4096 Out 30  2013 include
drwxrwxr-x 4  501  502 4096 Out 30  2013 lib
drwxrwxr-x 6  501  502 4096 Out 30  2013 samples

$ locate cl.h
[...]
/opt/AMDAPP/include/CL/cl.h
/opt/AMDAPP/include/CL/cl.hpp
/opt/AMDAPP/include/CL/opencl.h
[...]
<!-- gh-comment-id:42660931 --> @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. ``` $ echo $AMDAPPSDKROOT /opt/AMDAPP $ ls -la /opt/AMDAPP total 20 drwxrwxr-x 5 501 502 4096 Abr 17 17:39 . drwxr-xr-x 8 root root 4096 Mai 5 13:05 .. drwxrwxr-x 6 501 502 4096 Out 30 2013 include drwxrwxr-x 4 501 502 4096 Out 30 2013 lib drwxrwxr-x 6 501 502 4096 Out 30 2013 samples $ locate cl.h [...] /opt/AMDAPP/include/CL/cl.h /opt/AMDAPP/include/CL/cl.hpp /opt/AMDAPP/include/CL/opencl.h [...] ```
Author
Owner

@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?

$ clinfo

Number of platforms:                 1
  Platform Profile:              FULL_PROFILE
  Platform Version:              OpenCL 1.2 AMD-APP (1214.3)
  Platform Name:                 AMD Accelerated Parallel Processing
  Platform Vendor:               Advanced Micro Devices, Inc.
  Platform Extensions:               cl_khr_icd cl_amd_event_callback cl_amd_offline_devices


  Platform Name:                 AMD Accelerated Parallel Processing
Number of devices:               1
  Device Type:                   CL_DEVICE_TYPE_CPU
  Device ID:                     4098
  Board name:                    
  Max compute units:                 6
  Max work items dimensions:             3
    Max work items[0]:               1024
    Max work items[1]:               1024
    Max work items[2]:               1024
  Max work group size:               1024
  Preferred vector width char:           16
  Preferred vector width short:          8
  Preferred vector width int:            4
  Preferred vector width long:           2
  Preferred vector width float:          4
  Preferred vector width double:         2
  Native vector width char:          16
  Native vector width short:             8
  Native vector width int:           4
  Native vector width long:          2
  Native vector width float:             4
  Native vector width double:            2
  Max clock frequency:               3000Mhz
  Address bits:                  64
  Max memory allocation:             2147483648
  Image support:                 Yes
  Max number of images read arguments:       128
  Max number of images write arguments:      8
  Max image 2D width:                8192
  Max image 2D height:               8192
  Max image 3D width:                2048
  Max image 3D height:               2048
  Max image 3D depth:                2048
  Max samplers within kernel:            16
  Max size of kernel argument:           4096
  Alignment (bits) of base address:      1024
  Minimum alignment (bytes) for any datatype:    128
  Single precision floating point capability
    Denorms:                     Yes
    Quiet NaNs:                  Yes
    Round to nearest even:           Yes
    Round to zero:               Yes
    Round to +ve and infinity:           Yes
    IEEE754-2008 fused multiply-add:         Yes
  Cache type:                    Read/Write
  Cache line size:               64
  Cache size:                    65536
  Global memory size:                3879440384
  Constant buffer size:              65536
  Max number of constant args:           8
  Local memory type:                 Global
  Local memory size:                 32768
  Kernel Preferred work group size multiple:     1
  Error correction support:          0
  Unified memory for Host and Device:        1
  Profiling timer resolution:            1
  Device endianess:              Little
  Available:                     Yes
  Compiler available:                Yes
  Execution capabilities:                
    Execute OpenCL kernels:          Yes
    Execute native function:             Yes
  Queue properties:              
    Out-of-Order:                No
    Profiling :                  Yes
  Platform ID:                   0x00007fbdd886cfc0
  Name:                      AMD Phenom(tm) II X6 1075T Processor
  Vendor:                    AuthenticAMD
  Device OpenCL C version:           OpenCL C 1.2 
  Driver version:                1214.3 (sse2)
  Profile:                   FULL_PROFILE
  Version:                   OpenCL 1.2 AMD-APP (1214.3)
  Extensions:                    cl_khr_fp64 cl_amd_fp64 cl_khr_global_int32_base_atomics cl_khr_global_int32_extended_atomics cl_khr_local_int32_base_atomics cl_khr_local_int32_extended_atomics cl_khr_int64_base_atomics cl_khr_int64_extended_atomics cl_khr_3d_image_writes cl_khr_byte_addressable_store cl_khr_gl_sharing cl_ext_device_fission cl_amd_device_attribute_query cl_amd_vec3 cl_amd_printf cl_amd_media_ops cl_amd_media_ops2 cl_amd_popcnt 
<!-- gh-comment-id:42663033 --> @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? ``` $ clinfo Number of platforms: 1 Platform Profile: FULL_PROFILE Platform Version: OpenCL 1.2 AMD-APP (1214.3) Platform Name: AMD Accelerated Parallel Processing Platform Vendor: Advanced Micro Devices, Inc. Platform Extensions: cl_khr_icd cl_amd_event_callback cl_amd_offline_devices Platform Name: AMD Accelerated Parallel Processing Number of devices: 1 Device Type: CL_DEVICE_TYPE_CPU Device ID: 4098 Board name: Max compute units: 6 Max work items dimensions: 3 Max work items[0]: 1024 Max work items[1]: 1024 Max work items[2]: 1024 Max work group size: 1024 Preferred vector width char: 16 Preferred vector width short: 8 Preferred vector width int: 4 Preferred vector width long: 2 Preferred vector width float: 4 Preferred vector width double: 2 Native vector width char: 16 Native vector width short: 8 Native vector width int: 4 Native vector width long: 2 Native vector width float: 4 Native vector width double: 2 Max clock frequency: 3000Mhz Address bits: 64 Max memory allocation: 2147483648 Image support: Yes Max number of images read arguments: 128 Max number of images write arguments: 8 Max image 2D width: 8192 Max image 2D height: 8192 Max image 3D width: 2048 Max image 3D height: 2048 Max image 3D depth: 2048 Max samplers within kernel: 16 Max size of kernel argument: 4096 Alignment (bits) of base address: 1024 Minimum alignment (bytes) for any datatype: 128 Single precision floating point capability Denorms: Yes Quiet NaNs: Yes Round to nearest even: Yes Round to zero: Yes Round to +ve and infinity: Yes IEEE754-2008 fused multiply-add: Yes Cache type: Read/Write Cache line size: 64 Cache size: 65536 Global memory size: 3879440384 Constant buffer size: 65536 Max number of constant args: 8 Local memory type: Global Local memory size: 32768 Kernel Preferred work group size multiple: 1 Error correction support: 0 Unified memory for Host and Device: 1 Profiling timer resolution: 1 Device endianess: Little Available: Yes Compiler available: Yes Execution capabilities: Execute OpenCL kernels: Yes Execute native function: Yes Queue properties: Out-of-Order: No Profiling : Yes Platform ID: 0x00007fbdd886cfc0 Name: AMD Phenom(tm) II X6 1075T Processor Vendor: AuthenticAMD Device OpenCL C version: OpenCL C 1.2 Driver version: 1214.3 (sse2) Profile: FULL_PROFILE Version: OpenCL 1.2 AMD-APP (1214.3) Extensions: cl_khr_fp64 cl_amd_fp64 cl_khr_global_int32_base_atomics cl_khr_global_int32_extended_atomics cl_khr_local_int32_base_atomics cl_khr_local_int32_extended_atomics cl_khr_int64_base_atomics cl_khr_int64_extended_atomics cl_khr_3d_image_writes cl_khr_byte_addressable_store cl_khr_gl_sharing cl_ext_device_fission cl_amd_device_attribute_query cl_amd_vec3 cl_amd_printf cl_amd_media_ops cl_amd_media_ops2 cl_amd_popcnt ```
Author
Owner

@jfoug commented on GitHub (May 9, 2014):

Please do this:

This source (the new probe source for SSE4.1)

#include <smmintrin.h>
#include <stdio.h>
#include <string.h>
int main(){
   __m128d t;
   memset(&t,0,sizeof(t));
   _mm_round_pd(t,1);
   if(*((long*)&t)==88)
      printf("foo");
   else
      printf("bar");
   exit(0);
}

compile that the gcc on your machine, by gcc -msse4.1 -O2 and 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.

<!-- gh-comment-id:42671544 --> @jfoug commented on GitHub (May 9, 2014): Please do this: This source (the new probe source for SSE4.1) ``` #include <smmintrin.h> #include <stdio.h> #include <string.h> int main(){ __m128d t; memset(&t,0,sizeof(t)); _mm_round_pd(t,1); if(*((long*)&t)==88) printf("foo"); else printf("bar"); exit(0); } ``` compile that the gcc on your machine, by `gcc -msse4.1 -O2` and 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.
Author
Owner

@ghost commented on GitHub (May 9, 2014):

Done:

$ ./test
bar

<!-- gh-comment-id:42673880 --> @ghost commented on GitHub (May 9, 2014): Done: $ ./test bar
Author
Owner

@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.

<!-- gh-comment-id:42680241 --> @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.
Author
Owner

@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.

<!-- gh-comment-id:42682328 --> @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.
Author
Owner

@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:

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

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.

<!-- gh-comment-id:42683477 --> @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: > 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 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.
Author
Owner

@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).

<!-- gh-comment-id:42689309 --> @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).
Author
Owner

@magnumripper commented on GitHub (May 9, 2014):

Why are you not using -O0 for these tests? It seems to me it should be safer in many ways. -O2 won't do any good here anyway.

<!-- gh-comment-id:42691507 --> @magnumripper commented on GitHub (May 9, 2014): Why are you not using `-O0` for these tests? It seems to me it should be safer in many ways. `-O2` won't do any good here anyway.
Author
Owner

@magnumripper commented on GitHub (May 9, 2014):

@claudioandre

If I try to force -msse4, I get a "ilegal instruction" error.

But -msse4 is not the same as -msse4.1. What if you just force the latter (eg. in bleeding)? Does it still fail?

<!-- gh-comment-id:42692201 --> @magnumripper commented on GitHub (May 9, 2014): @claudioandre > If I try to force -msse4, I get a "ilegal instruction" error. But `-msse4` is not the same as `-msse4.1`. What if you just force the latter (eg. in bleeding)? Does it still fail?
Author
Owner

@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...

<!-- gh-comment-id:42692828 --> @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...
Author
Owner

@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).

<!-- gh-comment-id:42693093 --> @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).
Author
Owner

@jfoug commented on GitHub (May 9, 2014):

But -msse4 is not the same as -msse4.1

-msse4.1 implies -msse4, so it it was crashing at -msse4, it would also not be good at -msse4.1

Why are you not using -O0 for these tests? It seems to me it should be safer in many ways. -O2 won't do any good here anyway.

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.

Maybe we should abandon this mega thread and start separate issues for separate issues...

AGREED

Jim.

<!-- gh-comment-id:42693521 --> @jfoug commented on GitHub (May 9, 2014): > But -msse4 is not the same as -msse4.1 -msse4.1 implies -msse4, so it it was crashing at -msse4, it would also not be good at -msse4.1 > Why are you not using -O0 for these tests? It seems to me it should be safer in many ways. -O2 won't do any good here anyway. 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. > Maybe we should abandon this mega thread and start separate issues for separate issues... AGREED Jim.
Author
Owner

@magnumripper commented on GitHub (May 9, 2014):

But -msse4 is not the same as -msse4.1

-msse4.1 implies -msse4, so it it was crashing at -msse4, it would also not be good at -msse4.1

Are you sure? It must be the other way round: -msse4 should imply -msse4.1 because the latter is a subset of the former.

$ gcc -dM -E -x c /dev/null -march=native | grep -E "SSE|AVX|XOP"
#define __SSE4_1__ 1
#define __SSE4_2__ 1
#define __SSE2_MATH__ 1
#define __AVX__ 1
#define __SSE_MATH__ 1
#define __SSE2__ 1
#define __SSSE3__ 1
#define __SSE__ 1
#define __SSE3__ 1

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, -msse4 should imply -msse4.1 and not the other way round.

<!-- gh-comment-id:42694010 --> @magnumripper commented on GitHub (May 9, 2014): > > But -msse4 is not the same as -msse4.1 > > -msse4.1 implies -msse4, so it it was crashing at -msse4, it would also not be good at -msse4.1 Are you sure? It must be the other way round: `-msse4` should imply `-msse4.1` because the latter is a subset of the former. ``` $ gcc -dM -E -x c /dev/null -march=native | grep -E "SSE|AVX|XOP" #define __SSE4_1__ 1 #define __SSE4_2__ 1 #define __SSE2_MATH__ 1 #define __AVX__ 1 #define __SSE_MATH__ 1 #define __SSE2__ 1 #define __SSSE3__ 1 #define __SSE__ 1 #define __SSE3__ 1 ``` 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 :confounded: . Still, `-msse4` should imply `-msse4.1` and not the other way round.
Author
Owner

@magnumripper commented on GitHub (May 9, 2014):

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! Let's chop Makefile.in!

<!-- gh-comment-id:42696185 --> @magnumripper commented on GitHub (May 9, 2014): > 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! Let's chop Makefile.in!
Author
Owner

@ghost commented on GitHub (May 9, 2014):

But -msse4 is not the same as -msse4.1. What if you just force the latter (eg. in bleeding)? Does it still fail?

I see the same error message.

<!-- gh-comment-id:42702733 --> @ghost commented on GitHub (May 9, 2014): > But `-msse4` is not the same as `-msse4.1`. What if you just force the latter (eg. in bleeding)? Does it still fail? I see the same error message.
Author
Owner

@ghost commented on GitHub (May 9, 2014):

$  gcc -dM -E -x c /dev/null -march=native | grep -E "SSE|AVX|XOP"
#define __SSE2_MATH__ 1
#define __SSE4A__ 1
#define __SSE_MATH__ 1
#define __SSE2__ 1
#define __SSE__ 1
#define __SSE3__ 1
<!-- gh-comment-id:42702816 --> @ghost commented on GitHub (May 9, 2014): ``` $ gcc -dM -E -x c /dev/null -march=native | grep -E "SSE|AVX|XOP" #define __SSE2_MATH__ 1 #define __SSE4A__ 1 #define __SSE_MATH__ 1 #define __SSE2__ 1 #define __SSE__ 1 #define __SSE3__ 1 ```
Author
Owner

@ghost commented on GitHub (May 9, 2014):

Please try the new configure script (just uploaded).

Seems to be working fine. Commit: Missed updating configure.

...
checking how to run the C preprocessor... gcc -E
checking for SSE2... yes
checking for SSSE3... no
checking for 32/64 bit... 64-bit
checking for extra ASFLAGS... 
checking for unaligned memory access... allowed
...
<!-- gh-comment-id:42703976 --> @ghost commented on GitHub (May 9, 2014): > Please try the new configure script (just uploaded). Seems to be working fine. _Commit: Missed updating configure._ ``` ... checking how to run the C preprocessor... gcc -E checking for SSE2... yes checking for SSSE3... no checking for 32/64 bit... 64-bit checking for extra ASFLAGS... checking for unaligned memory access... allowed ... ```
Author
Owner

@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 -O0 just for the sake of it.

<!-- gh-comment-id:42704130 --> @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 `-O0` just for the sake of it.
Author
Owner

@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.

<!-- gh-comment-id:42704658 --> @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.
Author
Owner

@jfoug commented on GitHub (May 9, 2014):

Is SSE3 the same as SSSE3? In that case there's still a discrepancy between gcc and autoconf.

Nope. SSSE3 is an extension to SSE3.

<!-- gh-comment-id:42704901 --> @jfoug commented on GitHub (May 9, 2014): > Is **SSE3** the same as SSSE3? In that case there's still a discrepancy between gcc and autoconf. Nope. SSSE3 is an extension to SSE3.
Author
Owner

@ghost commented on GitHub (May 9, 2014):

Should I change the configure file in order to put the -O0 to test it?

<!-- gh-comment-id:42705168 --> @ghost commented on GitHub (May 9, 2014): Should I change the configure file in order to put the -O0 to test it?
Author
Owner

@jfoug commented on GitHub (May 9, 2014):

SSE4a 😖 . Still, -msse4 should imply -msse4.1 and not the other way round.

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.

<!-- gh-comment-id:42705307 --> @jfoug commented on GitHub (May 9, 2014): > SSE4a :confounded: . Still, -msse4 should imply -msse4.1 and not the other way round. 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.
Author
Owner

@magnumripper 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

This is not correct according to the wikipedia page. SSE4 consists of the two subsets SSE4.1 and SSE4.2.

<!-- gh-comment-id:42705437 --> @magnumripper 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 This is not correct according to the wikipedia page. SSE4 consists of the two subsets SSE4.1 and SSE4.2.
Author
Owner

@magnumripper commented on GitHub (May 9, 2014):

Should I change the configure file in order to put the -O0 to test it?

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 37494fc5c and manage to get the CPU test for 4.1 within configure.ac to compile with -O0 it would be very interesting if something changed.

<!-- gh-comment-id:42706023 --> @magnumripper commented on GitHub (May 9, 2014): > Should I change the configure file in order to put the -O0 to test it? 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 37494fc5c and manage to get the CPU test for 4.1 within configure.ac to compile with -O0 it would be very interesting if something changed.
Author
Owner

@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).

<!-- gh-comment-id:42706307 --> @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).
Author
Owner

@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.

<!-- gh-comment-id:42706637 --> @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.
Author
Owner

@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.

<!-- gh-comment-id:42706856 --> @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.
Author
Owner

@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.

<!-- gh-comment-id:42707046 --> @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.
Author
Owner

@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.

<!-- gh-comment-id:42707215 --> @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.
Author
Owner

@magnumripper commented on GitHub (May 9, 2014):

I had to put the ssl libs in there TWICE.

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.

<!-- gh-comment-id:42707346 --> @magnumripper commented on GitHub (May 9, 2014): > I had to put the ssl libs in there TWICE. 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.
Author
Owner

@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.

<!-- gh-comment-id:42710248 --> @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.
Author
Owner

@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 --rebase and then try git push again. This way we don't get local merges in the repo.

<!-- gh-comment-id:42738482 --> @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 --rebase` and then try `git push` again. This way we don't get local merges in the repo.
Author
Owner

@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.

<!-- gh-comment-id:42741181 --> @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.
Author
Owner

@magnumripper commented on GitHub (May 10, 2014):

Try git config --global pull.rebase true for 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.

<!-- gh-comment-id:42742593 --> @magnumripper commented on GitHub (May 10, 2014): Try `git config --global pull.rebase true` for 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.
Author
Owner

@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 ./configure with no extra options.

<!-- gh-comment-id:42744000 --> @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 `./configure` with no extra options.
Author
Owner

@jfoug commented on GitHub (May 11, 2014):

I am working on getting several things done (will be quite a few changed files)

  1. DONE: getting cygwin and mingw .exe file building done (using symlink.c where it needs to be). I added a new --with-exe-ext flag. If that is used, say --with-exe-ext=.exe then things work. NOTE, any other value will cause make to fail. I changed PROJ to be ../run/john@EXE_EXT@ .... Also, targets that link are now ../run/target@EXE_EXT@ in makefile.in. The targets that use ln -s still have to have special ../run/target.exe: targets, so that we can build using symlink. This is done and tested. I will get it checked in. Now, default cygwin uses the ln -s method, which works CORRECTLY, but only under cygwin bash shell. If the user specifies the with, then the symlink.c code is used, making it work (sort of) under win32 cmd shell.
  2. DONE added the foreach $$file in ${PROJ} rm $$file.exe and removed PROJ_EXE
  3. DONE added -DAC_BUILT to the CFLAGS. Now, we can start working on removing the 'removed' code i did, and get makefile.orig to work properly
  4. DONE the arch.h targets fixed (for AC_BUILT)
  5. Still to do. Get all other .c and .h files 'fixed' so that they work with or without autoconfig.h

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).

<!-- gh-comment-id:42770170 --> @jfoug commented on GitHub (May 11, 2014): I am working on getting several things done (will be quite a few changed files) 1. DONE: getting cygwin and mingw .exe file building done (using symlink.c where it needs to be). I added a new --with-exe-ext flag. If that is used, say --with-exe-ext=.exe then things work. NOTE, any other value will cause make to fail. I changed PROJ to be ../run/john@EXE_EXT@ .... Also, targets that link are now ../run/target@EXE_EXT@ in makefile.in. The targets that use ln -s still have to have special ../run/target.exe: targets, so that we can build using symlink. This is done and tested. I will get it checked in. Now, default cygwin uses the ln -s method, which works CORRECTLY, but only under cygwin bash shell. If the user specifies the with, then the symlink.c code is used, making it work (sort of) under win32 cmd shell. 2. DONE added the foreach $$file in ${PROJ} rm $$file.exe and removed PROJ_EXE 3. DONE added -DAC_BUILT to the CFLAGS. Now, we can start working on removing the 'removed' code i did, and get makefile.orig to work properly 4. DONE the arch.h targets fixed (for AC_BUILT) 5. Still to do. Get all other .c and .h files 'fixed' so that they work with or without autoconfig.h 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).
Author
Owner

@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.

<!-- gh-comment-id:42773745 --> @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.
Author
Owner

@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.

<!-- gh-comment-id:42776135 --> @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.
Author
Owner

@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:

$ make
A normal build is now "./configure && make".
For listing legacy builds, use "make --file Makefile.orig".
For using legacy Makefile, use "make --file Makefile.orig <target>".

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 :-)

<!-- gh-comment-id:42776382 --> @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: ``` $ make A normal build is now "./configure && make". For listing legacy builds, use "make --file Makefile.orig". For using legacy Makefile, use "make --file Makefile.orig <target>". ``` 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 :-)
Author
Owner

@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 ???)

<!-- gh-comment-id:42830504 --> @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 ???)
Author
Owner

@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.

<!-- gh-comment-id:42886469 --> @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.
Author
Owner

@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

<!-- gh-comment-id:42954266 --> @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
Author
Owner

@rofl0r commented on GitHub (May 13, 2014):

x32 can be detected by testing for existence of the __ILP32__ cpp macro
http://git.etalabs.net/cgit/musl/commit/?id=8c820231edc91da57abff4b9a92187ada7fb1928

<!-- gh-comment-id:42995292 --> @rofl0r commented on GitHub (May 13, 2014): x32 can be detected by testing for existence of the `__ILP32__` cpp macro http://git.etalabs.net/cgit/musl/commit/?id=8c820231edc91da57abff4b9a92187ada7fb1928
Author
Owner

@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.

<!-- gh-comment-id:42995501 --> @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.
Author
Owner

@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

<!-- gh-comment-id:42995796 --> @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
Author
Owner

@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.

<!-- gh-comment-id:42996202 --> @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.
Author
Owner

@magnumripper commented on GitHub (May 13, 2014):

x32 can be detected by testing for existence of the __ILP32__ cpp macro

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.

<!-- gh-comment-id:42996661 --> @magnumripper commented on GitHub (May 13, 2014): > x32 can be detected by testing for existence of the `__ILP32__` cpp macro 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.
Author
Owner

@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.

<!-- gh-comment-id:42997240 --> @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.
Author
Owner

@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__

<!-- gh-comment-id:42998112 --> @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__`
Author
Owner

@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.

<!-- gh-comment-id:42998803 --> @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.
Author
Owner

@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.

<!-- gh-comment-id:42999311 --> @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.
Author
Owner

@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.

<!-- gh-comment-id:42999876 --> @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.
Author
Owner

@magnumripper commented on GitHub (May 13, 2014):

That last problem was fixed in d03dc2430. Thanks @rofl0r for making me find it 😃

<!-- gh-comment-id:43001002 --> @magnumripper commented on GitHub (May 13, 2014): That last problem was fixed in d03dc2430. Thanks @rofl0r for making me find it :smiley:
Author
Owner

@magnumripper commented on GitHub (May 13, 2014):

http://sourceforge.net/p/predef/wiki/Home/ is a damn good collection

<!-- gh-comment-id:43001427 --> @magnumripper commented on GitHub (May 13, 2014): http://sourceforge.net/p/predef/wiki/Home/ is a damn good collection
Author
Owner

@magnumripper commented on GitHub (May 13, 2014):

Found another incorrect macro included in the 32/64-bit test. _M_IX86 is only for 32-bit archs. And I added a bunch of others (non-x86) now too, like PPC and ARM.

<!-- gh-comment-id:43004603 --> @magnumripper commented on GitHub (May 13, 2014): Found another incorrect macro included in the 32/64-bit test. `_M_IX86` is only for 32-bit archs. And I added a bunch of others (non-x86) now too, like PPC and ARM.
Author
Owner

@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.

<!-- gh-comment-id:43011929 --> @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.
Author
Owner

@magnumripper commented on GitHub (May 13, 2014):

That has changed. This is now a generic 64/32 test. The x86 specifics come afterwards.

<!-- gh-comment-id:43012116 --> @magnumripper commented on GitHub (May 13, 2014): That has changed. This is now a generic 64/32 test. The x86 specifics come afterwards.
Author
Owner

@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.

<!-- gh-comment-id:43037741 --> @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.
Author
Owner

@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).

<!-- gh-comment-id:43059500 --> @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).
Author
Owner

@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))

<!-- gh-comment-id:43092330 --> @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))
Author
Owner

@jfoug commented on GitHub (May 14, 2014):

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).

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 openssl and pkg-config --cflags openssl by 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.

<!-- gh-comment-id:43100725 --> @jfoug commented on GitHub (May 14, 2014): > 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). 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 openssl` and `pkg-config --cflags openssl` by 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.
Author
Owner

@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

$ ../run/john -te   -form=Raw-SHA1-ng
Will run 6 OpenMP threads
Benchmarking: Raw-SHA1-ng, (pwlen <= 15) [SHA1 128/128 SSE2 4x]... (6xOMP) FAILED (cmp_all(212))

BUT

$ OMP_NUM_THREADS=1 ../run/john -te   -form=Raw-SHA1-ng
Warning: OpenMP is disabled; a non-OpenMP build may be faster
Benchmarking: Raw-SHA1-ng, (pwlen <= 15) [SHA1 128/128 SSE2 4x]... DONE
Raw:    14906K c/s real, 14906K c/s virtual

diff --git a/src/Makefile.orig b/src/Makefile.orig
index a05cfa0..0f3cb6f 100644
--- a/src/Makefile.orig
+++ b/src/Makefile.orig
@@ -33,7 +33,7 @@ MAKE_ORIG = $(MAKE) -f Makefile.orig

 OMPFLAGS =
 # gcc with OpenMP
-#OMPFLAGS = -fopenmp
+OMPFLAGS = -fopenmp
 # gcc with OpenMP on 32-bit x86 with SSE2
 #OMPFLAGS = -fopenmp -msse2
 # Mac OS X (llvm-gcc) with OpenMP
<!-- gh-comment-id:43288766 --> @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 ``` $ ../run/john -te -form=Raw-SHA1-ng Will run 6 OpenMP threads Benchmarking: Raw-SHA1-ng, (pwlen <= 15) [SHA1 128/128 SSE2 4x]... (6xOMP) FAILED (cmp_all(212)) BUT $ OMP_NUM_THREADS=1 ../run/john -te -form=Raw-SHA1-ng Warning: OpenMP is disabled; a non-OpenMP build may be faster Benchmarking: Raw-SHA1-ng, (pwlen <= 15) [SHA1 128/128 SSE2 4x]... DONE Raw: 14906K c/s real, 14906K c/s virtual ``` ``` diff --git a/src/Makefile.orig b/src/Makefile.orig index a05cfa0..0f3cb6f 100644 --- a/src/Makefile.orig +++ b/src/Makefile.orig @@ -33,7 +33,7 @@ MAKE_ORIG = $(MAKE) -f Makefile.orig OMPFLAGS = # gcc with OpenMP -#OMPFLAGS = -fopenmp +OMPFLAGS = -fopenmp # gcc with OpenMP on 32-bit x86 with SSE2 #OMPFLAGS = -fopenmp -msse2 # Mac OS X (llvm-gcc) with OpenMP ```
Author
Owner

@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?

<!-- gh-comment-id:43315994 --> @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?
Author
Owner

@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... no
checking 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... no
checking for atexit... no

<!-- gh-comment-id:43352982 --> @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... no` checking 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... no` checking for atexit... no
Author
Owner

@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... unsupported
checking 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

<!-- gh-comment-id:43354709 --> @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... unsupported` checking 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
Author
Owner

@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.....

<!-- gh-comment-id:43355136 --> @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.....
Author
Owner

@jfoug commented on GitHub (May 16, 2014):

The last 3 items were fixed with 14ec2d8 PLEASE 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.

<!-- gh-comment-id:43356122 --> @jfoug commented on GitHub (May 16, 2014): The last 3 items were fixed with 14ec2d8 PLEASE 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.
Author
Owner

@magnumripper commented on GitHub (May 16, 2014):

Magnum, did you add code specific to testing for GNU compliant malloc and realloc?

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?!

<!-- gh-comment-id:43365683 --> @magnumripper commented on GitHub (May 16, 2014): > Magnum, did you add code specific to testing for GNU compliant malloc and realloc? 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?!
Author
Owner

@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)

<!-- gh-comment-id:43367437 --> @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)
Author
Owner

@ghost commented on GitHub (May 17, 2014):

Do you now get OpenCL?

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?

<!-- gh-comment-id:43393449 --> @ghost commented on GitHub (May 17, 2014): > Do you now get OpenCL? 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?
Author
Owner

@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).

diff --git a/src/configure b/src/configure
index 29ca672..c8e8b36 100755
--- a/src/configure
+++ b/src/configure
@@ -3415,7 +3415,7 @@ if test -n "$AMDAPPSDKROOT"; then
       CFLAGS+=" -I$AMDAPPSDKROOT/include"
    fi
    if test -d "$AMDAPPSDKROOT/lib"; then
-      LDFLAGS+=" -L$AMDAPPSDKROOT/lib"
+      LDFLAGS+=" -L$AMDAPPSDKROOT/lib  -L$AMDAPPSDKROOT/lib/x86_64"
    fi
 fi
 if test -n "$ATISTREAMSDKROOT"; then
diff --git a/src/configure.ac b/src/configure.ac
index 56745c0..cd1b3e6 100644
--- a/src/configure.ac
+++ b/src/configure.ac
@@ -98,7 +98,7 @@ if test -n "$AMDAPPSDKROOT"; then
       CFLAGS+=" -I$AMDAPPSDKROOT/include"
    fi
    if test -d "$AMDAPPSDKROOT/lib"; then
-      LDFLAGS+=" -L$AMDAPPSDKROOT/lib"
+      LDFLAGS+=" -L$AMDAPPSDKROOT/lib -L$AMDAPPSDKROOT/lib/x86_64"
    fi
 fi
 if test -n "$ATISTREAMSDKROOT"; then
<!-- gh-comment-id:43393987 --> @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). ``` diff --git a/src/configure b/src/configure index 29ca672..c8e8b36 100755 --- a/src/configure +++ b/src/configure @@ -3415,7 +3415,7 @@ if test -n "$AMDAPPSDKROOT"; then CFLAGS+=" -I$AMDAPPSDKROOT/include" fi if test -d "$AMDAPPSDKROOT/lib"; then - LDFLAGS+=" -L$AMDAPPSDKROOT/lib" + LDFLAGS+=" -L$AMDAPPSDKROOT/lib -L$AMDAPPSDKROOT/lib/x86_64" fi fi if test -n "$ATISTREAMSDKROOT"; then diff --git a/src/configure.ac b/src/configure.ac index 56745c0..cd1b3e6 100644 --- a/src/configure.ac +++ b/src/configure.ac @@ -98,7 +98,7 @@ if test -n "$AMDAPPSDKROOT"; then CFLAGS+=" -I$AMDAPPSDKROOT/include" fi if test -d "$AMDAPPSDKROOT/lib"; then - LDFLAGS+=" -L$AMDAPPSDKROOT/lib" + LDFLAGS+=" -L$AMDAPPSDKROOT/lib -L$AMDAPPSDKROOT/lib/x86_64" fi fi if test -n "$ATISTREAMSDKROOT"; then ```
Author
Owner

@ghost commented on GitHub (May 17, 2014):

Why GMP support (below) has no (blank) information?

Configured for building John the Ripper Jumbo:

Target CPU .................................. x86_64 SSE2, 64-bit
Target OS ................................... linux-gnu
Legacy arch header .......................... x86-64.h
OpenMP support .............................. yes
OpenMPI support ............................. no
OpenCL support .............................. yes
CUDA support ................................ no
Rexgen support .............................. no
GMP support (performance).................... 
NSS support (Mozilla format)................. no
AES-NI support .............................. depends on OpenSSL
<!-- gh-comment-id:43394168 --> @ghost commented on GitHub (May 17, 2014): Why GMP support (below) has no (blank) information? ``` Configured for building John the Ripper Jumbo: Target CPU .................................. x86_64 SSE2, 64-bit Target OS ................................... linux-gnu Legacy arch header .......................... x86-64.h OpenMP support .............................. yes OpenMPI support ............................. no OpenCL support .............................. yes CUDA support ................................ no Rexgen support .............................. no GMP support (performance).................... NSS support (Mozilla format)................. no AES-NI support .............................. depends on OpenSSL ```
Author
Owner

@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)

<!-- gh-comment-id:43409186 --> @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)
Author
Owner

@magnumripper 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).

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):

$ git clone http://github.com/magnumripper/JohnTheRipper -b autoconf testclone
<!-- gh-comment-id:43409497 --> @magnumripper 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). 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): ``` $ git clone http://github.com/magnumripper/JohnTheRipper -b autoconf testclone ```
Author
Owner

@jfoug commented on GitHub (May 17, 2014):

I have this and many other things fixed. When I get tem checked in, I will list.

<!-- gh-comment-id:43410429 --> @jfoug commented on GitHub (May 17, 2014): I have this and many other things fixed. When I get tem checked in, I will list.
Author
Owner

@ghost commented on GitHub (May 17, 2014):

Hmm bull fails at clone?

Something related to "refused by host" (I mean, seems to be a intermittent error).

<!-- gh-comment-id:43410716 --> @ghost commented on GitHub (May 17, 2014): > Hmm bull fails at clone? Something related to "refused by host" (I mean, seems to be a intermittent error).
Author
Owner

@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 11f0390 contains all of these changes.

<!-- gh-comment-id:43416051 --> @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 11f0390 contains all of these changes.
Author
Owner

@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).

<!-- gh-comment-id:43416167 --> @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).
Author
Owner

@magnumripper commented on GitHub (May 17, 2014):

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)

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.

<!-- gh-comment-id:43417120 --> @magnumripper commented on GitHub (May 17, 2014): > 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) 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.
Author
Owner

@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

<!-- gh-comment-id:43417618 --> @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
Author
Owner

@ghost commented on GitHub (May 17, 2014):

Please try now, and see if a 'raw' configure, with no fixups works properly for you

It is working fine, but I noticed a few glitches:

  • erros on configure
  • openMP = no (but it was detected and build properly)

Thanks.

config.status: linking x86-64.h to arch.h
config.status: executing default commands
./configure: line 13363: test: argument expected
./configure: line 13364: x: command not found
./configure: line 13365: x-fopenmp: command not found

Configured for building John the Ripper Jumbo:

Target CPU .................................. x86_64 SSE2, 64-bit
Target OS ................................... linux-gnu
Legacy arch header .......................... x86-64.h
OpenMP support .............................. no
OpenMPI support ............................. no
OpenCL support .............................. yes
CUDA support ................................ no
Rexgen support .............................. no
GMP support (performance).................... no
NSS support (Mozilla format)................. no
AES-NI support .............................. depends on OpenSSL
<!-- gh-comment-id:43421794 --> @ghost commented on GitHub (May 17, 2014): > Please try now, and see if a 'raw' configure, with no fixups works properly for you It is working fine, but I noticed a few glitches: - erros on configure - openMP = no (but it was detected and build properly) Thanks. ``` config.status: linking x86-64.h to arch.h config.status: executing default commands ./configure: line 13363: test: argument expected ./configure: line 13364: x: command not found ./configure: line 13365: x-fopenmp: command not found Configured for building John the Ripper Jumbo: Target CPU .................................. x86_64 SSE2, 64-bit Target OS ................................... linux-gnu Legacy arch header .......................... x86-64.h OpenMP support .............................. no OpenMPI support ............................. no OpenCL support .............................. yes CUDA support ................................ no Rexgen support .............................. no GMP support (performance).................... no NSS support (Mozilla format)................. no AES-NI support .............................. depends on OpenSSL ```
Author
Owner

@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.

<!-- gh-comment-id:43430419 --> @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.
Author
Owner

@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.

<!-- gh-comment-id:43436140 --> @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.
Author
Owner

@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.

<!-- gh-comment-id:43437642 --> @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.
Author
Owner

@magnumripper commented on GitHub (May 18, 2014):

I'm pretty sure -a is 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 to test this && test that.

Just now I tried it again and there seems to be no problems at command line:

$ if test 1 -eq $((2/2)) -a string = string ; then echo "yep"; fi
yep

I did not try this in configure.ac this time though (I think I tried that syntax before and it failed?)

<!-- gh-comment-id:43445624 --> @magnumripper commented on GitHub (May 18, 2014): I'm pretty sure `-a` is 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 to `test this && test that`. Just now I tried it again and there seems to be no problems at command line: ``` $ if test 1 -eq $((2/2)) -a string = string ; then echo "yep"; fi yep ``` I did not try this in configure.ac this time though (I think I tried that syntax before and it failed?)
Author
Owner

@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 -eq for numeric ones.

<!-- gh-comment-id:43445772 --> @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 `-eq` for numeric ones.
Author
Owner

@magnumripper commented on GitHub (May 18, 2014):

af08a8e changes all '==' to '=' and replaces 'test this && test that' with 'test this -a that'. Works fine on OSX and should be more portable.

<!-- gh-comment-id:43446420 --> @magnumripper commented on GitHub (May 18, 2014): af08a8e changes all '==' to '=' and replaces 'test this && test that' with 'test this -a that'. Works fine on OSX and should be more portable.
Author
Owner

@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

<!-- gh-comment-id:43447179 --> @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
Author
Owner

@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).

<!-- gh-comment-id:43447577 --> @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).
Author
Owner

@ghost commented on GitHub (May 18, 2014):

Everything seems to be ok here.

<!-- gh-comment-id:43457300 --> @ghost commented on GitHub (May 18, 2014): Everything seems to be ok here.
Author
Owner

@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.

checking CL/cl.h usability... yes
checking CL/cl.h presence... no
configure: WARNING: CL/cl.h: accepted by the compiler, rejected by the preprocessor!
configure: WARNING: CL/cl.h: proceeding with the compiler's result
checking for CL/cl.h... yes
checking OpenCL/cl.h usability... no
checking OpenCL/cl.h presence... no
checking for OpenCL/cl.h... no
checking windows.h usability... no
checking windows.h presence... no
checking for windows.h... no
checking for OpenCL library... -lOpenCL
checking cuda.h usability... yes
checking cuda.h presence... no
configure: WARNING: cuda.h: accepted by the compiler, rejected by the preprocessor!
configure: WARNING: cuda.h: proceeding with the compiler's result
checking for cuda.h... yes
checking for cudaGetDeviceCount in -lcudart... yes

Could it be that CPPFLAGS should be filled with the -I/path/oclincludes -I/path/cudaincludes too?

<!-- gh-comment-id:43458056 --> @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. ``` checking CL/cl.h usability... yes checking CL/cl.h presence... no configure: WARNING: CL/cl.h: accepted by the compiler, rejected by the preprocessor! configure: WARNING: CL/cl.h: proceeding with the compiler's result checking for CL/cl.h... yes checking OpenCL/cl.h usability... no checking OpenCL/cl.h presence... no checking for OpenCL/cl.h... no checking windows.h usability... no checking windows.h presence... no checking for windows.h... no checking for OpenCL library... -lOpenCL checking cuda.h usability... yes checking cuda.h presence... no configure: WARNING: cuda.h: accepted by the compiler, rejected by the preprocessor! configure: WARNING: cuda.h: proceeding with the compiler's result checking for cuda.h... yes checking for cudaGetDeviceCount in -lcudart... yes ``` Could it be that CPPFLAGS should be filled with the `-I/path/oclincludes -I/path/cudaincludes` too?
Author
Owner

@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!

<!-- gh-comment-id:43458181 --> @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!
Author
Owner

@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

<!-- gh-comment-id:43458555 --> @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
Author
Owner

@magnumripper commented on GitHub (May 19, 2014):

As of 539cb8ca bull, well and super configures & builds correctly just from ./configure && make. As does my MBPR.

<!-- gh-comment-id:43459259 --> @magnumripper commented on GitHub (May 19, 2014): As of 539cb8ca bull, well and super configures & builds correctly just from `./configure && make`. As does my MBPR.
Author
Owner

@ghost commented on GitHub (May 19, 2014):

Everything is Ok here too.

<!-- gh-comment-id:43459346 --> @ghost commented on GitHub (May 19, 2014): Everything is Ok here too.
Author
Owner

@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).

<!-- gh-comment-id:43460815 --> @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).
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
openwall/john#248
No description provided.