From nobody Thu Aug 17 19:33:33 2023 X-Original-To: freebsd-current@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4RRZtX4TdBz4q453 for ; Thu, 17 Aug 2023 19:33:40 +0000 (UTC) (envelope-from brooks@spindle.one-eyed-alien.net) Received: from spindle.one-eyed-alien.net (spindle.one-eyed-alien.net [199.48.129.229]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4RRZtX1Xsvz3bDW; Thu, 17 Aug 2023 19:33:40 +0000 (UTC) (envelope-from brooks@spindle.one-eyed-alien.net) Authentication-Results: mx1.freebsd.org; none Received: by spindle.one-eyed-alien.net (Postfix, from userid 3001) id 7CFFC3C0199; Thu, 17 Aug 2023 19:33:33 +0000 (UTC) Date: Thu, 17 Aug 2023 19:33:33 +0000 From: Brooks Davis To: Ronald Klop Cc: freebsd-current@freebsd.org Subject: Re: building with llvm16 pkg fails in tests Message-ID: References: <76ecade1-3f42-a314-825d-6f1ba0b2dcaa@FreeBSD.org> List-Id: Discussions about the use of FreeBSD-current List-Archive: https://lists.freebsd.org/archives/freebsd-current List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-current@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable In-Reply-To: <76ecade1-3f42-a314-825d-6f1ba0b2dcaa@FreeBSD.org> X-Rspamd-Queue-Id: 4RRZtX1Xsvz3bDW X-Spamd-Bar: ---- X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:36236, ipnet:199.48.128.0/22, country:US] 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::allocator> 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 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