Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 407137 - net-p2p/transmission-2.50-r1: configure can't find µTP if CXX is exported
Summary: net-p2p/transmission-2.50-r1: configure can't find µTP if CXX is exported
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Peter Volkov (RETIRED)
Depends on:
Reported: 2012-03-06 16:15 UTC by niks1024
Modified: 2012-04-08 17:54 UTC (History)
2 users (show)

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

transmission-2.42-config.log (transmission-2.42-config.log,112.81 KB, text/plain)
2012-03-06 20:26 UTC, niks1024
transmission-2.50-config.log (transmission-2.50-config.log,137.69 KB, text/plain)
2012-03-06 20:29 UTC, niks1024

Note You need to log in before you can comment on or make changes to this bug.
Description niks1024 2012-03-06 16:15:36 UTC
net-p2p/transmission-2.50-r1 fails to compile, printing:
    In file included from net.c:46:0:
    tr-utp.h:32:24: fatal error: libutp/utp.h: No such file or directory

It should be noted that net-p2p/transmission-2.42-r1 which I currently have (built on january 26) with uTP support doesn't recompile either failing during configure with:
    checking µTP... configure: error: "Unable to build uTP support -- C++ compiler not found; consider --disable-utp"

Reproducible: Sometimes

Steps to Reproduce:
1. emerge =net-p2p/transmission-2.50-r1
Comment 1 Samuli Suominen (RETIRED) gentoo-dev 2012-03-06 16:21:43 UTC
C++ compiler not found ?

provide 'emerge --info' output, 'emerge -pv gcc' output as well as the config.log from the ./configure transmission generated
Comment 2 niks1024 2012-03-06 18:44:51 UTC
I also have clang which I use by default but in this case I'm using /etc/portage/env/* magic to override it for transmission (also both gcc and clang fail in the same way).
I went over config.log myself and found it to be utterly useless since it only prints:
    configure:17959: checking µTP
    configure:17978: error: "Unable to build uTP support -- C++ compiler not found; consider --disable-utp"
besides that's for the older 2.42-r1 so unless it's really needed for this bug I'll refrain from posting that log.
The 2.50-r1 fails during compilation and with missing header (since it seems to expects that header file to be installed in /usr/include if my C/C++ understanding is anything to go by).

Anyways, including emerge --info:
Portage 2.2.0_alpha90 (default/linux/amd64/10.0/desktop/kde, gcc-4.6.2, glibc-2.14.1-r2, 3.2.9-gentoo x86_64)
System uname: Linux-3.2.9-gentoo-x86_64-Intel-R-_Core-TM-2_Quad_CPU_@_2.40GHz-with-gentoo-2.1
Timestamp of tree: Tue, 06 Mar 2012 17:45:01 +0000
app-shells/bash:          4.2_p20
dev-java/java-config:     2.1.11-r3
dev-lang/python:          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/sandbox:         2.5
sys-devel/autoconf:       2.13, 2.68
sys-devel/automake:       1.11.3
sys-devel/binutils:       2.22-r1
sys-devel/gcc:            4.6.2
sys-devel/gcc-config:     1.5.1
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 multimedia sunrise local_overlay
Installed sets: 
ACCEPT_KEYWORDS="amd64 ~amd64"
CFLAGS="-march=core2 -Oz -g"
CONFIG_PROTECT="/etc /usr/share/config /usr/share/gnupg/qualified.txt /usr/share/themes/oxygen-gtk/gtk-2.0 /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/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=core2 -Oz -g"
EMERGE_DEFAULT_OPTS="--with-bdeps=y --keep-going=y --autounmask-write=y --quiet-build=y --jobs --load-average=4.5"
FEATURES="assume-digests binpkg-logs compress-build-logs distlocks ebuild-locks fail-clean fixlafiles installsources metadata-transfer news noinfo parallel-fetch parallel-install preserve-libs protect-owned sandbox sfperms splitdebug strict suidctl unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync xattr"
LDFLAGS="-Wl,-O1 -Wl,--as-needed -Wl,-z,now"                                                                                                            
LINGUAS="lv en_GB en ja de fr"
MAKEOPTS="-j8 -l4"
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"
PORTDIR_OVERLAY="/var/lib/layman/multimedia /var/lib/layman/sunrise /usr/local/overlay"
USE="10bit 64bit X a52 aac accessibility acl acpi adns aio all_sfx amd64 archive ass avahi bash-completion berkdb boost branding bs2b bzip2 cairo caps chm cjk cleartype cli clutter colord consolekit cracklib crypt css cue cups custom-cflags custom-cpuopts custom-optimization cxx dbus dconf declarative device-mapper dga dhcp djbfft djvu double-precision dri drm dts ebook embedded emboss enca encode exceptions exif expat extras faad fam fastcgi fat festival ffmpeg fftw firefox flac fluidsynth fontconfig foomaticdb gcrypt gd-external gdbm gdu geoip gif gimp git glep glib go gphoto2 gpm gpu gtk gtk3 hardened hddtemp ibus iconv icu id3tag idn imagemagick inotify introspection ioctl ipc iproute2 ipv6 ithreads jabber java6 javascript jbig jfs jpeg kde kipi kpathsea kvm lame latex lcms ldap lensfun libass libedit libkms libnotify libproxy llvm lm_sensors logrotate lzma mad maps matroska mdadm mem-scramble mmap mmx mmxext mng modules moonlight mozdevelop mp3 mp4 mplayer mudflap multilib musepack musicbrainz natspec ncurses network-cron nio2 nls nptl nptlonly nsplugin nss ntp ofa offensive ogg okteta openal opengl openmp optimization optimized-qmake orc pam pango pch pcre pdf pgo phonon plasma plugins-symlink png policykit ppds pppd private-headers pulseaudio python3 qemu qt3support qt4 qthelp rar readline rtc samba scanner semantic-desktop sensord session shared-dricore sharedmem skype smi smp spell spice sse sse2 sse3 ssl ssse3 stars startup-notification strong-optimization subversion svg sysfs system-sqlite sysvipc tcpd threads tiff truetype tts udev unicode usb utp v4l vde videos vim-syntax virt-network vorbis wavpack webkit webstart wxwidgets x264 xattr xcb xcomposite xetex xfs xinerama xml xmp xorg xscreensaver xulrunner xv xvid zeroconf zlib" ALSA_CARDS="hda-intel" 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 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 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" INPUT_DEVICES="evdev" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LINGUAS="lv en_GB en ja de fr" PHP_TARGETS="php5-3" RUBY_TARGETS="ruby18 ree18 ruby19" SANE_BACKENDS="epson2" USERLAND="GNU" VIDEO_CARDS="nvidia" 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"

emerge -pv gcc:
[ebuild   R   #] sys-devel/gcc-4.6.2  USE="cxx fortran go graphite gtk mudflap (multilib) nls nptl openmp (-altivec) -bootstrap -build -doc (-fixed-point) -gcj (-hardened) (-libssp) -multislot -nocxx -nopie -nossp -objc -objc++ -objc-gc -test -vanilla" 0 kB
Comment 3 Jeroen Roovers (RETIRED) gentoo-dev 2012-03-06 19:29:19 UTC
Please attach the config.log file.
Comment 4 niks1024 2012-03-06 20:26:24 UTC
Created attachment 304445 [details]

Comment 5 niks1024 2012-03-06 20:29:10 UTC
Created attachment 304447 [details]
Comment 6 niks1024 2012-03-06 21:03:17 UTC
Looking at it once more I noticed that configure phase outputs
    configure:17956: checking µTP
    configure:17998: result: no
for net-p2p/transmission-2.50-r1 as well, it's just not fatal anymore (though it still fails to build).
P.S. Rant: This is why I have always said autotools are pointless mess.
Comment 7 Samuli Suominen (RETIRED) gentoo-dev 2012-03-07 10:33:28 UTC

onfigure:17956: checking µTP
configure:17998: result: no
configure:18003: checking supported miniupnp library
configure:18036: /usr/bin/gcc -o conftest -march=native -Os -pipe -ggdb -floop-interchange -floop-strip-mine -floop-block -floop-flatten -fno-loop-interchange -fno-loop-strip-mine -fno-loop-block -fno-loop-flatten -O2 -std=gnu99  -Wall -W -Wpointer-arith -Wformat-security -Wcast-align -Wundef -Wcast-align -Wstrict-prototypes -Wmissing-declarations -Wmissing-format-attribute -Wredundant-decls -Wnested-externs -Wunused-parameter -Wwrite-strings -Winline -Wfloat-equal -Wextra -Wdeclaration-after-statement -Winit-self -Wvariadic-macros  -DNDEBUG -Wl,-O1 -Wl,--as-needed -Wl,-z,now conftest.c -lminiupnpc >&5
conftest.c:60:1: warning: function declaration isn't a prototype [-Wstrict-prototypes]
conftest.c: In function 'main':
conftest.c:70:5: error: too few arguments to function 'upnpDiscover'
/usr/include/miniupnpc/miniupnpc.h:53:1: note: declared here
conftest.c:73:25: error: too few arguments to function 'UPNP_GetSpecificPortMappingEntry'
/usr/include/miniupnpc/upnpcommands.h:163:1: note: declared here


Looks to me as if the problem was in miniupnpc instead of utp.

emerge -pv net-libs/miniupnpc ? is that version 1.6-r1 ?
Comment 8 niks1024 2012-03-07 10:51:21 UTC
emerge -pv net-libs/miniupnpc
[ebuild   R    ] net-libs/miniupnpc-1.6-r1  USE="-static-libs" 0 kB
Comment 9 Samuli Suominen (RETIRED) gentoo-dev 2012-03-07 11:09:31 UTC
Well, libutp is part of transmission source tree. Then, your miniupnpc version is also correct. Please try re-emerging it for test.

But what stands out is...

What is -Oz in your CFLAGS/CXXFLAGS? Why do you have -Wl,-z,now in LDFLAGS? 
Have you tried with something sane, like CFLAGS="-O2 -march=native -pipe"? Same for CXXFLAGS.
Comment 10 niks1024 2012-03-08 10:50:51 UTC
Regarding -Wl,z,now it comes from my make.conf:
LDFLAGS="${LDFLAGS} -Wl,-z,now"
and the only difference it makes, as far as I'm aware of, is that symbols are resolved at link time rather than runtime, for dynamic linking this means that a program would segfault right at startup not only when an undefined symbol is called (if ever). This is mainly QA thing.
The -Oz it's more aggresive version of -Os and it's specific to Clang, I'll double check when I have time but I think I ran both configure phases with gcc instead of Clang.
Comment 11 niks1024 2012-03-08 13:35:12 UTC
So I have found the trigger - it seems to fail to build unless compiler environment variables are set to these values:

Previously I used:

Since this is just trigger, not marking as resolved until it's certain this is as intended.
Comment 12 Samuli Suominen (RETIRED) gentoo-dev 2012-03-08 14:12:35 UTC
I'm not sure if it's ideal for it to fail like that, but that setup certainly isn't standand. CCing toolchain@ if they have something to add here. 
Personally I don't find this worth of wasting time on.
Comment 13 niks1024 2012-03-08 23:08:20 UTC
After more testing it appears that the real problem is use of absolute paths in those variables, e.g., Transmission configures and builds fine if CC=clang CXX=clang++ is used instead of absolute paths I had before.
Comment 14 SpanKY gentoo-dev 2012-03-09 04:07:40 UTC
there's nothing wrong with setting to full paths.  however, ignoring that, this pkg is still broken.  set CXX to any value and it fails.

basically, it's the fault of this in
if test "x$HAVE_CXX" = "xyes" ; then

HAVE_CXX is useless, and this latter check is just wrong.  delete both and do normal library/func searching to check for 3rd party packages.
Comment 15 Samuli Suominen (RETIRED) gentoo-dev 2012-03-10 12:58:25 UTC
punted the broken check in portage and reported it to upstream Trac:

Moderation required for new ticket.

Thank you for submitting a new ticket ("If CXX is exported to value like /usr/bin/g++ the ./configure fails to set HAVE_CXX and fails later on compile due to missing libutp").

Your submission has been routed to a moderator for approval. We make every effort to review submissions within one working day.