MLton / mlton

The MLton repository
http://mlton.org
Other
962 stars 127 forks source link

bootstrap for loongarch64 #543

Closed loongson-zjl closed 10 months ago

loongson-zjl commented 10 months ago

Hi , I want bootstrap mlton for loongarch64 , but I get failed , please help , thanks .

  1. I get this error for remote-boostrap , reference http://mlton.org/PortingMLton , I can not find bin/add-cross or bin/regression please help .
make CROSS_TARGET=loongarch64-linux REMOTE_MACHINE=ssh://10.40.55.35:22 REMOTE_MAKE=gmake remote-bootstrap

(cat ../lib/stubs/mlton-stubs/pre-mlton_sml.src; echo 'false' 'amd64' 'linux'; cat ../lib/stubs/mlton-stubs/pre-mlton.sml) | sha1sum | sed 's/.*\([a-z0-9]\{40\}\).*/\1/' > ../lib/stubs/mlton-stubs/pre-mlton_sml.chk
"mlton" \
    @MLton ram-slop 0.7  gc-summary -- \
     -verbose 2     \
    -target loongarch64-linux -output mlton-compile \
    -codegen c -stop g \
    mlton-stubs.mlb
invalid target: loongarch64-linux
usage: mlton [option ...] file.{c|mlb|o|sml} [file.{c|o|s|S} ...]
    -align {8|4}                    object alignment
    -as-opt <opt>                   pass option to assembler
    -cc-opt <opt>                   pass option to C compiler
    -codegen {native|amd64|c|llvm}  which code generator to use
    -const '<name> <value>'         set compile-time constant
    -default-ann <ann>              set annotation default for mlb files
    -default-type '<ty><N>'         set default type
    -disable-ann <ann>              disable annotation in mlb files
    -export-header <file>           write C header file for _export's
    -ieee-fp {false|true}           use strict IEEE floating-point
    -inline <n>                     set inlining threshold
    -keep {g|o}                     save intermediate files
    -link-opt <opt>                 pass option to linker
    -llvm-as-opt <opt>              pass option to llvm assembler
    -llvm-llc-opt <opt>             pass option to llvm compiler
    -llvm-opt-opt <opt>             pass option to llvm optimizer
    -mlb-path-map <file>            additional MLB path map
    -mlb-path-var '<name> <value>'  additional MLB path var
    -output <file>                  name of output file
    -profile {no|alloc|count|time}  produce executable suitable for profiling
    -profile-branch {false|true}    profile branches in addition to functions
    -profile-stack {false|true}     profile the stack
    -profile-val {false|true}       profile val bindings in addition to functions
    -runtime <arg>                  pass arg to runtime via @MLton
    -show-basis <file>              write final basis environment
    -show-def-use <file>            write def-use information
    -stop {f|g|o|tc}                when to stop
    -target {x86_64-linux-gnu|...}  platform that executable will run on
    -target-as-opt <target> <opt>   target-dependent assembler option
    -target-cc-opt <target> <opt>   target-dependent C compiler option
    -target-link-opt <target> <opt> target-dependent linker option
    -verbose {0|1|2|3}              how verbose to be
GC type        time ms     number          bytes          bytes/sec
-------------    -------    -------    ---------------    ---------------
copying              1          2            517,120        517,120,000    
mark-compact          0          0                  0                  -    
minor              0          0                  0                  -    
total time: 15 ms
total GC time: 1 ms (6.7%)
max pause time: 1 ms
total bytes allocated: 3,371,424 bytes
max bytes live: 427,944 bytes
max heap size: 3,932,160 bytes
max stack size: 54,912 bytes
num cards marked: 0
bytes scanned: 0 bytes
bytes hash consed: 0 bytes
make[2]: *** [Makefile:181: mlton-bootstrap-loongarch64-linux.tgz] Error 1
make[2]: Leaving directory '/root/mlton/mlton'
make[1]: *** [Makefile:643: remote--gen-bootstrap-compiler-files] Error 2
make[1]: Leaving directory '/root/mlton'
make: *** [Makefile:604: remote-bootstrap] Error 2
  1. I get this error for remote-add-cross , reference http://www.mlton.org/CrossCompiling
root@a7c04abd2234:~/mlton# make CROSS_TARGET=loongarch64-linux REMOTE_MACHINE=ssh://10.40.55.35:22 remote-add-cross
Makefile:563: 'MLTON_VERSION' appears dirty; 20240112.073125-g780afd7bd-dirty
make: *** No rule to make target 'remote-add-cross'.  Stop.
MatthewFluet commented 10 months ago

I'm sure that some of the cross compiling and/or bootstrap documentation is out of date.

The invalid target: loongarch64-linux error suggests that the runtime system built on the remote machine was not properly received (or received under a different name). A fuller log would be needed to better understand the error.

I think the remote-add-cross target was at some point renamed to remote-add-target.

loongson-zjl commented 10 months ago

I'm sure that some of the cross compiling and/or bootstrap documentation is out of date.

The invalid target: loongarch64-linux error suggests that the runtime system built on the remote machine was not properly received (or received under a different name). A fuller log would be needed to better understand the error.

I think the remote-add-cross target was at some point renamed to remote-add-target.

thank you ,for your help , I have bootstrap it , thanks