Rebuilding johntheripper after upgrading to glibc-2.4 fails as follows; this probably should be patched to CLOCKS_PER_SEC? #emerge johntheripper [snip] x86_64-pc-linux-gnu-gcc -c -Wall -march=athlon64 -O3 -ftracer -pipe bench.c bench.c: In function `benchmark_cps': bench.c:177: error: `CLK_TCK' undeclared (first use in this function) bench.c:177: error: (Each undeclared identifier is reported only once bench.c:177: error: for each function it appears in.) make[1]: *** [bench.o] Error 1 make[1]: Leaving directory `/var/tmp/portage/johntheripper-1.6.40/work/john-1.6.40/src' make: *** [linux-x86-64] Error 2 !!! ERROR: app-crypt/johntheripper-1.6.40 failed. Call stack: ebuild.sh, line 1557: Called dyn_compile ebuild.sh, line 966: Called src_compile !!! Make failed !!! If you need support, post the topmost build error, and the call stack if relevant. #emerge --info Portage 2.1_pre6-r2 (default-linux/amd64/2006.0, gcc-3.4.5, glibc-2.4-r0, 2.6.15-gentoo-r7 x86_64) ================================================================= System uname: 2.6.15-gentoo-r7 x86_64 AMD Athlon(tm) 64 Processor 3500+ Gentoo Base System version 1.12.0_pre16 dev-lang/python: 2.4.2-r1 sys-apps/sandbox: 1.2.17 sys-devel/autoconf: 2.13, 2.59-r7 sys-devel/automake: 1.4_p6, 1.5, 1.6.3, 1.7.9-r1, 1.8.5-r3, 1.9.6-r1 sys-devel/binutils: 2.16.1-r2 sys-devel/libtool: 1.5.22 virtual/os-headers: 2.6.11-r3 ACCEPT_KEYWORDS="amd64 ~amd64" AUTOCLEAN="yes" CBUILD="x86_64-pc-linux-gnu" CFLAGS="-march=athlon64 -O3 -ftracer -pipe" CHOST="x86_64-pc-linux-gnu" CONFIG_PROTECT="/etc /usr/kde/2/share/config /usr/kde/3.5/env /usr/kde/3.5/share/config /usr/kde/3.5/shutdown /usr/kde/3/share/config /usr/lib/X11/xkb /usr/share/config /var/qmail/control" CONFIG_PROTECT_MASK="/etc/gconf /etc/revdep-rebuild /etc/splash /etc/terminfo /etc/env.d" CXXFLAGS="-march=athlon64 -O3 -ftracer -pipe" DISTDIR="/usr/portage/distfiles" FEATURES="autoconfig distlocks metadata-transfer nostrip sfperms strict" GENTOO_MIRRORS="http://bower/gentoo ftp://ftp.iinet.com.au/pub/Gentoo ftp://ftp.swin.edu.au/gentoo http://distfiles.gentoo.org/" LANG="en_AU" LC_ALL="en_AU" PKGDIR="/usr/portage/packages" PORTAGE_TMPDIR="/var/tmp" PORTDIR="/usr/portage" SYNC="rsync://bower/gentoo-portage" USE="amd64 X a52 aac alsa arts audiofile bash-completion berkdb bitmap-fonts bzip2 bzlib cdparanoia cdr cdrom chroot crypt cups curl dpms dri dts dv dvb dvd dvdr dvdread eds emboss encode exif expat fame fbcon ffmpeg flac foomaticdb fortran gdbm gif gimpprint gpm gps gstreamer gtk gtk2 hal idn ieee1394 imagemagick imap imlib ipv6 jack java jpeg jpeg2k junit kde lcms lirc lm_sensors lzo lzw lzw-tiff mad mmap mng mp3 mpeg mpeg4 musepack musicbrainz ncurses nls nptl nptlonly nvidia ogg oggvorbis openal opengl pam pda pdflib perl pic png ppds python qt quicktime readline real sdk sdl slang sndfile speex spell sqlite ssl svg tcpd test theora threads tiff truetype truetype-fonts type1-fonts usb userlocales vcd vorbis wmf xcomposite xml xml2 xpm xprint xscreensaver xv xvid xvmc yv12 zlib elibc_glibc kernel_linux userland_GNU video_cards_nvidia" Unset: ASFLAGS, CTARGET, EMERGE_DEFAULT_OPTS, LDFLAGS, LINGUAS, MAKEOPTS, PORTDIR_OVERLAY
Created attachment 82412 [details, diff] changes CLK_TCK to CLOCKS_PER_SEC works for me - glibc-2.4 gcc-4.1.0...
A less invasive patch would be to modify the ebuild CFLAGS editing to include -DCLK_TCK=CLOCKS_PER_SEC: sed -i -e "s|^CFLAGS.*|CFLAGS= -c -Wall -DCLK_TCK=CLOCKS_PER_SEC ${CFLAGS}|" \ Another thing I noticed is that the with amd64 mmx use flag the ebuild runs linux-x86-64-mmx target which is documented in the makefile to create a 32bit binary ("Linux, AMD x86-64, 32-bit with MMX"). I do not think the mmx is an allowed use flag for amd64, but still it would be good to remove testing for it in the amd64 case.
I can confirm that Michaels patch works. Although Mikkos solution sounds cleaner to me (haven't tried)
I did the same thing as Michael and got it working. To me, patching the source code (i.e. fixing the REAL problem) seems to me to be the best solution as long as it doesn't break portability. Hacks that muck around with the compile options are really far dirtier than a good solid diff. Michael -- have you submitted this upstream?
(In reply to comment #4) > > Michael -- have you submitted this upstream? > No I haven't. It's a rather trivial patch. But if you think it should be sent upstream, feel free to do it. cheers, Michael
fixed and sorry for the delay. I was on leave. Thanks for the patch too. It didn't break on x86 so I'm hoping its happy. I'll version bump to 1.7.0.* when I get a few hours free.
*** Bug 143932 has been marked as a duplicate of this bug. ***
This CLK_TCK patch is only applied to not stable versions (1.6.40 and later, they are all ~x86 masked) Is there any reason to not being applied to the stable version (1.6) ?
(In reply to comment #8) > This CLK_TCK patch is only applied to not stable versions (1.6.40 and later, > they are all ~x86 masked) > Is there any reason to not being applied to the stable version (1.6) ? > See Bug 147027.