Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bugzilla DB migration completed. Please report issues to Infra team via email via infra@gentoo.org or IRC
Bug 548148 - <declspec.h> from =net-libs/libnatpmp-20140401-r1 clashes with <miniupnpc/declspec.h> from =net-libs/miniupnpc-1.9.20150427: affects both net-misc/tor and net-p2p/transmission
Summary: <declspec.h> from =net-libs/libnatpmp-20140401-r1 clashes with <miniupnpc/dec...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Anthony Basile
URL: http://miniupnp.tuxfamily.org/forum/v...
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-04-29 16:43 UTC by r3lgar
Modified: 2015-10-01 17:10 UTC (History)
6 users (show)

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


Attachments
build log (tor-0.2.6.7:20150429-154533.log,102.24 KB, text/plain)
2015-04-29 16:43 UTC, r3lgar
Details
tor-fw-helper.i (tor-fw-helper.i,207.91 KB, text/plain)
2015-05-23 20:16 UTC, Nathan Caldwell
Details

Note You need to log in before you can comment on or make changes to this bug.
Description r3lgar 2015-04-29 16:43:56 UTC
Created attachment 402238 [details]
build log

Portage 2.2.18 (python 2.7.9-final-0, default/linux/amd64/13.0/desktop, gcc-4.9.2, glibc-2.20-r2, 4.0.0-gentoo x86_64)
=================================================================
                         System Settings
=================================================================
System uname: Linux-4.0.0-gentoo-x86_64-Intel-R-_Core-TM-_i7-4770K_CPU_@_3.50GHz-with-gentoo
KiB Mem:    15361984 total,   2515916 free
KiB Swap:    8388604 total,   8388460 free
Timestamp of repository gentoo: Wed, 29 Apr 2015 15:15:01 +0000
sh bash 4.3_p33-r2
ld GNU ld (Gentoo 2.25 p1.0) 2.25
app-shells/bash:          4.3_p33-r2::gentoo
dev-lang/perl:            5.20.2::gentoo
dev-lang/python:          2.7.9-r2::gentoo, 3.4.3::gentoo
dev-util/cmake:           3.2.1::gentoo
dev-util/pkgconfig:       0.28-r2::gentoo
sys-apps/baselayout:      2.2::gentoo
sys-apps/sandbox:         2.6-r1::gentoo
sys-devel/autoconf:       2.13::gentoo, 2.69-r1::gentoo
sys-devel/automake:       1.11.6-r1::gentoo, 1.14.1::gentoo, 1.15::gentoo
sys-devel/binutils:       2.25::gentoo
sys-devel/gcc:            4.9.2::gentoo
sys-devel/gcc-config:     1.8::gentoo
sys-devel/libtool:        2.4.6-r1::gentoo
sys-devel/make:           4.1-r1::gentoo
sys-kernel/linux-headers: 4.0::gentoo (virtual/os-headers)
sys-libs/glibc:           2.20-r2::gentoo
Repositories:

gentoo
    location: /usr/overlays/gentoo
    sync-type: git
    sync-uri: git://github.com/gentoo/gentoo-portage-rsync-mirror.git
    priority: -1000

steam-overlay
    location: /usr/overlays/steam-overlay
    sync-type: git
    sync-uri: git://github.com/anyc/steam-overlay.git
    masters: gentoo
    priority: 10

nightmare
    location: /usr/overlays/nightmare
    sync-type: git
    sync-uri: https://gitlab.com/r3lgar/nightmare.git
    masters: gentoo
    priority: 1000

Installed sets: @kernel
ACCEPT_KEYWORDS="amd64 ~amd64"
ACCEPT_LICENSE="*"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-march=native -O2 -pipe"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/share/gnupg/qualified.txt"
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"
CXXFLAGS="-march=native -O2 -pipe"
DISTDIR="/usr/distfiles"
EMERGE_DEFAULT_OPTS="--quiet-build=y --quiet-fail=y --autounmask=y --autounmask-write=y 	--with-bdeps=y --keep-going -Aa"
FCFLAGS="-O2 -pipe"
FEATURES="binpkg-logs cgroup collision-protect config-protect-if-modified distlocks ebuild-locks fixlafiles ipc-sandbox merge-sync news notitles parallel-fetch parallel-install preserve-libs protect-owned sandbox sfperms split-elog split-log strict unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync"
FFLAGS="-O2 -pipe"
GENTOO_MIRRORS="http://distfiles.gentoo.org"
LANG="en_US.UTF-8"
LC_ALL=""
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
MAKEOPTS="-j6"
PKGDIR="/usr/portage/packages"
PORTAGE_CONFIGROOT="/"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --omit-dir-times --compress --force --whole-file --delete --stats --human-readable --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages"
PORTAGE_TMPDIR="/var/tmp"
USE="X aac acl acpi aes alac alsa amd64 apng audiofile avx avx2 btrfs bzip2 cairo cdda cdr classic cli cracklib crypt cue curl custom-cflags custom-optimization cxx dbus dirac dmx dri drm dts dv dvdr e2fsprogs egl emboss emovix encode exif faac faad fam fat fbcon ffmpeg fftw firefox flac fma3 fontconfig fortran ftp gallium gcrypt ggi gif glamor glib gmp gpm gstreamer gtk gtk2 gtkstyle gudev hddtemp iconv icu id3tag idn imlib imlib2 introspection iproute2 ipv4 jabber joystick jpeg ladspa lame lcms libass libffi libmpeg2 libnotify libsamplerate lm_sensors lua lzma lzo mad matroska midi minizip mmx mng modules mp3 mp4 mp4v2 mpd mpeg mpg123 multilib ncurses nettle nls nptl nss ogg openal opencl opengl openmp openssl pam pango pcre png policykit popcnt postproc ppds python qt4 quicktime rar readline reiserfs script sdl session shine smp sndfile sound sqlite sse sse2 sse3 sse4_1 sse4_2 ssl ssse3 startup-notification svg symlink system-libvpx systemd taglib tga theora threads tiff tls tools truetype twolame udev udisks unicode upnp upower usb v4l vaapi vdpau vorbis wav wavpack wma wma-fixed wxwidgets x264 xcb xcomposite xinerama xml xmpp xpm xrandr xv xvid xvmc zip zlib zsh-completion" ABI_X86="64 32" 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" 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 author" CAMERAS="ptp2" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" CPU_FLAGS_X86="aes avx avx2 fma3 mmx mmxext popcnt sse sse2 sse3 sse4_1 sse4_2 ssse3" CURL_SSL="openssl" 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="en" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php5-5" PYTHON_SINGLE_TARGET="python2_7" PYTHON_TARGETS="python2_7 python3_4" QEMU_SOFTMMU_TARGETS="x86_64 i386" RUBY_TARGETS="ruby19 ruby20" USERLAND="GNU" VIDEO_CARDS="intel i915 i965" 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.6 2.7 -3.2 3.4"
Unset:  CPPFLAGS, CTARGET, INSTALL_MASK, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS

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

net-misc/tor-0.2.6.7::gentoo was built with the following:
USE="nat-pmp seccomp stats systemd transparent-proxy upnp -bufferevents -scrypt (-selinux) -test -tor-hardening -web" ABI_X86="64"



-----

net-libs/miniupnpc-1.9.20150424  USE="-ipv6 -static-libs"
Comment 1 RB 2015-05-01 20:25:25 UTC
Confirmed here too.  Of course, building net-misc/tor-0.2.6.7 with USE='-upnp' temporarily avoided the issue.
Comment 2 Anthony Basile gentoo-dev 2015-05-02 23:37:51 UTC
Can you try with =net-libs/miniupnpc-1.9.20150427.  The version in the title was buggy and taken off the tree.  Its working for me with 1.9.20150427.
Comment 3 Anthony Basile gentoo-dev 2015-05-04 13:40:02 UTC
(In reply to Anthony Basile from comment #2)
> Can you try with =net-libs/miniupnpc-1.9.20150427.  The version in the title
> was buggy and taken off the tree.  Its working for me with 1.9.20150427.

okay no response and I've tested and it works for me.  Please reopen if this is still a problem.
Comment 4 RB 2015-05-04 15:06:31 UTC
Sorry, no - I'd only eyeballed the package name and not the version when I confirmed.  I'm seeing it building against =net-libs/miniupnpc-1.9.20150427.

Dumb question, you are building net-misc/tor with USE=upnp?
Comment 5 Anthony Basile gentoo-dev 2015-05-04 19:02:27 UTC
(In reply to RB from comment #4)
> Sorry, no - I'd only eyeballed the package name and not the version when I
> confirmed.  I'm seeing it building against =net-libs/miniupnpc-1.9.20150427.
> 
> Dumb question, you are building net-misc/tor with USE=upnp?

Yes of course I'm using USE=upnp.  1.9.20150424 (note ending in 24) was taken off the tree and replaced by 1.9.20150427 (ending in 27).  tor with USE=upnp builds against the 27 version.
Comment 6 RB 2015-05-05 17:43:46 UTC
(in reply to comment #5)
> tor with USE=upnp builds against the 27 version.

Unfortunately, for me it does not.  Emerge --info follows, but compiling net-misc/tor-0.2.6.7 with USE=upnp results in the exact same error the OP's build.log describes, an excerpt from my own pasted below:

In file included from src/tools/tor-fw-helper/tor-fw-helper-upnp.h:14:0,
                 from src/tools/tor-fw-helper/tor-fw-helper.c:36:
/usr/include/miniupnpc/miniwget.h:17:18: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘void’
 MINIUPNP_LIBSPEC void * getHTTPResponse(int s, int * size);

=================================================
$ emerge --info net-misc/tor net-libs/miniupnpc
Portage 2.2.18 (python 2.7.9-final-0, default/linux/amd64/13.0, gcc-4.9.2, glibc-2.20-r2, 4.0.1-gentoo x86_64)
=================================================================
                         System Settings
=================================================================
System uname: Linux-4.0.1-gentoo-x86_64-Intel-R-_Core-TM-_i7-4900MQ_CPU_@_2.80GHz-with-gentoo-2.2
KiB Mem:    32952788 total,  23075316 free
KiB Swap:    9048936 total,   9048936 free
Timestamp of repository gentoo: Tue, 05 May 2015 17:00:01 +0000
sh bash 4.3_p33-r2
ld GNU ld (Gentoo 2.25 p1.0) 2.25
app-shells/bash:          4.3_p33-r2::gentoo
dev-java/java-config:     2.2.0::gentoo
dev-lang/perl:            5.20.2::gentoo
dev-lang/python:          2.7.9-r2::gentoo, 3.3.5-r1::gentoo, 3.4.3::gentoo
dev-util/cmake:           3.2.1::gentoo
dev-util/pkgconfig:       0.28-r2::gentoo
sys-apps/baselayout:      2.2::gentoo
sys-apps/openrc:          0.13.11::pentoo
sys-apps/sandbox:         2.6-r1::gentoo
sys-devel/autoconf:       2.13::gentoo, 2.69-r1::gentoo
sys-devel/automake:       1.11.6-r1::gentoo, 1.12.6::gentoo, 1.13.4::gentoo, 1.14.1::gentoo, 1.15::gentoo
sys-devel/binutils:       2.25::gentoo
sys-devel/gcc:            4.8.4::gentoo, 4.9.2::gentoo
sys-devel/gcc-config:     1.8::gentoo
sys-devel/libtool:        2.4.6-r1::gentoo
sys-devel/make:           4.1-r1::gentoo
sys-kernel/linux-headers: 4.0::gentoo (virtual/os-headers)
sys-libs/glibc:           2.20-r2::gentoo
Repositories:

gentoo
    location: /usr/portage
    sync-type: rsync
    sync-uri: rsync://rsync.gentoo.org/gentoo-portage
    priority: -1000

local
    location: /usr/local/portage
    masters: gentoo pentoo
    priority: 0

pentoo
    location: /var/lib/layman/pentoo
    masters: gentoo
    priority: 50

sunrise
    location: /var/lib/layman/sunrise
    masters: gentoo
    priority: 50

virtualization
    location: /var/lib/layman/virtualization
    masters: gentoo
    priority: 50

vmware
    location: /var/lib/layman/vmware
    masters: gentoo
    priority: 50

Installed sets: @nmrebuild
ACCEPT_KEYWORDS="amd64 ~amd64"
ACCEPT_LICENSE="* -@EULA AdobeFlash-11.x Intel-SDP NVIDIA-CUDA TeamViewer Vivaldi"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-Os -march=core-avx2 -pipe"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /etc/conf.d/openconnect /etc/init.d/openconnect /etc/stunnel/stunnel.conf /usr/lib64/libreoffice/program/sofficerc /usr/share/gnupg/qualified.txt"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/dconf /etc/env.d /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/php/apache2-php5.6/ext-active/ /etc/php/cgi-php5.6/ext-active/ /etc/php/cli-php5.6/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="-Os -march=core-avx2 -pipe"
DISTDIR="/usr/portage/distfiles"
EMERGE_DEFAULT_OPTS="--with-bdeps=y --misspell-suggestions=n"
FCFLAGS="-Os -mtune=nocona -pipe -frecord-gcc-switches"
FEATURES="assume-digests binpkg-logs config-protect-if-modified distlocks ebuild-locks fixlafiles merge-sync multilib-strict news parallel-fetch preserve-libs protect-owned sandbox sfperms strict unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync xattr"
FFLAGS="-Os -mtune=nocona -pipe -frecord-gcc-switches"
GENTOO_MIRRORS="http://distfiles.gentoo.org"
INSTALL_MASK="/usr/lib/debug"
LANG="en_US.utf8"
LDFLAGS="-Wl,-O1 -Wl,--as-needed -Wl,--hash-style=gnu"
MAKEOPTS="-j8"
PKGDIR="/usr/portage/packages"
PORTAGE_BZIP2_COMMAND="lbzip2"
PORTAGE_CONFIGROOT="/"
PORTAGE_RSYNC_EXTRA_OPTS="-P"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --omit-dir-times --compress --force --whole-file --delete --stats --human-readable --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages"
PORTAGE_TMPDIR="/var/tmp"
USE="X a52 aac acl acpi adns ads aff all_sfx alsa amd64 audit berkdb binary-drivers bluetooth branding bzip2 cairo caps cdda cdr cli clipboard consolekit cracklib crypt cuda cups curl cxx dbus device-mapper directfb dri dts dvd dvdr emboss encode ewf exif fam fbcon fcoe firefox firewalld flac fortran freerdp fuse gcrypt gdbm gif git gksu glamor gnome-keyring gpg gpm gps graph gssapi gtk gtk2 iconv ipv6 ithreads jack jpeg lapack lcms ldap libnotify libopts libproxy lm_sensors lua lvm lxc lzma lzo lzo4 mad mmx mmxext mng modemmanager modules mp3 mp4 mpeg multilib ncurses networkmanager nfs nls nptl ogg opencl opengl openmp oss pam pam_ssh pango passwdqc pcre pcre16 pdf pentoo perl png policykit ppds pulseaudio python qemu qt3support qt4 rar raw readline rtl rtlsdr ruby samba sdl seccomp session smp spell sqlite squashfs sse sse2 ssh ssl startup-notification subversion svg tcpd theora threads tiff truetype udev udisks unicode upnp upower usb uuid vdpau vim-syntax vorbis wxwidgets x264 xattr xcb xinerama xml xrandr xv xvid zlib" ABI_X86="64" 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" 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 author" CAMERAS="ptp2" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" CPU_FLAGS_X86="aes avx avx2 fma3 mmx mmxext popcnt sse sse2 sse3 sse4_1 sse4_2 ssse3" 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" GRUB_PLATFORMS="coreboot efi-32 efi-64 emu multiboot pc qemu" INPUT_DEVICES="evdev keyboard mouse synaptics synaptics" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer" LINGUAS="en_US en" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php5-5" PYTHON_SINGLE_TARGET="python2_7" PYTHON_TARGETS="python2_7 python3_3" QEMU_SOFTMMU_TARGETS="arm armeb i386 x86_64 mips mips64 mipsel mips64el ppc ppc64 sparc sparc64" QEMU_USER_TARGETS="arm armeb i386 x86_64 microblaze mips mips64 mipsel mips64el ppc ppc64 sparc sparc64" RUBY_TARGETS="ruby19 ruby20 ruby21" USERLAND="GNU" VIDEO_CARDS="intel nouveau nvidia qxl vmware" XFCE_PLUGINS="brightness menu logout trash" 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, LC_ALL, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, USE_PYTHON

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

net-misc/tor-0.2.6.7::gentoo was built with the following:
USE="nat-pmp seccomp tor-hardening transparent-proxy -bufferevents -scrypt (-selinux) -stats -systemd -test -upnp -web" ABI_X86="64"


net-libs/miniupnpc-1.9.20150427::gentoo was built with the following:
USE="ipv6 -static-libs" ABI_X86="64"
Comment 7 r3lgar 2015-05-06 08:32:39 UTC
(In reply to Anthony Basile from comment #2)

With =net-libs/miniupnpc-1.9.20150427 nothing changes.
Comment 8 Anthony Basile gentoo-dev 2015-05-06 11:28:56 UTC
(In reply to RB from comment #6)
> (in reply to comment #5)
> > tor with USE=upnp builds against the 27 version.
> 
> Unfortunately, for me it does not.  Emerge --info follows, but compiling
> net-misc/tor-0.2.6.7 with USE=upnp results in the exact same error the OP's
> build.log describes, an excerpt from my own pasted below:
> 

I'm still not hitting this so something is different.  To be clear, what flag combination did you use?  The flags below have USE=-upnp.

Also you have both gcc-4.8.4 and 4.9.2.  Does it fail with both?


> 
> net-misc/tor-0.2.6.7::gentoo was built with the following:
> USE="nat-pmp seccomp tor-hardening transparent-proxy -bufferevents -scrypt
> (-selinux) -stats -systemd -test -upnp -web" ABI_X86="64"
> 
> 
> net-libs/miniupnpc-1.9.20150427::gentoo was built with the following:
> USE="ipv6 -static-libs" ABI_X86="64"
Comment 9 Anthony Basile gentoo-dev 2015-05-06 11:45:25 UTC
> I'm still not hitting this so something is different.  To be clear, what
> flag combination did you use?  The flags below have USE=-upnp.
> 
> Also you have both gcc-4.8.4 and 4.9.2.  Does it fail with both?
> 

Follow up on the above, can you guys give me the output of

1) gcc -v

2) gcc -E /usr/include/miniupnpc/miniwget.h 

Make sure you use the same version of gcc as the one that's failing.
Comment 10 RB 2015-05-06 13:45:04 UTC
For background and clarity, this is a Pentoo-originated system running ~amd64 and USE="upnp" set globally in make.conf.

The USE="-upnp" for net-misc/tor was to get it rebuilt and working again, but subsequent attempts to build with USE="upnp" (since that is my default) fail.  I am defaulting to gcc-4.9.2 (have done "emerge -eD world" since switching), and gcc-4.8.4 (gcc-config x86_64-pc-linux-gnu-4.8.4 && env-update && . /etc/profile) fails in the same way.  

$ gcc -v
Using built-in specs.
COLLECT_GCC=/usr/x86_64-pc-linux-gnu/gcc-bin/4.9.2/gcc
COLLECT_LTO_WRAPPER=/usr/libexec/gcc/x86_64-pc-linux-gnu/4.9.2/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: /var/tmp/portage/sys-devel/gcc-4.9.2/work/gcc-4.9.2/configure --host=x86_64-pc-linux-gnu --build=x86_64-pc-linux-gnu --prefix=/usr --bindir=/usr/x86_64-pc-linux-gnu/gcc-bin/4.9.2 --includedir=/usr/lib/gcc/x86_64-pc-linux-gnu/4.9.2/include --datadir=/usr/share/gcc-data/x86_64-pc-linux-gnu/4.9.2 --mandir=/usr/share/gcc-data/x86_64-pc-linux-gnu/4.9.2/man --infodir=/usr/share/gcc-data/x86_64-pc-linux-gnu/4.9.2/info --with-gxx-include-dir=/usr/lib/gcc/x86_64-pc-linux-gnu/4.9.2/include/g++-v4 --with-python-dir=/share/gcc-data/x86_64-pc-linux-gnu/4.9.2/python --enable-languages=c,c++,fortran --enable-obsolete --enable-secureplt --disable-werror --with-system-zlib --enable-nls --without-included-gettext --enable-checking=release --with-bugurl=https://bugs.gentoo.org/ --with-pkgversion='Gentoo 4.9.2 p1.3, pie-0.6.2' --enable-libstdcxx-time --enable-shared --enable-threads=posix --enable-__cxa_atexit --enable-clocale=gnu --enable-multilib --with-multilib-list=m32,m64 --disable-altivec --disable-fixed-point --enable-targets=all --disable-libgcj --enable-libgomp --disable-libmudflap --disable-libssp --disable-libcilkrts --enable-lto --without-cloog --enable-libsanitizer
Thread model: posix
gcc version 4.9.2 (Gentoo 4.9.2 p1.3, pie-0.6.2)

#########  Output of gcc -E (...) :
$ gcc -E /usr/include/miniupnpc/miniwget.h
# 1 "/usr/include/miniupnpc/miniwget.h"
# 1 "<built-in>"
# 1 "<command-line>"
# 1 "/usr/include/stdc-predef.h" 1 3 4
# 1 "<command-line>" 2
# 1 "/usr/include/miniupnpc/miniwget.h"
# 11 "/usr/include/miniupnpc/miniwget.h"
# 1 "/usr/include/miniupnpc/declspec.h" 1
# 12 "/usr/include/miniupnpc/miniwget.h" 2





__attribute__ ((visibility ("default"))) void * getHTTPResponse(int s, int * size);

__attribute__ ((visibility ("default"))) void * miniwget(const char *, int *, unsigned int);

__attribute__ ((visibility ("default"))) void * miniwget_getaddr(const char *, int *, char *, int, unsigned int);

int parseURL(const char *, char *, unsigned short *, char * *, unsigned int *);
Comment 11 Anthony Basile gentoo-dev 2015-05-06 22:17:58 UTC
(In reply to RB from comment #10)
> For background and clarity, this is a Pentoo-originated system running
> ~amd64 and USE="upnp" set globally in make.conf.

your results are correct so far.  try running the following command and let me know if it throws any kind of error:

echo '__attribute__ ((visibility ("default"))) void * getHTTPResponse(int s, int * size);' | gcc -x c -c -o /dev/null -
Comment 12 RB 2015-05-06 22:25:15 UTC
> comment #11
That returns with no output, return code 0.
Comment 13 Anthony Basile gentoo-dev 2015-05-07 13:48:02 UTC
(In reply to RB from comment #12)
> > comment #11
> That returns with no output, return code 0.

So I don't get what's going on here.  The original error shows that the macro MINIUPNP_LIBSPEC is not being expanded in <miniupnpc/miniwget.h> despited the fact that it does #include "declspec.h" which defines it.  Yes a direct test (comment #10) shows that the declspec.h is being included, that MINIUPNP_LIBSPEC is being expanded, and that the compiler understands the __attribute__ (comment #12).  (If this wasn't the case, you'd have a lot of other problems, but we had to check.)

However, in the context of the tor build system this is not happening.  Since I can't reproduce this I can only suggest debugging techniques at your end.  Wait till the build breaks, then cd into the src directory and try running  the following manually.  Run variations of it, try adding -I's and poke around to see why declspec.h is not being included.  Sorry I can't be much more help.

x86_64-pc-linux-gnu-gcc -std=gnu99 -DHAVE_CONFIG_H -I.    -I"./src/ext" -I./src/common     -march=native -O2 -pipe -fasynchronous-unwind-tables -Wall -fno-strict-aliasing -c -o src/tools/tor-fw-helper/src_tools_tor_fw_helper_tor_fw_helper-tor-fw-helper-natpmp.o `test -f 'src/tools/tor-fw-helper/tor-fw-helper-natpmp.c' || echo './'`src/tools/tor-fw-helper/tor-fw-helper-natpmp.c
Comment 14 RB 2015-05-07 19:35:42 UTC
> debugging techniques

In which case it'll probably be several days (next week) until I can get to this, I have other production matters to attend to.  Hopefully someone else encounters it and/or has some time to debug in the interim.
Comment 15 RB 2015-05-08 17:35:29 UTC
The issue appears to be that __GNUC__ is not defined or >= 4 when make invokes GCC in the following manner (from comment #13 and the observed failures):

x86_64-pc-linux-gnu-gcc -std=gnu99 -DHAVE_CONFIG_H -I.    -I"./src/ext" -I./src/common     -march=native -O2 -pipe -fasynchronous-unwind-tables -Wall -fno-strict-aliasing -c -o src/tools/tor-fw-helper/src_tools_tor_fw_helper_tor_fw_helper-tor-fw-helper-natpmp.o `test -f 'src/tools/tor-fw-helper/tor-fw-helper-natpmp.c' || echo './'`src/tools/tor-fw-helper/tor-fw-helper-natpmp.c

It is, however, set appropriately when running a bare "gcc -E".
Comment 16 RB 2015-05-08 17:46:14 UTC
Sorry for the bugspam.

It's also worth pointing out that net-misc/tor-0.2.6.7[upnp] builds perfectly well against net-libs/miniupnpc-1.8 (marked stable).
Comment 17 Anthony Basile gentoo-dev 2015-05-09 11:24:35 UTC
(In reply to RB from comment #15)
> The issue appears to be that __GNUC__ is not defined or >= 4 when make
> invokes GCC in the following manner (from comment #13 and the observed
> failures):
> 
> x86_64-pc-linux-gnu-gcc -std=gnu99 -DHAVE_CONFIG_H -I.    -I"./src/ext"
> -I./src/common     -march=native -O2 -pipe -fasynchronous-unwind-tables
> -Wall -fno-strict-aliasing -c -o
> src/tools/tor-fw-helper/src_tools_tor_fw_helper_tor_fw_helper-tor-fw-helper-
> natpmp.o `test -f 'src/tools/tor-fw-helper/tor-fw-helper-natpmp.c' || echo
> './'`src/tools/tor-fw-helper/tor-fw-helper-natpmp.c
> 
> It is, however, set appropriately when running a bare "gcc -E".

This doesn't make sense to me because if __GNUC__ were not defined or not >= 4 then the header falls back to an empty definition of MINIUPNP_LIBSPEC which would build but not give miniwget() and friends hidden visibility.

I'm cc-ing the maintainers of miniunpnc to see if they can make sense of this.
Comment 18 Nathan Caldwell 2015-05-23 20:16:39 UTC
Created attachment 403838 [details]
tor-fw-helper.i

Here is a preprocessed tor-fw-helper.c showing MINIUPNP_LIBSPEC never gets set.

Also notice that before including <miniupnp/declspec.h>, <declspec.h> is included by <natpmp.h> both set the DECLSPEC_H_INCLUDED macro. This results in the entire <miniupnp/declspec.h> file never being processed. As the <declspec.h> file only defines LIBSPEC not MINIUPNP_LIBSPEC, it never gets defined!
Comment 19 Anthony Basile gentoo-dev 2015-05-24 10:37:26 UTC
(In reply to Nathan Caldwell from comment #18)
> Created attachment 403838 [details]
> tor-fw-helper.i
> 
> Here is a preprocessed tor-fw-helper.c showing MINIUPNP_LIBSPEC never gets
> set.
> 
> Also notice that before including <miniupnp/declspec.h>, <declspec.h> is
> included by <natpmp.h> both set the DECLSPEC_H_INCLUDED macro. This results
> in the entire <miniupnp/declspec.h> file never being processed. As the
> <declspec.h> file only defines LIBSPEC not MINIUPNP_LIBSPEC, it never gets
> defined!

Thanks that's what I needed.  Right now we have a bit of a mess with libnatpmp and miniupnpc which is why I wasn't hitting this.  Can you give me your versions of net-libs/miniupnpc and net-libs/libnatpmp so I can compare to what I'm getting at this end and make sure we're on the same page.
Comment 20 Anthony Basile gentoo-dev 2015-05-24 12:10:52 UTC
Both packages are from the same upstream and I've made upstream aware.  See ${URL}.

In the meant time, I recommend renaming <miniupnpc/declspec.h> to <miniupnpc/miniupnpc-declspec.h> and changing DECLSPEC_H_INCLUDED to MINIUPNPC-DECLSPEC_H_INCLUDED.
Comment 21 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2015-10-01 16:39:07 UTC
Good news, everyone! miniupnpc-1.9.20150917 renames this file, so the issue is solved. Now we just need to fix all reverse dependencies to use the new API.
Comment 22 Anthony Basile gentoo-dev 2015-10-01 17:10:50 UTC
(In reply to Michał Górny from comment #21)
> Good news, everyone! miniupnpc-1.9.20150917 renames this file, so the issue
> is solved. Now we just need to fix all reverse dependencies to use the new
> API.

Ironically tor-0.2.7.x dropped libnatpmp.  But this is good news.  I did report it upstream but the last I heard they weren't sure how to fix it.  I guess they came up with something.