Re: r344798: c++: error: linker command failed with exit code

From: O. Hartmann <ohartmann_at_walstatt.org>
Date: Wed, 6 Mar 2019 18:41:22 +0100
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

Am Tue, 5 Mar 2019 23:08:32 +0100
Dimitry Andric <dim_at_FreeBSD.org> schrieb:

> On 5 Mar 2019, at 21:54, O. Hartmann <ohartmann_at_walstatt.org> wrote:
> > 
> > Am Tue, 5 Mar 2019 13:16:26 -0500
> > Shawn Webb <shawn.webb_at_hardenedbsd.org> schrieb:
> >   
> > > On Tue, Mar 05, 2019 at 05:45:11PM +0100, O. Hartmann wrote:  
> > > > -----BEGIN PGP SIGNED MESSAGE-----
> > > > Hash: SHA256
> > > >
> > > > Hello,
> > > >
> > > > recent buildworld on a CURRENT box (FreeBSD 13.0-CURRENT #246 r344742: Sun Mar  3
> > > > 21:26:44 CET 2019 amd64) fails to build due to:
> > > >
> > > > [...]
> > > >
> > > > Building /usr/obj/usr/src/amd64.amd64/tmp/obj-tools/usr.bin/clang/clang/clang
> > > > - --- clang ---
> > > > ld: error: undefined symbol: llvm::createBPFMIPreEmitCheckingPass()  
> > > > >>> referenced by BPFTargetMachine.cpp
> > > > >>>               BPFTargetMachine.o:((anonymous
> > > > >>> namespace)::BPFPassConfig::addPreEmitPass()) in
> > > > >>> archive /usr/obj/usr/src/amd64.amd64/tmp/obj-tools/lib/clang/libllvm/libllvm.a  
> > > > ld: error: undefined symbol: llvm::BTFDebug::BTFDebug(llvm::AsmPrinter*)  
> > > > >>> referenced by BPFAsmPrinter.cpp
> > > > >>>               BPFAsmPrinter.o:((anonymous
> > > > >>> namespace)::BPFAsmPrinter::doInitialization(llvm::Module&)) in
> > > > >>> archive /usr/obj/usr/src/amd64.amd64/tmp/obj-tools/lib/clang/libllvm/libllvm.a  
> > > > c++: error: linker command failed with exit code 1 (use -v to see invocation)
> > > > *** [clang] Error code 1
> > > >
> > > > make[4]: stopped in /usr/src/usr.bin/clang/clang
> > > > [...]
> > > >
> > > > I tried to rebuild world from a fresh /usr/src and /usr/obj but the host gets always
> > > > stuck at the same error.  
> > >
> > > Do you have a custom src.conf and make.conf?
> > >
> > > Thanks,
> > >  
> > src.conf, yes, make.conf, yes, but make.conf references only ports tree stuff so far.
> > src.conf:
> > 
> > #
> > CPUTYPE?=           native
> > #
> > #CFLAGS+=            -O3
> > # for the kernel
> > #COPTFLAGS+=         -O3
> > #
> > #CXXFLAGS+=         -std=c++11
> > #
> > WITH_CLANG_EXTRAS=      YES
> > WITH_LLDB=              YES
> > WITH_LLD_IS_LD=         YES
> > #
> > WITH_IDEA=              YES
> > #
> > #WITH_BSD_GREP=         YES
> > #
> > WITH_OFED_EXTRA=        YES
> > WITH_NAND=              YES
> > #WITH_CTF=              YES
> > #
> > WITH_SVN=               YES
> > #
> > # Enable building openldap support for kerberos.
> > #WITH_OPENLDAP=         YES
> > #
> > WITH_SORT_THREADS=      YES
> > #
> > WITH_EXTRA_TCP_STACKS=  YES
> > #
> > WITH_ZONEINFO_LEAPSECONDS_SUPPORT=  YES
> > #
> > MALLOC_PRODUCTION=      YES
> > #
> > WITHOUT_ASSERT_DEBUG=   YES
> > #
> > WITHOUT_TESTS=          YES
> > #
> > WITHOUT_DEBUG_FILES=    YES
> > #
> > WITHOUT_REPRODUCIBLE_BUILD= YES
> > #
> > #  mitigation for CVE-2017-5715 in the kernel build
> > #WITH_KERNEL_RETPOLINE= YES  
> 
> Your original error messages seemed to indicate that you were building
> with MK_LLVM_TARGET_BPF=yes (which is not enabled by default).  I don't
> see it in your src.conf, but maybe you enabled it in some other way?
> 
> In any case, I have committed a fix in r344825.
> 
> -Dimitry
> 

Hello.

Thank you very much for fixing this!

Yes, you're right, I posted, again, the wrong file. That was one of the machines which worked.
I also had -O3 optimization enabled.

The fix has landed before I could answer your email - thanks for the fast fix.

Kind regards,

Oliver 

- -- 
O. Hartmann

Ich widerspreche der Nutzung oder Übermittlung meiner Daten für
Werbezwecke oder für die Markt- oder Meinungsforschung (§ 28 Abs. 4 BDSG).
-----BEGIN PGP SIGNATURE-----

iHUEARYIAB0WIQSy8IBxAPDkqVBaTJ44N1ZZPba5RwUCXIAGXgAKCRA4N1ZZPba5
R+cBAQDSlnP5HJeTx/x7ooK+4XP/AAYO6uUGgXifh0LYzssqvQEAv+zhsLx4Ct4x
S5u+lr1mKtIOpx/5rR/q0y/4WBeqmAI=
=Or32
-----END PGP SIGNATURE-----
Received on Wed Mar 06 2019 - 16:42:09 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:41:20 UTC