i_wasi.pas 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123
  1. {
  2. Copyright (c) 2019 by Dmitry Boyarintsev
  3. This unit implements support information structures for WebAssembly
  4. This program is free software; you can redistribute it and/or modify
  5. it under the terms of the GNU General Public License as published by
  6. the Free Software Foundation; either version 2 of the License, or
  7. (at your option) any later version.
  8. This program is distributed in the hope that it will be useful,
  9. but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  11. GNU General Public License for more details.
  12. You should have received a copy of the GNU General Public License
  13. along with this program; if not, write to the Free Software
  14. Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  15. ****************************************************************************
  16. }
  17. unit i_wasi;
  18. {$i fpcdefs.inc}
  19. interface
  20. uses
  21. systems,rescmn;
  22. const
  23. res_wasmraw_info : tresinfo =
  24. (
  25. id : res_none; // todo: not implemented. but could be as memory
  26. resbin : 'fpcwasmres';
  27. rescmd : '-o $OBJ $DBG';
  28. rcbin : '';
  29. rccmd : '';
  30. resourcefileclass : nil;
  31. resflags : [res_no_compile];
  32. );
  33. system_wasm32_wasi_info : tsysteminfo =
  34. (
  35. system : system_wasm32_wasi;
  36. name : 'The WebAssembly System Interface (WASI)';
  37. shortname : 'Wasi';
  38. flags : [tf_under_development,tf_needs_symbol_size,tf_needs_symbol_type,
  39. tf_files_case_sensitive,tf_no_generic_stackcheck,
  40. tf_smartlink_sections,tf_has_winlike_resources,
  41. { avoid the creation of threadvar tables }
  42. tf_section_threadvars];
  43. cpu : cpu_wasm32;
  44. unit_env : '';
  45. extradefines : '';
  46. exeext : '.wasm';
  47. defext : '.def';
  48. scriptext : '.sh';
  49. smartext : '.sl';
  50. unitext : '.ppu';
  51. unitlibext : '.ppl';
  52. asmext : '.wat';
  53. objext : '.o';
  54. resext : '';
  55. resobjext : '.o';
  56. sharedlibext : ''; // keep it empty! The sharedlibext drives the export module name
  57. // if this is populated, then the name should be cleared when generating import
  58. staticlibext : '.a';
  59. staticlibprefix : '';
  60. sharedlibprefix : '';
  61. sharedClibext : '.wasm';
  62. staticClibext : '.wasm';
  63. staticClibprefix : '';
  64. sharedClibprefix : '';
  65. importlibprefix : '';
  66. importlibext : '.wasm';
  67. Cprefix : '';
  68. newline : #10;
  69. dirsep : '/';
  70. assem : as_wasm32_wasm;
  71. assemextern : as_wasm32_llvm_mc;
  72. link : ld_none;
  73. linkextern : ld_wasi;
  74. ar : ar_none;
  75. res : res_none;
  76. dbg : dbg_dwarf2;
  77. script : script_unix;
  78. endian : endian_little;
  79. alignment :
  80. (
  81. procalign : 4;
  82. loopalign : 4;
  83. jumpalign : 0;
  84. jumpalignskipmax : 0;
  85. coalescealign : 0;
  86. coalescealignskipmax: 0;
  87. constalignmin : 4;
  88. constalignmax : 16;
  89. varalignmin : 4;
  90. varalignmax : 16;
  91. localalignmin : 4;
  92. localalignmax : 16;
  93. recordalignmin : 0;
  94. recordalignmax : 16;
  95. maxCrecordalign : 16
  96. );
  97. first_parm_offset : 0;
  98. stacksize : 262144;
  99. stackalign : 4;
  100. abi : abi_default;
  101. llvmdatalayout : 'todo';
  102. );
  103. implementation
  104. initialization
  105. {$ifdef CPUWASM32}
  106. {$ifdef wasi}
  107. set_source_info(system_wasm32_wasi_info);
  108. {$endif wasi}
  109. {$endif CPUWASM32}
  110. end.