Date: Wed, 13 Mar 2019 08:48:40 -0400 From: Dennis Clarke <dclarke@blastwave.org> To: Ruslan Bukin <ruslan.bukin@cl.cam.ac.uk> Cc: Dinesh Thirumurthy <dinesh.thirumurthy@gmail.com>, freebsd-riscv <freebsd-riscv@freebsd.org> Subject: Re: wiki pages https://wiki.freebsd.org/riscv wrong Message-ID: <2848569d-68e4-df5f-9d0f-7e96933450ca@blastwave.org> In-Reply-To: <20190312170103.GA9714@bsdpad.com> References: <eaf0c690-cca7-f88f-7c3a-3e23964ffd61@blastwave.org> <20190224212643.GA67845@bsdpad.com> <CAPn%2BtrHWmuqD=iek0DxO-co7K3Djva_EJart9Xg=DQiO4CZQgQ@mail.gmail.com> <4b5341ca-b1f5-a9c5-bdda-0204d37703ae@blastwave.org> <20190312170103.GA9714@bsdpad.com>
next in thread | previous in thread | raw e-mail | index | archive | help
> > What was your issue? They don't work. Plain and simple. Nope. No one has *really* followed along on that page in a while. On that page are some basic info and status and then "Instructions". None of which really works. Let's go step by step and watch it fail and be WRONG here there and everywhere. vesta# uname -a FreeBSD vesta 12.0-RELEASE FreeBSD 12.0-RELEASE r341666 GENERIC amd64 Note this is recent RELEASE and not 11.2 or anything else. Let's start ... vesta# echo $HOME /root vesta# cd vesta# pwd /root vesta# env | sort BLOCKSIZE=K COLUMNS=132 EDITOR=/usr/bin/vi GROUP=wheel HOME=/root HOST=vesta HOSTTYPE=FreeBSD LANG=en_US.UTF-8 LC_ALL=en_US.UTF-8 LC_COLLATE=en_US.UTF-8 LC_CTYPE=en_US.UTF-8 LC_MESSAGES=en_US.UTF-8 LC_MONETARY=en_US.UTF-8 LC_NUMERIC=en_US.UTF-8 LC_TIME=en_US.UTF-8 LINES=43 LOGNAME=root MACHTYPE=x86_64 MAIL=/var/mail/root OSTYPE=FreeBSD PAGER=/usr/bin/more PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/opt/schily/bin PWD=/root REMOTEHOST=static-68-179-116-203.ptr.terago.net SHELL=/bin/csh SHLVL=1 TERM=vt100 TMPDIR=/var/tmp/root TZ=GMT0 USER=root VENDOR=amd VISUAL=/usr/bin/vi XTERM_LOCALE=en_US.UTF-8 vesta# vesta# setenv PREFIX $HOME/riscv vesta# vesta# echo $PREFIX /root/riscv vesta# Check for a few packages. vesta# pkg query %n\ %v\ %o | grep -E -e 'bison|gmp|mpc|gawk|gsed' bison 3.3.2,1 devel/bison gawk 4.1.4_3 lang/gawk gmp 6.1.2_1 math/gmp gsed 4.7 textproc/gsed mpc 1.1.0_2 math/mpc vesta# get on with the process as detailed on that wiki page : vesta# git clone https://github.com/freebsd-riscv/riscv-gnu-toolchain Cloning into 'riscv-gnu-toolchain'... remote: Enumerating objects: 7319, done. remote: Total 7319 (delta 0), reused 0 (delta 0), pack-reused 7319 Receiving objects: 100% (7319/7319), 4.65 MiB | 5.58 MiB/s, done. Resolving deltas: 100% (3578/3578), done. vesta# cd riscv-gnu-toolchain vesta# git submodule update --init --recursive Submodule 'riscv-binutils' (https://github.com/freebsd-riscv/riscv-binutils-gdb) registered for path 'riscv-binutils' Submodule 'riscv-gcc' (https://github.com/freebsd-riscv/riscv-gcc) registered for path 'riscv-gcc' Submodule 'riscv-gdb' (https://github.com/freebsd-riscv/riscv-binutils-gdb) registered for path 'riscv-gdb' Submodule 'riscv-qemu' (https://github.com/riscv/riscv-qemu) registered for path 'riscv-qemu' Cloning into '/root/riscv-gnu-toolchain/riscv-binutils'... Cloning into '/root/riscv-gnu-toolchain/riscv-qemu'... Cloning into '/root/riscv-gnu-toolchain/riscv-gdb'... Cloning into '/root/riscv-gnu-toolchain/riscv-gcc'... Submodule path 'riscv-binutils': checked out '82dcb8613e1b1fb2989deffde1d3c9729695ff9c' Submodule path 'riscv-gcc': checked out 'be9abee2aaa919ad8530336569d17b5a60049717' Submodule path 'riscv-gdb': checked out '044a7fdd5d0e6f3a4fc60e43673368e387c4b753' Submodule path 'riscv-qemu': checked out 'ff36f2f77ec3e6a6211c63bfe1707ec057b12f7d' Submodule 'dtc' (git://git.qemu-project.org/dtc.git) registered for path 'riscv-qemu/dtc' Submodule 'pixman' (git://anongit.freedesktop.org/pixman) registered for path 'riscv-qemu/pixman' Submodule 'roms/SLOF' (git://git.qemu-project.org/SLOF.git) registered for path 'riscv-qemu/roms/SLOF' Submodule 'roms/ipxe' (git://git.qemu-project.org/ipxe.git) registered for path 'riscv-qemu/roms/ipxe' Submodule 'roms/openbios' (git://git.qemu-project.org/openbios.git) registered for path 'riscv-qemu/roms/openbios' Submodule 'roms/openhackware' (git://git.qemu-project.org/openhackware.git) registered for path 'riscv-qemu/roms/openhackware' Submodule 'roms/qemu-palcode' (git://github.com/rth7680/qemu-palcode.git) registered for path 'riscv-qemu/roms/qemu-palcode' Submodule 'roms/seabios' (git://git.qemu-project.org/seabios.git/) registered for path 'riscv-qemu/roms/seabios' Submodule 'roms/sgabios' (git://git.qemu-project.org/sgabios.git) registered for path 'riscv-qemu/roms/sgabios' Submodule 'roms/u-boot' (git://git.qemu-project.org/u-boot.git) registered for path 'riscv-qemu/roms/u-boot' Submodule 'roms/vgabios' (git://git.qemu-project.org/vgabios.git/) registered for path 'riscv-qemu/roms/vgabios' Cloning into '/root/riscv-gnu-toolchain/riscv-qemu/dtc'... Cloning into '/root/riscv-gnu-toolchain/riscv-qemu/roms/openhackware'... Cloning into '/root/riscv-gnu-toolchain/riscv-qemu/pixman'... Cloning into '/root/riscv-gnu-toolchain/riscv-qemu/roms/qemu-palcode'... Cloning into '/root/riscv-gnu-toolchain/riscv-qemu/roms/SLOF'... Cloning into '/root/riscv-gnu-toolchain/riscv-qemu/roms/sgabios'... Cloning into '/root/riscv-gnu-toolchain/riscv-qemu/roms/openbios'... Cloning into '/root/riscv-gnu-toolchain/riscv-qemu/roms/vgabios'... Cloning into '/root/riscv-gnu-toolchain/riscv-qemu/roms/seabios'... Cloning into '/root/riscv-gnu-toolchain/riscv-qemu/roms/u-boot'... Cloning into '/root/riscv-gnu-toolchain/riscv-qemu/roms/ipxe'... Submodule path 'riscv-qemu/dtc': checked out '65cc4d2748a2c2e6f27f1cf39e07a5dbabd80ebf' Submodule path 'riscv-qemu/pixman': checked out '87eea99e443b389c978cf37efc52788bf03a0ee0' Submodule path 'riscv-qemu/roms/SLOF': checked out 'e3d05727a074619fc12d0a67f05cf2c42c875cce' Submodule path 'riscv-qemu/roms/ipxe': checked out '04186319181298083ef28695a8309028b26fe83c' Submodule path 'riscv-qemu/roms/openbios': checked out 'c5542f226c0d3d61e7bb578b70e591097d575479' Submodule path 'riscv-qemu/roms/openhackware': checked out 'c559da7c8eec5e45ef1f67978827af6f0b9546f5' Submodule path 'riscv-qemu/roms/qemu-palcode': checked out 'c87a92639b28ac42bc8f6c67443543b405dc479b' Submodule path 'riscv-qemu/roms/seabios': checked out 'e2fc41e24ee0ada60fc511d60b15a41b294538be' Submodule path 'riscv-qemu/roms/sgabios': checked out '23d474943dcd55d0550a3d20b3d30e9040a4f15b' Submodule path 'riscv-qemu/roms/u-boot': checked out '2072e7262965bb48d7fffb1e283101e6ed8b21a8' Submodule path 'riscv-qemu/roms/vgabios': checked out '19ea12c230ded95928ecaef0db47a82231c2e485' vesta# vesta# ./configure --prefix=$PREFIX checking for gcc... no checking for cc... cc checking whether the C compiler works... yes checking for C compiler default output file name... a.out checking for suffix of executables... checking whether we are cross compiling... no checking for suffix of object files... o checking whether we are using the GNU C compiler... yes checking whether cc accepts -g... yes checking for cc option to accept ISO C89... none needed checking for grep that handles long lines and -e... /usr/local/bin/grep checking for fgrep... /usr/local/bin/grep -F checking for grep that handles long lines and -e... (cached) /usr/local/bin/grep checking for bash... /usr/local/bin/bash checking for __gmpz_init in -lgmp... no checking for mpfr_init in -lmpfr... no checking for mpc_init2 in -lmpc... no checking for curl... /usr/local/bin/curl checking for wget... /usr/local/bin/wget checking for ftp... /usr/bin/ftp configure: creating ./config.status config.status: creating Makefile config.status: creating scripts/wrapper/awk/awk config.status: creating scripts/wrapper/sed/sed vesta# I am not going to even bother with -j16 or -j4 or any parallel build here : vesta# /usr/bin/time -p gmake freebsd . . . gmake[3]: Leaving directory '/root/riscv-gnu-toolchain/build-gcc-freebsd/gcc' gmake[2]: Leaving directory '/root/riscv-gnu-toolchain/build-gcc-freebsd' rm -rf /root/riscv/lib/gcc/riscv64-unknown-freebsd*/*/include-fixed mkdir -p stamps/ && touch stamps/build-gcc-freebsd gmake[1]: Leaving directory '/root/riscv-gnu-toolchain' real 3156.02 user 2964.85 sys 213.00 vesta# Lovely. Here we hit the first bit of BROKEN and WRONG stuff on that page : vesta# ls -lad ${PREFIX}/lib/gcc/ drwxr-xr-x 3 root wheel 3 Mar 13 10:30 /root/riscv/lib/gcc/ vesta# ls /root/riscv/lib/gcc/ riscv64-unknown-freebsd12.0 vesta# vesta# ls /root/riscv/lib/gcc/riscv64-unknown-freebsd12.0/ 8.2.0 vesta# vesta# ls /root/riscv/lib/gcc/riscv64-unknown-freebsd12.0/8.2.0/ include install-tools plugin vesta# There is no such thing as "include-fixed" there and certainly not for FreeBSD 11.2 AND not gcc 8.1.0 and what else do you need? WRONG. Let's try to stumble forwards knowing that we are in the land of WRONG now and who knows what breaks next. vesta# cd vesta# pwd /root ??? Alternatively, install devel/riscv64-xtoolchain-gcc .... Why is this AFTER the instructions to build the cross compiler tools manually ??? vesta# svn co http://svn.freebsd.org/base/head freebsd-riscv . . . A freebsd-riscv/Makefile.sys.inc U freebsd-riscv Checked out revision 345085. vesta# vesta# Well now we hit the muddy bits. When using toolchain built by hand: ??? When using devel/riscv64-xtoolchain-gcc: ??? There is no explanation where this stuff comes from or what it is or why. I will make a wild guess and assume that someone somewhere is talking about a cross compiler : vesta# pkg query %n\ %v\ %o | grep 'risc' riscv64-binutils 2.32,1 devel/riscv64-binutils riscv64-gcc 8.1.0_1 devel/riscv64-gcc riscv64-xtoolchain-gcc 0.4_1 devel/riscv64-xtoolchain-gcc vesta# The user at the moment is root so whatever stuff on that page is about /home/${USER} is plain WRONG so we have to guess that maybe some path stuff has to be just sort of made up : vesta# vesta# pwd /root/freebsd-riscv vesta# setenv MAKEOBJDIRPREFIX /root/obj/ vesta# setenv WITHOUT_FORMAT_EXTENSIONS yes vesta# /usr/bin/time -p make CROSS_TOOLCHAIN=riscv64-gcc TARGET_ARCH=riscv64 buildworld [Creating objdir /root/obj//root/freebsd-riscv/amd64.amd64...] [Creating objdir /root/obj//root/freebsd-riscv/riscv.riscv64...] -------------------------------------------------------------- >>> World build started on Wed Mar 13 11:35:01 GMT 2019 -------------------------------------------------------------- -------------------------------------------------------------- >>> Rebuilding the temporary build tree -------------------------------------------------------------- rm -rf /root/obj//root/freebsd-riscv/riscv.riscv64/tmp cd /root/freebsd-riscv/tools/build; make DIRPRFX=tools/build/ DESTDIR=/root/obj//root/freebsd-riscv/riscv.riscv64/tmp/legacy installdirs [Creating objdir /root/obj//root/freebsd-riscv/riscv.riscv64/tools/build...] mkdir -p "/root/obj//root/freebsd-riscv/riscv.riscv64/tmp/legacy/bin" mkdir -p "/root/obj//root/freebsd-riscv/riscv.riscv64/tmp/legacy/usr/lib" . . . /usr/local/bin/riscv64-unknown-freebsd12.0-gcc --sysroot=/root/obj//root/freebsd-riscv/riscv.riscv64/tmp -B/usr/local/riscv64-unknown-freebsd12.0/bin/ -O2 -pipe -I/root/freebsd-riscv/lib/msun/ld128 -I/root/freebsd-riscv/lib/msun/riscv -I/root/freebsd-riscv/lib/msun/src -I/root/freebsd-riscv/lib/libc/include -I/root/freebsd-riscv/lib/libc/riscv64 -march=rv64imafdc -mabi=lp64d -g -MD -MF.depend.s_clog.o -MTs_clog.o -std=gnu99 -fstack-protector-strong -Wsystem-headers -Werror -Wno-pointer-sign -Wno-error=address -Wno-error=array-bounds -Wno-error=attributes -Wno-error=bool-compare -Wno-error=cast-align -Wno-error=clobbered -Wno-error=enum-compare -Wno-error=extra -Wno-error=inline -Wno-error=logical-not-parentheses -Wno-error=strict-aliasing -Wno-error=uninitialized -Wno-error=unused-but-set-variable -Wno-error=unused-function -Wno-error=unused-value -Wno-error=misleading-indentation -Wno-error=nonnull-compare -Wno-error=shift-negative-value -Wno-error=tautological-compare -Wno-error=unused-const-variable -Wno-error=bool-operation -Wno-error=deprecated -Wno-error=expansion-to-defined -Wno-error=format-overflow -Wno-error=format-truncation -Wno-error=implicit-fallthrough -Wno-error=int-in-bool-context -Wno-error=memset-elt-size -Wno-error=noexcept-type -Wno-error=nonnull -Wno-error=pointer-compare -Wno-error=stringop-overflow -Wno-error=aggressive-loop-optimizations -Wno-error=cast-function-type -Wno-error=catch-value -Wno-error=multistatement-macros -Wno-error=restrict -Wno-error=sizeof-pointer-memaccess -Wno-error=stringop-truncation -Wno-unknown-pragmas -c /root/freebsd-riscv/lib/msun/src/s_clog.c -o s_clog.o In file included from /root/freebsd-riscv/lib/msun/src/s_clog.c:33: /root/freebsd-riscv/lib/libc/include/fpmath.h:36:10: fatal error: _fpmath.h: No such file or directory #include "_fpmath.h" ^~~~~~~~~~~ compilation terminated. *** Error code 1 Stop. make[4]: stopped in /root/freebsd-riscv/lib/msun *** Error code 1 Stop. make[3]: stopped in /root/freebsd-riscv *** Error code 1 Stop. make[2]: stopped in /root/freebsd-riscv *** Error code 1 Stop. make[1]: stopped in /root/freebsd-riscv *** Error code 1 Stop. make: stopped in /root/freebsd-riscv real 1366.98 user 1189.19 sys 237.14 vesta# FAIL ... OKay maybe we try the cross tools built before ?? Let's watch that FAIL also ... vesta# cd vesta# rm -rf freebsd-riscv vesta# vesta# pwd /root vesta# svn co http://svn.freebsd.org/base/head freebsd-riscv A freebsd-riscv/share A freebsd-riscv/share/man . . . A freebsd-riscv/.gitignore A freebsd-riscv/.arclint U freebsd-riscv Checked out revision 345085. vesta# vesta# vesta# cd freebsd-riscv vesta# vesta# setenv MAKEOBJDIRPREFIX /root/obj vesta# setenv CROSS_BINUTILS_PREFIX $PREFIX/riscv64-unknown-freebsd12.0/bin/ vesta# setenv CROSS_COMPILER_PREFIX $PREFIX/bin/riscv64-unknown-freebsd12.0- vesta# setenv XCC ${CROSS_COMPILER_PREFIX}gcc vesta# setenv XCXX ${CROSS_COMPILER_PREFIX}c++ vesta# setenv XCPP ${CROSS_COMPILER_PREFIX}cpp vesta# setenv STRIPBIN ${CROSS_COMPILER_PREFIX}strip vesta# setenv X_COMPILER_TYPE gcc vesta# vesta# ls -lad $MAKEOBJDIRPREFIX drwxrwxr-x 3 root wheel 3 Mar 13 11:35 /root/obj vesta# ls -lad $CROSS_BINUTILS_PREFIX drwxr-xr-x 2 root wheel 12 Mar 13 09:44 /root/riscv/riscv64-unknown-freebsd12.0/bin/ vesta# ls -lad $XCC -rwxr-xr-x 2 root wheel 3653920 Mar 13 10:31 /root/riscv/bin/riscv64-unknown-freebsd12.0-gcc vesta# ls -lad $XCXX -rwxr-xr-x 2 root wheel 3656840 Mar 13 10:31 /root/riscv/bin/riscv64-unknown-freebsd12.0-c++ vesta# ls -lad $XCPP -rwxr-xr-x 1 root wheel 3655288 Mar 13 10:31 /root/riscv/bin/riscv64-unknown-freebsd12.0-cpp vesta# ls -lad $STRIPBIN -rwxr-xr-x 2 root wheel 5080736 Mar 13 09:44 /root/riscv/bin/riscv64-unknown-freebsd12.0-strip vesta# vesta# vesta# /root/riscv/bin/riscv64-unknown-freebsd12.0-gcc --version riscv64-unknown-freebsd12.0-gcc (GCC) 8.2.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# /root/riscv/bin/riscv64-unknown-freebsd12.0-gcc -v Using built-in specs. COLLECT_GCC=/root/riscv/bin/riscv64-unknown-freebsd12.0-gcc COLLECT_LTO_WRAPPER=/root/riscv/libexec/gcc/riscv64-unknown-freebsd12.0/8.2.0/lto-wrapper Target: riscv64-unknown-freebsd12.0 Configured with: /root/riscv-gnu-toolchain/riscv-gcc/configure --target=riscv64-unknown-freebsd12.0 --prefix=/root/riscv --with-sysroot=/root/riscv/sysroot --with-gxx-include-dir=/usr/include/c++/v1/ --without-newlib --without-headers --disable-werror --enable-threads --enable-tls --enable-languages=c,c++ --with-gmp=/usr/local --with-mpfr=/usr/local --with-mpc=/usr/local --disable-libatomic --disable-libmudflap --disable-libssp --disable-libquadmath --disable-libgomp --disable-nls --disable-bootstrap --disable-multilib --with-arch=rv64imafdc Thread model: posix gcc version 8.2.0 (GCC) vesta# Great. The arch there is rv64imafdc or rv64gc is the same thing. Looks good. vesta# vesta# echo $DESTDIR DESTDIR: Undefined variable. vesta# setenv DESTDIR /root/riscv-world vesta# /usr/bin/time -p make TARGET_ARCH=riscv64 buildworld -------------------------------------------------------------- >>> World build started on Wed Mar 13 12:23:28 GMT 2019 -------------------------------------------------------------- -------------------------------------------------------------- >>> Rebuilding the temporary build tree -------------------------------------------------------------- rm -rf /root/obj/root/freebsd-riscv/riscv.riscv64/tmp cd /root/freebsd-riscv/tools/build; make DIRPRFX=tools/build/ DESTDIR=/root/obj/root/freebsd-riscv/riscv.riscv64/tmp/legacy installdirs mkdir -p "/root/obj/root/freebsd-riscv/riscv.riscv64/tmp/legacy/bin" . . . /root/riscv/bin/riscv64-unknown-freebsd12.0-gcc --sysroot=/root/obj/root/freebsd-riscv/riscv.riscv64/tmp -B/root/riscv/riscv64-unknown-freebsd12.0/bin/ -O2 -pipe -I/root/freebsd-riscv/lib/msun/ld128 -I/root/freebsd-riscv/lib/msun/riscv -I/root/freebsd-riscv/lib/msun/src -I/root/freebsd-riscv/lib/libc/include -I/root/freebsd-riscv/lib/libc/riscv64 -march=rv64imafdc -mabi=lp64d -g -MD -MF.depend.s_clog.o -MTs_clog.o -std=gnu99 -fstack-protector-strong -Wsystem-headers -Werror -Wno-pointer-sign -Wno-error=address -Wno-error=array-bounds -Wno-error=attributes -Wno-error=bool-compare -Wno-error=cast-align -Wno-error=clobbered -Wno-error=enum-compare -Wno-error=extra -Wno-error=inline -Wno-error=logical-not-parentheses -Wno-error=strict-aliasing -Wno-error=uninitialized -Wno-error=unused-but-set-variable -Wno-error=unused-function -Wno-error=unused-value -Wno-error=misleading-indentation -Wno-error=nonnull-compare -Wno-error=shift-negative-value -Wno-error=tautological-compare -Wno-error=unused-const-variable -Wno-error=bool-operation -Wno-error=deprecated -Wno-error=expansion-to-defined -Wno-error=format-overflow -Wno-error=format-truncation -Wno-error=implicit-fallthrough -Wno-error=int-in-bool-context -Wno-error=memset-elt-size -Wno-error=noexcept-type -Wno-error=nonnull -Wno-error=pointer-compare -Wno-error=stringop-overflow -Wno-error=aggressive-loop-optimizations -Wno-error=cast-function-type -Wno-error=catch-value -Wno-error=multistatement-macros -Wno-error=restrict -Wno-error=sizeof-pointer-memaccess -Wno-error=stringop-truncation -Wno-unknown-pragmas -c /root/freebsd-riscv/lib/msun/src/s_clog.c -o s_clog.o In file included from /root/freebsd-riscv/lib/msun/src/s_clog.c:33: /root/freebsd-riscv/lib/libc/include/fpmath.h:36:10: fatal error: _fpmath.h: No such file or directory #include "_fpmath.h" ^~~~~~~~~~~ compilation terminated. *** Error code 1 Stop. make[4]: stopped in /root/freebsd-riscv/lib/msun *** Error code 1 Stop. make[3]: stopped in /root/freebsd-riscv *** Error code 1 Stop. make[2]: stopped in /root/freebsd-riscv *** Error code 1 Stop. make[1]: stopped in /root/freebsd-riscv *** Error code 1 Stop. make: stopped in /root/freebsd-riscv real 1346.37 user 1174.05 sys 230.59 vesta# FAIL again ... same fail in fact of that makes sense. So really .. no .. that page is wrong and no one has tested it in a while. Dennis
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?2848569d-68e4-df5f-9d0f-7e96933450ca>