Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 8 Jun 2019 21:09:32 -0400
From:      Dennis Clarke <dclarke@blastwave.org>
To:        Li-Wen Hsu <lwhsu@freebsd.org>
Cc:        freebsd-riscv <freebsd-riscv@freebsd.org>
Subject:   Re: FreeBSD build for RISC-V blows up in make TARGET_ARCH=riscv64 buildworld
Message-ID:  <3803e532-00f2-06f2-6d1f-6f3c65292106@blastwave.org>
In-Reply-To: <CAKBkRUzcRPbiNugo8nVPWDoWJwYp%2BLvewNUBEtw2pjzm7u5uTg@mail.gmail.com>
References:  <c1339fdd-fea0-197e-dd63-0ce347356a57@blastwave.org> <CAKBkRUzcRPbiNugo8nVPWDoWJwYp%2BLvewNUBEtw2pjzm7u5uTg@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On 5/28/19 11:27 AM, Li-Wen Hsu wrote:
> On Fri, May 24, 2019 at 2:18 PM Dennis Clarke <dclarke@blastwave.org> wrote:
>> So on FreeBSD 13 CURRENT I hit the same brick walls as usual while
>> trying to follow https://wiki.freebsd.org/riscv wherein I have the
>> cross compiler built and in
>> /opt/riscv_tools/bin/riscv64-unknown-freebsd13.0-foo as per usual.
>> Nothing is a surprise until I hit
>> the make TARGET_ARCH=riscv64 buildworld which blows up fast :
> ...
>> Any clues ??
> 
> Not from me, I haven't checked the status on 13 for a while.  Just
> wanted to let you know that we have regular build and boot check for
> head:
> 
> https://ci.freebsd.org/job/FreeBSD-head-riscv64-build/
> https://ci.freebsd.org/job/FreeBSD-head-riscv64-test/
> 
> The difference with your setup is we're using toolchain installed from
> pkg described in that wiki page and running on 12.0-RELEASE.
> 

Thank you for the pointers but I tried to use the riscv64-xtoolchain-gcc
pkgs today and that fails neatly :

/usr/local/bin/riscv64-unknown-freebsd12.0-gcc 
--sysroot=/usr/home/root/obj/root/freebsd-riscv/riscv.riscv64/tmp 
-B/usr/local/riscv64-unknown-freebsd12.0/bin/ -O2 -pipe 
-march=rv64imafdc -mabi=lp64d -g -std=gnu99 -fstack-protector-strong 
-Wsystem-headers -Werror -Wall -Wno-format-y2k -W -Wno-unused-parameter 
-Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith -Wreturn-type 
-Wcast-qual -Wwrite-strings -Wswitch -Wshadow -Wunused-parameter 
-Wcast-align -Wchar-subscripts -Winline -Wnested-externs 
-Wredundant-decls -Wold-style-definition -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   -o binmiscctl.full binmiscctl.o
/usr/local/riscv64-unknown-freebsd12.0/bin/objcopy --only-keep-debug 
binmiscctl.full binmiscctl.debug
/usr/local/riscv64-unknown-freebsd12.0/bin/objcopy --strip-debug 
--add-gnu-debuglink=binmiscctl.debug  binmiscctl.full binmiscctl
gzip -cn /root/freebsd-riscv/usr.sbin/binmiscctl/binmiscctl.8 > 
binmiscctl.8.gz
===> usr.sbin/camdd (all)
echo camdd.full: 
/usr/home/root/obj/root/freebsd-riscv/riscv.riscv64/tmp/usr/lib/libc.a 
/usr/home/root/obj/root/freebsd-riscv/riscv.riscv64/tmp/usr/lib/libcam.a 
/usr/home/root/obj/root/freebsd-riscv/riscv.riscv64/tmp/usr/lib/libmt.a 
/usr/home/root/obj/root/freebsd-riscv/riscv.riscv64/tmp/usr/lib/libutil.a 
/usr/home/root/obj/root/freebsd-riscv/riscv.riscv64/tmp/usr/lib/libpthread.a 
 >> .depend
/usr/local/bin/riscv64-unknown-freebsd12.0-gcc 
--sysroot=/usr/home/root/obj/root/freebsd-riscv/riscv.riscv64/tmp 
-B/usr/local/riscv64-unknown-freebsd12.0/bin/  -O2 -pipe 
-march=rv64imafdc -mabi=lp64d   -g -MD  -MF.depend.camdd.o -MTcamdd.o 
-std=gnu99 -fstack-protector-strong -Wsystem-headers -Werror -Wall 
-Wno-format-y2k -W -Wno-unused-parameter -Wstrict-prototypes 
-Wmissing-prototypes -Wpointer-arith -Wreturn-type -Wcast-qual 
-Wwrite-strings -Wswitch -Wshadow -Wunused-parameter -Wcast-align 
-Wchar-subscripts -Winline -Wnested-externs -Wredundant-decls 
-Wold-style-definition -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 
-c /root/freebsd-riscv/usr.sbin/camdd/camdd.c -o camdd.o
/root/freebsd-riscv/usr.sbin/camdd/camdd.c: In function 
'camdd_get_next_lba_len':
/root/freebsd-riscv/usr.sbin/camdd/camdd.c:2751:25: warning: variable 
'pass_dev' set but not used [-Wunused-but-set-variable]
   struct camdd_dev_pass *pass_dev;
                          ^~~~~~~~
/root/freebsd-riscv/usr.sbin/camdd/camdd.c: In function 'camdd_queue':
/root/freebsd-riscv/usr.sbin/camdd/camdd.c:2819:6: warning: variable 
'error' set but not used [-Wunused-but-set-variable]
   int error;
       ^~~~~
/root/freebsd-riscv/usr.sbin/camdd/camdd.c:2813:25: warning: variable 
'pass_dev' set but not used [-Wunused-but-set-variable]
   struct camdd_dev_pass *pass_dev;
                          ^~~~~~~~
/root/freebsd-riscv/usr.sbin/camdd/camdd.c: In function 'camdd_probe_pass':
/root/freebsd-riscv/usr.sbin/camdd/camdd.c:1560:26: error: 
'scsi_dev_type' may be used uninitialized in this function 
[-Werror=maybe-uninitialized]
   pass_dev->scsi_dev_type = scsi_dev_type;
   ~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~
cc1: all warnings being treated as errors
*** Error code 1

Stop.
make[4]: stopped in /root/freebsd-riscv/usr.sbin/camdd
*** Error code 1

Stop.
make[3]: stopped in /root/freebsd-riscv/usr.sbin
*** 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
vesta#


So today was a full day of trying with the instructions at the wiki
  https://wiki.freebsd.org/riscv both with the toolchain built from
here https://github.com/freebsd-riscv/riscv-gnu-toolchain and then
again with the pkgs for FreeBSD 12. Fails.

So not sure how you or anyone is getting a bootable result but it
surely isn't documented anywhere.

I am baffled by what I see at 
https://ci.freebsd.org/job/FreeBSD-head-riscv64-testvm/ as there can not 
be any way to build FreeBSD for rv64imafdc unless someone has some pointers?

Has anyone anywhere actually done this?  Recently ?


-- 
Dennis Clarke
RISC-V/SPARC/PPC/ARM/CISC
UNIX and Linux spoken
GreyBeard and suspenders optional




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?3803e532-00f2-06f2-6d1f-6f3c65292106>