Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 388995 - games-strategy/wesnoth-1.8.* fails to build with dev-libs/boost-1.47.0-r1 with gcc 4.6
Summary: games-strategy/wesnoth-1.8.* fails to build with dev-libs/boost-1.47.0-r1 wit...
Status: RESOLVED INVALID
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Games (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Gentoo Games
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: boost-1.47
  Show dependency tree
 
Reported: 2011-10-30 17:01 UTC by Ben Longbons
Modified: 2011-11-16 05:17 UTC (History)
2 users (show)

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


Attachments
wesnoth 1.8.6 build.log (build.log,416.42 KB, text/plain)
2011-10-30 17:02 UTC, Ben Longbons
Details
backported patch from upstream (wesnoth-1.8.6-backport-boost-1.47-gcc-4.6-fix.patch,3.29 KB, patch)
2011-11-15 03:34 UTC, Ben Longbons
Details | Diff
add the patch line to the ebuild (wesnoth-1.8.6.ebuild.diff,667 bytes, patch)
2011-11-15 03:36 UTC, Ben Longbons
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Ben Longbons 2011-10-30 17:01:31 UTC
After emerge --depclean removed boost 1.46, revdep-rebuild indicated broken links. So I tried to rebuild it.

Removing boost 1.47 allows wesnoth to build again. (changing the version used by eselect boost is not enough, because the ebuild explicitly overrides it)

---
emerge -pqv =games-strategy/wesnoth-1.8.6

[ebuild   R   ] games-strategy/wesnoth-1.8.6  USE="dbus doc server -dedicated -nls -tinygui"

---
emerge --info =games-strategy/wesnoth-1.8.6

Portage 2.1.10.31 (default/linux/amd64/10.0, gcc-4.6.1, glibc-2.13-r4, 3.1.0-gentoo x86_64)
=================================================================
                         System Settings
=================================================================
System uname: Linux-3.1.0-gentoo-x86_64-AMD_Athlon-tm-_64_X2_Dual_Core_Processor_4200+-with-gentoo-2.1
Timestamp of tree: Sun, 30 Oct 2011 09:45:01 +0000
app-shells/bash:          4.2_p10
dev-java/java-config:     2.1.11-r3
dev-lang/python:          2.7.2-r3, 3.2.2
dev-util/cmake:           2.8.6-r1
dev-util/pkgconfig:       0.26
sys-apps/baselayout:      2.1
sys-apps/openrc:          0.9.4
sys-apps/sandbox:         2.5
sys-devel/autoconf:       2.13, 2.68
sys-devel/automake:       1.9.6-r3, 1.10.3, 1.11.1-r1
sys-devel/binutils:       2.21.1-r1
sys-devel/gcc:            4.2.4-r1, 4.3.6-r1, 4.4.6-r1, 4.5.3-r1, 4.6.0, 4.6.1-r1
sys-devel/gcc-config:     1.4.1-r1
sys-devel/libtool:        2.4-r4
sys-devel/make:           3.82-r3
sys-kernel/linux-headers: 2.6.39 (virtual/os-headers)
sys-libs/glibc:           2.13-r4
Repositories: gentoo o11c
ACCEPT_KEYWORDS="amd64 ~amd64"
ACCEPT_LICENSE="* -@EULA"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-O2 -pipe -march=native -ggdb"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/share/config /usr/share/gnupg/qualified.txt /var/lib/hsqldb"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/env.d/java/ /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/php/apache2-php5.3/ext-active/ /etc/php/cgi-php5.3/ext-active/ /etc/php/cli-php5.3/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 -ggdb"
DISTDIR="/usr/portage/distfiles"
FEATURES="assume-digests binpkg-logs distlocks ebuild-locks fixlafiles news parallel-fetch protect-owned sandbox sfperms splitdebug strict unknown-features-warn unmerge-logs unmerge-orphans userfetch"
FFLAGS=""
GENTOO_MIRRORS="http://gentoo.mirrors.easynews.com/linux/gentoo/ http://distro.ibiblio.org/pub/linux/distributions/gentoo/ http://gentoo.osuosl.org/ http://mirror.its.uidaho.edu/pub/gentoo/ ftp://ftp.wallawalla.edu/pub/mirrors/ftp.gentoo.org"
LANG="en_US.UTF-8"
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
LINGUAS="en"
MAKEOPTS="-j3"
PKGDIR="/usr/portage/packages"
PORTAGE_CONFIGROOT="/"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --stats --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/usr/local/portage"
SYNC="rsync://rsync.us.gentoo.org/gentoo-portage"
USE="X acl alsa amd64 avahi bash-completion berkdb bzip2 cli consolekit cracklib crypt cups cxx dbus doc dri ffmpeg flac fortran gdbm gpm gtk hal hscolour iconv ipv6 jpeg kde midi mikmod mmx mng modules mp3 mp4 mpeg mudflap multilib ncurses nptl nptlonly ogg opengl openmp pam pcre png pppd qt3support qt4 readline sdl session sql sse sse2 ssl svg sysfs tcpd threads tiff timidity truetype unicode usb vorbis webkit xinerama xorg zeroconf zlib" 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="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 synaptics" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LINGUAS="en" PHP_TARGETS="php5-3" RUBY_TARGETS="ruby18" 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"
Unset:  CPPFLAGS, CTARGET, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LC_ALL, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS

=================================================================
                        Package Settings
=================================================================
USE="dbus doc (multilib) server -dedicated -nls -tinygui"

games-strategy/wesnoth-1.8.6 was built with the following:
CXXFLAGS="-O2 -pipe -march=native -ggdb -I/usr/include/boost-1_46"
LDFLAGS="-Wl,-O1 -Wl,--as-needed -L/usr/lib64/boost-1_46"
Comment 1 Ben Longbons 2011-10-30 17:02:30 UTC
Created attachment 291249 [details]
wesnoth 1.8.6 build.log
Comment 2 Mr. Bones. (RETIRED) gentoo-dev 2011-10-31 21:23:28 UTC
builds fine for me with dev-libs/boost-1.47.0-r1 on stable x86.
Comment 3 Ben Longbons 2011-11-01 07:02:42 UTC
Hm, it it is related to an added boost check for GCC 4.6.

I don't understand why boost would have made this change - GCC 4.6 supports range-based for natively, but it doesn't try to use that for BOOST_FOREACH

I don't pretend to understand most of the header, but I changed the condition and wesnoth built properly.


---
in /usr/include/boost-1_46/boost/foreach.hpp :

// Some compilers let us detect even const-qualified rvalues at compile-time
#if BOOST_WORKAROUND(BOOST_MSVC, >= 1310) && !defined(_PREFAST_)                                 \
 || (BOOST_WORKAROUND(__GNUC__, >= 4) && !defined(BOOST_INTEL) && !defined(BOOST_CLANG))         \
 || (BOOST_WORKAROUND(__GNUC__, == 3) && (__GNUC_MINOR__ >= 4) && !defined(BOOST_INTEL) &&       \
                                                                  !defined(BOOST_CLANG))
# define BOOST_FOREACH_COMPILE_TIME_CONST_RVALUE_DETECTION
#else

---
in /usr/include/boost-1_47/boost/foreach.hpp :

// Some compilers let us detect even const-qualified rvalues at compile-time
#if !defined(BOOST_NO_RVALUE_REFERENCES)                                                         \
 || BOOST_WORKAROUND(BOOST_MSVC, >= 1310) && !defined(_PREFAST_)                                 \
 || (BOOST_WORKAROUND(__GNUC__, == 4) && (__GNUC_MINOR__ <= 5) && !defined(BOOST_INTEL) &&       \
                                                                  !defined(BOOST_CLANG))         \
 || (BOOST_WORKAROUND(__GNUC__, == 3) && (__GNUC_MINOR__ >= 4) && !defined(BOOST_INTEL) &&       \
                                                                  !defined(BOOST_CLANG))
# define BOOST_FOREACH_COMPILE_TIME_CONST_RVALUE_DETECTION
#else
Comment 4 Ben Longbons 2011-11-01 15:28:29 UTC
See:

https://svn.boost.org/trac/boost/ticket/5279

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49021

Also, as someone in #boost helpfully pointed out - the fact that GCC 4.6 supports range-based for is irrelevant because not everybody uses C++11 - and to remember to file a bug on Boost's tracker.
Comment 5 Mr. Bones. (RETIRED) gentoo-dev 2011-11-01 16:07:36 UTC
so it's a gcc bug.  and hey, you're using a masked gcc version so you get to keep both pieces.
Comment 6 Ben Longbons 2011-11-01 21:42:42 UTC
Sure, GCC 4.6 is masked *now*, but it (or possibly a later version) will be unmasked *sometime*. It is a *fix* in GCC 4.6 that was *incorrect* in previous versions, which uncovered a *bug* in boost (which may be very difficult to fix).

What is the point in "masked for testing" if we can't file bug reports about broken packages?

From my understanding, with GCC 4.6: certain code (not necessarily what is in wesnoth) will fail at runtime with older versions of boost, and certain code (such as in wesnoth) will fail to compile with newer versions of boost.

Also, why is the wesnoth ebuild unconditionally overriding the version chosen by eselect boost? Shouldn't it only do that if eselect boost points to something older than the required version?
Comment 7 Markus Walter 2011-11-14 13:35:45 UTC
This seems to be fixed upstream with Wesnoth. See https://gna.org/bugs/index.php?18399

So it seems we only have to wait for next Wesnoth release.
Comment 8 Ben Longbons 2011-11-15 03:34:36 UTC
Created attachment 292585 [details, diff]
backported patch from upstream

Although upstream has decided not to fix for 1.8, the patch cleanly applies after removing the changelog section.
Comment 9 Ben Longbons 2011-11-15 03:36:02 UTC
Created attachment 292587 [details, diff]
add the patch line to the ebuild
Comment 10 Steffen Schaumburg 2011-11-16 05:17:04 UTC
(In reply to comment #5)
> so it's a gcc bug.  and hey, you're using a masked gcc version so you get to
> keep both pieces.

I can confirm Ben's backport works on my mostly ~amd64 system.
As a patch has now been located and adapted, please include it so gcc-4.6 can move one bit closer to ~arch :)