Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 330671 - dev-libs/boost fails when cross-compiled for i686-mingw32
Summary: dev-libs/boost fails when cross-compiled for i686-mingw32
Status: RESOLVED OBSOLETE
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: New packages (show other bugs)
Hardware: All Linux
: High normal
Assignee: David Seifert
URL:
Whiteboard:
Keywords:
: 330691 521942 (view as bug list)
Depends on:
Blocks:
 
Reported: 2010-08-01 02:15 UTC by Adam Nielsen
Modified: 2019-12-14 20:25 UTC (History)
2 users (show)

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


Attachments
boost-1.56.0-r1-mingw.patch (boost-1.56.0-r1-mingw.patch,698 bytes, patch)
2015-03-26 11:47 UTC, Michael Seifert
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Adam Nielsen 2010-08-01 02:15:51 UTC
Run "crossdev -t i686-mingw32" to install a Windows cross compiler, then run "i686-mingw32-emerge boost" and the compilation fails with:

    "i686-mingw32-g++"    -o "bin.v2/libs/math/build/gcc-mingw-4.3/gentoorelease/pch-off/libboost_math_c99-1_42.so.1.42.0" -Wl,-h -Wl,libboost_math_c99-1_42.so.1.42.0 -shared -Wl,--start-group "bin.v2/libs/math/build/gcc-mingw-4.3/gentoorelease/pch-off/acosh.o" "bin.v2/libs/math/build/gcc-mingw-4.3/gentoorelease/pch-off/asinh.o" "bin.v2/libs/math/build/gcc-mingw-4.3/gentoorelease/pch-off/atanh.o" "bin.v2/libs/math/build/gcc-mingw-4.3/gentoorelease/pch-off/cbrt.o" "bin.v2/libs/math/build/gcc-mingw-4.3/gentoorelease/pch-off/copysign.o" "bin.v2/libs/math/build/gcc-mingw-4.3/gentoorelease/pch-off/erfc.o" "bin.v2/libs/math/build/gcc-mingw-4.3/gentoorelease/pch-off/erf.o" "bin.v2/libs/math/build/gcc-mingw-4.3/gentoorelease/pch-off/expm1.o" "bin.v2/libs/math/build/gcc-mingw-4.3/gentoorelease/pch-off/fmax.o" "bin.v2/libs/math/build/gcc-mingw-4.3/gentoorelease/pch-off/fmin.o" "bin.v2/libs/math/build/gcc-mingw-4.3/gentoorelease/pch-off/fpclassify.o" "bin.v2/libs/math/build/gcc-mingw-4.3/gentoorelease/pch-off/hypot.o" "bin.v2/libs/math/build/gcc-mingw-4.3/gentoorelease/pch-off/lgamma.o" "bin.v2/libs/math/build/gcc-mingw-4.3/gentoorelease/pch-off/llround.o" "bin.v2/libs/math/build/gcc-mingw-4.3/gentoorelease/pch-off/log1p.o" "bin.v2/libs/math/build/gcc-mingw-4.3/gentoorelease/pch-off/lround.o" "bin.v2/libs/math/build/gcc-mingw-4.3/gentoorelease/pch-off/nextafter.o" "bin.v2/libs/math/build/gcc-mingw-4.3/gentoorelease/pch-off/nexttoward.o" "bin.v2/libs/math/build/gcc-mingw-4.3/gentoorelease/pch-off/round.o" "bin.v2/libs/math/build/gcc-mingw-4.3/gentoorelease/pch-off/tgamma.o" "bin.v2/libs/math/build/gcc-mingw-4.3/gentoorelease/pch-off/trunc.o"  -Wl,-Bstatic  -Wl,-Bdynamic  -Wl,--end-group  

/usr/lib/gcc/i686-mingw32/4.3.5/libstdc++.a(stubs.o): In function `hypot':
/var/tmp/cross/i686-mingw32/portage/cross-i686-mingw32/gcc-4.3.5/work/gcc-4.3.5/libstdc++-v3/libmath/stubs.c:275: multiple definition of `_hypot'
bin.v2/libs/math/build/gcc-mingw-4.3/gentoorelease/pch-off/hypot.o:hypot.cpp:(.text+0x5f): first defined here
collect2: ld returned 1 exit status
...failed updating 1 target...
 * ERROR: dev-libs/boost-1.42.0-r1 failed:
 *   building boost failed
 * 
 * Call stack:
 *     ebuild.sh, line  54:  Called src_compile
 *   environment, line 5268:  Called die
 * The specific snippet of code:
 *       ${BJAM} ${NUMJOBS} -q -d+2 gentoorelease ${OPTIONS} threading=single,multi ${LINK_OPTS} runtime-link=shared || die "building boost failed";
 * 
 * If you need support, post the output of 'emerge --info =dev-libs/boost-1.42.0-r1',
 * the complete build log and the output of 'emerge -pqv =dev-libs/boost-1.42.0-r1'.
 * The complete build log is located at '/var/tmp/portage/dev-libs/boost-1.42.0-r1/temp/build.log'.
 * The ebuild environment file is located at '/var/tmp/portage/dev-libs/boost-1.42.0-r1/temp/environment'.
 * S: '/var/tmp/portage/dev-libs/boost-1.42.0-r1/work/boost_1_42_0'

$ i686-mingw32-emerge --info =dev-libs/boost-1.42.0-r1
Portage 2.1.8.3 (prefix/windows/winnt/5.2/x86, gcc-4.3.5, glibc-2.11-r0, 2.6.33.1 x86_64)
=================================================================
                        System Settings
=================================================================
System uname: Linux-2.6.33.1-x86_64-Intel-R-_Core-TM-2_Quad_CPU_Q6600_@_2.40GHz-with-gentoo-2.0.1
Timestamp of tree: Wed, 28 Jul 2010 16:00:01 +0000
distcc 3.1 x86_64-pc-linux-gnu [disabled]
app-shells/bash:     4.0_p35
dev-java/java-config: 1.3.7-r1, 2.1.10
dev-lang/python:     2.4.4-r6, 2.5.4-r3, 2.6.4, 3.1.1-r1
dev-util/cmake:      2.8.0
sys-apps/baselayout: 2.0.1
sys-apps/openrc:     0.5.2-r2
sys-apps/sandbox:    2.2
sys-devel/autoconf:  2.13, 2.64
sys-devel/automake:  1.5, 1.7.9-r1, 1.8.5-r3, 1.9.6-r3, 1.10.3, 1.11.1
sys-devel/binutils:  2.20
sys-devel/gcc:       3.4.6-r2, 4.1.2, 4.3.4, 4.4.2
sys-devel/gcc-config: 1.4.1
sys-devel/libtool:   2.2.6b
virtual/os-headers:  2.6.30-r1
ACCEPT_KEYWORDS="~x86-winnt"
ACCEPT_LICENSE="*"
CBUILD="i686-mingw32"
CFLAGS=""
CHOST="i686-mingw32"
CONFIG_PROTECT="/etc /usr/share/X11/xkb /usr/share/config /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/ext-active/ /etc/php/cgi-php5/ext-active/ /etc/php/cli-php5/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 /etc/udev/rules.d"
CXXFLAGS=""
DISTDIR="/usr/portage/distfiles"
FEATURES="assume-digests collision-protect distlocks fixpackages news nostrip parallel-fetch protect-owned sfperms strict unmerge-logs unmerge-orphans userfetch"
GENTOO_MIRRORS="http://distfiles.gentoo.org"
LANG="en_AU.UTF-8"
LC_ALL="en_AU.UTF-8"
LDFLAGS=""
PKGDIR="/usr/portage/packages"
PORTAGE_CONFIGROOT="/usr/i686-mingw32/"
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"
SYNC="rsync://rsync.gentoo.org/gentoo-portage"
USE="cracklib cxx modules prefix ssl x86-winnt zlib" 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" ELIBC="Winnt" INPUT_DEVICES="keyboard mouse" KERNEL="Winnt" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" RUBY_TARGETS="ruby18" USERLAND="GNU" 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, FFLAGS, INSTALL_MASK, LINGUAS, MAKEOPTS, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS, PORTDIR_OVERLAY

$ i686-mingw32-emerge -pqv =dev-libs/boost-1.42.0-r1
[ebuild     U ] dev-libs/boost-1.42.0-r1 [1.42.0] USE="eselect -debug -doc* -icu -mpi -python* -static-libs -test -tools*"

I'm not sure why it's listed as an upgrade, the only versions already installed are the native ones, there are no cross-compiled ones installed yet.
Comment 1 Chí-Thanh Christopher Nguyễn gentoo-dev 2010-08-01 09:22:12 UTC
Maybe you can work around this with LDFLAGS="-Wl,-z,muldefs"
But this would of course not be a proper solution.
Comment 2 Pacho Ramos gentoo-dev 2010-08-01 11:17:26 UTC
*** Bug 330691 has been marked as a duplicate of this bug. ***
Comment 3 Adam Nielsen 2010-08-01 12:07:30 UTC
I'm not sure what those options do, but unfortunately it just changes the error:

$ LDFLAGS="-Wl,-z,muldefs" i686-mingw32-emerge -v boost
/usr/libexec/gcc/i686-mingw32/ld: unrecognized option '-z'
/usr/libexec/gcc/i686-mingw32/ld: use the --help option for usage information

$ LDFLAGS="-Wl,muldefs" i686-mingw32-emerge -v boost
/usr/libexec/gcc/i686-mingw32/ld: muldefs: No such file: No such file or directory
Comment 4 Adam Nielsen 2010-10-22 03:33:45 UTC
Just revisited this, after reinstalling/upgrading mingw32 and the entire cross-compiler environment, now it gets further and instead breaks here:

    "i686-mingw32-g++"  -ftemplate-depth-128 -O2 -pipe -fno-strict-aliasing -finline-functions -Wno-inline -Wall -fPIC  -DBOOST_ALL_NO_LIB=1 -DBOOST_PYTHON_SOURCE -DNDEBUG  -I"." -I"/usr/include/python2.6" -c -o "bin.v2/libs/python/build/gcc-mingw-4.4/gentoorelease/pch-off/numeric.o" "libs/python/src/numeric.cpp"

libs/python/src/numeric.cpp:1: warning: -fPIC ignored for target (all code is position independent)
In file included from /usr/include/python2.6/Python.h:58,
                 from ./boost/python/detail/wrap_python.hpp:142,
                 from ./boost/python/detail/prefix.hpp:13,
                 from ./boost/python/numeric.hpp:8,
                 from libs/python/src/numeric.cpp:6:
/usr/include/python2.6/pyport.h:261:24: error: sys/select.h: No such file or directory
In file included from ./boost/python/object/make_instance.hpp:9,
                 from ./boost/python/object/make_ptr_instance.hpp:8,
                 from ./boost/python/to_python_indirect.hpp:11,
                 from ./boost/python/converter/arg_to_python.hpp:10,
                 from ./boost/python/call.hpp:15,
                 from ./boost/python/object_core.hpp:12,
                 from ./boost/python/object.hpp:9,
                 from ./boost/python/tuple.hpp:10,
                 from ./boost/python/numeric.hpp:10,
                 from libs/python/src/numeric.cpp:6:
./boost/python/object/instance.hpp:14: warning: type attributes ignored after type is already defined
...failed updating 1 target...
 * ERROR: dev-libs/boost-1.42.0-r2 failed:
 *   building boost failed
 *
 * Call stack:
 *     ebuild.sh, line  56:  Called src_compile
 *   environment, line 5324:  Called die
 * The specific snippet of code:
 *       ${BJAM} ${NUMJOBS} -q -d+2 gentoorelease ${OPTIONS} threading=single,multi ${LINK_OPTS} runtime-link=shared || die "building boost failed";

Not sure whether it should be looking in /usr/include or /usr/i686-mingw32/include.  Has anyone actually succeeded in cross-compiling Boost?
Comment 5 Michael Seifert 2014-09-02 10:17:20 UTC
*** Bug 521942 has been marked as a duplicate of this bug. ***
Comment 6 Michael Seifert 2014-09-02 10:20:06 UTC
The patch attached in bug #521942 adds support for MinGW toolchains to the boost ebuild. I tested it on a x86_64-w64-mingw32 toolchain, but it should work just as well on i686.

No idea about Python support, though.
Comment 7 Michael Seifert 2015-03-26 11:47:16 UTC
Created attachment 399800 [details, diff]
boost-1.56.0-r1-mingw.patch

The patch adds support for compilation on the x86_64-w64-mingw32 target to the dev-libs/boost-1.56.0-r1 ebuild.
Comment 8 David Seifert gentoo-dev 2019-12-14 20:25:40 UTC
Ancient bug, file a fresh one if this is still an issue.