Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 30 Dec 2020 14:45:10 -0400
From:      Mitchell Horne <mhorne@freebsd.org>
To:        Dennis Clarke <dclarke@blastwave.org>
Cc:        freebsd-riscv <freebsd-riscv@freebsd.org>
Subject:   Re: llvm stage in buildworld fails with 368820. Has anyone even tried this ?
Message-ID:  <CADeAsy3XW7cw_bYWm%2BaU%2Bx0iB_jm8NsSHSc62V5%2B=LRLe7NQtA@mail.gmail.com>
In-Reply-To: <CADeAsy2cj4-XZdh-oLbaWaeWZ1hc6QgvtD1Ks-w%2BAS78JV-5vw@mail.gmail.com>
References:  <48461668-e8cd-ea55-273c-9f53cd318a1f@blastwave.org> <3396d30e-a2a1-d585-63f5-83f4e6c2233a@blastwave.org> <CADeAsy2cj4-XZdh-oLbaWaeWZ1hc6QgvtD1Ks-w%2BAS78JV-5vw@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Wed, Dec 23, 2020 at 12:25 PM Mitchell Horne <mhorne@freebsd.org> wrote:
>
> On Mon, Dec 21, 2020 at 10:38 AM Dennis Clarke via freebsd-riscv
> <freebsd-riscv@freebsd.org> wrote:
> >
> >
> > Fairly certain that Mr. Horne said to me that no one tries to run a
> > buildworld within a RISC-V system and it seems cross-compile is what
> > folks are doing. So I am going to assume this is a LLVM/Clang bug and
> > not really a bug within the FreeBSD buildworld. At least at this point
> > I see no alternative than to keep running my FreeBSD 13.0-CURRENT at
> > rev 367349.  Any thoughts ?
> >
>
> Hi Dennis,
>
> To be clear, this is not a regression, but your first time attempting
> such a build within QEMU, is that correct?
>
> To update this system, you have the option of cross-building world +
> kernel on the host, mounting the QEMU disk image, and installing.
> Roughly, the instructions to do so are:
>
> # Crossbuild from host
> make TARGET=riscv buildworld
> make TARGET=riscv KERNCONF=QEMU buildkernel
>
> # Create md(4) disk from QEMU image file
> mdconfig -af /path/to/riscv.img
> gpart show md0 #show the partition table
>
> # Mount the ufs root filesystem (exact partition number may vary)
> mount /dev/md0p3 /mnt
>
> # Update world + kernel
> make TARGET=riscv DESTDIR=/mnt installworld
> make TARGET=riscv DESTDIR=/mnt installkernel
>
> # Unmount and cleanup
> umount /mnt
> mdconfig -du 0
>
> The next time you boot riscv.img, it should have an updated world +
> kernel. It may seem obvious but your QEMU instance should be shut down
> while you do this.
>
> >
> > .
> > .
> > .
> > --- _bootstrap-tools-usr.bin/clang/llvm-tblgen ---
> > --- CodeGenSchedule.o ---
> > c++  -O2 -pipe -fno-common
> > -I/usr/obj/usr/src/head/riscv.riscv64/tmp/obj-tools/lib/clang/libllvm
> > -march=rv64imafdc -mabi=lp64d -I/usr/src/head/lib/clang/include
> > -I/usr/src/head/contrib/llvm-project/llvm/include
> > -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS
> > -DHAVE_VCS_VERSION_INC
> > -DLLVM_DEFAULT_TARGET_TRIPLE=\"riscv64-unknown-freebsd13.0\"
> > -DLLVM_HOST_TRIPLE=\"riscv64-unknown-freebsd13.0\"
> > -DDEFAULT_SYSROOT=\"/usr/obj/usr/src/head/riscv.riscv64/tmp\"
> > -DLLVM_TARGET_ENABLE_RISCV
> > -DLLVM_NATIVE_ASMPARSER=LLVMInitializeRISCVAsmParser
> > -DLLVM_NATIVE_ASMPRINTER=LLVMInitializeRISCVAsmPrinter
> > -DLLVM_NATIVE_DISASSEMBLER=LLVMInitializeRISCVDisassembler
> > -DLLVM_NATIVE_TARGET=LLVMInitializeRISCVTarget
> > -DLLVM_NATIVE_TARGETINFO=LLVMInitializeRISCVTargetInfo
> > -DLLVM_NATIVE_TARGETMC=LLVMInitializeRISCVTargetMC -ffunction-sections
> > -fdata-sections -mno-relax -gline-tables-only -MD
> > -MF.depend.CodeGenSchedule.o -MTCodeGenSchedule.o
> > -Wno-format-zero-length -Qunused-arguments
> > -I/usr/obj/usr/src/head/riscv.riscv64/tmp/legacy/usr/include
> > -fno-exceptions -fno-rtti -std=c++14 -stdlib=libc++
> > -Wno-c++11-extensions   -c
> > /usr/src/head/contrib/llvm-project/llvm/utils/TableGen/CodeGenSchedule.cpp
> > -o CodeGenSchedule.o
> > --- _bootstrap-tools-usr.bin/clang/clang-tblgen ---
> > --- clang-tblgen.full ---
> > c++ -O2 -pipe -fno-common
> > -I/usr/obj/usr/src/head/riscv.riscv64/tmp/obj-tools/lib/clang/libllvm
> > -march=rv64imafdc -mabi=lp64d -I/usr/src/head/lib/clang/include
> > -I/usr/src/head/contrib/llvm-project/llvm/include
> > -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS
> > -DHAVE_VCS_VERSION_INC
> > -DLLVM_DEFAULT_TARGET_TRIPLE=\"riscv64-unknown-freebsd13.0\"
> > -DLLVM_HOST_TRIPLE=\"riscv64-unknown-freebsd13.0\"
> > -DDEFAULT_SYSROOT=\"/usr/obj/usr/src/head/riscv.riscv64/tmp\"
> > -DLLVM_TARGET_ENABLE_RISCV
> > -DLLVM_NATIVE_ASMPARSER=LLVMInitializeRISCVAsmParser
> > -DLLVM_NATIVE_ASMPRINTER=LLVMInitializeRISCVAsmPrinter
> > -DLLVM_NATIVE_DISASSEMBLER=LLVMInitializeRISCVDisassembler
> > -DLLVM_NATIVE_TARGET=LLVMInitializeRISCVTarget
> > -DLLVM_NATIVE_TARGETINFO=LLVMInitializeRISCVTargetInfo
> > -DLLVM_NATIVE_TARGETMC=LLVMInitializeRISCVTargetMC -ffunction-sections
> > -fdata-sections -mno-relax -gline-tables-only -Wno-format-zero-length
> > -Qunused-arguments
> > -I/usr/obj/usr/src/head/riscv.riscv64/tmp/legacy/usr/include
> > -fno-exceptions -fno-rtti -std=c++14 -stdlib=libc++
> > -Wno-c++11-extensions  -Wl,--gc-sections -static
> > -L/usr/obj/usr/src/head/riscv.riscv64/tmp/legacy/usr/lib -o
> > clang-tblgen.full  ASTTableGen.o ClangASTNodesEmitter.o
> > ClangASTPropertiesEmitter.o ClangAttrEmitter.o
> > ClangCommentCommandInfoEmitter.o
> > ClangCommentHTMLNamedCharacterReferenceEmitter.o
> > ClangCommentHTMLTagsEmitter.o ClangDataCollectorsEmitter.o
> > ClangDiagnosticsEmitter.o ClangOpcodesEmitter.o
> > ClangOpenCLBuiltinEmitter.o ClangOptionDocEmitter.o
> > ClangSACheckersEmitter.o ClangTypeNodesEmitter.o MveEmitter.o
> > NeonEmitter.o SveEmitter.o TableGen.o
> > /usr/obj/usr/src/head/riscv.riscv64/tmp/obj-tools/lib/clang/libllvmminimal/libllvmminimal.a
> > -L/usr/obj/usr/src/head/riscv.riscv64/tmp/obj-tools/lib/libexecinfo
> > -lexecinfo
> > -L/usr/obj/usr/src/head/riscv.riscv64/tmp/obj-tools/lib/libelf -lelf
> > -L/usr/obj/usr/src/head/riscv.riscv64/tmp/obj-tools/lib/ncurses/ncursesw
> > -lncursesw
> > -L/usr/obj/usr/src/head/riscv.riscv64/tmp/obj-tools/lib/libthr -lpthread
> >  -legacy
> > ld: error: undefined symbol: llvm::EnableABIBreakingChecks
>
> Seems that LLVM will purposefully cause this link error, according to
> the following code block I found:
>
> // One of these two variables will be referenced by a symbol defined in
> // llvm-config.h. We provide a link-time (or load time for DSO) failure when
> // there is a mismatch in the build configuration of the API client and LLVM.
> #if LLVM_ENABLE_ABI_BREAKING_CHECKS
> int EnableABIBreakingChecks;
> #else int DisableABIBreakingChecks;
> #endif
>
> Is this instance a copy of the image I provided you a few weeks back?
> If so, it's possible that while building it I took a WITHOUT_CLANG=yes
> shortcut and ended up with a mismatched clang and llvm library. I will
> see if I can reproduce the same error on a fresh build. If you end up
> doing the upgrade steps above, please try the native buildworld again
> and let me know if you see the same error.
>
> > >>> referenced by PrettyStackTrace.cpp
> > >>>               PrettyStackTrace.o:(.sdata+0x0) in archive
> > /usr/obj/usr/src/head/riscv.riscv64/tmp/obj-tools/lib/clang/libllvmminimal/libllvmminimal.a
> > >>> referenced by Signals.cpp
> > >>>               Signals.o:(.sdata+0x8) in archive
> > /usr/obj/usr/src/head/riscv.riscv64/tmp/obj-tools/lib/clang/libllvmminimal/libllvmminimal.a
> > >>> referenced by Timer.cpp
> > >>>               Timer.o:(.sdata+0x28) in archive
> > /usr/obj/usr/src/head/riscv.riscv64/tmp/obj-tools/lib/clang/libllvmminimal/libllvmminimal.a
> > c++: error: linker command failed with exit code 1 (use -v to see
> > invocation)
> > *** [clang-tblgen.full] Error code 1
> >

I was able to reproduce this error exactly, so it looks like something
needs tweaking. I will look a little closer at this in the next week
or so.

Cheers,
Mitchell

> > make[3]: stopped in /usr/src/head/usr.bin/clang/clang-tblgen
> > 1 error
> >
> > make[3]: stopped in /usr/src/head/usr.bin/clang/clang-tblgen
> > --- _bootstrap-tools-usr.bin/clang/llvm-tblgen ---
> > real 3234.48
> > user 5924.02
> > sys 310.00
> > ijiraq#
> >
> > The timestamp there tells you the sort of time needed within a qemu
> > instance.  I fired off the buildworld thus :
> >
> >     /usr/bin/time -p /usr/bin/nice -n +15 make -j 2 buildworld
> >
> > Concerned that I was tripping over some sort of error caused by
> > previous attempts I did destroy the zfs filesystem for /usr/src and
> > did a recreate and fresh checkout. No help there.
> >
> > ijiraq#
> > ijiraq# svnlite info
> > Path: .
> > Working Copy Root Path: /usr/src/head
> > URL: https://svn.freebsd.org/base/head
> > Relative URL: ^/head
> > Repository Root: https://svn.freebsd.org/base
> > Repository UUID: ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
> > Revision: 368820
> > Node Kind: directory
> > Schedule: normal
> > Last Changed Author: lwhsu
> > Last Changed Rev: 368820
> > Last Changed Date: 2020-12-20 02:59:44 +0000 (Sun, 20 Dec 2020)
> >
> > ijiraq# uname -apKU
> > FreeBSD ijiraq 13.0-CURRENT FreeBSD 13.0-CURRENT #0 r367349: Wed Nov  4
> > 22:48:25 UTC 2020
> > root@FreeBSD-head-riscv64-build.jail.ci.FreeBSD.org:/usr/obj/usr/src/riscv.riscv64/sys/QEMU
> >  riscv riscv64 1300125 1300125
> > ijiraq#
> >
> >
> > --
> > Dennis Clarke
> > RISC-V/SPARC/PPC/ARM/CISC
> > UNIX and Linux spoken
> > GreyBeard and suspenders optional
> >
> >
> > -------- Forwarded Message --------
> > Subject: trying to build from head with 368820 and previous revs always fail
> > Date: Sun, 20 Dec 2020 15:33:12 -0500
> > From: Dennis Clarke via freebsd-riscv <freebsd-riscv@freebsd.org>
> > Reply-To: Dennis Clarke <dclarke@blastwave.org>
> > To: freebsd-riscv@freebsd.org
> >
> >
> > buildworld seems to always blow up in the same place :
> >
> >
> > .
> > .
> > .
> > /src/head/lib/clang/include
> > -I/usr/src/head/contrib/llvm-project/llvm/include
> > -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS
> > -DHAVE_VCS_VERSION_INC
> > -DLLVM_DEFAULT_TARGET_TRIPLE=\"riscv64-unknown-freebsd13.0\"
> > -DLLVM_HOST_TRIPLE=\"riscv64-unknown-freebsd13.0\"
> > -DDEFAULT_SYSROOT=\"/usr/obj/usr/src/head/riscv.riscv64/tmp\"
> > -DLLVM_TARGET_ENABLE_RISCV
> > -DLLVM_NATIVE_ASMPARSER=LLVMInitializeRISCVAsmParser
> > -DLLVM_NATIVE_ASMPRINTER=LLVMInitializeRISCVAsmPrinter
> > -DLLVM_NATIVE_DISASSEMBLER=LLVMInitializeRISCVDisassembler
> > -DLLVM_NATIVE_TARGET=LLVMInitializeRISCVTarget
> > -DLLVM_NATIVE_TARGETINFO=LLVMInitializeRISCVTargetInfo
> > -DLLVM_NATIVE_TARGETMC=LLVMInitializeRISCVTargetMC -ffunction-sections
> > -fdata-sections -mno-relax -gline-tables-only -Wno-format-zero-length
> > -Qunused-arguments
> > -I/usr/obj/usr/src/head/riscv.riscv64/tmp/legacy/usr/include
> > -fno-exceptions -fno-rtti -std=c++14 -stdlib=libc++
> > -Wno-c++11-extensions  -Wl,--gc-sections -static
> > -L/usr/obj/usr/src/head/riscv.riscv64/tmp/legacy/usr/lib -o
> > clang-tblgen.full  ASTTableGen.o ClangASTNodesEmitter.o
> > ClangASTPropertiesEmitter.o ClangAttrEmitter.o
> > ClangCommentCommandInfoEmitter.o
> > ClangCommentHTMLNamedCharacterReferenceEmitter.o
> > ClangCommentHTMLTagsEmitter.o ClangDataCollectorsEmitter.o
> > ClangDiagnosticsEmitter.o ClangOpcodesEmitter.o
> > ClangOpenCLBuiltinEmitter.o ClangOptionDocEmitter.o
> > ClangSACheckersEmitter.o ClangTypeNodesEmitter.o MveEmitter.o
> > NeonEmitter.o SveEmitter.o TableGen.o
> > /usr/obj/usr/src/head/riscv.riscv64/tmp/obj-tools/lib/clang/libllvmminimal/libllvmminimal.a
> > -L/usr/obj/usr/src/head/riscv.riscv64/tmp/obj-tools/lib/libexecinfo
> > -lexecinfo
> > -L/usr/obj/usr/src/head/riscv.riscv64/tmp/obj-tools/lib/libelf -lelf
> > -L/usr/obj/usr/src/head/riscv.riscv64/tmp/obj-tools/lib/ncurses/ncursesw
> > -lncursesw
> > -L/usr/obj/usr/src/head/riscv.riscv64/tmp/obj-tools/lib/libthr -lpthread
> >  -legacy
> > ld: error: undefined symbol: llvm::EnableABIBreakingChecks
> > >>> referenced by PrettyStackTrace.cpp
> > >>>               PrettyStackTrace.o:(.sdata+0x0) in archive
> > /usr/obj/usr/src/head/riscv.riscv64/tmp/obj-tools/lib/clang/libllvmminimal/libllvmminimal.a
> > >>> referenced by Signals.cpp
> > >>>               Signals.o:(.sdata+0x8) in archive
> > /usr/obj/usr/src/head/riscv.riscv64/tmp/obj-tools/lib/clang/libllvmminimal/libllvmminimal.a
> > >>> referenced by Timer.cpp
> > >>>               Timer.o:(.sdata+0x28) in archive
> > /usr/obj/usr/src/head/riscv.riscv64/tmp/obj-tools/lib/clang/libllvmminimal/libllvmminimal.a
> > c++: error: linker command failed with exit code 1 (use -v to see
> > invocation)
> > *** [clang-tblgen.full] Error code 1
> >
> > make[3]: stopped in /usr/src/head/usr.bin/clang/clang-tblgen
> > 1 error
> >
> > make[3]: stopped in /usr/src/head/usr.bin/clang/clang-tblgen
> > --- _bootstrap-tools-usr.bin/clang/llvm-tblgen ---
> >
> >
> > any thoughts ?
> >
> > this is inside a very stable qemu instance.
> >
> >
> > --
> > Dennis Clarke
> > RISC-V/SPARC/PPC/ARM/CISC
> > UNIX and Linux spoken
> > GreyBeard and suspenders optional
> > _______________________________________________
> > freebsd-riscv@freebsd.org mailing list
> > https://lists.freebsd.org/mailman/listinfo/freebsd-riscv
> > To unsubscribe, send any mail to "freebsd-riscv-unsubscribe@freebsd.org"
> > _______________________________________________
> > freebsd-riscv@freebsd.org mailing list
> > https://lists.freebsd.org/mailman/listinfo/freebsd-riscv
> > To unsubscribe, send any mail to "freebsd-riscv-unsubscribe@freebsd.org"



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CADeAsy3XW7cw_bYWm%2BaU%2Bx0iB_jm8NsSHSc62V5%2B=LRLe7NQtA>