Build error on RISC-V64
Trying to compile Fleng (from Git) in a RISC-V 64 machine gives the following error. The system has GNU Prolog installed:
[aarroyoc@mangopi fleng]$ ./configure
checking operating system ... linux
checking architecture ... r64
searching for GNU Prolog ... /usr/bin/gplc
generating driver script ...
generating config.mk ...
TOP = fghc2fl fl2r64
OS = linux
ARCH = r64
PREFIX = /usr/local
TPREFIX =
CC = cc
AS = as
AR = ar
CFLAGS = -std=gnu99 -fno-strict-aliasing -fwrapv -O2 -DHAVE_PTHREADS -pthread -DENABLE_PROFILING
ASFLAGS = -march=rv64imafdc
LDFLAGS = -lm -lpthread
PROLOG = gnu
GPLC = gplc
YAP = yap
SWIPL = swipl
FLENGFLAGS =
generating version.pl ... 11 Juliet 7664706
[aarroyoc@mangopi fleng]$ make
gplc fghc2fl.pl -o fghc2fl
echo "% GENERATED" > fleng.pl
echo ":- include('top.pl')." >> fleng.pl
echo ":- include('r64.pl')." >> fleng.pl
echo ":- include('entrypoints.pl')." >> fleng.pl
gplc fleng.pl -o fl2r64
as -march=rv64imafdc rt0r64.s -o rt0.o
env FLENG_PREFIX=. ./fleng -m '$rt' rt.fl -o rt.o
printf 'static char *version = "%s\\n"\n' "$(cat version.pl)" > version.h
awk '{print "\"" $0 "\\n\""}' config.mk >> version.h
echo ';' >> version.h
cc -c -I. -DLOGGING -std=gnu99 -fno-strict-aliasing -fwrapv -O2 -DHAVE_PTHREADS -pthread -DENABLE_PROFILING rt1.c -o rt1.o
cc -c -I. -DLOGGING -std=gnu99 -fno-strict-aliasing -fwrapv -O2 -DHAVE_PTHREADS -pthread -DENABLE_PROFILING prng.c -o prng.o
cc -c -I. -DLOGGING -std=gnu99 -fno-strict-aliasing -fwrapv -O2 -DHAVE_PTHREADS -pthread -DENABLE_PROFILING memlib.c -o memlib.o
cc -c -I. -DLOGGING -std=gnu99 -fno-strict-aliasing -fwrapv -O2 -DHAVE_PTHREADS -pthread -DENABLE_PROFILING linux.c -o linux.o
cc -c -I. -DLOGGING -std=gnu99 -fno-strict-aliasing -fwrapv -O2 -DHAVE_PTHREADS -pthread -DENABLE_PROFILING rtlib.c -o rtlib.o
env FLENG_PREFIX=. ./fleng -m lib lib.ghc -o lib.o
system_error(cannot_catch_throw(error(type_error(evaluable,fl_true/0),format/3)))
system_error(cannot_catch_throw(error(type_error(evaluable,fl_true/0),format/3)))
system_error(cannot_catch_throw(error(type_error(evaluable,fl_true/0),format/3)))
system_error(cannot_catch_throw(error(type_error(evaluable,fl_true/0),format/3)))
system_error(cannot_catch_throw(error(type_error(evaluable,fl_true/0),format/3)))
system_error(cannot_catch_throw(error(type_error(evaluable,fl_true/0),format/3)))
system_error(cannot_catch_throw(error(type_error(evaluable,fl_true/0),format/3)))
system_error(cannot_catch_throw(error(type_error(evaluable,fl_true/0),format/3)))
system_error(cannot_catch_throw(error(type_error(evaluable,fl_true/0),format/3)))
system_error(cannot_catch_throw(error(type_error(evaluable,fl_true/0),format/3)))
system_error(cannot_catch_throw(error(type_error(evaluable,fl_false/0),format/3)))
system_error(cannot_catch_throw(error(type_error(evaluable,fl_true/0),format/3)))
system_error(cannot_catch_throw(error(type_error(evaluable,fl_true/0),format/3)))
system_error(cannot_catch_throw(error(type_error(evaluable,fl_true/0),format/3)))
system_error(cannot_catch_throw(error(type_error(evaluable,fl_true/0),format/3)))
/tmp/fleng.lXTef3: Assembler messages:
/tmp/fleng.lXTef3:48: Error: illegal operands `lui t0,mv a0,s6'
/tmp/fleng.lXTef3:80: Error: illegal operands `lui t0,mv a0,s6'
/tmp/fleng.lXTef3:119: Error: illegal operands `lui t0,mv a0,s6'
/tmp/fleng.lXTef3:384: Error: illegal operands `lui t0,mv a0,s6'
/tmp/fleng.lXTef3:1457: Error: illegal operands `lui t0,mv a0,s7'
/tmp/fleng.lXTef3:1693: Error: illegal operands `lui t0,mv a0,s8'
/tmp/fleng.lXTef3:1784: Error: illegal operands `lui t0,mv a0,s8'
/tmp/fleng.lXTef3:2442: Error: illegal operands `lui t0,mv a0,s9'
/tmp/fleng.lXTef3:2511: Error: illegal operands `lui t0,mv a0,s10'
/tmp/fleng.lXTef3:2610: Error: illegal operands `lui t0,ld a0,0(fp)'
/tmp/fleng.lXTef3:3002: Error: illegal operands `lui t0,mv a0,s6'
/tmp/fleng.lXTef3:3108: Error: illegal operands `lui t0,mv a0,s6'
/tmp/fleng.lXTef3:5215: Error: illegal operands `lui t0,mv a0,s7'
/tmp/fleng.lXTef3:5915: Error: illegal operands `lui t0,mv a0,s7'
/tmp/fleng.lXTef3:5952: Error: illegal operands `lui t0,mv a0,s7'
/tmp/fleng.lXTef3:6007: Error: symbol `L3' is already defined
/tmp/fleng.lXTef3:6017: Error: symbol `L5' is already defined
/tmp/fleng.lXTef3:6021: Error: symbol `L7' is already defined
/tmp/fleng.lXTef3:6082: Error: symbol `L22' is already defined
/tmp/fleng.lXTef3:6226: Error: symbol `L83' is already defined
/tmp/fleng.lXTef3:6279: Error: symbol `L93' is already defined
/tmp/fleng.lXTef3:6287: Error: symbol `L96' is already defined
/tmp/fleng.lXTef3:6419: Error: symbol `L134' is already defined
/tmp/fleng.lXTef3:6439: Error: symbol `L137' is already defined
/tmp/fleng.lXTef3:6465: Error: symbol `L141' is already defined
/tmp/fleng.lXTef3:6477: Error: symbol `L154' is already defined
/tmp/fleng.lXTef3:6491: Error: symbol `L158' is already defined
/tmp/fleng.lXTef3:6609: Error: symbol `L258' is already defined
/tmp/fleng.lXTef3:6641: Error: symbol `L289' is already defined
/tmp/fleng.lXTef3:6653: Error: symbol `L291' is already defined
make: *** [Makefile:34: lib.o] Error 1
[aarroyoc@mangopi fleng]$ uname -a
Linux mangopi 5.19.0-rc1-gfe178cf0153d-dirty #1 PREEMPT Mon Aug 22 15:56:18 CEST 2022 riscv64 GNU/Linux