Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 31 Jan 2013 11:43:09 +1200
From:      Jan Beich <jbeich@tormail.org>
To:        freebsd-current@freebsd.org
Subject:   Re: r246057: buildworld fails with: /usr/obj/usr/src/tmp/usr/lib/libc++.so: undefined reference to `std::bad_alloc::~bad_alloc()'
Message-ID:  <1U0hJQ-0008zb-Do@internal.tormail.org>
In-Reply-To: <51079F0A.20309@zedat.fu-berlin.de> (O. Hartmann's message of "Tue, 29 Jan 2013 11:06:02 %2B0100")
References:  <51079F0A.20309@zedat.fu-berlin.de>

next in thread | previous in thread | raw e-mail | index | archive | help
"O. Hartmann" <ohartman@zedat.fu-berlin.de> writes:

> c++ -O3 -pipe -fno-strict-aliasing -march=native -march=native
> -DHAVE_CONFIG_H -I/usr/src/libexec/atf/atf-check/../../../contrib/atf
> -Qunused-arguments -fstack-protector -Wsystem-headers -Wall
> -Wno-format-y2k -W -Wno-unused-parameter -Wpointer-arith
> -Wno-uninitialized -Wno-empty-body -Wno-string-plus-int
> -Wno-tautological-compare -Wno-unused-value -Wno-parentheses-equality
> -Wno-unused-function -Wno-conversion -stdlib=libc++ -std=c++11
> -L/usr/obj/usr/src/libexec/atf/atf-check/../../../lib/atf/libatf-c++
> -L/usr/obj/usr/src/libexec/atf/atf-check/../../../lib/atf/libatf-c -o
> atf-check atf-check.o -latf-c++ -latf-c
> /usr/obj/usr/src/tmp/usr/lib/libc++.so: undefined reference to
> `std::bad_alloc::~bad_alloc()'
> /usr/obj/usr/src/libexec/atf/atf-check/../../../lib/atf/libatf-c++/libatf-c++.so:
> undefined reference to `std::bad_alloc::bad_alloc()'
> /usr/obj/usr/src/libexec/atf/atf-check/../../../lib/atf/libatf-c++/libatf-c++.so:
> undefined reference to `std::bad_alloc::~bad_alloc()'
> /usr/obj/usr/src/tmp/usr/lib/libc++.so: undefined reference to
> `std::bad_alloc::bad_alloc()'
> c++: error: linker command failed with exit code 1 (use -v to see
> invocation)
> *** [atf-check] Error code 1

Try stage binaries built with default CXXFLAGS from allbsd.org snapshot.
With them installed do you see smth like the following?

  $ clang++ -stdlib=libc++ foo.c
  clang++: warning: treating 'c' input as 'c++' when in C++ mode, this behavior is deprecated
  /usr/lib/libc++.so: undefined reference to `std::bad_alloc::~bad_alloc()'
  /usr/lib/libc++.so: undefined reference to `std::bad_alloc::bad_alloc()'
  /usr/lib/libc++.so: undefined reference to `std::bad_alloc::~bad_alloc()'
  /usr/lib/libc++.so: undefined reference to `std::bad_alloc::bad_alloc()'
  clang++: error: linker command failed with exit code 1 (use -v to see invocation)

It's different from the error when you build libc++ before libcxxrt.

  $ clang++ -stdlib=libc++ foo.c
  clang++: warning: treating 'c' input as 'c++' when in C++ mode, this behavior is deprecated
  /usr/lib/libc++.so: undefined reference to `std::uncaught_exception()@CXXABI_1.3'
  /usr/lib/libc++.so: undefined reference to `std::exception::~exception()@CXXRT_1.0'
  /usr/lib/libc++.so: undefined reference to `std::bad_alloc::~bad_alloc()@CXXRT_1.0'
  /usr/lib/libc++.so: undefined reference to `typeinfo for std::exception@CXXRT_1.0'
  /usr/lib/libc++.so: undefined reference to `std::bad_alloc::~bad_alloc()@CXXRT_1.0'
  /usr/lib/libc++.so: undefined reference to `std::bad_alloc::bad_alloc()@CXXRT_1.0'
  /usr/lib/libc++.so: undefined reference to `typeinfo for std::bad_cast@CXXRT_1.0'
  /usr/lib/libc++.so: undefined reference to `std::bad_cast::~bad_cast()@CXXRT_1.0'
  /usr/lib/libc++.so: undefined reference to `typeinfo for std::bad_alloc@CXXRT_1.0'
  /usr/lib/libc++.so: undefined reference to `std::bad_alloc::bad_alloc()@CXXRT_1.0'
  /usr/lib/libc++.so: undefined reference to `std::terminate()@CXXABI_1.3'
  clang++: error: linker command failed with exit code 1 (use -v to see invocation)

--
#! /bin/sh
# fetch/install stage binaries from allbsd.org snapshots

TARGET=amd64
TARGET_ARCH=amd64
BRANCH=10.0-HEAD
#REVISION=r245980 # works fine
REVISION=r246034 # doesn't work
LIBS="lib/libcxxrt/libcxxrt.so.1:/lib \
      lib/libc++/libc++.so.1:/usr/lib \
      gnu/lib/libsupc++/libsupc++.so.1:/usr/lib"

for f in $LIBS; do
#    chflags 0 $dir/${file##*/}
    fetch -o ${f#*:} https://pub.allbsd.org/FreeBSD-snapshots/${TARGET}-${TARGET_ARCH}/${BRANCH}-${REVISION}-JPSNAP/stage/usr/obj/usr/src/${f%:*}
done



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?1U0hJQ-0008zb-Do>