Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20160804105103.GA15277@openwall.com>
Date: Thu, 4 Aug 2016 13:51:03 +0300
From: Solar Designer <solar@...nwall.com>
To: john-users@...ts.openwall.com
Subject: Re: specify home ($JOHN) at compiletime

On Wed, Aug 03, 2016 at 02:52:14PM +0200, Matus UHLAR - fantomas wrote:
> to explain:
> I have started with packaged john 1.7.9, then backported 1.8.0 because of
> fork option. they both used ~/.john/john.pot
> 
> then i went to jumbo because of extra formats, and bleeding-jumbo because of
> faster algorithms... 
> 
> I want to make them all use the same john.conf and john.pot files...

Oh, OK.  It is not typical to want that from your user-local builds.
Personally, I am more comfortable with each build using its own files.

> I use debian, but yes, I was trying to create packages, so I could easily
> distribute them to different systems.

If you're the only user for those packages, it might be easier to use
tarballs instead (of the "run" and "doc" directories).

> unfortunately files from debian 1.8.0 package don't work with jumbo:
> 
> make[2]: *** No rule to make target 'linux-x86-64'.  Stop.
> make[2]: Leaving directory '/home/uhlar/src/debian/john/bleeding-jumbo/src'
> 
> I have no problem to build it manually, but the process seems to have
> problems:
> 
> env CFLAGS='-DJOHN_SYSTEMWIDE=1 -DCFG_FULL_NAME="/etc/john/john.conf"' 
> ./configure
> 
> 1. configure warning:
> 
> configure: WARNING: No recognized optimization option present in CFLAGS
> 
> maybe I should add "-O2" or "-O3" to CFLAGS? (debian adds -funroll-loops
> which makes -O3 from -O2)

Yes, you should have "-O2 -fomit-frame-pointer" in CFLAGS, if you
override CFLAGS at all.  Also, by default "configure" will detect and
enable use of your build host CPU's features.  This is very important
for performance (e.g., AVX2 is often a 2x speedup), but it makes your
binary non-portable to machines with less capable CPUs.  To disable this
detection, use "./configure --disable-native-tests", and then you'll
want to make separate builds for each of your target CPU categories -
e.g., plain x86-64/SSE2, SSSE3, SSE4.1, AVX, XOP, AVX2.  With
non-ancient systems, perhaps you can require at least SSSE3, but
anything below AVX is only a minor improvement over SSE2.

As to "-funroll-loops", I think our current "configure" will make use of
it by default where appropriate (not for all source files).  Ditto for
"-finline-functions".

(And no, merely adding "-funroll-loops" doesn't make "-O3" from "-O2".
There are more differences between these optimization levels.)

> 2. compile warnings:
> 
> params.h:152:0: warning: "CFG_FULL_NAME" redefined
>   #define CFG_FULL_NAME   "$JOHN/john.conf"
>   ^
> <command-line>:0:0: note: this is the location of the previous definition
> 
> apparently the #define should to #ifndef CFG_FULL_NAME block
> (debian patch adds that).
> Otherwise, seems that the latter is being used.

I think Debian overrides CFG_FULL_NAME because of their policy to have
all config files under /etc.  This policy is inconsistent with JtR's,
and vice versa, where JtR checks a set of directories for several of its
files, including the config file and more.  By overriding CFG_FULL_NAME
like above, if it worked, you'd break some desirable functionality -
namely, being able to override the system-wide config file at runtime by
placing a local one in ~/.john/john.conf.  Just how do Debian package
users make edits to their john.conf?  Edit the global file as root?
That's nasty.  Here's how I do it on Owl, as non-root:

cp /usr/share/john/john.conf ~/.john
vi ~/.john/john.conf

This works due to our default CFG_FULL_NAME.

There's no "#ifndef CFG_FULL_NAME" on purpose.  We don't support this,
and proper support would amount to more than just the #ifndef.

I suggest that you simply drop this Debian'ism, especially as it doesn't
even build for you.

> ...I'm out of ideas. Debian uses backslash escaping:
> 
> CFLAGS='-DJOHN_SYSTEMWIDE=1 -DCFG_FULL_NAME=\"/etc/john/john.conf\"' 
> ./configure
> 
> but that causes configure errors:
> 
> configure: creating ./fmt_externs.h
> <command-line>:0:16: warning: missing terminating " character

I guess the exact escaping needed varies between Debian's invocation
from a script and your invocation from the command-line.

> any idea how to continue?

Just don't override CFG_FULL_NAME.  Also, seriously consider whether you
actually want system-wide builds.

And I guess by now you realize that you're doing something weird, and/or
that we don't support your use case well (sorry!)  Hopefully, you have
at least tens of similar machines to make this exercise worthwhile.

Alexander

Powered by blists - more mailing lists

Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.