On Tue, 9 Apr 2019 at 11:53, David Abdurachmanov
<[email protected]> wrote:
>
> This patch has been in Fedora/RISCV for the last couple of months.
> I have tested simple applications (e.g. word count example), which
> worked without a problem.
>
> I believe Iain Buclaw did run GCC testsuite using Fedora/RISCV
> build and QEMU. The patch has not changed since that.
>
I've got a change in method to the way the unittests are ran, I'll
re-run with that and check the results.
> @@ -671,7 +674,16 @@ version (Shared)
> if (dyn.d_tag == DT_STRTAB)
> {
> version (linux)
> - strtab = cast(const(char)*)dyn.d_un.d_ptr;
> + {
> + // This might change in future glibc releases (after
> 2.29) as dynamic sections
> + // are not required to be read-only on RISC-V. This was
> copy & pasted from MIPS while
> + // upstreaming RISC-V support. Otherwise MIPS is the
> only arch which sets in glibc:
> + // #define DL_RO_DYN_SECTION 1
> + version (RISCV_Any)
> + strtab = cast(const(char)*)(info.dlpi_addr +
> dyn.d_un.d_ptr); // relocate
I guess we'll pre-emptively need to add MIPS_Any here as well.
> diff --git
> a/libphobos/src/std/experimental/allocator/building_blocks/region.d
> b/libphobos/src/std/experimental/allocator/building_blocks/region.d
> index dfcecce72bd..cafe059a61f 100644
> --- a/libphobos/src/std/experimental/allocator/building_blocks/region.d
> +++ b/libphobos/src/std/experimental/allocator/building_blocks/region.d
> @@ -391,7 +391,8 @@ struct InSituRegion(size_t size, size_t minAlign =
> platformAlignment)
> else version (PPC) enum growDownwards = Yes.growDownwards;
> else version (PPC64) enum growDownwards = Yes.growDownwards;
> else version (MIPS32) enum growDownwards = Yes.growDownwards;
> - else version (MIPS64) enum growDownwards = Yes.growDownwards;
> + else version (RISCV32) enum growDownwards = Yes.growDownwards;
> + else version (RISCV64) enum growDownwards = Yes.growDownwards;
> else version (SPARC) enum growDownwards = Yes.growDownwards;
> else version (SystemZ) enum growDownwards = Yes.growDownwards;
> else static assert(0, "Dunno how the stack grows on this architecture.");
> diff --git a/libphobos/src/std/math.d b/libphobos/src/std/math.d
> index e98e746a856..9fe746501a4 100644
> --- a/libphobos/src/std/math.d
> +++ b/libphobos/src/std/math.d
> @@ -162,6 +162,8 @@ version (AArch64) version = ARM_Any;
> version (ARM) version = ARM_Any;
> version (SPARC) version = SPARC_Any;
> version (SPARC64) version = SPARC_Any;
> +version (RISCV32) version = RISCV_Any;
> +version (RISCV64) version = RISCV_Any;
>
Any objection if I upstream the non-asm bits?
--
Iain