Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 594138

Summary: sys-libs/libcxxrt-0.0_p20150423-r1 : stdexcept.cc:(.text+<snip>): undefined reference to `operator delete(void*, unsigned long)'
Product: Gentoo Linux Reporter: Toralf Förster <toralf>
Component: Current packagesAssignee: Alexis Ballier <aballier>
Status: RESOLVED FIXED    
Severity: normal CC: bsd+disabled, carlphilippreh, francoisvalenduc, hendrik, jrmalaq, mgorny, plevine457
Priority: Normal    
Version: unspecified   
Hardware: All   
OS: Linux   
URL: https://github.com/pathscale/libcxxrt/issues/43
See Also: https://bugs.gentoo.org/show_bug.cgi?id=632186
Whiteboard:
Package list:
Runtime testing required: ---
Bug Depends on:    
Bug Blocks: 582084    
Attachments: emerge-history.txt
environment
sys-libs:libcxxrt-0.0_p20150423-r1:20160917-211943.log
libcxxrt-0.0_p20150423-gcc6.patch

Description Toralf Förster gentoo-dev 2016-09-17 22:23:53 UTC
x86_64-pc-linux-gnu-g++ -fPIC -nodefaultlibs -march=native -O2 -pipe -Wl,-O1 -Wl,--as-needed -Wl,-z,defs -shared -Wl,-soname,libcxxrt.so.1 -o libcxxrt.so.1 dynamic_cast.So exception.So guard.So stdexcept.So typeinfo.So memory.So auxhelper.So libelftc_dem_gnu3.So -ldl -lgcc_s -lc
stdexcept.So: In function `std::exception::~exception()':
stdexcept.cc:(.text+0xf3): undefined reference to `operator delete(void*, unsigned long)'
stdexcept.So: In function `std::bad_alloc::~bad_alloc()':


$ cat emerge-info.txt
  -----------------------------------------------------------------

  This is an unstable amd64 chroot image (named amd64-desktop-unstable_20160916-100730) at a hardened host acting as a tinderbox.

  -----------------------------------------------------------------
  USE flags ...

  ... in make.conf:
USE="  pax_kernel xtpax -cdinstall -oci8 -bindist alisp apache -apache2 avformat -bugzilla cairo cdb cddb -consolekit dbus dec_av2 -designer dnssec dvb dvd ffmpeg ftp -git -glamor gnutls graphtft gstreamer gtk2 gudev -gzip ipv6 -jadetex javaxml ldap -libvirtd mod mpi mta multitarget ncurses obj ois openexr opengl -pdo pkcs11 policykit pyqt4 qml sdl -smartcard smpeg -sql sqlite3 ssh-askpass ssl sslv3 system-jpeg system-libevent system-sqlite theora timidity tk -tls uml utils uxa vaapi vala vlc vorbis xa -xkb xmlreader xslt"

  ... in /etc/portage/package.use/*:
  mail-mta/ssmtp      ssl mta
  net-misc/wget       ssl
  app-crypt/pinentry  -qt4
  app-editors/emacs   -dbus -svg -ssl -gtk -gtk3
  app-text/xmlto      -latex
  dev-libs/boehm-gc   threads
  dev-libs/libpcre    pcre16
  dev-qt/qtgui        egl eglfs
  net-nds/openldap    -sasl
  dev-util/cmake      -qt4 -qt5
  dev-vcs/git         -perl
  gnome-base/librsvg  -tools
  media-libs/mesa     -vaapi
  sys-apps/kmod       tools
  <=net-misc/openssh-7.3_p1-r2    -hpn
  net-misc/iputils -caps -filecaps

  entries in /etc/portage/package.unmask/*:
  media-video/ffmpeg
  sys-devel/gcc:6.2.0
  -----------------------------------------------------------------

gcc-config -l:
 [1] x86_64-pc-linux-gnu-6.2.0 *

Available Python interpreters, in order of preference:
  [1]   python3.4
  [2]   python2.7 (fallback)

  -----------------------------------------------------------------

Portage 2.3.0 (python 3.4.5-final-0, default/linux/amd64/13.0/desktop, gcc-6.2.0, glibc-2.23-r2, 4.7.4-hardened x86_64)
=================================================================
                         System Settings
=================================================================
System uname: Linux-4.7.4-hardened-x86_64-Intel-R-_Core-TM-_i7-3930K_CPU_@_3.20GHz-with-gentoo-2.3
KiB Mem:    65285480 total,  31474812 free
KiB Swap:   67108860 total,  67108860 free
Timestamp of repository gentoo: Sat, 17 Sep 2016 19:10:36 +0000
sh bash 4.3_p46
ld GNU ld (Gentoo 2.26.1 p1.0) 2.26.1
app-shells/bash:          4.3_p46::gentoo
dev-lang/perl:            5.24.0-r1::gentoo
dev-lang/python:          2.7.12::gentoo, 3.4.5::gentoo
dev-util/cmake:           3.6.2::gentoo
dev-util/pkgconfig:       0.29.1::gentoo
sys-apps/baselayout:      2.3::gentoo
sys-apps/openrc:          0.21.7::gentoo
sys-apps/sandbox:         2.10-r2::gentoo
sys-devel/autoconf:       2.69-r2::gentoo
sys-devel/automake:       1.11.6-r2::gentoo, 1.13.4-r1::gentoo, 1.14.1-r1::gentoo, 1.15-r2::gentoo
sys-devel/binutils:       2.26.1::gentoo
sys-devel/gcc:            6.2.0::gentoo
sys-devel/gcc-config:     1.8-r1::gentoo
sys-devel/libtool:        2.4.6-r2::gentoo
sys-devel/make:           4.2.1::gentoo
sys-kernel/linux-headers: 4.7::gentoo (virtual/os-headers)
sys-libs/glibc:           2.23-r2::gentoo
Repositories:

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

local
    location: /usr/local/portage
    masters: gentoo
    priority: 2

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/config"
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="/var/tmp/distfiles"
EMERGE_DEFAULT_OPTS="--verbose --verbose-conflicts --color=n --nospinner --tree --quiet-build"
FCFLAGS="-O2 -pipe"
FEATURES="assume-digests binpkg-logs config-protect-if-modified distlocks ebuild-locks fixlafiles ipc-sandbox merge-sync network-sandbox parallel-fetch preserve-libs protect-owned sandbox sfperms strict test-fail-continue unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync xattr"
FFLAGS="-O2 -pipe"
GENTOO_MIRRORS="http://ftp.uni-erlangen.de/pub/mirrors/gentoo rsync://mirror.netcologne.de/gentoo/ ftp://sunsite.informatik.rwth-aachen.de/pub/Linux/gor.bytemark.co.uk/gentoo/ rsync://ftp.snt.utwente.nl/gentoo"
LANG="en_US.utf8"
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
MAKEOPTS="-j1"
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 --exclude=/.git"
PORTAGE_TMPDIR="/var/tmp"
USE="X a52 aac acl acpi alisp alsa amd64 apache avformat berkdb bluetooth branding bzip2 cairo cdb cdda cddb cdr cli cracklib crypt cups cxx dbus dec_av2 dnssec dri dts dvb dvd dvdr emboss encode exif fam ffmpeg firefox flac fortran ftp gdbm gif gnutls gpm graphtft gstreamer gtk gtk2 gudev iconv ipv6 javaxml jpeg lcms ldap libnotify mad mmx mmxext mng mod modules mp3 mp4 mpeg mpi mta multilib multitarget ncurses nls nptl obj ogg ois openexr opengl openmp pam pango pax_kernel pcre pdf pkcs11 png policykit ppds pyqt4 qml qt3support qt4 readline sdl seccomp session smpeg spell sqlite3 sse sse2 ssh-askpass ssl sslv3 startup-notification svg system-jpeg system-libevent system-sqlite tcpd theora tiff timidity tk truetype udev udisks uml unicode upower usb utils uxa vaapi vala vlc vorbis wxwidgets x264 xa xattr xcb xml xmlreader xslt xtpax 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 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" INPUT_DEVICES="keyboard mouse evdev" KERNEL="linux" L10N="am" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php5-6" PYTHON_SINGLE_TARGET="python2_7" PYTHON_TARGETS="python2_7 python3_4" RUBY_TARGETS="ruby20 ruby21" USERLAND="GNU" VIDEO_CARDS="amdgpu fbdev intel nouveau radeon radeonsi vesa dummy v4l" 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:  CC, CPPFLAGS, CTARGET, CXX, INSTALL_MASK, LC_ALL, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS, USE_PYTHON
Comment 1 Toralf Förster gentoo-dev 2016-09-17 22:24:00 UTC
Created attachment 446240 [details]
emerge-history.txt
Comment 2 Toralf Förster gentoo-dev 2016-09-17 22:24:03 UTC
Created attachment 446242 [details]
environment
Comment 3 Toralf Förster gentoo-dev 2016-09-17 22:24:06 UTC
Created attachment 446244 [details]
sys-libs:libcxxrt-0.0_p20150423-r1:20160917-211943.log
Comment 4 Marco Ziebell 2016-09-18 08:49:02 UTC
package works fine for me on AMD64 with gcc-5.4.0.

Your first comment says that you're using gcc-6.2.0, please remove blocker gcc-5 and set gcc-6


Portage 2.2.28 (python 2.7.10-final-0, default/linux/amd64/13.0, gcc-5.4.0, glibc-2.22-r4, 4.6.5-gentoo x86_64)
=================================================================
                         System Settings
=================================================================
System uname: Linux-4.6.5-gentoo-x86_64-AMD_A6-4400M_APU_with_Radeon-tm-_HD_Graphics-with-gentoo-2.2
KiB Mem:    15809020 total,  10213336 free
KiB Swap:    3583996 total,   3583996 free
Timestamp of repository gentoo: Sat, 17 Sep 2016 16:45:01 +0000
sh dash 0.5.8.2
ld GNU gold (Gentoo 2.25.1 p1.1 2.25.1) 1.11
ccache version 3.2.4 [disabled]
app-shells/bash:          4.3_p42-r1::gentoo
dev-java/java-config:     2.2.0-r3::gentoo
dev-lang/perl:            5.22.2::gentoo
dev-lang/python:          2.7.10-r1::gentoo, 3.4.3-r1::gentoo
dev-util/ccache:          3.2.4::gentoo
dev-util/cmake:           3.5.2-r1::gentoo
dev-util/pkgconfig:       0.28-r2::gentoo
sys-apps/baselayout:      2.2::gentoo
sys-apps/openrc:          0.21.7::gentoo
sys-apps/sandbox:         2.10-r1::gentoo
sys-devel/autoconf:       2.13::gentoo, 2.69::gentoo
sys-devel/automake:       1.11.6-r1::gentoo, 1.14.1::gentoo, 1.15::gentoo
sys-devel/binutils:       2.25.1-r1::gentoo
sys-devel/gcc:            5.3.0::gentoo, 5.4.0::gentoo
sys-devel/gcc-config:     1.7.3::gentoo
sys-devel/libtool:        2.4.6::gentoo
sys-devel/make:           4.1-r1::gentoo
sys-kernel/linux-headers: 4.3::gentoo (virtual/os-headers)
sys-libs/glibc:           2.22-r4::gentoo
Repositories:

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

ACCEPT_KEYWORDS="amd64"
ACCEPT_LICENSE="* -@EULA"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-march=native -mtune=native -pipe -w -g0 -O2 -flto=2 -fuse-linker-plugin -ffat-lto-objects --param lto-partitions=1 -flto-partition=none -fdata-sections -ffunction-sections -fdevirtualize-at-ltrans -fomit-frame-pointer -ftree-vectorize -fno-aggressive-loop-optimizations -funswitch-loops -fgcse-sm -fgcse-las -fgcse-after-reload -fopenmp-simd -ftree-partial-pre -fbranch-target-load-optimize -finline-functions -funroll-loops -mvzeroupper -minline-all-stringops -malign-data=cacheline -maccumulate-outgoing-args --param prefetch-latency=600 -mtls-dialect=gnu2"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/lib64/libreoffice/program/sofficerc /usr/share/gnupg/qualified.txt /var/lib/hsqldb"
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 /etc/texmf/language.dat.d /etc/texmf/language.def.d /etc/texmf/updmap.d /etc/texmf/web2c"
CXXFLAGS="-march=native -mtune=native -pipe -w -g0 -O2 -flto=2 -fuse-linker-plugin -ffat-lto-objects --param lto-partitions=1 -flto-partition=none -fdata-sections -ffunction-sections -fdevirtualize-at-ltrans -fomit-frame-pointer -ftree-vectorize -fno-aggressive-loop-optimizations -funswitch-loops -fgcse-sm -fgcse-las -fgcse-after-reload -fopenmp-simd -ftree-partial-pre -fbranch-target-load-optimize -finline-functions -funroll-loops -mvzeroupper -minline-all-stringops -malign-data=cacheline -maccumulate-outgoing-args --param prefetch-latency=600 -mtls-dialect=gnu2"
DISTDIR="/usr/portage/distfiles"
EMERGE_DEFAULT_OPTS="--quiet-build=y"
FCFLAGS="-O2 -pipe"
FEATURES="assume-digests binpkg-logs cgroup collision-protect config-protect-if-modified distlocks ebuild-locks fixlafiles merge-sync multilib-strict news parallel-fetch parallel-install preserve-libs protect-owned sandbox sfperms strict test-fail-continue unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync xattr"
FFLAGS="-O2 -pipe"
GENTOO_MIRRORS="http://distfiles.gentoo.org"
LANG="de_DE.utf8"
LDFLAGS="-Wl,-O1 -Wl,--icf=all -Wl,--as-needed -Wl,--hash-style=gnu -march=native -mtune=native -pipe -w -g0 -O2 -flto=2 -fuse-linker-plugin -ffat-lto-objects --param lto-partitions=1 -flto-partition=none -fdata-sections -ffunction-sections -fdevirtualize-at-ltrans -fomit-frame-pointer -ftree-vectorize -fno-aggressive-loop-optimizations -funswitch-loops -fgcse-sm -fgcse-las -fgcse-after-reload -fopenmp-simd -ftree-partial-pre -fbranch-target-load-optimize -finline-functions -funroll-loops -mvzeroupper -minline-all-stringops -malign-data=cacheline -maccumulate-outgoing-args --param prefetch-latency=600 -mtls-dialect=gnu2"
MAKEOPTS="-j2 V=1"
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 --exclude=/.git"
PORTAGE_TMPDIR="/var/tmp"
USE="X acl alsa amd64 branding gpl hdaps ipv6 nls nptl openmp pic seccomp ssl threads truetype unicode vim-syntax xattr xcb" ABI_X86="64" CPU_FLAGS_X86="aes avx fma3 fma4 mmx mmxext popcnt sse sse2 sse3 sse4_1 sse4_2 sse4a ssse3 xop" ELIBC="glibc" INPUT_DEVICES="evdev" KERNEL="linux" L10N="de de_DE en en_GB en_US" LIBREOFFICE_EXTENSIONS="presenter-console pdfimport presenter-minimizer" LINGUAS="de de_DE en en_GB en_US" PYTHON_SINGLE_TARGET="python3_4" PYTHON_TARGETS="python2_7 python3_4" RUBY_TARGETS="ruby20" USERLAND="GNU" VIDEO_CARDS="radeon r600" XFCE_PLUGINS="trash clock battery power"
Unset:  CC, CPPFLAGS, CTARGET, CXX, INSTALL_MASK, LC_ALL, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS, USE_PYTHON

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

sys-libs/libcxxrt-0.0_p20150423-r1::gentoo was built with the following:
USE="-libunwind -static-libs" ABI_X86="64 -32 -x32"
LDFLAGS="-Wl,-O1 -Wl,--icf=all -Wl,--as-needed -Wl,--hash-style=gnu -march=native -mtune=native -pipe -w -g0 -O2 -flto=2 -fuse-linker-plugin -ffat-lto-objects --param lto-partitions=1 -flto-partition=none -fdata-sections -ffunction-sections -fdevirtualize-at-ltrans -fomit-frame-pointer -ftree-vectorize -fno-aggressive-loop-optimizations -funswitch-loops -fgcse-sm -fgcse-las -fgcse-after-reload -fopenmp-simd -ftree-partial-pre -fbranch-target-load-optimize -finline-functions -funroll-loops -mvzeroupper -minline-all-stringops -malign-data=cacheline -maccumulate-outgoing-args --param prefetch-latency=600 -mtls-dialect=gnu2 -Wl,-z,defs"
Comment 5 Peter Levine 2016-10-08 01:54:20 UTC
Change bug block from gcc-5 to gcc-6 please:  https://bugs.gentoo.org/show_bug.cgi?id=582084

I submitted the bug upstream: https://github.com/pathscale/libcxxrt/issues/43
Comment 6 Pacho Ramos gentoo-dev 2017-04-08 10:10:41 UTC
is 0.0_p20160922 affected too?
Comment 7 Toralf Förster gentoo-dev 2017-04-08 11:54:03 UTC
yep:

tinderbox@mr-fox ~ $ grep p20160922 tb/data/ALREADY_CATCHED 
dev-ros/rosserial_server-0.7.4 : /.../bind.hpp:319:35: error: no match for call to ‘(boost::_mfi::mf1<void, rosserial_server::Session<rosserial_server::UdpStream>, ros::serialization::IStream&>) (rosserial_server::Session<rosserial_server::UdpStream>*&,sys-libs/libcxxrt-0.0_p20160922 : stdexcept.cc:(.text+<snip>): undefined reference to `operator delete(void*, unsigned long)'
sys-libs/libcxxrt-0.0_p20160922 : stdexcept.cc:(.text+<snip>): undefined reference to `operator delete(void*, unsigned int)'
Comment 8 Peter Levine 2017-04-08 19:54:56 UTC
Created attachment 469508 [details, diff]
libcxxrt-0.0_p20150423-gcc6.patch

The following patch just needs some testing to make sure it's sane.

libcxxrt defines its own new and delete functions in std namespace in src/memory.cc.  The basic `operator delete(void*)` just calls `free(void*)`.  'operator delete[]' just calls its own `operator delete(void*).

In C++14, there is now an `operator delete(void * ptr, std::size_t)`.  Because libcxxrt needs to link against it but doesn't provide its own, there are errors.  Because the default behavior in libcxxrt appears to be that various forms of delete() seem to call the default form with just a pointer (which then calls free(ptr)) it should be sufficient to define an `operator delete(void * ptr, std::size_t)` that does the same and ignores the size_t parameter.
Comment 9 Toralf Förster gentoo-dev 2017-04-09 10:09:43 UTC
(In reply to Peter Levine from comment #8)
still fails at image 13.0-libressl-abi32+64_20170325-144555 
gcc version 6.3.0 (Gentoo 6.3.0 p1.0)
with

x86_64-pc-linux-gnu-gcc -fPIC -O2 -pipe -march=native -Wall  -c -o libelftc_dem_gnu3.So libelftc_dem_gnu3.c
libelftc_dem_gnu3.c: In function ‘cpp_demangle_read_number_as_string’:
libelftc_dem_gnu3.c:2000:6: warning: implicit declaration of function ‘asprintf’ [-Wimplicit-function-declaration]
  if (asprintf(str, "%ld", n) < 0) {
      ^~~~~~~~
x86_64-pc-linux-gnu-g++ -fPIC -nodefaultlibs -Werror=terminate -O2 -pipe -march=native -Wl,-O1 -Wl,--as-needed -Wl,-z,defs -shared -Wl,-soname,libcxxrt.so.1 -o libcxxrt.so.1 dynamic_cast.So exception.So guard.So stdexcept.So typeinfo.So memory.So auxhelper.So libelftc_dem_gnu3.So -ldl -lgcc_s -lc
stdexcept.So: In function `std::exception::~exception()':
stdexcept.cc:(.text+0xf3): undefined reference to `operator delete(void*, unsigned long)'
stdexcept.So: In function `std::bad_alloc::~bad_alloc()':
stdexcept.cc:(.text+0x113): undefined reference to `operator delete(void*, unsigned long)'
stdexcept.So: In function `std::bad_cast::~bad_cast()':
stdexcept.cc:(.text+0x133): undefined reference to `operator delete(void*, unsigned long)'
stdexcept.So: In function `std::bad_typeid::~bad_typeid()':
stdexcept.cc:(.text+0x153): undefined reference to `operator delete(void*, unsigned long)'
stdexcept.So: In function `std::bad_array_new_length::~bad_array_new_length()':
stdexcept.cc:(.text+0x173): undefined reference to `operator delete(void*, unsigned long)'
typeinfo.So:typeinfo.cc:(.text+0x34a): more undefined references to `operator delete(void*, unsigned long)' follow
collect2: error: ld returned 1 exit status
make: *** [Makefile:20: libcxxrt.so.1] Error 1
 * ERROR: sys-libs/libcxxrt-0.0_p20160922::gentoo failed (compile phase):
 *   emake failed
 *
Comment 10 Toralf Förster gentoo-dev 2017-04-09 10:11:01 UTC
(In reply to Toralf Förster from comment #9)
gah, is /etc/portage/patches/sys-libs/libcxxrt/gcc6.patch at least working with this ebuild ?
Comment 11 Peter Levine 2017-04-09 18:17:42 UTC
(In reply to Toralf Förster from comment #9)
> (In reply to Peter Levine from comment #8)
> still fails at image 13.0-libressl-abi32+64_20170325-144555 
(In reply to Toralf Förster from comment #10)
> (In reply to Toralf Förster from comment #9)
> gah, is /etc/portage/patches/sys-libs/libcxxrt/gcc6.patch at least working
> with this ebuild ?

(In reply to Toralf Förster from comment #9)
> (In reply to Peter Levine from comment #8)
> still fails at image 13.0-libressl-abi32+64_20170325-144555 
> gcc version 6.3.0 (Gentoo 6.3.0 p1.0)
> with
> 
> x86_64-pc-linux-gnu-gcc -fPIC -O2 -pipe -march=native -Wall  -c -o
> libelftc_dem_gnu3.So libelftc_dem_gnu3.c
> libelftc_dem_gnu3.c: In function ‘cpp_demangle_read_number_as_string’:
> libelftc_dem_gnu3.c:2000:6: warning: implicit declaration of function
> ‘asprintf’ [-Wimplicit-function-declaration]
>   if (asprintf(str, "%ld", n) < 0) {
>       ^~~~~~~~
> x86_64-pc-linux-gnu-g++ -fPIC -nodefaultlibs -Werror=terminate -O2 -pipe
> -march=native -Wl,-O1 -Wl,--as-needed -Wl,-z,defs -shared
> -Wl,-soname,libcxxrt.so.1 -o libcxxrt.so.1 dynamic_cast.So exception.So
> guard.So stdexcept.So typeinfo.So memory.So auxhelper.So
> libelftc_dem_gnu3.So -ldl -lgcc_s -lc
> stdexcept.So: In function `std::exception::~exception()':
> stdexcept.cc:(.text+0xf3): undefined reference to `operator delete(void*,
> unsigned long)'
> stdexcept.So: In function `std::bad_alloc::~bad_alloc()':
> stdexcept.cc:(.text+0x113): undefined reference to `operator delete(void*,
> unsigned long)'
> stdexcept.So: In function `std::bad_cast::~bad_cast()':
> stdexcept.cc:(.text+0x133): undefined reference to `operator delete(void*,
> unsigned long)'
> stdexcept.So: In function `std::bad_typeid::~bad_typeid()':
> stdexcept.cc:(.text+0x153): undefined reference to `operator delete(void*,
> unsigned long)'
> stdexcept.So: In function
> `std::bad_array_new_length::~bad_array_new_length()':
> stdexcept.cc:(.text+0x173): undefined reference to `operator delete(void*,
> unsigned long)'
> typeinfo.So:typeinfo.cc:(.text+0x34a): more undefined references to
> `operator delete(void*, unsigned long)' follow
> collect2: error: ld returned 1 exit status
> make: *** [Makefile:20: libcxxrt.so.1] Error 1
>  * ERROR: sys-libs/libcxxrt-0.0_p20160922::gentoo failed (compile phase):
>  *   emake failed
>  *

I'm pretty sure the patch wasn't applied.  I've tested it with gcc-6.3.0 and gcc-5.4.0 for both libcxxrt-0.0_p20160922 and libcxxrt-0.0_p20150423-r1.
Comment 12 Toralf Förster gentoo-dev 2017-04-09 19:45:43 UTC
It fails here in this manner :

# emerge -u sys-libs/libcxxrt

These are the packages that would be merged, in reverse order:

Calculating dependencies  ..... done!
[ebuild  N     ] sys-libs/libcxxrt-0.0_p20160922::tinderbox  USE="static-libs -libunwind" ABI_X86="(64) -32 (-x32)" 0 KiB

Total: 1 package (1 new), Size of downloads: 0 KiB

>>> Verifying ebuild manifests
>>> Emerging (1 of 1) sys-libs/libcxxrt-0.0_p20160922::tinderbox
>>> Failed to emerge sys-libs/libcxxrt-0.0_p20160922, Log file:
>>>  '/var/log/portage/sys-libs:libcxxrt-0.0_p20160922:20170409-194322.log'
>>> Jobs: 0 of 1 complete, 1 failed                 Load avg: 10.8, 10.6, 10.8
 * Package:    sys-libs/libcxxrt-0.0_p20160922
 * Repository: tinderbox
 * USE:        abi_x86_64 amd64 elibc_glibc kernel_linux static-libs userland_GNU
 * FEATURES:   preserve-libs sandbox userpriv usersandbox
>>> Unpacking source...
>>> Unpacking libcxxrt-0.0_p20160922.tar.xz to /var/tmp/portage/sys-libs/libcxxrt-0.0_p20160922/work
>>> Source unpacked in /var/tmp/portage/sys-libs/libcxxrt-0.0_p20160922/work
>>> Preparing source in /var/tmp/portage/sys-libs/libcxxrt-0.0_p20160922/work/libcxxrt-0.0_p20160922 ...
 * Will copy sources from /var/tmp/portage/sys-libs/libcxxrt-0.0_p20160922/work/libcxxrt-0.0_p20160922
 * abi_x86_64.amd64: copying to /var/tmp/portage/sys-libs/libcxxrt-0.0_p20160922/work/libcxxrt-0.0_p20160922-abi_x86_64.amd64
 * Applying user patches from /etc/portage/patches//sys-libs/libcxxrt ...
 *   gcc.patch ...
 [ ok ]
 * Done with patching
>>> Source prepared.
>>> Configuring source in /var/tmp/portage/sys-libs/libcxxrt-0.0_p20160922/work/libcxxrt-0.0_p20160922 ...
 * abi_x86_64.amd64: running multilib-minimal_abi_src_configure
>>> Source configured.
>>> Compiling source in /var/tmp/portage/sys-libs/libcxxrt-0.0_p20160922/work/libcxxrt-0.0_p20160922 ...
 * abi_x86_64.amd64: running multilib-minimal_abi_src_compile
make -j1 shared 
x86_64-pc-linux-gnu-g++ -fPIC -Werror=terminate -O2 -pipe -march=native  -c -o dynamic_cast.So dynamic_cast.cc
x86_64-pc-linux-gnu-g++ -fPIC -Werror=terminate -O2 -pipe -march=native  -c -o exception.So exception.cc
x86_64-pc-linux-gnu-g++ -fPIC -Werror=terminate -O2 -pipe -march=native  -c -o guard.So guard.cc
x86_64-pc-linux-gnu-g++ -fPIC -Werror=terminate -O2 -pipe -march=native  -c -o stdexcept.So stdexcept.cc
x86_64-pc-linux-gnu-g++ -fPIC -Werror=terminate -O2 -pipe -march=native  -c -o typeinfo.So typeinfo.cc
x86_64-pc-linux-gnu-g++ -fPIC -Werror=terminate -O2 -pipe -march=native  -c -o memory.So memory.cc
x86_64-pc-linux-gnu-g++ -fPIC -Werror=terminate -O2 -pipe -march=native  -c -o auxhelper.So auxhelper.cc
x86_64-pc-linux-gnu-gcc -fPIC -O2 -pipe -march=native -Wall  -c -o libelftc_dem_gnu3.So libelftc_dem_gnu3.c
libelftc_dem_gnu3.c: In function ‘cpp_demangle_read_number_as_string’:
libelftc_dem_gnu3.c:2000:6: warning: implicit declaration of function ‘asprintf’ [-Wimplicit-function-declaration]
  if (asprintf(str, "%ld", n) < 0) {
      ^~~~~~~~
x86_64-pc-linux-gnu-g++ -fPIC -nodefaultlibs -Werror=terminate -O2 -pipe -march=native -Wl,-O1 -Wl,--as-needed -Wl,-z,defs -shared -Wl,-soname,libcxxrt.so.1 -o libcxxrt.so.1 dynamic_cast.So exception.So guard.So stdexcept.So typeinfo.So memory.So auxhelper.So libelftc_dem_gnu3.So -ldl -lgcc_s -lc
stdexcept.So: In function `std::exception::~exception()':
stdexcept.cc:(.text+0xf3): undefined reference to `operator delete(void*, unsigned long)'
stdexcept.So: In function `std::bad_alloc::~bad_alloc()':
stdexcept.cc:(.text+0x113): undefined reference to `operator delete(void*, unsigned long)'
stdexcept.So: In function `std::bad_cast::~bad_cast()':
stdexcept.cc:(.text+0x133): undefined reference to `operator delete(void*, unsigned long)'
stdexcept.So: In function `std::bad_typeid::~bad_typeid()':
stdexcept.cc:(.text+0x153): undefined reference to `operator delete(void*, unsigned long)'
stdexcept.So: In function `std::bad_array_new_length::~bad_array_new_length()':
stdexcept.cc:(.text+0x173): undefined reference to `operator delete(void*, unsigned long)'
typeinfo.So:typeinfo.cc:(.text+0x34a): more undefined references to `operator delete(void*, unsigned long)' follow
collect2: error: ld returned 1 exit status
make: *** [Makefile:20: libcxxrt.so.1] Error 1
 * ERROR: sys-libs/libcxxrt-0.0_p20160922::tinderbox failed (compile phase):
 *   emake failed
 * 
 * If you need support, post the output of `emerge --info '=sys-libs/libcxxrt-0.0_p20160922::tinderbox'`,
 * the complete build log and the output of `emerge -pqv '=sys-libs/libcxxrt-0.0_p20160922::tinderbox'`.
 * The complete build log is located at '/var/log/portage/sys-libs:libcxxrt-0.0_p20160922:20170409-194322.log'.
 * For convenience, a symlink to the build log is located at '/var/tmp/portage/sys-libs/libcxxrt-0.0_p20160922/temp/build.log'.
 * The ebuild environment file is located at '/var/tmp/portage/sys-libs/libcxxrt-0.0_p20160922/temp/environment'.
 * Working directory: '/var/tmp/portage/sys-libs/libcxxrt-0.0_p20160922/work/libcxxrt-0.0_p20160922-abi_x86_64.amd64/src'
 * S: '/var/tmp/portage/sys-libs/libcxxrt-0.0_p20160922/work/libcxxrt-0.0_p20160922'
 * !!! User patches were applied to this build!


# cat /etc/portage/patches//sys-libs/libcxxrt/gcc.patch 
--- a/src/memory.cc
+++ b/src/memory.cc
@@ -151,4 +151,11 @@
        ::operator delete(ptr);
 }
 
+#if __cplusplus >= 201402L
+__attribute__((weak))
+void operator delete(void * ptr, std::size_t) noexcept
+{
+       ::operator delete(ptr);
+}
+#endif
 

# diff /usr/portage/sys-libs/libcxxrt/libcxxrt-0.0_p20160922.ebuild /tmp/tb/data/portage/sys-libs/libcxxrt/libcxxrt-0.0_p20160922.ebuild
40a41
>       epatch_user
Comment 13 Peter Levine 2017-04-09 20:12:59 UTC
(In reply to Toralf Förster from comment #12)
>  * Will copy sources from
> /var/tmp/portage/sys-libs/libcxxrt-0.0_p20160922/work/libcxxrt-0.0_p20160922
>  * abi_x86_64.amd64: copying to
> /var/tmp/portage/sys-libs/libcxxrt-0.0_p20160922/work/libcxxrt-0.0_p20160922-
> abi_x86_64.amd64
>  * Applying user patches from /etc/portage/patches//sys-libs/libcxxrt ...
>  *   gcc.patch ...
>  [ ok ]
>  * Done with patching


You're applying epatch_user too late.  The ebuild's src_prepare() copies ${WORKDIR}/libcxxrt-0.0_p20160922 to ${WORKDIR}/libcxxrt-0.0_p20160922-abi_x86_64.amd64, then it patches ${WORKDIR}/libcxxrt-0.0_p20160922, and then configures and builds in ${WORKDIR}/libcxxrt-0.0_p20160922-abi_x86_64.amd64.
Comment 14 Toralf Förster gentoo-dev 2017-04-09 20:27:10 UTC
(In reply to Peter Levine from comment #13)
You're right - and the patch works !
Tested at the affected image (currently I do just have this one with gcc-6).
Comment 15 Peter Levine 2017-05-14 17:18:04 UTC
This has been fixed upstream
https://github.com/pathscale/libcxxrt/commit/db54f535fc67703b2993b9b2d3fc7ede7a608936
Comment 16 Peter Levine 2017-05-14 18:07:46 UTC
PR: https://github.com/gentoo/gentoo/pull/4628
Comment 17 Alexis Ballier gentoo-dev 2017-05-15 16:23:23 UTC
no need to worry about backporting patches when we only have git snapshots at the moment...

commit 6b599951500c76cc4482120fc56e030f4c783d80 (HEAD -> master, origin/master, origin/HEAD)
Author: Alexis Ballier <aballier@gentoo.org>
Date:   Mon May 15 18:22:30 2017 +0200

    sys-libs/libcxxrt: bump a new snapshort fixing bug #594138
Comment 18 Brian Evans (RETIRED) gentoo-dev 2017-12-03 17:22:23 UTC
*** Bug 639478 has been marked as a duplicate of this bug. ***