There is __riscv_flush_icache in glibc or __builtin___clear_cache in gcc, which flushes all harts.
write8le((uint8_t *)P, addend);
I'm seeing crashes with the latest update.
https://build.opensuse.org/package/live_build_log/home:Andreas_Schwab:riscv:ghc:ncg/ghc-DAV/standard/riscv64 Running: /usr/bin/ghc-pkg init dist/package.conf.inplace /var/tmp/rpm-tmp.eB9MZr: line 79: 6968 Segmentation fault ./Setup build -v
https://build.opensuse.org/package/live_build_log/home:Andreas_Schwab:riscv:ghc:ncg/ghc-wai-app-static/standard/riscv64 Running: /usr/bin/ghc-pkg recache '--package-db=dist/package.conf.inplace' /var/tmp/rpm-tmp.pphGvl: line 79: 6354 Segmentation fault ./Setup build -v
https://build.opensuse.org/package/live_build_log/home:Andreas_Schwab:riscv:ghc:ncg/hledger/standard/riscv64 Running: /usr/bin/ghc-pkg recache '--package-db=dist/package.conf.inplace' /var/tmp/rpm-tmp.i5Odkm: line 79: 6995 Segmentation fault ./Setup build -v
https://build.opensuse.org/package/live_build_log/home:Andreas_Schwab:riscv:ghc:ncg/hlint/standard/riscv64 Running: /usr/bin/ghc-pkg recache '--package-db=dist/package.conf.inplace' /var/tmp/rpm-tmp.3XhK2M: line 79: 5758 Segmentation fault ./Setup build -v
The compiler now not only builds successfully, it is also fully functional!
https://build.opensuse.org/project/monitor/home:Andreas_Schwab:riscv:ghc:ncg
The compiler now builds sucessfully, but doesn't survive a trivial test:
testghc/foo.hs:1:1: error:
Could not find module ‘Prelude’
Use -v (or :set -v
in ghci) to see a list of the files searched for.
|
1 | main = putStrLn "Foo"
| ^
Command line: _build/stage0/bin/ghc -Wall -Wcompat -fdiagnostics-color=never -hisuf p_hi -osuf p_o -hcsuf p_hc -static -prof -hide-all-packages -no-user-package-db '-package-env -' '-package-db _build/stage1/inplace/package.conf.d' '-this-unit-id ghc-prim-0.10.0' '-package-id rts-1.0.2' -i -i/home/abuild/rpmbuild/BUILD/ghc-9.6.3/_build/stage1/libraries/ghc-prim/build -i/home/abuild/rpmbuild/BUILD/ghc-9.6.3/_build/stage1/libraries/ghc-prim/build/autogen -i/home/abuild/rpmbuild/BUILD/ghc-9.6.3/libraries/ghc-prim -Irts/include -I_build/stage1/libraries/ghc-prim/build -I/home/abuild/rpmbuild/BUILD/ghc-9.6.3/rts/include -I/home/abuild/rpmbuild/BUILD/ghc-9.6.3/_build/stage1/rts/build/include -I/home/abuild/rpmbuild/BUILD/ghc-9.6.3/rts/@FFIIncludeDir@ -I/home/abuild/rpmbuild/BUILD/ghc-9.6.3/_build/stage1/rts/build/@FFIIncludeDir@ -I/home/abuild/rpmbuild/BUILD/ghc-9.6.3/rts/@LibdwIncludeDir@ -I/home/abuild/rpmbuild/BUILD/ghc-9.6.3/_build/stage1/rts/build/@LibdwIncludeDir@ -optP-include -optP_build/stage1/libraries/ghc-prim/build/autogen/cabal_macros.h -outputdir _build/stage1/libraries/ghc-prim/build -Wnoncanonical-monad-instances -optc-Wno-error=inline -optP-Wno-nonportable-include-path -c _build/stage1/libraries/ghc-prim/build/GHC/PrimopWrappers.hs -o _build/stage1/libraries/ghc-prim/build/GHC/PrimopWrappers.p_o -fsplit-sections -O -H64m -this-unit-id ghc-prim -XHaskell2010 -no-global-package-db -package-db=/home/abuild/rpmbuild/BUILD/ghc-9.6.3/_build/stage1/inplace/package.conf.d -ghcversion-file=rts/include/ghcversion.h -ghcversion-file=rts/include/ghcversion.h -O2 -Wno-deprecated-flags -Wno-trustworthy-safe ===> Command failed with error code: 1 /tmp/ghc18519_0/ghc_1.s: Assembler messages:
/tmp/ghc18519_0/ghc_1.s:11749:0: error: Error: unrecognized opcode `fcvt ft0,ft0' | 11749 | fcvt ft0, ft0 | ^
/tmp/ghc18519_0/ghc_1.s:14158:0: error:
Error: unrecognized opcode fcvt ft0,ft0' | 14158 | fcvt ft0, ft0 | ^
gcc' failed in phase `Assembler'. (Exit code: 1)
Command failed
Build failed.
Already doing that all the time.
RV64.ppr: unhandled CSET conditional
t0, zero, t0
Unsupported unsigned load FF64 ft0 0( s2 )
Now it fails with
ghc: panic! (the 'impossible' happened) GHC version 9.6.2: Unsupported unsigned load FF32 ft0 8(s2) Call stack: CallStack (from HasCallStack): callStackDoc, called at compiler/GHC/Utils/Panic.hs:189:37 in ghc:GHC.Utils.Panic pprPanic, called at compiler/GHC/CmmToAsm/RV64/Ppr.hs:659:19 in ghc:GHC.CmmToAsm.RV64.Ppr CallStack (from HasCallStack): panic, called at compiler/GHC/Utils/Error.hs:454:29 in ghc:GHC.Utils.Error
It currently fails with
ghc: panic! (the 'impossible' happened) GHC version 9.6.2: RV64.ppr: unhandled CSET conditional: OGE CallStack (from HasCallStack): panic, called at compiler/GHC/CmmToAsm/RV64/Ppr.hs:587:11 in ghc:GHC.CmmToAsm.RV64.Ppr
I have set up a test build with the changes in https://build.opensuse.org/project/show/home:Andreas_Schwab:riscv:ghc:ncg
When genapply is compiled with an unregisterised compiler it always outputs code for an unregisterised build. This is because an unregisterised compiler defines UnregisterisedCompiler, which implies NO_REGS. But we only want to define NO_REGS if building an unregisterised compiler.
Every object file must be properly marked for non-executable stack, even if it contains no code.
Still the same error.
Someone needs to fix genapply.cabal so that it works as advertised.
This is !4331 (closed).
See https://build.opensuse.org/package/show/openSUSE:Factory:RISCV/ghc for the full sources. The SRPM can currenly only be downloaded from https://build.opensuse.org/package/binaries/openSUSE:Factory:RISCV/ghc/standard, but it isn't used for building.
https://build.opensuse.org/package/show/home:Andreas_Schwab:riscv:ghc/ghc
This has a build of 9.2.1-rc1. It only fails due to an unrelated error while generating the docs. The stage2 compiler has sucessfully built the haddock tool.