tor-0.2.3.2_alpha-r1 is missing a dependency on net-libs/miniupnpc when USE=upnp: # USE=upnp emerge tor [...] >>> Configuring source in /var/tmp/portage/net-misc/tor-0.2.3.2_alpha-r1/work/tor-0.2.3.2-alpha ... * econf: updating tor-0.2.3.2-alpha/config.sub with /usr/share/gnuconfig/config.sub * econf: updating tor-0.2.3.2-alpha/config.guess with /usr/share/gnuconfig/config.guess ./configure --prefix=/usr --build=x86_64-pc-linux-gnu --host=x86_64-pc-linux-gnu --mandir=/usr/share/man --infodir=/usr/share/info --datadir=/usr/share --sysconfdir=/etc --localstatedir=/var/lib --libdir=/usr/lib64 --disable-dependency-tracking --docdir=/usr/share/doc/tor-0.2.3.2_alpha-r1 --enable-bufferevents --enable-asciidoc --disable-nat-pmp --disable-gcc-hardening --disable-linker-hardening --disable-transparent --enable-threads --enable-upnp [...] checking for openssl directory... (system) checking whether we need extra options to link openssl... (none) tor_cv_library_openssl_dir is (system) checking for zlib directory... (system) checking whether we need extra options to link zlib... (none) checking for libminiupnpc directory... configure: WARNING: Could not find a linkable libminiupnpc. If you have it installed somewhere unusual, you can specify an explicit path using --with-libminiupnpc-dir configure: error: Missing libraries; unable to proceed. !!! Please attach the following file when seeking support: !!! /var/tmp/portage/net-misc/tor-0.2.3.2_alpha-r1/work/tor-0.2.3.2-alpha/config.log * ERROR: net-misc/tor-0.2.3.2_alpha-r1 failed (configure phase): * econf failed But even after manually emerging net-libs/miniupnpc, tor still fails to build with USE=upnp: # USE=upnp emerge tor [...] make[4]: Entering directory `/var/tmp/portage/net-misc/tor-0.2.3.2_alpha-r1/work/tor-0.2.3.2-alpha/src/tools/tor-fw-helper' x86_64-pc-linux-gnu-gcc -DHAVE_CONFIG_H -I. -I../../.. -I../../../src/common -Wall -fno-strict-aliasing -march=native -O2 -pipe -c -o tor_fw_helper-tor-fw-helper.o `test -f 'tor-fw-helper.c' || echo './'`tor-fw-helper.c tor-fw-helper.c: In function ‘main’: tor-fw-helper.c:215:7: warning: ‘backend_state.backend_state[0]’ may be used uninitialized in this function [-Wuninitialized] tor-fw-helper.c:229:14: note: ‘backend_state.backend_state[0]’ was declared here tor-fw-helper.c:215:7: warning: ‘backend_state.backend_ops[0].add_tcp_mapping’ may be used uninitialized in this function [-Wuninitialized] tor-fw-helper.c:229:14: note: ‘backend_state.backend_ops[0].add_tcp_mapping’ was declared here tor-fw-helper.c:161:7: warning: ‘backend_state.backend_ops[0].fetch_public_ip’ may be used uninitialized in this function [-Wuninitialized] tor-fw-helper.c:229:14: note: ‘backend_state.backend_ops[0].fetch_public_ip’ was declared here tor-fw-helper.c:210:14: warning: ‘backend_state.backend_ops[0].state_len’ may be used uninitialized in this function [-Wuninitialized] tor-fw-helper.c:229:14: note: ‘backend_state.backend_ops[0].state_len’ was declared here x86_64-pc-linux-gnu-gcc -DHAVE_CONFIG_H -I. -I../../.. -I../../../src/common -Wall -fno-strict-aliasing -march=native -O2 -pipe -c -o tor_fw_helper-tor-fw-helper-natpmp.o `test -f 'tor-fw-helper-natpmp.c' || echo './'`tor-fw-helper-natpmp.c x86_64-pc-linux-gnu-gcc -DHAVE_CONFIG_H -I. -I../../.. -I../../../src/common -Wall -fno-strict-aliasing -march=native -O2 -pipe -c -o tor_fw_helper-tor-fw-helper-upnp.o `test -f 'tor-fw-helper-upnp.c' || echo './'`tor-fw-helper-upnp.c x86_64-pc-linux-gnu-gcc -Wall -fno-strict-aliasing -march=native -O2 -pipe -Wl,--as-needed -Wl,-O1 -o tor-fw-helper tor_fw_helper-tor-fw-helper.o tor_fw_helper-tor-fw-helper-natpmp.o tor_fw_helper-tor-fw-helper-upnp.o -lminiupnpc -lm ../../common/libor.a -lpthread -ldl ../../common/libor.a(util.o): In function `tor_mathlog': util.c:(.text+0x8e1): undefined reference to `log' ../../common/libor.a(util.o): In function `tor_lround': util.c:(.text+0x8f1): undefined reference to `lround' collect2: ld returned 1 exit status make[4]: *** [tor-fw-helper] Error 1 make[4]: Leaving directory `/var/tmp/portage/net-misc/tor-0.2.3.2_alpha-r1/work/tor-0.2.3.2-alpha/src/tools/tor-fw-helper' make[3]: *** [all-recursive] Error 1 make[3]: Leaving directory `/var/tmp/portage/net-misc/tor-0.2.3.2_alpha-r1/work/tor-0.2.3.2-alpha/src/tools' make[2]: *** [all-recursive] Error 1 make[2]: Leaving directory `/var/tmp/portage/net-misc/tor-0.2.3.2_alpha-r1/work/tor-0.2.3.2-alpha/src' make[1]: *** [all-recursive] Error 1 make[1]: Leaving directory `/var/tmp/portage/net-misc/tor-0.2.3.2_alpha-r1/work/tor-0.2.3.2-alpha' make: *** [all] Error 2 * ERROR: net-misc/tor-0.2.3.2_alpha-r1 failed (compile phase): * emake failed --- # emerge --info Portage 2.2.0_alpha46 (default/linux/amd64/10.0/desktop/gnome, gcc-4.6.1, glibc-2.13-r4, 2.6.39-gentoo-r2.3 x86_64) ================================================================= System Settings ================================================================= System uname: Linux-2.6.39-gentoo-r2.3-x86_64-Intel-R-_Core-TM-2_Quad_CPU_Q6600_@_2.40GHz-with-gentoo-2.0.3 Timestamp of tree: Fri, 22 Jul 2011 02:00:01 +0000 distcc 3.1 x86_64-pc-linux-gnu [disabled] ccache version 3.1.5 [disabled] app-shells/bash: 4.2_p10 dev-java/java-config: 2.1.11-r3 dev-lang/python: 2.4.6, 2.6.7, 2.7.2, 3.2 dev-util/ccache: 3.1.5 dev-util/cmake: 2.8.5-r2 dev-util/pkgconfig: 0.26 sys-apps/baselayout: 2.0.3 sys-apps/openrc: 0.8.3-r1 sys-apps/sandbox: 2.5 sys-devel/autoconf: 2.13, 2.68 sys-devel/automake: 1.4_p6-r1, 1.5-r1, 1.6.3-r1, 1.7.9-r2, 1.8.5-r4, 1.9.6-r3, 1.10.3, 1.11.1-r1 sys-devel/binutils: 2.16.1-r3, 2.18-r4, 2.19.1-r1, 2.20.1-r1, 2.21, 2.21.1 sys-devel/gcc: 3.3.6-r1, 3.4.6-r2, 4.1.2, 4.2.4-r1, 4.3.6, 4.4.5, 4.5.2, 4.6.1 sys-devel/gcc-config: 1.4.1-r1 sys-devel/libtool: 2.4-r1 sys-devel/make: 3.82-r1 sys-kernel/linux-headers: 2.6.38 (virtual/os-headers) sys-libs/glibc: 2.13-r4 CFLAGS="-march=native -O2 -pipe" LDFLAGS="-Wl,--as-needed -Wl,-O1"
Attach full build.log please
(In reply to comment #1) > Attach full build.log please I'd like to see this too, but I see the problem. I need a dep on net-libs/miniupnpc. Look for it in -r2. Thanks for testing!
(In reply to comment #2) > (In reply to comment #1) > > Attach full build.log please > > I'd like to see this too Why waste bandwidth? Just look at the short the part of the log that I pasted, this is an elementary --as-needed linking problem. [...] -lm ../../common/libor.a [...] should be [...] ../../common/libor.a -lm [...] People, come on. When you see "undefined reference" in the error message, "-Wl,--as-needed" in the bug reporter's LDFLAGS, and no "-Wl,--as-needed" in your own LDFLAGS, the first thing you should be thinking of is "this probably has to do with --as-needed; let me check if the object files and libraries in the link command are listed in the correct order".
Or in terms of the build system: have a look at src/tools/tor-fw-helper/Makefile.am: tor_fw_helper_LDADD = $(nat_pmp_ldadd) $(miniupnpc_ldadd) ../../common/libor.a @TOR_LIB_WS32@ Since $(miniupnpc_ldadd) contains "-lm", and ../../common/libor.a uses symbols from libm, ../../common/libor.a needs to come before $(miniupnpc_ldadd).
(In reply to comment #4) > Or in terms of the build system: have a look at > src/tools/tor-fw-helper/Makefile.am: > > tor_fw_helper_LDADD = $(nat_pmp_ldadd) $(miniupnpc_ldadd) ../../common/libor.a > @TOR_LIB_WS32@ > > Since $(miniupnpc_ldadd) contains "-lm", and ../../common/libor.a uses symbols > from libm, ../../common/libor.a needs to come before $(miniupnpc_ldadd). Thanks, I noticed that as soon as I started debugging. There were two problems: 1) I need the depend, and 2) there is this problem in the build system. Both will be in -r2.
Please test tor-0.2.3.2_alpha-r2 which I just added to the tree. Please test with respect to USE="upnp" and USE="nat-pmp". Its working for me, so I'm going to close this RESOLVED TEST-REQUEST. Feel free to reopen if this is still a problem. Open a different bug if you find a new problem.
(In reply to comment #6) > Please test tor-0.2.3.2_alpha-r2 which I just added to the tree. Please test > with respect to USE="upnp" and USE="nat-pmp". Its working for me, so I'm going > to close this RESOLVED TEST-REQUEST. Feel free to reopen if this is still a > problem. Open a different bug if you find a new problem. Thank you, tor-0.2.3.2_alpha-r2 now builds for me with all combinations of upnp and nat-pmp USE flags. Marking as RESOLVED FIXED.