Date: Thu, 17 Aug 2023 19:33:33 +0000 From: Brooks Davis <brooks@freebsd.org> To: Ronald Klop <ronald@freebsd.org> Cc: freebsd-current@freebsd.org Subject: Re: building with llvm16 pkg fails in tests Message-ID: <ZN52DRc5DJ7ouyYp@spindle.one-eyed-alien.net> In-Reply-To: <76ecade1-3f42-a314-825d-6f1ba0b2dcaa@FreeBSD.org> References: <76ecade1-3f42-a314-825d-6f1ba0b2dcaa@FreeBSD.org>
next in thread | previous in thread | raw e-mail | index | archive | help
On Thu, Aug 17, 2023 at 12:45:06PM +0200, Ronald Klop wrote: > Hi, >=20 > To save time on my Raspberry Pi I would like to build FreeBSD using a llv= m pkg instead of llvm in the tree. >=20 > My /etc/make.conf: > WITHOUT_TOOLCHAIN=3Dyes > LD=3D/usr/local/llvm16/bin/ld.lld > CC=3D/usr/local/llvm16/bin/clang > CXX=3D/usr/local/llvm16/bin/clang++ > CPP=3D/usr/local/llvm16/bin/clang-cpp > OBJCOPY=3D/usr/local/llvm16/bin/llvm-objcopy >=20 > #WITHOUT_CLEAN=3Dyes >=20 >=20 > This fails in: >=20 > /usr/local/llvm16/bin/clang++ -O2 -pipe -fno-common -fPIE -Wno-format-zer= o-length -nobuiltininc -idirafter /usr/local/llvm16/lib/clang/16/include -f= stack-protector-strong -Wsystem-headers -Werror -Wall -Wno-format-y2k -W -W= no-unused-parameter -Wpointer-arith -Wreturn-type -Wcast-qual -Wwrite-strin= gs -Wswitch -Wshadow -Wunused-parameter -Wcast-align -Wchar-subscripts -Wda= te-time -Wmissing-variable-declarations -Wno-empty-body -Wno-string-plus-in= t -Wno-unused-const-variable -Wno-error=3Dunused-but-set-parameter -O0 -g0 = -Qunused-arguments -I/usr/obj/usr/src/amd64.amd64/tmp/usr/include/private -= I/usr/src/contrib/googletest/googlemock/include -I/usr/src/contrib/googlete= st/googlemock -I/usr/src/contrib/googletest/googletest/include -I/usr/src/c= ontrib/googletest/googletest -I/usr/obj/usr/src/amd64.amd64/tmp/usr/include= /private -DGTEST_HAS_POSIX_RE=3D1 -DGTEST_HAS_PTHREAD=3D1 -DGTEST_HAS_STREA= M_REDIRECTION=3D1 -frtti -Wno-deprecated-copy -Wno-signed-unsigned-wchar -D= GTEST_HAS_POSIX_RE=3D1 -DGTEST_HAS_PTHREAD=3D1 -DGTEST_HAS_STREAM_REDIRECTI= ON=3D1 -frtti -Wno-deprecated-copy -Wno-signed-unsigned-wchar -fPIE -std=3D= c++14 -Wno-deprecated-copy -Wno-error=3Dinconsistent-missing-override -Wno-= error=3Dmissing-variable-declarations -Wno-error=3Dsign-compare -Wno-error= =3Dunused-parameter -Wno-c++11-extensions -Wl,-zrelro -pie --ld-path=3D/u= sr/local/llvm16/bin/ld.lld -o gmock-actions_test gmock-actions_test.o -lpr= ivategmock_main -lprivategmock -lprivategtest > ld.lld: error: undefined symbol: testing::internal::DeathTest::Create(cha= r const*, testing::Matcher<std::__1::basic_string<char, std::__1::char_trai= ts<char>, std::__1::allocator<char>> const&>, char const*, int, testing::in= ternal::DeathTest**) > >>> referenced by gmock-actions_test.cc > >>> gmock-actions_test.o:(testing::(anonymous namespace)::B= uiltInDefaultValueDeathTest_IsUndefinedForReferences_Test::TestBody()) > >>> referenced by gmock-actions_test.cc > >>> gmock-actions_test.o:(testing::(anonymous namespace)::B= uiltInDefaultValueDeathTest_IsUndefinedForReferences_Test::TestBody()) > >>> referenced by gmock-actions_test.cc > >>> gmock-actions_test.o:(testing::(anonymous namespace)::B= uiltInDefaultValueDeathTest_IsUndefinedForNonDefaultConstructibleType_Test:= :TestBody()) > >>> referenced 4 more times >=20 > ld.lld: error: undefined symbol: testing::Expectation::Expectation(std::_= _1::shared_ptr<testing::internal::ExpectationBase> const&) >=20 >=20 > Any thoughts on how to fix this? > Compiling with the in tree llvm does work properly. Did it work with exactly this git revision? I suspect an issue with the recent google test update rather than an llvm16 issue. Note that for every sync to github we build the tree with the llvm16 port (all be it on amd64 by default). It's worth noting one difference between your configuration and the CI one: We don't set CC and friends directly. Instead we use CROSS_TOOLCHAIN=3Dllvm16. -- Brooks
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?ZN52DRc5DJ7ouyYp>