i_wasi.pas 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112
  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. system_wasm32_wasi_info : tsysteminfo =
  24. (
  25. system : system_wasm32_wasi;
  26. name : 'The WebAssembly System Interface (WASI)';
  27. shortname : 'Wasi';
  28. flags : [tf_under_development,tf_needs_symbol_size,tf_needs_symbol_type,
  29. tf_files_case_sensitive,
  30. tf_smartlink_sections,tf_has_winlike_resources,
  31. { avoid the creation of threadvar tables }
  32. tf_section_threadvars];
  33. cpu : cpu_wasm32;
  34. unit_env : '';
  35. extradefines : '';
  36. exeext : '.wasm';
  37. defext : '.def';
  38. scriptext : '.sh';
  39. smartext : '.sl';
  40. unitext : '.ppu';
  41. unitlibext : '.ppl';
  42. asmext : '.wat';
  43. objext : '.o';
  44. resext : '';
  45. resobjext : '.or';
  46. sharedlibext : ''; // keep it empty! The sharedlibext drives the export module name
  47. // if this is populated, then the name should be cleared when generating import
  48. staticlibext : '.a';
  49. staticlibprefix : '';
  50. sharedlibprefix : '';
  51. sharedClibext : '.wasm';
  52. staticClibext : '.wasm';
  53. staticClibprefix : '';
  54. sharedClibprefix : '';
  55. importlibprefix : '';
  56. importlibext : '.wasm';
  57. Cprefix : '';
  58. newline : #10;
  59. dirsep : '/';
  60. assem : as_wasm32_wasm;
  61. assemextern : as_wasm32_llvm_mc;
  62. link : ld_int_wasi;
  63. linkextern : ld_wasi;
  64. ar : ar_none;
  65. res : res_wasm;
  66. dbg : dbg_dwarf2;
  67. script : script_unix;
  68. endian : endian_little;
  69. alignment :
  70. (
  71. procalign : 4;
  72. loopalign : 4;
  73. jumpalign : 0;
  74. jumpalignskipmax : 0;
  75. coalescealign : 0;
  76. coalescealignskipmax: 0;
  77. constalignmin : 4;
  78. constalignmax : 16;
  79. varalignmin : 4;
  80. varalignmax : 16;
  81. localalignmin : 4;
  82. localalignmax : 16;
  83. recordalignmin : 0;
  84. recordalignmax : 16;
  85. maxCrecordalign : 16
  86. );
  87. first_parm_offset : 0;
  88. stacksize : 8*1024*1024;
  89. stackalign : 16;
  90. abi : abi_default;
  91. llvmdatalayout : 'todo';
  92. );
  93. implementation
  94. initialization
  95. {$ifdef CPUWASM32}
  96. {$ifdef wasi}
  97. set_source_info(system_wasm32_wasi_info);
  98. {$endif wasi}
  99. {$endif CPUWASM32}
  100. end.