Bug 175778 - /usr/obj/usr/src/tmp/usr/lib/libc++.so: undefined reference to `std::bad_alloc::~bad_alloc()'
Summary: /usr/obj/usr/src/tmp/usr/lib/libc++.so: undefined reference to `std::bad_allo...
Status: Closed FIXED
Alias: None
Product: Base System
Classification: Unclassified
Component: kern (show other bugs)
Version: Unspecified
Hardware: Any Any
: Normal Affects Only Me
Assignee: freebsd-bugs (Nobody)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-02-02 09:10 UTC by O. Hartmann
Modified: 2014-06-02 08:08 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description O. Hartmann 2013-02-02 09:10:00 UTC
Compiling world with option

-stdlib=libc++ -std=c++11

or even only

-stdlib=libc++

fails building world with the below shown error message.

Obviously, libc++ is broken.

Avoiding the option -stdlib=libc++

makes buildworld run cleanly thriugh everything.


[...]
===> libexec/atf/atf-check (all)
c++ -O2 -pipe -O3 -march=native -DHAVE_CONFIG_H -O3 -march=native -pipe -I/usr/src/libexec/atf/atf-check/../../../contrib/atf -Qunused-arguments -fstack-protector -Wsystem-headers -Werror -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 -c /usr/src/libexec/atf/atf-check/../../../contrib/atf/atf-sh/atf-check.cpp
c++ -O2 -pipe -O3 -march=native -DHAVE_CONFIG_H -O3 -march=native -pipe -I/usr/src/libexec/atf/atf-check/../../../contrib/atf -Qunused-arguments -fstack-protector -Wsystem-headers -Werror -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

Stop in /usr/src/libexec/atf/atf-check.
*** [all] Error code 1

Stop in /usr/src/libexec/atf.
*** [all] Error code 1

Stop in /usr/src/libexec.
*** [libexec.all__D] Error code 1

Stop in /usr/src.
*** [everything] Error code 1

Stop in /usr/src.
*** [buildworld] Error code 1

Stop in /usr/src.

Fix: 

Avoid the build with -stdlib=libc++
How-To-Repeat: Build world with CXXFLAGS+= -stdlib=libc++ and WITH_LIBCPLUSPLUS=YES set in /etc/src.conf or /etc/make.conf
Comment 1 David Chisnall freebsd_committer freebsd_triage 2014-06-02 08:08:21 UTC
I believe that this was an error in the version script that is was fixed some time ago.