Problem: Although eautoreconf is ran from the ebuild, ./unix/configure is sometimes not rebuilt from ./unix/configure.in, so the fontconfig/freetype underlinking fix in the ebuild does not get into ./unix/configure, causing build failures when I use ld.gold. On my pretty fast computer with /var/tmp/portage on tmpfs, the chance of the failure is around 70%. I suspect the problem is related to timing. This may not actually a problem of dev-lang/tk, but I'm only seen it happening on the ebuild. Details: 1. I upgraded @world, as usual, yesterday, when I found dev-lang/tk-8.5.13 didn't build, with many error messages like "undefined reference to 'FcPatternGetInteger'". 2. As I'm using ld.gold, my first impression is there's a underlying issue in the software. Build logs shows it uses -lXft when linking but lacks -lfontconfig. 3. When I looked at the ebuild, I found it already modifies configure.in then run eautoreconf to correct the underlinking problem. 4. I looked at the build directory. Surprisingly I found ./unix/configure.in has been updated with the fix of the underlinking issue, but ./unix/configure wasn't rebuilt correctly. 5. As it only happens sometimes (70% chance here?), and I have a pretty fast/costly computer, with /var/tmp/portage on tmpfs, the first thing I suspect is timestamps. So I inserted a `stat unix/configure*` call into the build, before the eautoconf part started running. I found no significant difference between the stat output when the configure script is correctly rebuilt and when it isn't. When it fails: ---- * Applying tk-8.5.10-conf.patch ... [ ok ] * Applying tcl-8.5.9-gentoo-fbsd.patch ... [ ok ] File: ‘unix/configure’ Size: 360668 Blocks: 712 IO Block: 4096 regular file Device: 10h/16d Inode: 202101 Links: 1 Access: (0755/-rwxr-xr-x) Uid: ( 250/ portage) Gid: ( 250/ portage) Access: 2012-12-01 09:57:24.610517627 +0800 Modify: 2012-12-01 09:57:24.610517627 +0800 Change: 2012-12-01 09:57:24.610517627 +0800 Birth: - File: ‘unix/configure.in’ Size: 31620 Blocks: 64 IO Block: 4096 regular file Device: 10h/16d Inode: 202782 Links: 1 Access: (0755/-rwxr-xr-x) Uid: ( 250/ portage) Gid: ( 250/ portage) Access: 2012-12-01 09:57:24.630517634 +0800 Modify: 2012-12-01 09:57:24.630517634 +0800 Change: 2012-12-01 09:57:24.630517634 +0800 Birth: - * Running eautoreconf in '/var/tmp/portage/dev-lang/tk-8.5.13/work/tk8.5.13/unix' ... * Running autoconf ... [ ok ] * Running autoheader ... [ !! ] ... x86_64-pc-linux-gnu-gcc -shared -O2 -O2 -pipe -march=native -pipe -Wl,-O1 -Wl,--as-needed -Wl,--export-dynamic -o libtk8.5.so tk3d.o tkArgv.o tkAtom.o tkBind.o tkBitmap.o tkClipboard.o tkCmds.o tkColor.o tkConfig.o tkConsole.o tkCursor.o tkError.o tkEvent.o tkFocus.o tkFont.o tkGet.o tkGC.o tkGeometry.o tkGrab.o tkGrid.o tkMain.o tkObj.o tkOldConfig.o tkOption.o tkPack.o tkPlace.o tkSelect.o tkStyle.o tkUndo.o tkUtil.o tkVisual.o tkWindow.o tkButton.o tkEntry.o tkFrame.o tkListbox.o tkMenu.o tkMenubutton.o tkMenuDraw.o tkMessage.o tkPanedWindow.o tkScale.o tkScrollbar.o tkCanvas.o tkCanvArc.o tkCanvBmap.o tkCanvImg.o tkCanvLine.o tkCanvPoly.o tkCanvPs.o tkCanvText.o tkCanvUtil.o tkCanvWind.o tkRectOval.o tkTrig.o tkImage.o tkImgBmap.o tkImgGIF.o tkImgPPM.o tkImgPhoto.o tkText.o tkTextBTree.o tkTextDisp.o tkTextImage.o tkTextIndex.o tkTextMark.o tkTextTag.o tkTextWind.o tkStubInit.o tkStubLib.o ttkBlink.o ttkButton.o ttkCache.o ttkClamTheme.o ttkClassicTheme.o ttkDefaultTheme.o ttkElements.o ttkEntry.o ttkFrame.o ttkImage.o ttkInit.o ttkLabel.o ttkLayout.o ttkManager.o ttkNotebook.o ttkPanedwindow.o ttkProgress.o ttkScale.o ttkScrollbar.o ttkScroll.o ttkSeparator.o ttkSquare.o ttkState.o ttkTagSet.o ttkTheme.o ttkTrace.o ttkTrack.o ttkTreeview.o ttkWidget.o ttkStubInit.o tkUnix.o tkUnix3d.o tkUnixButton.o tkUnixColor.o tkUnixConfig.o tkUnixCursor.o tkUnixDraw.o tkUnixEmbed.o tkUnixEvent.o tkUnixFocus.o tkUnixRFont.o tkUnixInit.o tkUnixKey.o tkUnixMenu.o tkUnixMenubu.o tkUnixScale.o tkUnixScrlbr.o tkUnixSelect.o tkUnixSend.o tkUnixWm.o tkUnixXId.o -lXft -lX11 -ldl -lieee -lm -ltclstub8.5 -Wl,-rpath,/usr/lib64 x86_64-pc-linux-gnu-gcc -O2 -O2 -pipe -march=native -pipe -Wl,-O1 -Wl,--as-needed -Wl,--export-dynamic tkAppInit.o -L/var/tmp/portage/dev-lang/tk-8.5.13/work/tk8.5.13/unix -ltk8.5 -ltcl8.5 -lXft -lX11 -ldl -lieee -lm \ -Wl,-rpath,/usr/lib64 -o wish /var/tmp/portage/dev-lang/tk-8.5.13/work/tk8.5.13/unix/libtk8.5.so: error: undefined reference to 'FcCharSetHasChar' /var/tmp/portage/dev-lang/tk-8.5.13/work/tk8.5.13/unix/libtk8.5.so: error: undefined reference to 'FcFontRenderPrepare' /var/tmp/portage/dev-lang/tk-8.5.13/work/tk8.5.13/unix/libtk8.5.so: error: undefined reference to 'FcCharSetDestroy' /var/tmp/portage/dev-lang/tk-8.5.13/work/tk8.5.13/unix/libtk8.5.so: error: undefined reference to 'FcPatternDestroy' /var/tmp/portage/dev-lang/tk-8.5.13/work/tk8.5.13/unix/libtk8.5.so: error: undefined reference to 'FcFontSetDestroy' /var/tmp/portage/dev-lang/tk-8.5.13/work/tk8.5.13/unix/libtk8.5.so: error: undefined reference to 'FcPatternGetString' /var/tmp/portage/dev-lang/tk-8.5.13/work/tk8.5.13/unix/libtk8.5.so: error: undefined reference to 'FcPatternGetDouble' /var/tmp/portage/dev-lang/tk-8.5.13/work/tk8.5.13/unix/libtk8.5.so: error: undefined reference to 'FcPatternGetInteger' /var/tmp/portage/dev-lang/tk-8.5.13/work/tk8.5.13/unix/libtk8.5.so: error: undefined reference to 'FcConfigSubstitute' /var/tmp/portage/dev-lang/tk-8.5.13/work/tk8.5.13/unix/libtk8.5.so: error: undefined reference to 'FcFontSort' /var/tmp/portage/dev-lang/tk-8.5.13/work/tk8.5.13/unix/libtk8.5.so: error: undefined reference to 'FcPatternGetCharSet' /var/tmp/portage/dev-lang/tk-8.5.13/work/tk8.5.13/unix/libtk8.5.so: error: undefined reference to 'FcCharSetCopy' /var/tmp/portage/dev-lang/tk-8.5.13/work/tk8.5.13/unix/libtk8.5.so: error: undefined reference to 'FcPatternCreate' /var/tmp/portage/dev-lang/tk-8.5.13/work/tk8.5.13/unix/libtk8.5.so: error: undefined reference to 'FcPatternAddString' /var/tmp/portage/dev-lang/tk-8.5.13/work/tk8.5.13/unix/libtk8.5.so: error: undefined reference to 'FcPatternAddDouble' /var/tmp/portage/dev-lang/tk-8.5.13/work/tk8.5.13/unix/libtk8.5.so: error: undefined reference to 'FcPatternAddInteger' /var/tmp/portage/dev-lang/tk-8.5.13/work/tk8.5.13/unix/libtk8.5.so: error: undefined reference to 'FcPatternAddBool' /var/tmp/portage/dev-lang/tk-8.5.13/work/tk8.5.13/unix/libtk8.5.so: error: undefined reference to 'FcUtf8ToUcs4' collect2: error: ld returned 1 exit status make: *** [wish] Error 1 ---- When it works: ---- ... * Adjusting to prefix / * Makefile.in ... [ ok ] * Applying tk-8.5.10-conf.patch ... [ ok ] * Applying tcl-8.5.9-gentoo-fbsd.patch ... [ ok ] File: ‘unix/configure’ Size: 360668 Blocks: 712 IO Block: 4096 regular file Device: 10h/16d Inode: 211289 Links: 1 Access: (0755/-rwxr-xr-x) Uid: ( 250/ portage) Gid: ( 250/ portage) Access: 2012-12-01 09:59:36.820529898 +0800 Modify: 2012-12-01 09:59:36.820529898 +0800 Change: 2012-12-01 09:59:36.820529898 +0800 Birth: - File: ‘unix/configure.in’ Size: 31620 Blocks: 64 IO Block: 4096 regular file Device: 10h/16d Inode: 211305 Links: 1 Access: (0755/-rwxr-xr-x) Uid: ( 250/ portage) Gid: ( 250/ portage) Access: 2012-12-01 09:59:36.840529898 +0800 Modify: 2012-12-01 09:59:36.840529898 +0800 Change: 2012-12-01 09:59:36.840529898 +0800 Birth: - * Running eautoreconf in '/var/tmp/portage/dev-lang/tk-8.5.13/work/tk8.5.13/unix' ... * Running autoconf ... [ ok ] * Running autoheader ... [ !! ] ... ---- My knowledge about autoconf is close to none, and I'm totally lost now. My workaround: My temporary workaround is to drop ./unix/configure before running eautoreconf, to make sure it always gets rebuilt. I will shortly attach the build logs. Reproducible: Sometimes Steps to Reproduce: 1. Use ld.gold instead of ld.bfd to expose underlinking problems. 2. emerge '=dev-lang/tk-8.5.13' 3. Actual Results: Sometimes (70% chance here), ./unix/configure.in contains the fix of the underlying problem, ./unix/configure isn't updated (its modification time is smaller than ./unix/configure.in.) It doesn't build, with tons of "undefined reference" errors to fontconfig functions. Expected Results: ./unix/configure should always be rebuilt from ./unix/configure.in (I use the LD_ALTEXEC patch to run ld.gold indirectly, so it shows as "GNU ld" while I'm in fact using "GNU gold (GNU Binutils 2.23.1) 1.11".) Portage 2.2.0_alpha143 (default/linux/amd64/10.0/desktop, gcc-4.7.2, glibc-2.16.0, 3.6.9-pf x86_64) ================================================================= System uname: Linux-3.6.9-pf-x86_64-Intel-R-_Core-TM-_i7-3770K_CPU_@_3.50GHz-with-gentoo-2.2 Timestamp of tree: Fri, 30 Nov 2012 23:15:01 +0000 ld GNU ld (GNU Binutils) 2.23.1 app-shells/bash: 4.2_p39 dev-java/java-config: 2.1.12 dev-lang/python: 2.7.3-r2, 3.2.3-r1 dev-util/cmake: 2.8.10.2 dev-util/pkgconfig: 0.27.1 sys-apps/baselayout: 2.2 sys-apps/openrc: 0.11.6 sys-apps/sandbox: 2.6 sys-devel/autoconf: 2.13, 2.69 sys-devel/automake: 1.9.6-r3, 1.11.6, 1.12.5 sys-devel/binutils: 2.23.1 sys-devel/gcc: 4.7.2 sys-devel/gcc-config: 1.8 sys-devel/libtool: 2.4.2 sys-devel/make: 3.82-r4 sys-kernel/linux-headers: 3.6 (virtual/os-headers) sys-libs/glibc: 2.16.0 Repositories: gentoo sunrise mysql local_overlay ACCEPT_KEYWORDS="amd64 ~amd64" ACCEPT_LICENSE="*" CBUILD="x86_64-pc-linux-gnu" CFLAGS="-O2 -pipe -march=native" CHOST="x86_64-pc-linux-gnu" CONFIG_PROTECT="/etc /usr/share/config /usr/share/gnupg/qualified.txt /usr/share/openvpn/easy-rsa" CONFIG_PROTECT_MASK="${EPREFIX}/etc/gconf /etc/ca-certificates.conf /etc/dconf /etc/env.d /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/php/apache2-php5.4/ext-active/ /etc/php/cgi-php5.4/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 -pipe -march=native" DISTDIR="/usr/portage/distfiles" FCFLAGS="-O2 -pipe" FEATURES="assume-digests binpkg-logs buildsyspkg config-protect-if-modified distlocks ebuild-locks fixlafiles force-mirror merge-sync news parallel-fetch preserve-libs protect-owned sandbox sfperms strict unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv" FFLAGS="-O2 -pipe" GENTOO_MIRRORS="http://mirrors.163.com/gentoo/ http://mirrors.sohu.com/gentoo/ http://mirrors.stuhome.net/gentoo/ http://mirrors.xmu.edu.cn/gentoo" LANG="en_US.UTF-8" LDFLAGS="-Wl,-O1 -Wl,--as-needed" LINGUAS="en en_US" MAKEOPTS="-j9" PKGDIR="/usr/portage/packages" PORTAGE_COMPRESS="xz" PORTAGE_CONFIGROOT="/" 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/sunrise /var/lib/layman/mysql /usr/local/portage" SYNC="rsync://rsync.cn.gentoo.org/gentoo-portage" USE="X a52 aac acl acpi alsa amd64 berkdb branding bzip2 cairo caps cdda cdr cjk cli consolekit cracklib crypt cups custom-cflags cxx dbus dri dts dvd dvdr emboss encode exif fam ffmpeg firefox flac fontconfig gdbm gif gpm gtk gtk3 gtkstyle hardened iconv icu iproute2 jpeg lcms libnotify mad mmx mng modules mp3 mp4 mpeg mudflap multilib ncurses nls nptl nvidia ogg opengl openmp optimization optimized-qmake pam pango pcre pdf png ppds pppd qt3support readline sdl session smp spell sse sse2 sse4_1 sse4_2 ssl ssse3 startup-notification svg system-sqlite tcpd truetype udev unicode upower usb vdpau vim-syntax vorbis wxwidgets x264 xcb xft xml xv xvid zlib zsh-completion" 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 mmap_emul mulaw multi null plug rate route share shm softvol" APACHE2_MODULES="authn_core authz_core socache_shmcb unixd actions alias auth_basic authn_alias authn_anon authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache cgi cgid dav dav_fs dav_lock deflate dir disk_cache env expires ext_filter file_cache filter headers include info log_config logio mem_cache mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias" CALLIGRA_FEATURES="kexi words flow plan sheets stage tables krita karbon braindump" CAMERAS="ptp2" 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" GRUB_PLATFORMS="efi-64 pc" INPUT_DEVICES="evdev" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer" LINGUAS="en en_US" PHP_TARGETS="php5-4" PYTHON_SINGLE_TARGET="python2_7" PYTHON_TARGETS="python2_7 python3_2" RUBY_TARGETS="ruby19" USERLAND="GNU" VIDEO_CARDS="nvidia intel" 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_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS, USE_PYTHON
Created attachment 331106 [details] build-failing.log Build log when it fails.
Created attachment 331108 [details] build-working.log Build log when it works correctly.
So, basically the problem lies in tcl-8.5_alpha6-multilib.patch.
(In reply to comment #3) > So, basically the problem lies in tcl-8.5_alpha6-multilib.patch. Hmm, yeah, it's a bit weird that tk-8.4.11-multilib.patch modifies both ./unix/configure and ./unix/configure.in, but can't there be a more reliable solution, like dropping ./unix/configure before running autoconf, either in the ebuild or in autotools.eclass? Also, I couldn't understand why when the difference in modification time of those two files is always around 0.02 second, it sometimes works but sometimes fails.
I am also using tmpfs but never see such problems. anyways, I will drop the modification from configure so that the timestamp keeps to be old.
+ 05 Dec 2012; Justin Lecher <jlec@gentoo.org> tk-8.5.13.ebuild, + +files/tk-8.5.13-multilib.patch: + Avoid problems with autotools by only modifying configure.in, #445432 +