Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 17 Aug 2023 20:00:10 +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:  <ZN58SkJv9aLk1gFx@spindle.one-eyed-alien.net>
In-Reply-To: <ZN52DRc5DJ7ouyYp@spindle.one-eyed-alien.net>
References:  <76ecade1-3f42-a314-825d-6f1ba0b2dcaa@FreeBSD.org> <ZN52DRc5DJ7ouyYp@spindle.one-eyed-alien.net>

next in thread | previous in thread | raw e-mail | index | archive | help
On Thu, Aug 17, 2023 at 07:33:33PM +0000, Brooks Davis wrote:
> 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 l=
lvm 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-z=
ero-length -nobuiltininc -idirafter /usr/local/llvm16/lib/clang/16/include =
-fstack-protector-strong -Wsystem-headers -Werror -Wall -Wno-format-y2k -W =
-Wno-unused-parameter -Wpointer-arith -Wreturn-type -Wcast-qual -Wwrite-str=
ings -Wswitch -Wshadow -Wunused-parameter -Wcast-align -Wchar-subscripts -W=
date-time -Wmissing-variable-declarations -Wno-empty-body -Wno-string-plus-=
int -Wno-unused-const-variable -Wno-error=3Dunused-but-set-parameter -O0 -g=
0 -Qunused-arguments -I/usr/obj/usr/src/amd64.amd64/tmp/usr/include/private=
 -I/usr/src/contrib/googletest/googlemock/include -I/usr/src/contrib/google=
test/googlemock -I/usr/src/contrib/googletest/googletest/include -I/usr/src=
/contrib/googletest/googletest -I/usr/obj/usr/src/amd64.amd64/tmp/usr/inclu=
de/private -DGTEST_HAS_POSIX_RE=3D1 -DGTEST_HAS_PTHREAD=3D1 -DGTEST_HAS_STR=
EAM_REDIRECTION=3D1 -frtti -Wno-deprecated-copy -Wno-signed-unsigned-wchar =
-DGTEST_HAS_POSIX_RE=3D1 -DGTEST_HAS_PTHREAD=3D1 -DGTEST_HAS_STREAM_REDIREC=
TION=3D1 -frtti -Wno-deprecated-copy -Wno-signed-unsigned-wchar -fPIE -std=
=3Dc++14 -Wno-deprecated-copy -Wno-error=3Dinconsistent-missing-override -W=
no-error=3Dmissing-variable-declarations -Wno-error=3Dsign-compare -Wno-err=
or=3Dunused-parameter -Wno-c++11-extensions  -Wl,-zrelro -pie  --ld-path=3D=
/usr/local/llvm16/bin/ld.lld -o gmock-actions_test  gmock-actions_test.o -l=
privategmock_main -lprivategmock -lprivategtest
> > ld.lld: error: undefined symbol: testing::internal::DeathTest::Create(c=
har const*, testing::Matcher<std::__1::basic_string<char, std::__1::char_tr=
aits<char>, std::__1::allocator<char>> const&>, char const*, int, testing::=
internal::DeathTest**)
> > >>> referenced by gmock-actions_test.cc
> > >>>               gmock-actions_test.o:(testing::(anonymous namespace):=
:BuiltInDefaultValueDeathTest_IsUndefinedForReferences_Test::TestBody())
> > >>> referenced by gmock-actions_test.cc
> > >>>               gmock-actions_test.o:(testing::(anonymous namespace):=
:BuiltInDefaultValueDeathTest_IsUndefinedForReferences_Test::TestBody())
> > >>> referenced by gmock-actions_test.cc
> > >>>               gmock-actions_test.o:(testing::(anonymous namespace):=
:BuiltInDefaultValueDeathTest_IsUndefinedForNonDefaultConstructibleType_Tes=
t::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.
>=20
> 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).
>=20
> 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.

FYI, here's a build and boot of aarch64 with llvm16:
https://cirrus-ci.com/task/6710148899536896

-- Brooks



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?ZN58SkJv9aLk1gFx>