Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 515242 - dev-libs/cdk-5.0.20140118: uses system-wide libtool
Summary: dev-libs/cdk-5.0.20140118: uses system-wide libtool
Status: RESOLVED OBSOLETE
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal enhancement (vote)
Assignee: No maintainer - Look at https://wiki.gentoo.org/wiki/Project:Proxy_Maintainers if you want to take care of it
URL: http://lists.gnu.org/archive/html/bug...
Whiteboard:
Keywords:
: 778785 (view as bug list)
Depends on:
Blocks: rlibtool
  Show dependency tree
 
Reported: 2014-06-26 21:26 UTC by Michał Górny
Modified: 2022-06-18 00:19 UTC (History)
3 users (show)

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


Attachments
Build log (dev-libs:cdk-5.0.20140118:20140626-210329.log,53.99 KB, text/x-log)
2014-06-26 21:27 UTC, Michał Górny
Details
Example proof-of-concept ebuild diff (cdk-5.0.20140118.ebuild.diff,7.75 KB, patch)
2014-06-26 22:38 UTC, Michał Górny
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2014-06-26 21:26:12 UTC
Long story short:

libtool --tag=CC  --mode=link x86_64-pc-linux-gnu-gcc-4.8.3 [...]
                                                      ^^^^^
/usr/bin/libtool: line 8979: x86_64-pc-linux-gnu-gcc-4.8.2: command not found
                                                     ^^^^^

I've reported that against libtool and were told you aren't supposed to use system-wide libtool copy (see bug #515054). Instead, the package is supposed to generate its own libtool using configure check results. Somehow.

I'm not sure if it's possible to fix this without replacing the ugly custom macro with regular libtool macros in configure.in.


emerge --info libtool:

Portage 2.2.10 (default/linux/amd64/13.0/desktop, gcc-4.8.3, glibc-2.19-r1, 3.15.0-pf1-mgorny-amd64+ x86_64)
=================================================================
                        System Settings
=================================================================
System uname: Linux-3.15.0-pf1-mgorny-amd64+-x86_64-AMD_Athlon-tm-_64_X2_Dual_Core_Processor_3800+-with-gentoo-2.2
KiB Mem:     4048580 total,    161772 free
KiB Swap:    1502072 total,   1489440 free
Timestamp of tree: Wed, 25 Jun 2014 06:00:01 +0000
ld GNU ld (GNU Binutils) 2.24
distcc 3.2rc1 x86_64-pc-linux-gnu [enabled]
ccache version 3.1.9 [disabled]
app-shells/bash:          4.2_p47
dev-java/java-config:     2.2.0
dev-lang/python:          2.7.6-r1, 3.2.5-r4, 3.3.5, 3.4.0
dev-util/ccache:          3.1.9-r3
dev-util/cmake:           2.8.12.2-r1
dev-util/pkgconfig:       0.28-r1
sys-apps/baselayout:      2.2
sys-apps/openrc:          0.12.4
sys-apps/sandbox:         2.6-r1
sys-devel/autoconf:       2.13, 2.69
sys-devel/automake:       1.11.6, 1.12.6, 1.14.1
sys-devel/binutils:       2.24-r3
sys-devel/gcc:            4.8.3
sys-devel/gcc-config:     1.8
sys-devel/libtool:        2.4.2-r1::gentoo-cvs
sys-devel/make:           4.0-r1
sys-kernel/linux-headers: 3.15 (virtual/os-headers)
sys-libs/glibc:           2.19-r1
Repositories: gentoo sunrise x11 science mozilla gentoo-cvs mgorny
Installed sets: @system
ACCEPT_KEYWORDS="amd64 ~amd64"
ACCEPT_LICENSE="* -@EULA"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-march=k8-sse3 -mcx16 -msahf --param l1-cache-size=64 --param l1-cache-line-size=64 --param l2-cache-size=512 -O2 -pipe -frecord-gcc-switches"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/share/gnupg/qualified.txt /var/lib/hsqldb"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/dconf /etc/env.d /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /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="-march=k8-sse3 -mcx16 -msahf --param l1-cache-size=64 --param l1-cache-line-size=64 --param l2-cache-size=512 -O2 -pipe -frecord-gcc-switches"
DISTDIR="/srv/nfs/common/distfiles"
EMERGE_DEFAULT_OPTS="--with-bdeps y --ask --keep-going --quiet-build=n"
FCFLAGS="-march=k8-sse3 -mcx16 -msahf --param l1-cache-size=64 --param l1-cache-line-size=64 --param l2-cache-size=512 -O2 -pipe -frecord-gcc-switches"
FEATURES="assume-digests binpkg-logs buildpkg cgroup collision-protect config-protect-if-modified distcc distcc-pump distlocks ebuild-locks fixlafiles merge-sync multilib-strict news parallel-fetch preserve-libs protect-owned sandbox sfperms sign strict unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync"
FFLAGS="-march=k8-sse3 -mcx16 -msahf --param l1-cache-size=64 --param l1-cache-line-size=64 --param l2-cache-size=512 -O2 -pipe -frecord-gcc-switches"
GENTOO_MIRRORS="http://linux.rz.ruhr-uni-bochum.de/download/gentoo-mirror/ http://gentoo.mirror.web4u.cz/ http://mirror.netcologne.de/gentoo/ http://ftp.snt.utwente.nl/pub/os/linux/gentoo http://gd.tuwien.ac.at/opsys/linux/gentoo/ http://gentoo.mirror.pw.edu.pl/ http://ftp.vectranet.pl/gentoo/ http://ftp.fi.muni.cz/pub/linux/gentoo/"
INSTALL_MASK=""
LANG="pl_PL.utf8"
LDFLAGS="-Wl,-O1 -Wl,--as-needed -Wl,--hash-style=gnu"
MAKEOPTS="-j12"
PKGDIR="/srv/nfs/common/packages/athlon64"
PORTAGE_COMPRESS="xz"
PORTAGE_COMPRESS_FLAGS="-9"
PORTAGE_CONFIGROOT="/"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --times --compress --force --whole-file --delete --stats --timeout=45 --exclude=/distfiles --exclude=/packages --exclude=/local --exclude=CVS --exclude=/metadata/cache --omit-dir-times"
PORTAGE_TMPDIR="/tmp"
PORTDIR="/var/db/repos/gentoo"
PORTDIR_OVERLAY="/var/db/repos/sunrise /var/db/repos/x11 /var/db/repos/science /var/db/repos/mozilla /usr/src/gx86 /home/mgorny/git/mgorny-repo"
USE="3dnow 3dnowext X a52 aac acl adns aio alsa amd64 bash-completion bluetooth branding btrfs bzip2 cairo caps cdda cdr cli crypt cups curl cxx dbus djvu dri dts dvb dvd dvdr egl emboss exif fftw firefox flac fontconfig fortran gd gif glamor gles2 gmp gnuplot gnutls gphoto2 gstreamer gtk iconv idn imagemagick ipv6 jpeg jpeg2k kate latex lcms libass libatomic liblockfile libnotify libproxy libsamplerate libsecret libtiger lz4 lzma lzo mad mmap mmx mmxext mng modules mp3 mp4 mpeg multilib ncurses nls nptl ogg openal opencl opengl openmp openvg opus osmesa pam pango pch pcre pcre-jit pdf plotutils png policykit postscript ppds qt3support readline sdl session slang smp sndfile speex spell sse sse2 sse3 ssl startup-notification svg systemd t1lib tcpd threads tiff truetype udev udisks unicode upower usb v4l2 vhosts vim-syntax vorbis wavpack wayland webp wmf wxwidgets x264 xattr xcb xft xml xpm xv xvid xvmc zlib zsh-completion" ABI_X86="32 64" ALSA_CARDS="hda-intel emu10k1 virmidi mpu401 pcsp" APACHE2_MODULES="actions alias deflate filter mime mime_magic negotiation rewrite socache_shmcb unixd" CALLIGRA_FEATURES="kexi words flow plan sheets stage tables krita karbon braindump author" 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 ublox ubx" INPUT_DEVICES="evdev" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer" LINGUAS="pl" LIRC_DEVICES="serial" NGINX_MODULES_HTTP="gzip limit_conn limit_req rewrite spdy uwsgi" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php5-5" PYTHON_SINGLE_TARGET="python2_7" PYTHON_TARGETS="python2_7 python3_4 python3_3 jython2_7 pypy python3_2" QEMU_SOFTMMU_TARGETS="i386 x86_64 ppc ppc64 ppc64abi32 arm aarch64" QEMU_USER_TARGETS="ppc ppc64 arm aarch64" RUBY_TARGETS="ruby19 ruby20" SANE_BACKENDS="artec_eplus48u" USERLAND="GNU" VIDEO_CARDS="nouveau vesa radeon r600 s3" 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"
USE_PYTHON="2.7 3.3 3.2"
Unset:  CPPFLAGS, CTARGET, LC_ALL, PORTAGE_BUNZIP2_COMMAND, PORTAGE_RSYNC_EXTRA_OPTS, SYNC

=================================================================
                        Package Settings
=================================================================

sys-devel/libtool-2.4.2-r1 was built with the following:
USE="-static-libs -test -vanilla" ABI_X86="32 64 -x32"
CFLAGS="-march=athlon64 -O2 -pipe -frecord-gcc-switches"
CXXFLAGS="-march=athlon64 -O2 -pipe -frecord-gcc-switches"
Comment 1 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2014-06-26 21:27:12 UTC
Created attachment 379756 [details]
Build log
Comment 2 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2014-06-26 22:38:44 UTC
Created attachment 379758 [details, diff]
Example proof-of-concept ebuild diff

So I've found a working solution but you're not going to like it :).

The problem is that we need to generate a local 'libtool' script with proper CC. To do that, we need to enable proper libtool support in the package. There are a few problems with this:

1. it uses the ancient, ugly hand-written 'aclocal.m4' -- so 'libtoolize' won't help you. You need to append all necessary libtool macros to 'aclocal.m4' by hand,

2. the custom Makefile is unsuitable for libtool, so you either need to add defines like top_builddir or override LIBTOOL,

3. adding libtool macros results in some custom magic being broken and incorrect data landing in Makefile. Long story short, hell breaks loose.

So I've used an alternate approach and instead created an external package that provides libtool. Just a plain configure script that detects CC/CXX and generates libtool, 200 KiB .tar.xz. The idea is to configure the external package to obtain the local libtool, and then override LIBTOOL in cdk to use the newly-generated libtool.

What do you think? If you like it, I will push generic-libtool to my bitbucket along with a dist tarball.
Comment 3 Tim Harder gentoo-dev 2014-06-26 22:42:58 UTC
(In reply to Michał Górny from comment #2)
> What do you think? If you like it, I will push generic-libtool to my
> bitbucket along with a dist tarball.

How about you start by just asking upstream to use libtool properly? I think he's fairly responsive and I've even seen him comment on this bugzilla.
Comment 4 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2014-06-27 08:10:48 UTC
I'm looking through the archives and I see some patch was submitted for that back in 2004 but the discussion never got anywhere.

I also see that we're not using --with-libtool in ncurses which effectively hides the issue. Maybe there isn't much point in using it in cdk when it's not used in much more core library of ncurses...

Anyway, I'm going to mail bug-ncurses about that.
Comment 5 orbea 2022-06-18 00:09:10 UTC
*** Bug 778785 has been marked as a duplicate of this bug. ***
Comment 6 orbea 2022-06-18 00:19:51 UTC
This bug with hidden when --with-libtool was removed to fix an unrelated issue, closing it for now.