From owner-freebsd-current@FreeBSD.ORG Wed Jan 30 23:46:29 2013 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 96ACC674 for ; Wed, 30 Jan 2013 23:46:29 +0000 (UTC) (envelope-from jbeich@tormail.org) Received: from outgoing.tormail.org (outgoing.tormail.org [82.221.96.22]) by mx1.freebsd.org (Postfix) with ESMTP id 3301AD8F for ; Wed, 30 Jan 2013 23:46:28 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=internal.tormail.org) by outgoing.tormail.org with esmtp (Exim 4.72) (envelope-from ) id 1U0hM6-0004Ae-62 for freebsd-current@freebsd.org; Thu, 31 Jan 2013 02:46:21 +0300 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=tormail.org; s=tm; h=Message-Id:X-TorMail-User:Content-Type:MIME-Version:References:Date:In-Reply-To:Subject:To:From; bh=lk5IPU21tG+/QSr4lrv+7JByTUvw9fF6ssjRG/Ed0eo=; b=Ds+/C17VO1HQ3sgN7BupntlEluIOWuSsdK/7+eEJfZ0gFGOjyDetWXzcdd3OIjPWK/8mVvTEVW1egzWcb5Xx1CVjUgte4px5O+Y9qQSyVys+zYM6Nx/UXV6HQJLoAjHXlGCOGagaogOQ8uuiec96TI+fiEeLo/fM+VXtlOVsR3M=; Received: from jbeich by internal.tormail.org with local (Exim 4.63) (envelope-from ) id 1U0hJQ-0008zb-Do for freebsd-current@freebsd.org; Wed, 30 Jan 2013 23:43:29 +0000 From: Jan Beich 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()' In-Reply-To: <51079F0A.20309@zedat.fu-berlin.de> (O. Hartmann's message of "Tue, 29 Jan 2013 11:06:02 +0100") Date: Thu, 31 Jan 2013 11:43:09 +1200 References: <51079F0A.20309@zedat.fu-berlin.de> MIME-Version: 1.0 Content-Type: text/plain X-TorMail-User: jbeich Message-Id: <1U0hJQ-0008zb-Do@internal.tormail.org> X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 30 Jan 2013 23:46:29 -0000 "O. Hartmann" 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