Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 405941 - app-crypt/johntheripper-1.7.9 - x86-sse.o: In function `DES_bs_crypt': (.text+0x40): multiple definition of `DES_bs_crypt'
Summary: app-crypt/johntheripper-1.7.9 - x86-sse.o: In function `DES_bs_crypt': (.text...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Crypto team [DISABLED]
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-02-26 18:04 UTC by Jean-Francois Ostiguy
Modified: 2012-10-06 21:10 UTC (History)
6 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
build log (build.log,57.45 KB, text/plain)
2012-02-26 18:11 UTC, Jean-Francois Ostiguy
Details
detect user CFLAGS and honor them (john-1.7.9.ebuild.patch,974 bytes, patch)
2012-03-05 21:44 UTC, Rick Farina (Zero_Chaos)
Details | Diff
build log (jtr-405941-fix-confirmation.txt,47.61 KB, text/plain)
2012-03-05 22:19 UTC, Rick Farina (Zero_Chaos)
Details
build.log (build.log,36.65 KB, text/x-log)
2012-04-11 01:53 UTC, Jean-Francois Ostiguy
Details
build.log (app-crypt:johntheripper-1.7.9-r2:20120421-071933.log,38.21 KB, text/plain)
2012-04-21 10:48 UTC, Dan Johansson
Details
build.log (build.log,47.71 KB, text/plain)
2012-10-05 16:34 UTC, Andrew Savchenko
Details
emerge --info (emerge.info,7.57 KB, text/plain)
2012-10-05 16:35 UTC, Andrew Savchenko
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Jean-Francois Ostiguy 2012-02-26 18:04:55 UTC
johntheripper 1.7.9 emerge fails  with the following message:

 .... 

i686-pc-linux-gnu-gcc DES_fmt.o DES_std.o DES_bs.o DES_bs_b.o BSDI_fmt.o MD5_fmt.o MD5_std.o BF_fmt.o BF_std.o AFS_fmt.o LM_fmt.o tr
ip_fmt.o timer.o md5_go.o md5_eq.o md5.o rc4.o hmacmd5.o base64.o md4.o dynamic_fmt.o dynamic_parser.o dynamic_preloads.o dynamic_ut
ils.o rawSHA224_fmt.o rawSHA256_fmt.o rawSHA384_fmt.o rawSHA512_fmt.o XSHA512_fmt.o hmailserver_fmt.o SybaseASE_fmt.o SKEY_fmt.o ssh
_fmt.o ssh2john.o pdf_fmt.o pdf2john.o pdfcrack_common.o pdfcrack_md5.o pdfparser.o pdfcrack.o pdfcrack_rc4.o rar_fmt.o rar2john.o z
ip_fmt.o zip2john.o gladman_hmac.o gladman_pwd2key.o EPI_fmt_plug.o phpassMD5_fmt_plug.o rawMD5go_fmt_plug.o hmacMD5_fmt_plug.o NETL
Mv2_fmt_plug.o mskrb5_fmt_plug.o sapB_fmt_plug.o crc32_fmt_plug.o NETNTLM_fmt_plug.o NT_fmt_plug.o PHPS_fmt_plug.o rawMD5_fmt_plug.o
 nt2_fmt_plug.o rawSHA_fmt_plug.o pixMD5_fmt_plug.o MSCHAPv2_fmt_plug.o mssql-old_fmt_plug.o mscash1_fmt_plug.o KRB4_fmt_plug.o IPB2
_fmt_plug.o salted_sha1_fmt_plug.o rawMD4_fmt_plug.o rawSHA1_fmt_plug.o NS_fmt_plug.o pkzip_fmt_plug.o sha1_gen_fmt_plug.o oracle11_
fmt_plug.o mssql05_fmt_plug.o XSHA_fmt_plug.o MYSQL_fast_fmt_plug.o KRB5_fmt_plug.o mysqlSHA1_fmt_plug.o NETNTLMv2_fmt_plug.o NETLM_
fmt_plug.o PO_fmt_plug.o DOMINOSEC_fmt_plug.o mscash2_fmt_plug.o NETSPLITLM_fmt_plug.o KRB5_std_plug.o HDAA_fmt_plug.o lotus5_fmt_pl
ug.o md4_gen_fmt_plug.o MYSQL_fmt_plug.o KRB4_std_plug.o nsldap_fmt_plug.o rawmd5u_fmt_plug.o DMD5_fmt_plug.o sapG_fmt_plug.o oracle
_fmt_plug.o mediawiki_fmt_plug.o BFEgg_fmt_plug.o plugin.o dummy.o batch.o bench.o charset.o common.o compiler.o config.o cracker.o 
crc32.o external.o formats.o getopt.o idle.o inc.o john.o list.o loader.o logger.o math.o memory.o misc.o options.o params.o path.o 
recovery.o rpp.o rules.o signals.o single.o status.o tty.o wordlist.o mkv.o mkvlib.o unicode.o unshadow.o unafs.o undrop.o unique.o 
c3_fmt.o x86.o x86-sse.o sha1-mmx.o md4-mmx.o md5-mmx.o -Wl,--hash-style=gnu -Wl,-O1 -Wl,--as-needed -lcrypto -lssl -lm -lz -fopenmp
 -lcrypt -ldl -lcrypto -lssl -lm -lz -fopenmp -o ../run/john
x86-sse.o: In function `DES_bs_crypt':
(.text+0x40): multiple definition of `DES_bs_crypt'
DES_bs_b.o:DES_bs_b.c:(.text+0x4e88): first defined here
x86-sse.o: In function `DES_bs_crypt_25':
(.text+0x2380): multiple definition of `DES_bs_crypt_25'
DES_bs_b.o:DES_bs_b.c:(.text+0x7552): first defined here
x86-sse.o: In function `DES_bs_crypt_LM':
(.text+0x4b00): multiple definition of `DES_bs_crypt_LM'
DES_bs_b.o:DES_bs_b.c:(.text+0x277f): first defined here
collect2: ld returned 1 exit status
make[1]: *** [../run/john] Error 1
make[1]: Leaving directory `/var/tmp/portage/app-crypt/johntheripper-1.7.9/work/john-1.7.9/src'
make: *** [linux-x86-sse2] Error 2
make: Leaving directory `/var/tmp/portage/app-crypt/johntheripper-1.7.9/work/john-1.7.9/src'
 * ERROR: app-crypt/johntheripper-1.7.9 failed (compile phase):
 *   emake failed


Reproducible: Always
Comment 1 Jean-Francois Ostiguy 2012-02-26 18:11:36 UTC
Created attachment 303397 [details]
build log

 emerge --info
Portage 2.1.10.49 (default/linux/x86/10.0/developer, gcc-4.5.3, glibc-2.14.1-r2, 3.2.1-gentoo i686)
=================================================================
System uname: Linux-3.2.1-gentoo-i686-Intel-R-_Pentium-R-_4_CPU_3.20GHz-with-gentoo-2.1
Timestamp of tree: Sun, 26 Feb 2012 14:00:01 +0000
app-shells/bash:          4.2_p20
dev-java/java-config:     2.1.11-r3
dev-lang/python:          2.6.7-r2, 2.7.2-r3, 3.2.2
dev-util/cmake:           2.8.7-r3
dev-util/pkgconfig:       0.26
sys-apps/baselayout:      2.1
sys-apps/openrc:          0.9.9.2
sys-apps/sandbox:         2.5
sys-devel/autoconf:       2.13, 2.68
sys-devel/automake:       1.9.6-r3, 1.10.3, 1.11.3
sys-devel/binutils:       2.22-r1
sys-devel/gcc:            3.4.6-r2, 4.2.4-r1, 4.3.6-r1, 4.4.6-r1, 4.5.3-r2, 4.6.2
sys-devel/gcc-config:     1.5-r2
sys-devel/libtool:        2.4.2
sys-devel/make:           3.82-r3
sys-kernel/linux-headers: 3.2-r1 (virtual/os-headers)
sys-libs/glibc:           2.14.1-r2
Repositories: gentoo kde-sunset sunrise sage-on-gentoo local-repo mingw32-repo
ACCEPT_KEYWORDS="x86 ~x86"
ACCEPT_LICENSE="*"
CBUILD="i686-pc-linux-gnu"
CFLAGS="-O2 -march=native -fomit-frame-pointer -pipe"
CHOST="i686-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/share/config /usr/share/gnupg/qualified.txt /usr/share/maven-bin-3.0/conf /usr/share/openvpn/easy-rsa /var/lib/hsqldb"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/dconf /etc/env.d /etc/env.d/java/ /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/php/apache2-php5.3/ext-active/ /etc/php/apache2-php5.4/ext-active/ /etc/php/cgi-php5.3/ext-active/ /etc/php/cgi-php5.4/ext-active/ /etc/php/cli-php5.3/ext-active/ /etc/php/cli-php5.4/ext-active/ /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo /etc/texmf/language.dat.d /etc/texmf/language.def.d /etc/texmf/updmap.d /etc/texmf/web2c"
CXXFLAGS="-O2 -march=native -fomit-frame-pointer -pipe"
DISTDIR="/usr/portage/distfiles"
FEATURES="assume-digests binpkg-logs collision-protect distlocks ebuild-locks fixlafiles multilib-strict news parallel-fetch protect-owned sandbox sfperms sign splitdebug test-fail-continue unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox"
FFLAGS="-march=native -O2 -pipe"
GENTOO_MIRRORS="http://gentoo.osuosl.org/ ftp://distro.ibiblio.org/pub/linux/distributions/gentoo/ http://distro.ibiblio.org/pub/linux/distributions/gentoo/ ftp://ftp.gtlib.gatech.edu/pub/gentoo http://www.gtlib.gatech.edu/pub/gentoo ftp://mirror.iawnet.sandia.gov/pub/gentoo/ ftp://ftp.ussg.iu.edu/pub/linux/gentoo http://gentoo.chem.wisc.edu/gentoo/ "
LANG="en_US.utf8"
LDFLAGS="-Wl,--hash-style=gnu -Wl,-O1 -Wl,--as-needed"
LINGUAS="en en_US fr"
MAKEOPTS="-j2"
PKGDIR="/usr/portage/packages"
PORTAGE_CONFIGROOT="/"
PORTAGE_RSYNC_EXTRA_OPTS="--exclude ChangeLog --delete-excluded"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --stats --human-readable --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/var/lib/layman/kde-sunset /var/lib/layman/sunrise /var/lib/layman/sage-on-gentoo /usr/local/portage /usr/i686-mingw32/usr/portage"
SYNC="rsync://rsync.gentoo.org/gentoo-portage"
USE="X a52 aac acl acpi alsa apache2 berkdb bluetooth bzip2 cairo cdda cdr cleartype cli consolekit corefonts cpdflib cracklib crypt cups cxx dbus doc dri dts dv dvd dvdr emboss encode exif fam firefox flac fortran gcj gd-external gdbm gdu gif gnomedb gpm gtk iconv icu ieee1394 ipv6 java jpeg kde kdehiddenvisibility lcms ldap libnotify lm_sensors mad maildir mbox mmx mng modules mp3 mp4 mpeg mudflap ncurses nls nptl nptlonly ogg opengl openmp oss pam pango pcre pdf php png policykit ppds pppd private-headers qt3support qt4 readline scanner sdl semantic-desktop session snmp spell sqlite sse sse2 ssl startup-notification svg sysfs tcpd tiff truetype type1 type3 udev unicode usb vorbis wicd x264 x86 xcb xml xmlrpc xorg xulrunner xv xvid zlib" ALSA_CARDS="intel8x0 usb-audio" ALSA_PCM_PLUGINS="adpcm alaw asym copy dmix dshare dsnoop empty extplug file hooks iec958 ioplug ladspa lfloat linear meter mmap_emul mulaw multi null plug rate route share shm softvol" APACHE2_MODULES="actions alias auth_basic auth_digest authn_anon authn_dbd authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache dav dav_fs dav_lock dbd deflate dir disk_cache env expires ext_filter file_cache filter headers ident imagemap include info log_config logio mem_cache mime mime_magic negotiation proxy proxy_ajp proxy_balancer proxy_connect proxy_http rewrite setenvif so speling status unique_id userdir usertrack vhost_alias" CALLIGRA_FEATURES="kexi words flow plan stage tables krita karbon braindump" CAMERAS="canon" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" ELIBC="glibc" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock itrax mtk3301 nmea ntrip navcom oceanserver oldstyle oncore rtcm104v2 rtcm104v3 sirf superstar2 timing tsip tripmate tnt ubx" INPUT_DEVICES="evdev keyboard mouse" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LINGUAS="en en_US fr" NETBEANS_MODULES="apisupport harness ide java nb gsf php websvccommon webcommon" PHP_TARGETS="php5-3" RUBY_TARGETS="ruby18" SANE_BACKENDS="umax" USERLAND="GNU" VIDEO_CARDS="radeon vesa fbdev" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipset ipp2p iface geoip fuzzy condition tee tarpit sysrq steal rawnat logmark ipmark dhcpmac delude chaos account"
Unset:  CPPFLAGS, CTARGET, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LC_ALL, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS
Comment 2 Massimo Balestra 2012-03-02 17:19:27 UTC
I have the same problem.

I followed the suggestion of Bug 405927.

I modified in CFLAGS from -march=native to -mtune=native and the compilation run successfully.

Now I have CFLAGS="-O2 -mtune=native "

Massimo
Comment 3 Rick Farina (Zero_Chaos) gentoo-dev 2012-03-05 05:08:20 UTC
If you add this line just inside of src_compile it allows me to build despite my unsupported cflag:

replace-flags -march=native -mtune=native

I suggest we update the ebuild.

Thanks,
ZC
Comment 4 Rick Farina (Zero_Chaos) gentoo-dev 2012-03-05 19:47:09 UTC
The offending CFLAG in this case is -mavx

The relevant section of the gcc man page:


           These switches enable or disable the use of instructions in the MMX, SSE, SSE2, SSE3, SSSE3, SSE4.1, AVX, AES, PCLMUL, SSE4A, FMA4, XOP, LWP, ABM or 3DNow! extended
           instruction sets.  These extensions are also available as built-in functions: see X86 Built-in Functions, for details of the functions enabled and disabled by these
           switches.

           To have SSE/SSE2 instructions generated automatically from floating-point code (as opposed to 387 instructions), see -mfpmath=sse.

           GCC depresses SSEx instructions when -mavx is used. Instead, it generates new AVX instructions or AVX equivalence for all SSEx instructions when needed.

           These options will enable GCC to use these extended instructions in generated code, even without -mfpmath=sse.  Applications which perform runtime CPU detection must
           compile separate files for each supported architecture, using the appropriate flags.  In particular, the file containing the CPU detection code should be compiled
           without these options.




Unfortunately since this flag is added by gcc when it expands -march=native it seems that flag-o-matic.eclass cannot filter it out.... I'm stuck at this point.

-ZC
Comment 5 Rick Farina (Zero_Chaos) gentoo-dev 2012-03-05 21:02:06 UTC
--- johntheripper-1.7.9.ebuild	2012-02-23 05:04:21.000000000 -0500
+++ johntheripper-1.7.9-r1.ebuild	2012-03-05 15:59:54.863600022 -0500
@@ -40,7 +40,13 @@
 	if use alpha; then
 		echo "linux-alpha"
 	elif use amd64; then
-		echo "linux-x86-64"
+		if test-flags-CC -mavx > /dev/null; then
+			echo "linux-x86-64-avx"
+		elif test-flags-CC -mxop > /dev/null; then
+			echo "linux-x86-64-xop"
+		else
+			echo "linux-x86-64"
+		fi
 	elif use ppc; then
 		#if use altivec; then
 		#	echo "linux-ppc32-altivec"


Thanks to steev_ and radhermit I've developed the above patch which should fix -march=native compiling on systems supporting box avx and xop.

Please issue an -r1 for this critical bug fix.
Comment 6 Rick Farina (Zero_Chaos) gentoo-dev 2012-03-05 21:11:03 UTC
--- johntheripper-1.7.9.ebuild	2012-02-23 05:04:21.000000000 -0500
+++ johntheripper-1.7.9-r1.ebuild	2012-03-05 16:09:14.900620749 -0500
@@ -40,7 +40,13 @@
 	if use alpha; then
 		echo "linux-alpha"
 	elif use amd64; then
-		echo "linux-x86-64"
+		if test-flags-CC -mxop > /dev/null; then
+			echo "linux-x86-64-xop"
+		elif test-flags-CC -mavx > /dev/null; then
+			echo "linux-x86-64-avx"
+		else
+			echo "linux-x86-64"
+		fi
 	elif use ppc; then
 		#if use altivec; then
 		#	echo "linux-ppc32-altivec"


As pointed out by radhermit, xop devices can support both xop and avx so check for xop first, then avx, then default.

Thanks,
ZC
Comment 7 Rick Farina (Zero_Chaos) gentoo-dev 2012-03-05 21:44:54 UTC
Created attachment 304331 [details, diff]
detect user CFLAGS and honor them

Ignore the inline patches as they did not properly honor the users cflags.  Original patches checked if optimizations were supported and then just used them, this version of the patch respects the user's cflags and builds as expected.

Again, heavy handed help from radhermit.

Thanks,
ZC
Comment 8 Rick Farina (Zero_Chaos) gentoo-dev 2012-03-05 22:19:10 UTC
Created attachment 304343 [details]
build log

I have been questioned on how my patch fixes this issue.  While it is far more obvious a fix for bug #405927 for me it fixes this bug as well.  The attached bug log shows me attempting to build and replicating the error, then applying the patch already attached to this bug, then building without error.

Why does it work? That is above my understanding but this and bug #405927 appear related to me.  If I had to guess, it looks like cpu detection is added by the jumbo patch (USE=-minimal) and this is the same error manifesting in different places depending on changes made by the jumbo patch.

Thanks,
ZC
Comment 9 Tim Harder gentoo-dev 2012-03-05 22:43:27 UTC
Should be fixed for most people with newer processors in CVS.

@Jean-Francois Ostiguy: Can you test again to see if it still fails for that same machine?
Comment 10 Jean-Francois Ostiguy 2012-04-08 12:50:03 UTC
(In reply to comment #9)
> Should be fixed for most people with newer processors in CVS.
> 
> @Jean-Francois Ostiguy: Can you test again to see if it still fails for that
> same machine?

Sorry for the delayed response.  
1.7.9-r1 is still failing, with either -mtune=native or -mtune=pentium4.
Previously, it worked with  -mtune=pentium4 but not with  -mtune=native.
Compilation is successful when I omit these flags. 

x86-sse.o: In function `DES_bs_crypt':
(.text+0x40): multiple definition of `DES_bs_crypt'
DES_bs_b.o:DES_bs_b.c:(.text+0x4e88): first defined here
x86-sse.o: In function `DES_bs_crypt_25':
(.text+0x2380): multiple definition of `DES_bs_crypt_25'
DES_bs_b.o:DES_bs_b.c:(.text+0x7552): first defined here
x86-sse.o: In function `DES_bs_crypt_LM':
(.text+0x4b00): multiple definition of `DES_bs_crypt_LM'
DES_bs_b.o:DES_bs_b.c:(.text+0x277f): first defined here
collect2: ld returned 1 exit status
make[1]: *** [../run/john] Error 1
make[1]: Leaving directory `/var/tmp/portage/app-crypt/johntheripper-1.7.9-r1/work/john-1.7.9/src'
make: *** [linux-x86-sse2] Error 2
make: Leaving directory `/var/tmp/portage/app-crypt/johntheripper-1.7.9-r1/work/john-1.7.9/src'
 * ERROR: app-crypt/johntheripper-1.7.9-r1 failed (compile phase):
 *   emake failed
 * 
 * If you need support, post the output of 'emerge --info =app-crypt/johntheripper-1.7.9-r1',
 * the complete build log and the output of 'emerge -pqv =app-crypt/johntheripper-1.7.9-r1'.
 * The complete build log is located at '/var/tmp/portage/app-crypt/johntheripper-1.7.9-r1/temp/build.log'.
 * The ebuild environment file is located at '/var/tmp/portage/app-crypt/johntheripper-1.7.9-r1/temp/environment'.
 * S: '/var/tmp/portage/app-crypt/johntheripper-1.7.9-r1/work/john-1.7.9'
Comment 11 Dan Johansson 2012-04-09 07:30:35 UTC
For me 1.7.9-r2 still fails with the following:

i686-pc-linux-gnu-gcc DES_fmt.o DES_std.o DES_bs.o DES_bs_b.o BSDI_fmt.o MD5_fmt.o MD5_std.o BF_fmt.o BF_std.o AFS_fmt.o LM_fmt.o trip_fmt.o timer.o md5_go.o md5_eq.o md5.o rc4.o hmacmd5.o base64.o md4.o dynamic_fmt.o dynamic_parser.o dynamic_preloads.o dynamic_utils.o rawSHA224_fmt.o rawSHA256_fmt.o rawSHA384_fmt.o rawSHA512_fmt.o XSHA512_fmt.o hmailserver_fmt.o SybaseASE_fmt.o SKEY_fmt.o ssh_fmt.o ssh2john.o pdf_fmt.o pdf2john.o pdfcrack_common.o pdfcrack_md5.o pdfparser.o pdfcrack.o pdfcrack_rc4.o rar_fmt.o rar2john.o zip_fmt.o zip2john.o gladman_hmac.o gladman_pwd2key.o phpassMD5_fmt_plug.o hmacMD5_fmt_plug.o rawSHA1_fmt_plug.o oracle_fmt_plug.o mskrb5_fmt_plug.o sapB_fmt_plug.o DOMINOSEC_fmt_plug.o NETNTLM_fmt_plug.o NT_fmt_plug.o MYSQL_fmt_plug.o PHPS_fmt_plug.o rawMD5_fmt_plug.o nt2_fmt_plug.o rawSHA_fmt_plug.o pixMD5_fmt_plug.o MSCHAPv2_fmt_plug.o mscash1_fmt_plug.o KRB4_fmt_plug.o IPB2_fmt_plug.o rawMD5go_fmt_plug.o salted_sha1_fmt_plug.o rawMD4_fmt_plug.o NS_fmt_plug.o pkzip_fmt_plug.o KRB4_std_plug.o sha1_gen_fmt_plug.o oracle11_fmt_plug.o NETLMv2_fmt_plug.o mssql05_fmt_plug.o XSHA_fmt_plug.o MYSQL_fast_fmt_plug.o EPI_fmt_plug.o KRB5_fmt_plug.o mysqlSHA1_fmt_plug.o NETLM_fmt_plug.o NETNTLMv2_fmt_plug.o PO_fmt_plug.o NETSPLITLM_fmt_plug.o mssql-old_fmt_plug.o KRB5_std_plug.o HDAA_fmt_plug.o lotus5_fmt_plug.o md4_gen_fmt_plug.o mscash2_fmt_plug.o nsldap_fmt_plug.o rawmd5u_fmt_plug.o DMD5_fmt_plug.o sapG_fmt_plug.o crc32_fmt_plug.o mediawiki_fmt_plug.o BFEgg_fmt_plug.o plugin.o dummy.o batch.o bench.o charset.o common.o compiler.o config.o cracker.o crc32.o external.o formats.o getopt.o idle.o inc.o john.o list.o loader.o logger.o math.o memory.o misc.o options.o params.o path.o recovery.o rpp.o rules.o signals.o single.o status.o tty.o wordlist.o mkv.o mkvlib.o unicode.o unshadow.o unafs.o undrop.o unique.o c3_fmt.o x86.o x86-sse.o sha1-mmx.o md4-mmx.o md5-mmx.o -Wl,-O1 -Wl,--as-needed -lcrypto -lssl -lm -lz -fopenmp -lcrypt -ldl -lcrypto -lssl -lm -lz -fopenmp -o ../run/john
x86-sse.o: In function `DES_bs_crypt':
(.text+0x40): multiple definition of `DES_bs_crypt'
DES_bs_b.o:DES_bs_b.c:(.text+0x4e8c): first defined here
x86-sse.o: In function `DES_bs_crypt_25':
(.text+0x2380): multiple definition of `DES_bs_crypt_25'
DES_bs_b.o:DES_bs_b.c:(.text+0x7558): first defined here
x86-sse.o: In function `DES_bs_crypt_LM':
(.text+0x4b00): multiple definition of `DES_bs_crypt_LM'
DES_bs_b.o:DES_bs_b.c:(.text+0x2781): first defined here
collect2: ld returned 1 exit status


Adding "replace-flags -march=native -mtune=native"
Solves it (again).
Comment 12 Rick Farina (Zero_Chaos) gentoo-dev 2012-04-09 13:15:15 UTC
for anyone who is experiencing failures, please attach full build.log to the ticket and I'll discuss with upstream.
Comment 13 Jean-Francois Ostiguy 2012-04-11 01:53:24 UTC
Created attachment 308471 [details]
build.log
Comment 14 Dan Johansson 2012-04-21 10:46:09 UTC
I'm still having the same problem emerging...
log will follow.
Comment 15 Dan Johansson 2012-04-21 10:48:45 UTC
Created attachment 309711 [details]
build.log
Comment 16 Rick Farina (Zero_Chaos) gentoo-dev 2012-04-22 20:52:51 UTC
Response from john-dev mailing list pasted here for reference while I work on proper solutions:

On Fri, Apr 20, 2012 at 04:50:36PM -0400, Richard Farina wrote:
> He cannot build john with CFLAGS="-march=native" but has no issues with CFLAGS="-mtune=native".
In short, if you add certain flags to CFLAGS, you must also add these
flags to ASFLAGS and/or LDFLAGS.  In the case of -march=native (and
certain other -march=... settings), it must be in both CFLAGS and
ASFLAGS, so that the .c and .S files from JtR are compiled for a
consistent target architecture (not two different ones).  In the case of
-fopenmp, it must be in all three of CFLAGS, ASFLAGS, and LDFLAGS -
which is readily achieved with OMPFLAGS.  Thus, as an option, you may
specify -march=native in OMPFLAGS instead of in CFLAGS.

I understand that in your case -march=native might come from a
distro-wide setting that you use for packages' CFLAGS.  If so, you may
try including that entire string in ASFLAGS as well - most of the
options will be no-ops while assembling, but that's OK.

> make -j1 -C src/ CPP=i686-pc-linux-gnu-g++ CC=i686-pc-linux-gnu-gcc AS=i686-pc-linux-gnu-gcc LD=i686-pc-linux-gnu-gcc 'CFLAGS=-c -Wall -include \"/var/tmp/portage/app-crypt/johntheripper-1.7.9-r2/work/john-1.7.9\"/config.gentoo -O2 -march=native -pipe -fPIC -fPIE -fopenmp' 'LDFLAGS=-Wl,--hash-style=gnu -Wl,-O1 -Wl,--as-needed' OPT_NORMAL= OMPFLAGS=-fopenmp linux-x86-sse2
You dropped -fomit-frame-pointer and added -fPIC -fPIE there.  These
changes relative to JtR's default flags may have performance impact
(likely exceeding the possible advantage of -march=native).  It would be
better to just use JtR's defaults.

Starting with gcc 4.6.x, -fomit-frame-pointer became the default for -O2
when building for 32-bit x86, though.  Since Gentoo uses fresh stuff,
you're probably lucky to benefit from this.  Yet a while ago it was a
real problem (distros overriding CFLAGS, thus not including
-fomit-frame-pointer and incurring performance hits of up to 10% or so).

-fPIC -fPIE are still a bit problematic, although I understand why
Gentoo is doing that.  You may try a relbench of a Gentoo build vs.
default build of jumbo.  I suspect that the Gentoo build would run
slower on average.  You may try it separately for x86_64 and i686 (also
for different make targets and OpenMP or not if you like).

I hope this helps.

Alexander
Comment 17 Anton Bolshakov 2012-09-25 23:22:22 UTC
I that problem compiling it in virtual env. The workaround was to compile it with "app-crypt/johntheripper -sse2"

Jean-Francois, could you confirm it please?
Comment 18 Andrew Savchenko gentoo-dev 2012-10-05 16:34:09 UTC
Hello,

-sse2 doesn't work for me, USE="-sse2 -custom-cflags" too.
Error is the same.
Comment 19 Andrew Savchenko gentoo-dev 2012-10-05 16:34:48 UTC
Created attachment 325726 [details]
build.log
Comment 20 Andrew Savchenko gentoo-dev 2012-10-05 16:35:10 UTC
Created attachment 325728 [details]
emerge --info
Comment 21 Andrew Savchenko gentoo-dev 2012-10-06 20:49:46 UTC
Problem is gone with johntheripper-1.7.9-r5.
Comment 22 Rick Farina (Zero_Chaos) gentoo-dev 2012-10-06 21:10:55 UTC
The most recent comment says this is fixed, please reopen if it is not (only reopen for same issue please don't reopen in 6 months with a new build issue and a new version).

Thanks!