From owner-freebsd-riscv@freebsd.org Wed Dec 30 18:45:22 2020 Return-Path: Delivered-To: freebsd-riscv@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 63E2C4CBC65 for ; Wed, 30 Dec 2020 18:45:22 +0000 (UTC) (envelope-from mhorne@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [IPv6:2610:1c1:1:606c::24b:4]) (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-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4D5gFt2KPMz4WbY for ; Wed, 30 Dec 2020 18:45:22 +0000 (UTC) (envelope-from mhorne@freebsd.org) Received: from mail-yb1-f181.google.com (mail-yb1-f181.google.com [209.85.219.181]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) (Authenticated sender: mhorne) by smtp.freebsd.org (Postfix) with ESMTPSA id 3CA0E7407 for ; Wed, 30 Dec 2020 18:45:22 +0000 (UTC) (envelope-from mhorne@freebsd.org) Received: by mail-yb1-f181.google.com with SMTP id r63so8685959ybf.5 for ; Wed, 30 Dec 2020 10:45:22 -0800 (PST) X-Gm-Message-State: AOAM533/oOrdCdemecMcSVaVYXxHlIbOJjS0AsCP1YJ9q7vxAMCI/cJ6 TFI117vy3UEzoAYmrZ7HI49i7SK9TeShuvT6ljc= X-Google-Smtp-Source: ABdhPJx0+Bl6TDkKteAWnHqxzzPdfuOedC1a6rD9mPS4YEJD0YzoKu/iWK4T2ozM7/NIPVM296scbj+Qdhss6wj12cs= X-Received: by 2002:a25:2d61:: with SMTP id s33mr82401223ybe.36.1609353921714; Wed, 30 Dec 2020 10:45:21 -0800 (PST) MIME-Version: 1.0 References: <48461668-e8cd-ea55-273c-9f53cd318a1f@blastwave.org> <3396d30e-a2a1-d585-63f5-83f4e6c2233a@blastwave.org> In-Reply-To: From: Mitchell Horne Date: Wed, 30 Dec 2020 14:45:10 -0400 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: llvm stage in buildworld fails with 368820. Has anyone even tried this ? To: Dennis Clarke Cc: freebsd-riscv Content-Type: text/plain; charset="UTF-8" X-BeenThere: freebsd-riscv@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: FreeBSD on the RISC-V instruction set architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 30 Dec 2020 18:45:22 -0000 On Wed, Dec 23, 2020 at 12:25 PM Mitchell Horne wrote: > > On Mon, Dec 21, 2020 at 10:38 AM Dennis Clarke via freebsd-riscv > 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 > > Reply-To: Dennis Clarke > > 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"