Minimal set of changes required for "make kernel-toolchain" for RISC-V
Details
Diff Detail
- Lint
Lint Skipped - Unit
Tests Skipped
Event Timeline
Makefile.inc1 | ||
---|---|---|
175 | We should probably wrap this line (in a separate commit prior to this change), it's already very long. | |
etc/etc.riscv/ttys | ||
2–5 | Probably a candidate for https://wiki.freebsd.org/SrcDeDup | |
lib/csu/riscv/crt1.c | ||
41–43 | Remove this - see rS282551 / D2422. The other csu files should be done as well. Remove historical GNUC test The requirement is for a GCC-compatible compiler and not necessarily GCC itself. However, we currently expect any compiler used for building the whole of FreeBSD to be GCC-compatible and many things will break if not; there's no longer a need to have an explicit test for this in rtld. | |
lib/csu/riscv/crti.S | ||
6 | These should probably be "Portions of this software were..." when there are two entries | |
share/mk/src.opts.mk | ||
237–239 | Perhaps we should list these on individual lines with a comment about why they fail, something like BROKEN_OPTIONS+=PROFILE # missing mumble BROKEN_OPTIONS+=RESCUE # crunchgen does not support RISC-V |
Makefile.inc1 | ||
---|---|---|
175–179 | Please also update the TARGET_ARCHES list in share/mk/local.meta.sys.mk | |
lib/csu/riscv/Makefile | ||
41–43 | Please see the other csu directories. We're using FILES* now. Like this: FILES= ${OBJS} These FILES qualify as libraries for the purpose of LIBRARIES_ONLY..undef LIBRARIES_ONLY |
etc/etc.riscv/ttys | ||
---|---|---|
45–52 | You might want to update this, we have moved to use 3wire and onifconsole on these. | |
lib/csu/riscv/crt1.c | ||
2 | This file looks very similar to the arm64 version (it even has the _end hack). You should be using the existing license & adding yourself to it. The alternative is to redo it based on the amd64 version (which is similar). | |
lib/libc/riscv/Makefile.inc | ||
4 | arm? | |
lib/msun/riscv/Makefile.inc | ||
4 | What size is long double? On arm64 this is 113 as it's a 128-bit type. | |
lib/msun/riscv/fenv.h | ||
2 | This looks very similar to the arm64 fenv.h, the license may need to be checked. |
lib/msun/riscv/fenv.h | ||
---|---|---|
3 | Sometimes I think we need to have a fp-ieee directory that has all this stuff in it that most ports these days just reference (or define one or two things to describe the flavor, then include). Of course, that may be too big an ask for someone porting to a new arch since we've not required it for others. | |
share/mk/bsd.cpu.mk | ||
155 | Before this you need something like or maybe -mcpu depending on what gcc does. I see references to riscv32 and riscv64 so maybe we need that distinction too? What did you do your port for? | |
163 | this should have been added alphabetically. | |
287 | You need to minimally have here . elif ${MACHINE_ARCH} == "riscv" here too. There's two places for each architecture we set it. | |
323 | This isn't the compiler default? | |
share/mk/bsd.sys.mk | ||
113 | is this a riscv thing, or is it just a gcc 5.2.0 thing? I'm not entirely sure this is the right place for this as well, but let's sort that bit out first. | |
share/mk/src.opts.mk | ||
238–240 | I'm curious why CXX is on the list too... |
lib/msun/riscv/fenv.h | ||
---|---|---|
3 | I'd settle for 'update SrcDeDup wiki' here. | |
share/mk/bsd.cpu.mk | ||
163 | Agreed. I was mostly grumpy since I thought I'd alphabetized these already. Turns out that mips is after powerpc, so my world was shattered again there. Let's actually move it after riscv goes in. It isn't important enough to force a rebase / merge cycle. |
share/mk/bsd.cpu.mk | ||
---|---|---|
163 | I've already forced a rebase cycle though :) I think Ruslan expected at least one iteration anyway. My general approach has been to put it in the correct spot if it's already ordered or only one is out of place, or at the end otherwise. |
Thanks, my findings look OK now. Approving just what I've commented on. I didn't look at other pieces.
share/mk/bsd.sys.mk | ||
---|---|---|
113 | I think it is GCC 5.2.0 |
Makefile | ||
---|---|---|
350 | Will universe work if the riscv toolchain is missing? We check for the external parts on arm64 & warn the user it was skipped. | |
lib/libc/riscv/Makefile.inc | ||
2 | The libc changes are incomplete, would it pay to drop them for now so we can review them as a complete unit. | |
share/mk/src.opts.mk | ||
241 | Where in the build is contents.ms from? | |
242 | I'm guessing we just need to add EM_RISCV to usr.sbin/crunch/crunchide/exec_elf32.c. |
Makefile | ||
---|---|---|
350 | Agreed. | |
lib/msun/riscv/fenv.h | ||
4 | I've added the files noted in this review to SrcDeDup | |
share/mk/src.opts.mk | ||
241 | This will be taken care of with a forthcoming llvm-libunwind import | |
242 | It turns out I had that change sitting in an old work branch but did not have a way to test -- I've committed it now. |
share/mk/bsd.cpu.mk | ||
---|---|---|
154 | You can't have this as _CPUFLAGS. It is an ABI affecting flag, so must be added directly to CFLAGS. _CPUCFLAGS = -march=$CPUTYPE since that generally doesn't affect the ABI, just the set of instructions used and their relative costs for the optimizer. -msoft-float, however, changes calling conventions (at least on ARM it does), so must either be the compiler default (preferred) or always added to the command line (second best). There's a spot further down in the file that does this. | |
share/mk/bsd.endian.mk | ||
7 | I'd be tempted to use MACHINE_CPUARCH here, since all members of the family are little endian, right? | |
share/mk/bsd.sys.mk | ||
113 | If so, it should be based on compiler version only, not on cpu arch. |