From nobody Sat Jun 14 11:08:33 2025 X-Original-To: freebsd-riscv@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 4bKD5x241kz511rp for ; Sat, 14 Jun 2025 11:08:37 +0000 (UTC) (envelope-from freebsd-riscv@dino.sk) Received: from cm0.netlabit.sk (mailhost.netlabit.sk [84.245.65.72]) (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 4bKD5w62W8z3NfQ; Sat, 14 Jun 2025 11:08:36 +0000 (UTC) (envelope-from freebsd-riscv@dino.sk) Authentication-Results: mx1.freebsd.org; none Received: from dino.sk ([84.245.95.254]) (AUTH: LOGIN milan, TLS: TLSv1.3,256bits,TLS_AES_256_GCM_SHA384) by cm0.netlabit.sk with ESMTPSA id 00000000007A7EDA.00000000684D5832.00012D92; Sat, 14 Jun 2025 13:08:34 +0200 Date: Sat, 14 Jun 2025 13:08:33 +0200 From: Milan Obuch To: Michael Tuexen Cc: freebsd-riscv@freebsd.org Subject: Re: Problem with cc in native build Message-ID: <20250614130833.97058868.14667060.98125142@dino.sk> In-Reply-To: <23AF089C-F1F3-47B3-8F46-FCA4E4DEF67D@FreeBSD.org> References: <20250614112931.62906549.14667060.09536044@dino.sk> <23AF089C-F1F3-47B3-8F46-FCA4E4DEF67D@FreeBSD.org> X-Mailer: Claws Mail 3.21.0 (GTK+ 2.24.33; amd64-portbld-freebsd14.3) List-Id: FreeBSD on the RISC-V instruction set architecture List-Archive: https://lists.freebsd.org/archives/freebsd-riscv List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: freebsd-riscv@freebsd.org Sender: owner-freebsd-riscv@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 4bKD5w62W8z3NfQ 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:5578, ipnet:84.245.64.0/18, country:SK] On Sat, 14 Jun 2025 12:50:11 +0200 Michael Tuexen wrote: > > On 14. Jun 2025, at 11:29, Milan Obuch > > wrote: > > > > Hi, > > > > I did native build on Star64, but there is something wrong with cc > > binary generated. > > > > I started with sme snapshot from ftp.freebsd.org, then I did all the > > usual steps (make buildworld, make buildkernel, make installkernel, > > make installworld), as I do on other systems when doing full source > > based upgrade. > > > > That seemingly went OK, I can boot newly boot system and check > > devices, interfaces,files, etc. Now, I tried another buildkernel to > > test some changes, but that failed. The error was (at stage 3.1: > > building everything, on first cc invocation) > > > > cc -target riscv64-unknown-freebsd15.0 > > --sysroot=/usr/obj/usr/src/riscv.riscv64/tmp > > -B/usr/obj/usr/src/riscv.riscv64/tmp/usr/bin -c -O2 -pipe > > -fno-strict-aliasing -g -nostdinc -I. -I/usr/src/sys > > -I/usr/src/sys/contrib/ck/include -I/usr/src/sys/contrib/libfdt > > -I/usr/src/sys/contrib/device-tree/include -D_KERNEL > > -DHAVE_KERNEL_OPTION_HEADERS -include opt_global.h -fPIE > > -fno-omit-frame-pointer -fno-optimize-sibling-calls -MD > > -MF.depend.genoffset.o -MTgenoffset.o > > -fdebug-prefix-map=./machine=/usr/src/sys/riscv/include > > -march=rv64imafdch -mabi=lp64 -mno-relax -ffreestanding -fwrapv > > -fstack-protector -gdwarf-4 -Wall -Wstrict-prototypes > > -Wmissing-prototypes -Wpointer-arith -Wcast-qual -Wundef > > -Wno-pointer-sign -D__printf__=__freebsd_kprintf__ > > -Wmissing-include-dirs -fdiagnostics-show-option > > -Wno-unknown-pragmas -Wswitch -Wno-error=tautological-compare > > -Wno-error=empty-body -Wno-error=parentheses-equality > > -Wno-error=unused-function -Wno-error=pointer-sign > > -Wno-error=shift-negative-value -Wno- address-of-packed-member > > -Wno-format-zero-length -mcmodel=medium -std=gnu17 -fcommon > > /usr/src/sys/kern/genoffset.c error: unable to create target: 'No > > available targets are compatible with triple > > "riscv64-unknown-freebsd15.0"' 1 error generated. *** Error code 1 > > > > I do not understand the issue, but trying > > > > # cc -print-target-triple > > riscv64-unknown-freebsd15.0 > > > > looks OK, however > > > > # cc -print-targets > > > > Registered Targets: > > arm - ARM > > armeb - ARM (big endian) > > thumb - Thumb > > thumbeb - Thumb (big endian) > > > > probably means cc as built cannot actually compile for riscv arch... > > > > Did anybody tried building FreeBSD natively on some RiscV platform? > > I think this is some kind of oversight in build process, but really > > fatal one... > I am building FreeBSD on a RiscV board (HiFive Unmatched Rev B). The > last time a month ago or so. > I get > tuexen@riscv:~ % cc -print-target-triple > riscv64-unknown-freebsd15.0 > tuexen@riscv:~ % cc -print-targets > > Registered Targets: > aarch64 - AArch64 (little endian) > aarch64_32 - AArch64 (little endian ILP32) > aarch64_be - AArch64 (big endian) > arm - ARM > arm64 - ARM64 (little endian) > arm64_32 - ARM64 (little endian ILP32) > armeb - ARM (big endian) > ppc32 - PowerPC 32 > ppc32le - PowerPC 32 LE > ppc64 - PowerPC 64 > ppc64le - PowerPC 64 LE > riscv32 - 32-bit RISC-V > riscv64 - 64-bit RISC-V > thumb - Thumb > thumbeb - Thumb (big endian) > x86 - 32-bit X86: Pentium-Pro and above > x86-64 - 64-bit X86: EM64T and AMD64 > > Let me trigger a new build. > Great. I did use sources from June 1st, git hash 66c2e68076bd. But I just found the issue... My /etc/src.conf is the culprit, I mistakenly put there some WITHOUT_LLVM_TARGET knobs, so consider this a pilot error. Shame on me :( I should know better, but this was my first non-x86 build after long time. Now if I could fix it without full reinstall and rebuild... Regards, Milan