From owner-freebsd-riscv@freebsd.org Wed Nov 27 22:49:26 2019 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 A5A981BAF9E for ; Wed, 27 Nov 2019 22:49:26 +0000 (UTC) (envelope-from dclarke@blastwave.org) Received: from jax4mhob25.registeredsite.com (jax4mhob25.registeredsite.com [64.69.218.113]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "*.registeredsite.com", Issuer "COMODO RSA Domain Validation Secure Server CA" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47NbYd4H9Tz3DKW for ; Wed, 27 Nov 2019 22:49:25 +0000 (UTC) (envelope-from dclarke@blastwave.org) Received: from mailpod.hostingplatform.com ([10.30.77.35]) by jax4mhob25.registeredsite.com (8.14.4/8.14.4) with ESMTP id xARMnLNO115651 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL) for ; Wed, 27 Nov 2019 17:49:21 -0500 Received: (qmail 35911 invoked by uid 0); 27 Nov 2019 22:49:21 -0000 X-TCPREMOTEIP: 99.253.169.68 X-Authenticated-UID: dclarke@blastwave.org Received: from unknown (HELO ?172.16.35.2?) (dclarke@blastwave.org@99.253.169.68) by 0 with ESMTPA; 27 Nov 2019 22:49:21 -0000 Subject: Re: [sw-dev] GCC 8.x or 9.x for FreeBSD rv64imafdc ?? To: Ruslan Bukin , Bruce Hoult Cc: RISC-V SW Dev , freebsd-riscv References: <5bca6745-1c09-3ba7-3b4a-2456ea2e1081@blastwave.org> <20191127135941.GA20804@bsdpad.com> From: Dennis Clarke Message-ID: <11917081-1ce7-182d-d6a8-3d88fd58b153@blastwave.org> Date: Wed, 27 Nov 2019 22:49:20 +0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:71.0) Gecko/20100101 Thunderbird/71.0 MIME-Version: 1.0 In-Reply-To: <20191127135941.GA20804@bsdpad.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 47NbYd4H9Tz3DKW X-Spamd-Bar: ++++ Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=none (mx1.freebsd.org: domain of dclarke@blastwave.org has no SPF policy when checking 64.69.218.113) smtp.mailfrom=dclarke@blastwave.org X-Spamd-Result: default: False [4.21 / 15.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; IP_SCORE(0.38)[ipnet: 64.69.218.0/23(0.29), asn: 19871(1.66), country: US(-0.05)]; MIME_GOOD(-0.10)[text/plain]; MIME_TRACE(0.00)[0:+]; PREVIOUSLY_DELIVERED(0.00)[freebsd-riscv@freebsd.org]; AUTH_NA(1.00)[]; DMARC_NA(0.00)[blastwave.org]; RCVD_COUNT_THREE(0.00)[3]; TO_MATCH_ENVRCPT_SOME(0.00)[]; TO_DN_ALL(0.00)[]; NEURAL_SPAM_MEDIUM(0.97)[0.972,0]; NEURAL_SPAM_LONG(0.96)[0.962,0]; RCVD_IN_DNSWL_NONE(0.00)[113.218.69.64.list.dnswl.org : 127.0.10.0]; R_SPF_NA(0.00)[]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; SUBJECT_ENDS_QUESTION(1.00)[]; ASN(0.00)[asn:19871, ipnet:64.69.218.0/23, country:US]; MID_RHS_MATCH_FROM(0.00)[]; RCVD_TLS_LAST(0.00)[] X-BeenThere: freebsd-riscv@freebsd.org X-Mailman-Version: 2.1.29 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, 27 Nov 2019 22:49:26 -0000 On 11/27/19 1:59 PM, Ruslan Bukin wrote: > The gcc we use is not old, but 8.3.0: > http://svn.freebsd.org/ports/head/devel/riscv64-gcc/Makefile > Thank you for the reply here as I was hoping to hear from you. > We have an official way of cross building native toolchain using base/gcc port and instructions: http://svn.freebsd.org/ports/head/base/README. > This port is outdated a bit (GCC 6.4) and requires an update (won't work for riscv currently). > I have tried a few methods with varying degrees of success and more recently with consistent success. However the absence of a native compiler may as well reduce the whole idea to nothing but ashes. However I may be wrong as I am told that clang is now being built in the buildworld process. I can tell you that I have tried the RISC-V projects gnu-toolchain gcc and the results are promising : vesta# vesta# uname -apKU FreeBSD vesta 12.1-RELEASE-p1 FreeBSD 12.1-RELEASE-p1 GENERIC amd64 amd64 1201000 1201000 vesta# /opt/rv64/tools/bin/riscv64-unknown-elf-gcc --version riscv64-unknown-elf-gcc (GCC) 9.2.0 Copyright (C) 2019 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. vesta# So that is 9.2.0 from https://github.com/riscv/riscv-gnu-toolchain and we can buildworld but not build the kernel. I find that curious. However I do see in my $DESTDIR a clang : vesta# ls -lap $DESTDIR/usr/bin/cl* -r-xr-xr-x 3 root wheel 63383544 Nov 26 08:00 /opt/rv64/rootfs/usr/bin/clang -r-xr-xr-x 3 root wheel 63383544 Nov 26 08:00 /opt/rv64/rootfs/usr/bin/clang-cpp -r-xr-xr-x 1 root wheel 865912 Nov 26 08:00 /opt/rv64/rootfs/usr/bin/clang-tblgen -r-xr-xr-x 3 root wheel 63383544 Nov 26 08:00 /opt/rv64/rootfs/usr/bin/clang++ -r-xr-xr-x 1 root wheel 1750 Nov 26 08:00 /opt/rv64/rootfs/usr/bin/clear vesta# vesta# file /opt/rv64/rootfs/usr/bin/clang /opt/rv64/rootfs/usr/bin/clang: ELF 64-bit LSB executable, UCB RISC-V, version 1 (SYSV), dynamically linked, interpreter /libexec/ld-elf.so.1, FreeBSD-style, for FreeBSD 13.0 (1300061), stripped vesta# vesta# vesta# readelf -delV /opt/rv64/rootfs/usr/bin/clang ELF Header: Magic: 7f 45 4c 46 02 01 01 00 00 00 00 00 00 00 00 00 Class: ELF64 Data: 2's complement, little endian Version: 1 (current) OS/ABI: UNIX - System V ABI Version: 0 Type: EXEC (Executable file) Machine: RISC-V Version: 0x1 Entry point address: 0x6d48a Start of program headers: 64 (bytes into file) Start of section headers: 63381560 (bytes into file) Flags: 0x5, RVC, double-float ABI Size of this header: 64 (bytes) Size of program headers: 56 (bytes) Number of program headers: 8 Size of section headers: 64 (bytes) Number of section headers: 31 Section header string table index: 30 . . . etc etc. However for the kernel I must use the cross tools from ports : vesta# vesta# /usr/local/bin/riscv64-unknown-freebsd12.0-gcc --version riscv64-unknown-freebsd12.0-gcc (FreeBSD Ports Collection for riscv64) 8.1.0 Copyright (C) 2018 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. vesta# However the only gcc that I have in the native RISC-V FreeBSD world is the one you cooked up in your homedir a while ago. I will try for a bootstrap of 9.2.0 natively today or tomorrow and with some effort maybe report back a result of some value. > On Tue, Nov 26, 2019 at 02:18:35AM -0800, Bruce Hoult wrote: >> I think there are very few people who have experience with the >> intersection of FreeBSD and RISC-V. So very true and yet I have had good results on RISC-V with FreeBSD and even ZFS ZPools however what the world desperately needs is a machine with real DDR4 memory slots and some SAS/SATA ports or at the very least a few PCI slots for storage controllers. We just are not there and the money needed for a 9nm solution is $300M or so. I don't think a FPGA is the way to go here. -- Dennis Clarke RISC-V/SPARC/PPC/ARM/CISC UNIX and Linux spoken GreyBeard and suspenders optional