Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 149356 - [cross-mingw32/gcc] building any C++ code fails with: libstdc++ undefined reference to `___dso_handle'
Summary: [cross-mingw32/gcc] building any C++ code fails with: libstdc++ undefined ref...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: New packages (show other bugs)
Hardware: All Linux
: High normal
Assignee: Gentoo Toolchain Maintainers
URL:
Whiteboard:
Keywords:
: 149410 (view as bug list)
Depends on:
Blocks:
 
Reported: 2006-09-27 15:32 UTC by Cédric Krier
Modified: 2006-09-28 06:29 UTC (History)
1 user (show)

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Cédric Krier gentoo-dev 2006-09-27 15:32:45 UTC
When cross-compiling a c++ with mingw32-g++, there is undefined references in libstdc++ to ___dso_handle and ___cxa_atexit
Comment 1 Jakub Moc (RETIRED) gentoo-dev 2006-09-27 15:36:39 UTC
Post actual errors you get, emerge --info and reopen then.
Comment 2 Cédric Krier gentoo-dev 2006-09-28 01:18:29 UTC
here is the error message when compiling a cpp source with mingw32-g++:


/usr/lib/gcc/mingw32/4.1.1/libstdc++.a(eh_globals.o):(.text+0x59): undefined reference to `___dso_handle'
/usr/lib/gcc/mingw32/4.1.1/libstdc++.a(eh_globals.o):(.text+0x65): undefined reference to `___cxa_atexit'
collect2: ld returned 1 exit status

emerge --info:

Portage 2.1.1 (hardened/x86/2.6, gcc-3.4.6, glibc-2.3.6-r4, 2.6.16-hardened-r11 i686)
=================================================================
System uname: 2.6.16-hardened-r11 i686 AMD Athlon(TM) XP 2400+
Gentoo Base System version 1.12.5
Last Sync: Wed, 27 Sep 2006 18:50:01 +0000
distcc 2.18.3 i686-pc-linux-gnu (protocols 1 and 2) (default port 3632) [disabled]
ccache version 2.3 [enabled]
app-admin/eselect-compiler: [Not Present]
dev-java/java-config: 1.2.11-r1
dev-lang/python:     2.3.5-r2, 2.4.3-r1
dev-python/pycrypto: 2.0.1-r5
dev-util/ccache:     2.3
dev-util/confcache:  0.4.2-r1
sys-apps/sandbox:    1.2.17
sys-devel/autoconf:  2.13, 2.60
sys-devel/automake:  1.4_p6, 1.5, 1.6.3, 1.7.9-r1, 1.8.5-r3, 1.9.6-r2
sys-devel/binutils:  2.16.1-r3
sys-devel/gcc-config: 1.3.13-r3
sys-devel/libtool:   1.5.22
virtual/os-headers:  2.6.17-r1
ACCEPT_KEYWORDS="x86"
AUTOCLEAN="yes"
CBUILD="i686-pc-linux-gnu"
CFLAGS="-O3 -march=athlon-xp -fomit-frame-pointer -pipe"
CHOST="i686-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/share/X11/xkb /usr/share/texmf/dvipdfm/config/ /usr/share/texmf/dvips/config/ /usr/share/texmf/tex/generic/config/ /usr/share/texmf/tex/platex/config/ /usr/share/texmf/xdvi/"
CONFIG_PROTECT_MASK="/etc/env.d /etc/gconf /etc/revdep-rebuild /etc/terminfo"
CXXFLAGS="-O3 -march=athlon-xp -fomit-frame-pointer -pipe"
DISTDIR="/usr/portage/distfiles"
FEATURES="autoconfig ccache collision-protect confcache distlocks metadata-transfer parallel-fetch sandbox sfperms strict userfetch userpriv usersandbox"
GENTOO_MIRRORS="http://ftp.belnet.be/mirror/rsync.gentoo.org/gentoo/ ftp://ftp.belnet.be/mirror/rsync.gentoo.org/gentoo/"
LANG="en_US.UTF-8"
LC_ALL="en_US.UTF-8"
LINGUAS=""
MAKEOPTS="-j2"
PKGDIR="/usr/portage//packages/x86/"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --delete-after --stats --timeout=180 --exclude='/distfiles' --exclude='/local' --exclude='/packages'"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage/"
PORTDIR_OVERLAY="/usr/local/portage /usr/portage/local/layman/sunrise"
SYNC="rsync://rsync.europe.gentoo.org/gentoo-portage"
USE="3dnow X alsa bash-completion bzip2 caps cdr crypt cups dedicated divx4linux dlloader dri dv dvb dvd dvdread elibc_glibc encode fam fbcon foomaticdb gdbm geoip ggi gnutls gtk gtk2 hardened imap input_devices_keyboard input_devices_mouse ipv6 javascript jpeg kernel_linux lcms libcaca lirc lirc_devices_leadtek_pvr2000 logrotate matrox mbox mmx mng motif mozsvg mpeg nas nls nptl nptlonly nsplugin offensive opengl oss pam pcre pic png ppds readline samba sdl sse ssl svg tcpd theora threads tiff truetype unicode userland_GNU userlocales v4l v4l2 video_cards_nv video_cards_vesa win32codecs wmf x86 xface xorg xv zlib"
Unset:  CTARGET, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LDFLAGS, PORTAGE_RSYNC_EXTRA_OPTS
Comment 3 Roberto Castagnola 2006-09-28 04:24:05 UTC
I have created a mingw32 cross-compiler with crossdev-0.9.17 using gcc-3.4.6-r2, but compiling a my project I get the same error (while using dev-util/xmingw-gcc it doesn't happened); I solved it adding '-fno-use-cxa-atexit' flag while compiling.
Checking on file cross-mingw32-gcc-stage2.log I found out that the option '--enable-__cxa_atexit' where used to configuring GCC (while it wasn't used compiling dev-util/xmingw-gcc).
Maybe this option should not be used when creating a mingw32 compiler.
Comment 4 SpanKY gentoo-dev 2006-09-28 04:55:01 UTC
ive fixed up toolchain.eclass accordingly ... thanks for finding that !
Comment 5 Jakub Moc (RETIRED) gentoo-dev 2006-09-28 06:29:21 UTC
*** Bug 149410 has been marked as a duplicate of this bug. ***