Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 167731 - app-crypt/johntheripper-1.7.2-r2 fails to link on hardened AMD64 (PIC problem)
Summary: app-crypt/johntheripper-1.7.2-r2 fails to link on hardened AMD64 (PIC problem)
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: New packages (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Crypto team [DISABLED]
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-02-20 11:06 UTC by Tony Vroon (RETIRED)
Modified: 2007-12-14 19:33 UTC (History)
4 users (show)

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


Attachments
Complete build log of app-crypt/johntheripper-1.7.2-r2 (johntheripper.buildlog.txt,13.23 KB, text/plain)
2007-11-16 17:40 UTC, Tony Vroon (RETIRED)
Details
johntheripper-1.7.2-pic.patch (johntheripper-1.7.2-pic.patch,620 bytes, patch)
2007-11-16 18:11 UTC, Alon Bar-Lev (RETIRED)
Details | Diff
Makefile (Makefile,139 bytes, text/plain)
2007-11-17 15:57 UTC, Alon Bar-Lev (RETIRED)
Details
a1.c (a1.c,115 bytes, text/plain)
2007-11-17 15:57 UTC, Alon Bar-Lev (RETIRED)
Details
a2.S (a2.S,147 bytes, text/plain)
2007-11-17 15:57 UTC, Alon Bar-Lev (RETIRED)
Details
johntheripper-with-asflags.buildlog.txt (johntheripper-with-asflags.buildlog.txt,13.35 KB, text/plain)
2007-11-23 15:35 UTC, Tony Vroon (RETIRED)
Details
johntheripper-nopie.buildlog.txt (johntheripper-nopie.buildlog.txt,13.81 KB, text/plain)
2007-11-28 11:39 UTC, Tony Vroon (RETIRED)
Details
johntheripper-1.7.2-r2.ebuild.diff (johntheripper-1.7.2-r2.ebuild.diff,1.07 KB, patch)
2007-12-08 10:45 UTC, Alon Bar-Lev (RETIRED)
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Tony Vroon (RETIRED) gentoo-dev 2007-02-20 11:06:01 UTC
Build output:
>>> Compiling source in /var/tmp/portage/app-crypt/johntheripper-1.7.2/work/john-1.7.2 ...
ln -sf x86-64.h arch.h
make ../run/john ../run/unshadow ../run/unafs ../run/unique ../run/undrop \
                JOHN_OBJS="DES_fmt.o DES_std.o DES_bs.o BSDI_fmt.o MD5_fmt.o MD5_std.o MD5_apache_fmt.o BFEgg_fmt.o BF_fmt.o BF_std.o AFS_fmt.o LM_fmt.o DOMINOSEC_fmt.o lotus5_fmt.o MYSQL_fmt.o KRB5_fmt.o KRB5_std.o md5_go.o rawMD5go_fmt.o PO_fmt.o md5.o IPB2_fmt.o rawSHA1_fmt.o NSLDAP_fmt.o sha1.o base64.o NT_fmt.o md4.o smbencrypt.o mscash_fmt.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 unshadow.o unafs.o undrop.o unique.o x86-64.o"
make[1]: Entering directory `/var/tmp/portage/app-crypt/johntheripper-1.7.2/work/john-1.7.2/src'
x86_64-pc-linux-gnu-gcc -c -Wall -march=opteron -O2 -pipe  DES_fmt.c
x86_64-pc-linux-gnu-gcc -c -Wall -march=opteron -O2 -pipe  DES_std.c
x86_64-pc-linux-gnu-gcc -c -Wall -march=opteron -O2 -pipe  DES_bs.c
x86_64-pc-linux-gnu-gcc -c -Wall -march=opteron -O2 -pipe  BSDI_fmt.c
x86_64-pc-linux-gnu-gcc -c -Wall -march=opteron -O2 -pipe  MD5_fmt.c
x86_64-pc-linux-gnu-gcc -c -Wall -march=opteron -O2 -pipe  MD5_std.c
x86_64-pc-linux-gnu-gcc -c -Wall -march=opteron -O2 -pipe  MD5_apache_fmt.c
x86_64-pc-linux-gnu-gcc -c -Wall -march=opteron -O2 -pipe  BFEgg_fmt.c
In file included from BFEgg_fmt.c:12:
blowfish.c:185:2: warning: no newline at end of file
BFEgg_fmt.c:124:3: warning: no newline at end of file
x86_64-pc-linux-gnu-gcc -c -Wall -march=opteron -O2 -pipe  BF_fmt.c
x86_64-pc-linux-gnu-gcc -c -Wall -march=opteron -O2 -pipe  BF_std.c
x86_64-pc-linux-gnu-gcc -c -Wall -march=opteron -O2 -pipe  AFS_fmt.c
x86_64-pc-linux-gnu-gcc -c -Wall -march=opteron -O2 -pipe  LM_fmt.c
x86_64-pc-linux-gnu-gcc -c -Wall -march=opteron -O2 -pipe  DOMINOSEC_fmt.c
x86_64-pc-linux-gnu-gcc -c -Wall -march=opteron -O2 -pipe  lotus5_fmt.c
x86_64-pc-linux-gnu-gcc -c -Wall -march=opteron -O2 -pipe  MYSQL_fmt.c
x86_64-pc-linux-gnu-gcc -c -Wall -march=opteron -O2 -pipe  KRB5_fmt.c
x86_64-pc-linux-gnu-gcc -c -Wall -march=opteron -O2 -pipe  KRB5_std.c
x86_64-pc-linux-gnu-gcc -c -Wall -march=opteron -O2 -pipe  md5_go.c
x86_64-pc-linux-gnu-gcc -c -Wall -march=opteron -O2 -pipe  rawMD5go_fmt.c
x86_64-pc-linux-gnu-gcc -c -Wall -march=opteron -O2 -pipe  PO_fmt.c
x86_64-pc-linux-gnu-gcc -c -Wall -march=opteron -O2 -pipe  md5.c
x86_64-pc-linux-gnu-gcc -c -Wall -march=opteron -O2 -pipe  IPB2_fmt.c
x86_64-pc-linux-gnu-gcc -c -Wall -march=opteron -O2 -pipe  rawSHA1_fmt.c
x86_64-pc-linux-gnu-gcc -c -Wall -march=opteron -O2 -pipe  NSLDAP_fmt.c
x86_64-pc-linux-gnu-gcc -c -Wall -march=opteron -O2 -pipe  sha1.c
x86_64-pc-linux-gnu-gcc -c -Wall -march=opteron -O2 -pipe  base64.c
x86_64-pc-linux-gnu-gcc -c -Wall -march=opteron -O2 -pipe  NT_fmt.c
x86_64-pc-linux-gnu-gcc -c -Wall -march=opteron -O2 -pipe  md4.c
x86_64-pc-linux-gnu-gcc -c -Wall -march=opteron -O2 -pipe  smbencrypt.c
x86_64-pc-linux-gnu-gcc -c -Wall -march=opteron -O2 -pipe  mscash_fmt.c
x86_64-pc-linux-gnu-gcc -c -Wall -march=opteron -O2 -pipe  batch.c
x86_64-pc-linux-gnu-gcc -c -Wall -march=opteron -O2 -pipe  bench.c
x86_64-pc-linux-gnu-gcc -c -Wall -march=opteron -O2 -pipe  charset.c
x86_64-pc-linux-gnu-gcc -c -Wall -march=opteron -O2 -pipe  common.c
x86_64-pc-linux-gnu-gcc -c -Wall -march=opteron -O2 -pipe  compiler.c
x86_64-pc-linux-gnu-gcc -c -Wall -march=opteron -O2 -pipe  config.c
x86_64-pc-linux-gnu-gcc -c -Wall -march=opteron -O2 -pipe  cracker.c
x86_64-pc-linux-gnu-gcc -c -Wall -march=opteron -O2 -pipe  crc32.c
x86_64-pc-linux-gnu-gcc -c -Wall -march=opteron -O2 -pipe  external.c
x86_64-pc-linux-gnu-gcc -c -Wall -march=opteron -O2 -pipe  formats.c
x86_64-pc-linux-gnu-gcc -c -Wall -march=opteron -O2 -pipe  getopt.c
x86_64-pc-linux-gnu-gcc -c -Wall -march=opteron -O2 -pipe  idle.c
x86_64-pc-linux-gnu-gcc -c -Wall -march=opteron -O2 -pipe  inc.c
x86_64-pc-linux-gnu-gcc -c -Wall -march=opteron -O2 -pipe  john.c
x86_64-pc-linux-gnu-gcc -c -Wall -march=opteron -O2 -pipe  list.c
x86_64-pc-linux-gnu-gcc -c -Wall -march=opteron -O2 -pipe  loader.c
x86_64-pc-linux-gnu-gcc -c -Wall -march=opteron -O2 -pipe  logger.c
x86_64-pc-linux-gnu-gcc -c -Wall -march=opteron -O2 -pipe  math.c
x86_64-pc-linux-gnu-gcc -c -Wall -march=opteron -O2 -pipe  memory.c
x86_64-pc-linux-gnu-gcc -c -Wall -march=opteron -O2 -pipe  misc.c
x86_64-pc-linux-gnu-gcc -c -Wall -march=opteron -O2 -pipe  options.c
x86_64-pc-linux-gnu-gcc -c -Wall -march=opteron -O2 -pipe  params.c
x86_64-pc-linux-gnu-gcc -c -Wall -march=opteron -O2 -pipe  path.c
x86_64-pc-linux-gnu-gcc -c -Wall -march=opteron -O2 -pipe  recovery.c
x86_64-pc-linux-gnu-gcc -c -Wall -march=opteron -O2 -pipe  rpp.c
x86_64-pc-linux-gnu-gcc -c -Wall -march=opteron -O2 -pipe  rules.c
x86_64-pc-linux-gnu-gcc -c -Wall -march=opteron -O2 -pipe  signals.c
x86_64-pc-linux-gnu-gcc -c -Wall -march=opteron -O2 -pipe  single.c
x86_64-pc-linux-gnu-gcc -c -Wall -march=opteron -O2 -pipe  status.c
x86_64-pc-linux-gnu-gcc -c -Wall -march=opteron -O2 -pipe  tty.c
x86_64-pc-linux-gnu-gcc -c -Wall -march=opteron -O2 -pipe  wordlist.c
x86_64-pc-linux-gnu-gcc -c -Wall -march=opteron -O2 -pipe  unshadow.c
x86_64-pc-linux-gnu-gcc -c -Wall -march=opteron -O2 -pipe  unafs.c
x86_64-pc-linux-gnu-gcc -c -Wall -march=opteron -O2 -pipe  undrop.c
x86_64-pc-linux-gnu-gcc -c -Wall -march=opteron -O2 -pipe  unique.c
x86_64-pc-linux-gnu-gcc -c x86-64.S
x86_64-pc-linux-gnu-gcc -lm DES_fmt.o DES_std.o DES_bs.o BSDI_fmt.o MD5_fmt.o MD5_std.o MD5_apache_fmt.o BFEgg_fmt.o BF_fmt.o BF_std.o AFS_fmt.o LM_fmt.o DOMINOSEC_fmt.o lotus5_fmt.o MYSQL_fmt.o KRB5_fmt.o KRB5_std.o md5_go.o rawMD5go_fmt.o PO_fmt.o md5.o IPB2_fmt.o rawSHA1_fmt.o NSLDAP_fmt.o sha1.o base64.o NT_fmt.o md4.o smbencrypt.o mscash_fmt.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 unshadow.o unafs.o undrop.o unique.o x86-64.o -o ../run/john -lcrypto -lssl
/usr/lib/gcc/x86_64-pc-linux-gnu/3.4.6/../../../../x86_64-pc-linux-gnu/bin/ld: x86-64.o: relocation R_X86_64_32S against `a local symbol' can not be used when making a shared object; recompile with -fPIC
x86-64.o: could not read symbols: Bad value
collect2: ld returned 1 exit status
make[1]: *** [../run/john] Error 1
make[1]: Leaving directory `/var/tmp/portage/app-crypt/johntheripper-1.7.2/work/john-1.7.2/src'
make: *** [linux-x86-64] Error 2

!!! ERROR: app-crypt/johntheripper-1.7.2 failed.
Call stack:
  ebuild.sh, line 1614:   Called dyn_compile
  ebuild.sh, line 971:   Called qa_call 'src_compile'
  environment, line 3215:   Called src_compile
  johntheripper-1.7.2.ebuild, line 62:   Called die

!!! Make failed
!!! If you need support, post the topmost build error, and the call stack if relevant.
Comment 1 Tony Vroon (RETIRED) gentoo-dev 2007-02-20 11:06:43 UTC
System info:
Portage 2.1.2-r9 (hardened/amd64, gcc-3.4.6, glibc-2.3.6-r5, 2.6.18-hardened x86_64)
=================================================================
System uname: 2.6.18-hardened x86_64 Dual-Core AMD Opteron(tm) Processor 2218
Gentoo Base System release 1.12.8
Timestamp of tree: Tue, 13 Feb 2007 00:20:01 +0000
dev-lang/python:     2.4.3-r4
dev-python/pycrypto: 2.0.1-r5
sys-apps/sandbox:    1.2.17
sys-devel/autoconf:  2.13, 2.60
sys-devel/automake:  1.4_p6, 1.5, 1.6.3, 1.7.9-r1, 1.8.5-r3, 1.9.6-r2, 1.10
sys-devel/binutils:  2.16.1-r3
sys-devel/gcc-config: 1.3.14
sys-devel/libtool:   1.5.22
virtual/os-headers:  2.6.17-r1
ACCEPT_KEYWORDS="amd64"
AUTOCLEAN="yes"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-march=opteron -O2 -pipe"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc"
CONFIG_PROTECT_MASK="/etc/env.d /etc/gconf /etc/terminfo"
CXXFLAGS="-march=opteron -O2 -pipe"
DISTDIR="/usr/portage/distfiles"
FEATURES="autoconfig distlocks metadata-transfer sandbox sfperms strict"
GENTOO_MIRRORS="http://distfiles.gentoo.org http://distro.ibiblio.org/pub/linux/distributions/gentoo"
LDFLAGS="-fPIC"
MAKEOPTS="-j4"
PKGDIR="/usr/portage/packages"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --delete-after --stats --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
SYNC="rsync://red.linx.net/gentoo-portage"
USE="amd64 apache2 bash-completion berkdb bzip2 calendar cli cracklib crypt elf expat gd hardened iconv imap innodb ipv6 jpeg justify lm_sensors mpm-prefork mysql ncurses nls no-old-linux nptl nptlonly pam pcre perl pic pie png posix postgres python readline sensord session sse sse2 ssl tokenizer truetype unicode urandom vhosts xml xml2 xmlrpc zlib" ALSA_PCM_PLUGINS="adpcm alaw asym copy dmix dshare dsnoop empty extplug file hooks iec958 ioplug ladspa lfloat linear meter mulaw multi null plug rate route share shm softvol" ELIBC="glibc" INPUT_DEVICES="mouse keyboard" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" USERLAND="GNU"
Unset:  CTARGET, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LANG, LC_ALL, LINGUAS, PORTAGE_RSYNC_EXTRA_OPTS, PORTDIR_OVERLAY
Comment 2 Tony Vroon (RETIRED) gentoo-dev 2007-02-20 11:09:13 UTC
LDFLAGS was set during debugging, now unset like it was before. (Made no difference)
Comment 3 Christian Heim (RETIRED) gentoo-dev 2007-02-20 21:14:32 UTC
Thanks to Tony this is fixed in CVS. Let me know if the `emake generic` is too much of a performance impact.
Comment 4 Tony Vroon (RETIRED) gentoo-dev 2007-11-16 12:15:04 UTC
Got unfixed in 1.7.2-r2 while it worked before.
Comment 5 Tony Vroon (RETIRED) gentoo-dev 2007-11-16 12:15:42 UTC
Please fix this again. Feel free to ping me on IRC or e-mail me if you need testing done on hardened/AMD64 or hardened/X86.
Comment 6 Alon Bar-Lev (RETIRED) gentoo-dev 2007-11-16 17:27:50 UTC
Now I understand why there was:
   elif use amd64 ; then
        emake ${OPTIONS} generic || die "Make failed"
   elif use amd64; then
        emake ${OPTIONS} linux-x86-64  || die "Make failed"

No comment, I thought it is a mistake.
But I don't think compiling this as generic is the correct solution.

This is strange as amd64 marked this as stable.

Let's solve this.
Comment 7 Alon Bar-Lev (RETIRED) gentoo-dev 2007-11-16 17:37:35 UTC
Can you please paste a new failure?
Just to make sure it is the same...
I don't understand why the -fPIC was not accepted for john linkage.
Thanks!
Comment 8 Tony Vroon (RETIRED) gentoo-dev 2007-11-16 17:38:01 UTC
(In reply to comment #6)
> No comment, I thought it is a mistake.

Please mark this section as required for compilation on hardened so this does not get removed. However, there should have been some mention of this bug in ChangeLog...

> But I don't think compiling this as generic is the correct solution.

All I want is for it to compile correctly on AMD64/hardened. It is the end result that matters to me, it is up to you what route you decide to follow to get there.

> This is strange as amd64 marked this as stable.

Then they did not test on hardened.

> Let's solve this.

As you have dismissed the fix that was originally applied I will be happy to test the fix you will apply instead.
Comment 9 Tony Vroon (RETIRED) gentoo-dev 2007-11-16 17:40:57 UTC
Created attachment 136097 [details]
Complete build log of app-crypt/johntheripper-1.7.2-r2

Portage 2.1.3.19 (hardened/amd64, gcc-3.4.6, glibc-2.6.1-r0, 2.6.23-hardened-r1 x86_64)
=================================================================
System uname: 2.6.23-hardened-r1 x86_64 Dual-Core AMD Opteron(tm) Processor 2218
Timestamp of tree: Fri, 16 Nov 2007 00:16:01 +0000
app-shells/bash:     3.2_p17
dev-lang/python:     2.4.4-r6
dev-python/pycrypto: 2.0.1-r6
sys-apps/baselayout: 1.12.9-r2
sys-apps/sandbox:    1.2.18.1-r2
sys-devel/autoconf:  2.61-r1
sys-devel/automake:  1.10
sys-devel/binutils:  2.18-r1
sys-devel/gcc-config: 1.3.16
sys-devel/libtool:   1.5.24
virtual/os-headers:  2.6.22-r2
ACCEPT_KEYWORDS="amd64"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-march=opteron -O2 -pipe"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc"
CONFIG_PROTECT_MASK="/etc/env.d /etc/gconf /etc/revdep-rebuild /etc/terminfo /etc/udev/rules.d"
CXXFLAGS="-march=opteron -O2 -pipe"
DISTDIR="/usr/portage/distfiles"
FEATURES="distlocks metadata-transfer sandbox sfperms strict unmerge-orphans userfetch"
GENTOO_MIRRORS="http://distfiles.gentoo.org http://distro.ibiblio.org/pub/linux/distributions/gentoo"
LANG="en_GB.UTF-8"
LC_ALL="en_GB.UTF-8"
MAKEOPTS="-j4"
PKGDIR="/usr/portage/packages"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --delete-after --stats --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages --filter=H_**/files/digest-*"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
SYNC="rsync://red.linx.net/gentoo-portage"
USE="amd64 berkdb cracklib crypt hardened hpn ipv6 justify midi ncurses nls no-old-linux nptl nptlonly pam perl pic python readline sse2 ssl tcpd unicode urandom xorg zlib" ALSA_CARDS="ali5451 als4000 atiixp atiixp-modem bt87x ca0106 cmipci emu10k1x ens1370 ens1371 es1938 es1968 fm801 hda-intel intel8x0 intel8x0m maestro3 trident usb-audio via82xx via82xx-modem ymfpci" ALSA_PCM_PLUGINS="adpcm alaw asym copy dmix dshare dsnoop empty extplug file hooks iec958 ioplug ladspa lfloat linear meter mulaw multi null plug rate route share shm softvol" ELIBC="glibc" INPUT_DEVICES="mouse keyboard" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" USERLAND="GNU" VIDEO_CARDS="apm ark chips cirrus cyrix dummy fbdev glint i128 i810 mach64 mga neomagic nv r128 radeon rendition s3 s3virge savage siliconmotion sis sisusb tdfx tga trident tseng v4l vesa vga via vmware voodoo"
Unset:  CPPFLAGS, CTARGET, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LDFLAGS, LINGUAS, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS, PORTDIR_OVERLAY
Comment 10 Alon Bar-Lev (RETIRED) gentoo-dev 2007-11-16 18:11:22 UTC
Created attachment 136099 [details, diff]
johntheripper-1.7.2-pic.patch

Can you please test this patch?
Comment 11 Alon Bar-Lev (RETIRED) gentoo-dev 2007-11-17 15:57:07 UTC
Created attachment 136176 [details]
Makefile

I don't understand why this happens...
Can you please try to reproduce this, I attach a template.
Thanks.
Comment 12 Alon Bar-Lev (RETIRED) gentoo-dev 2007-11-17 15:57:32 UTC
Created attachment 136177 [details]
a1.c
Comment 13 Alon Bar-Lev (RETIRED) gentoo-dev 2007-11-17 15:57:53 UTC
Created attachment 136178 [details]
a2.S
Comment 14 Alon Bar-Lev (RETIRED) gentoo-dev 2007-11-20 06:17:01 UTC
Tony?
Comment 15 Tony Vroon (RETIRED) gentoo-dev 2007-11-20 09:51:31 UTC
(In reply to comment #14)
> Tony?

If you are not available on IRC to coordinate the issue as it happens, delays are incurred. You'll have to wait until I am around AMD64 hardened kit again, which will be tomorrow.
Yesterday and today I am at a conference where I can not be disturbed.
Comment 16 Jens Pranaitis 2007-11-22 20:41:09 UTC
Portage 2.1.3.19 (hardened/amd64/multilib, gcc-3.4.6, glibc-2.6.1-r0, 2.6.22-hardened-r8 x86_64)
=================================================================
System uname: 2.6.22-hardened-r8 x86_64 AMD Athlon(tm) 64 X2 Dual Core Processor 5600+
Timestamp of tree: Wed, 21 Nov 2007 16:46:01 +0000
app-shells/bash:     3.2_p17
dev-java/java-config: 1.3.7, 2.0.33-r1
dev-lang/python:     2.4.4-r6
dev-python/pycrypto: 2.0.1-r6
sys-apps/baselayout: 1.12.9-r2
sys-apps/sandbox:    1.2.18.1-r2
sys-devel/autoconf:  2.61-r1
sys-devel/automake:  1.5, 1.7.9-r1, 1.9.6-r2, 1.10
sys-devel/binutils:  2.18-r1
sys-devel/gcc-config: 1.3.16
sys-devel/libtool:   1.5.24
virtual/os-headers:  2.6.22-r2
ACCEPT_KEYWORDS="amd64"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-march=athlon64 -O2 -pipe"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /opt/openfire/resources/security/"
CONFIG_PROTECT_MASK="/etc/env.d /etc/env.d/java/ /etc/fonts/fonts.conf /etc/gconf /etc/php/apache2-php5/ext-active/ /etc/php/cgi-php5/ext-active/ /etc/php/cli-php5/ext-active/ /etc/revdep-rebuild /etc/terminfo /etc/udev/rules.d"
CXXFLAGS="-march=athlon64 -O2 -pipe"
DISTDIR="/usr/portage/distfiles"
FEATURES="autoconfig distlocks metadata-transfer noinfo parallel-fetch sandbox sfperms strict unmerge-orphans userfetch"
GENTOO_MIRRORS="http://linux.rz.ruhr-uni-bochum.de/download/gentoo-mirror/ http://ftp-stud.fht-esslingen.de/pub/Mirrors/gentoo/"
LC_ALL="en_US.UTF-8"
MAKEOPTS="-j3"
PKGDIR="/usr/portage/packages"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --delete-after --stats --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages --filter=H_**/files/digest-*"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
SYNC="rsync://rsync.europe.gentoo.org/gentoo-portage"
USE="7zip aim amd64 authdaemond bash-completion berkdb bitmap-fonts bzip2 caps cgi chroot cli cracklib crypt cscope ctype curl curlwrappers dynamicplugin encode expat fam fastcgi flatfile ftp gd gdbm geoip gif gnutls gpgme hardened iconv idn imagemagick imap iproute2 ipv6 ithreads jpeg jpeg2k kqemu libg++ libwww lighttpd logrotate maildir mailwrapper mime mng mudflap mysql ncurses nls nptl nptlonly ntlm offensive ogg pam pcre pdf perl php pic png pop python readline reflection rrdtool ruby sasl session slang smime smtp snmp socks5 spell spl sse sse2 ssl svg sysfs tcpd theora threads tidy tiff tordns truetype truetype-fonts type1-fonts unicode userlocales vhosts vim x264 xml xvid zip zlib" ALSA_CARDS="ali5451 als4000 atiixp atiixp-modem bt87x ca0106 cmipci emu10k1x  ens1370 ens1371 es1938 es1968 fm801 hda-intel intel8x0 intel8x0m maestro3       trident usb-audio via82xx via82xx-modem ymfpci" ALSA_PCM_PLUGINS="adpcm alaw asym copy dmix dshare dsnoop empty extplug file hooks iec958 ioplug ladspa lfloat linear meter mulaw multi null plug rate route share shm softvol" ELIBC="glibc" INPUT_DEVICES="mouse keyboard" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" USERLAND="GNU" VIDEO_CARDS="apm ark chips cirrus cyrix dummy fbdev glint i128 i810 mach64       mga neomagic nv r128 radeon rendition s3 s3virge savage siliconmotion sis       sisusb tdfx tga trident tseng v4l vesa vga via vmware voodoo"
Unset:  CPPFLAGS, CTARGET, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LANG, LDFLAGS, LINGUAS, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS, PORTDIR_OVERLAY




I'd like to help you fix this issue, but I have no idea what I'm supposed to do with the files you attached, if you have some time to explain I'd really like to help.
Comment 17 Alon Bar-Lev (RETIRED) gentoo-dev 2007-11-22 21:10:47 UTC
Download Makefile, a1.c, a2.S and put them in specific directory, then try to build this by using the "make" command.
Comment 18 Jens Pranaitis 2007-11-22 21:26:31 UTC
Your application worked:
Hello world! 1234

It's fairly late here right now, I can do some more testing tomorrow.
Comment 19 Tony Vroon (RETIRED) gentoo-dev 2007-11-23 15:35:49 UTC
Created attachment 136773 [details]
johntheripper-with-asflags.buildlog.txt

While the flag is respected (as visible in the build output), the linking error remains.
Comment 20 Alon Bar-Lev (RETIRED) gentoo-dev 2007-11-24 06:45:03 UTC
Hello hardened and expert vapier!

I wish to understand the root cause of this, it happens only on hardened profile, and I don't understand exactly how or able to reproduce it in order to solve it my-self.
Have you fix this kind of issue in the past?

For some strange reason the assember output cannot be read by the linker.

Thanks!
Comment 21 SpanKY gentoo-dev 2007-11-28 10:05:23 UTC
it's because the hardened toolchain produces PIEs by default which means all object code is compiled as PIC

the x86-64.S is clearly not PIC thus the failure

it's hard to say the x86-64.S code is wrong considering johntheripper is not designed (nor does it really make sense from a security point of view) to be compiled as PIC

i'd just disable PIE building in the ebuild and call it a day
Comment 22 Alon Bar-Lev (RETIRED) gentoo-dev 2007-11-28 11:05:43 UTC
Thanks for the reply!

Tony: can you please give it a try with CFLAGS="-nopie"?

vapier: Do I append -nopie flag if gcc-specs-pie?
Comment 23 Tony Vroon (RETIRED) gentoo-dev 2007-11-28 11:35:04 UTC
(In reply to comment #22)
> Tony: can you please give it a try with CFLAGS="-nopie"?

Your strip-flags statement prevents this from being specified.
Comment 24 Tony Vroon (RETIRED) gentoo-dev 2007-11-28 11:39:43 UTC
Created attachment 137212 [details]
johntheripper-nopie.buildlog.txt
Comment 25 Alon Bar-Lev (RETIRED) gentoo-dev 2007-11-28 12:05:57 UTC
Can you please hardcode add this to CFLAGS at src_compile()?
If it works for you I will add a permanent fix.
Comment 26 Tony Vroon (RETIRED) gentoo-dev 2007-11-28 12:21:31 UTC
I did that. Please see the attachment. It failed to resolve the issue, although the error message did change.
Comment 27 Alon Bar-Lev (RETIRED) gentoo-dev 2007-11-28 13:35:15 UTC
I guess you should add this to LDFLAGS as well/only, and even maybe to ASFLAGS.
Comment 28 solar (RETIRED) gentoo-dev 2007-11-28 14:38:26 UTC
due the nature of jtr.. I would also disable any ssp if detected. 
(append -fno-stack-protector)
Comment 29 SpanKY gentoo-dev 2007-12-03 00:24:28 UTC
i would use these lines:
    use custom-cflags || strip-flags
    append-flags -fno-PIC -fno-PIE
    append-ldflags -nopie

while it's true SSP wont generally add the system safer, it would catch bad code that should get fixed anyways ...

also, that huge OPTIONS line makes me want to kill myself ... please consider fixing the Makefile instead
Comment 30 Alon Bar-Lev (RETIRED) gentoo-dev 2007-12-08 10:45:32 UTC
Created attachment 138004 [details, diff]
johntheripper-1.7.2-r2.ebuild.diff

vapier, thanks!
It seems that the ld ignores (with a warning) the unknown flags at my system... So no need to detect hardened profile.

Tony, can you please see if it solves the issue for you?
Comment 31 Alon Bar-Lev (RETIRED) gentoo-dev 2007-12-14 08:37:33 UTC
Reopen when you have some time to work on this.
Thanks!
Comment 32 SpanKY gentoo-dev 2007-12-14 19:15:38 UTC
that should work fine
Comment 33 Alon Bar-Lev (RETIRED) gentoo-dev 2007-12-14 19:33:37 UTC
Thanks!