Recent

Author Topic: can not crossbuild rtl-[wasm-embedded]  (Read 168 times)

cai

  • New Member
  • *
  • Posts: 33
can not crossbuild rtl-[wasm-embedded]
« on: January 09, 2023, 04:28:02 am »
1. build
================
wasm-embedded rtl build error info:
systhrd.inc(18,4) Fatal: User defined: This file shouldn't be included if thread support is disabled!
======================
wasm-wasi is ok!
-------------------------------

2. system.pp code
wasm-embedded:
Code: Pascal  [Select][+][-]
  1. Unit System;
  2.  
  3. {*****************************************************************************}
  4.                                     interface
  5. {*****************************************************************************}
  6.  
  7. {$define FPC_SYSTEM_HAS_STACKTOP}
  8.  
  9. {$define FPC_IS_SYSTEM}
  10. {$define HAS_CMDLINE}
  11.  
  12. { $define USE_NOTHREADMANAGER}
  13.  
  14. {$define DISABLE_NO_THREAD_MANAGER}
  15. { Do not use standard memory manager }
  16. {$define HAS_MEMORYMANAGER}
  17. {$define FPC_NO_DEFAULT_HEAP}
  18. ...
  19.  

wasm-wasi:
Code: Pascal  [Select][+][-]
  1. unit system;
  2.  
  3. interface
  4.  
  5. {$define FPC_IS_SYSTEM}
  6. {$ifdef FPC_WASM_THREADS}
  7.   {$define DISABLE_NO_THREAD_MANAGER}
  8. {$else FPC_WASM_THREADS}
  9.   {$define USE_NOTHREADMANAGER}
  10. {$endif FPC_WASM_THREADS}
  11.  
  12. {$I systemh.inc}
  13.  


you can see that in wasm-embedded define USE_NOTHREADMANAGER & DISABLE_NO_THREAD_MANAGER,
then in rtl/inc/system.inc will:
Code: Pascal  [Select][+][-]
  1. {$ifdef DISABLE_NO_THREAD_MANAGER}
  2. { OS Dependent implementation }
  3. {$i systhrd.inc}
  4. {$endif DISABLE_NO_THREAD_MANAGER}  
  5.  

finally,error happened in systhrd.inc
Code: Pascal  [Select][+][-]
  1. {$ifndef FPC_WASM_THREADS}
  2.   {$fatal This file shouldn't be included if thread support is disabled!}
  3. {$endif FPC_WASM_THREADS}
  4.  

3. question
is this problem can be fix by any parameter in crossbuild, or it is a BUG?

4. custom fix
I modify some define in system.pp[wasm-embedded]
Code: Pascal  [Select][+][-]
  1. Unit System;
  2.  
  3. {*****************************************************************************}
  4.                                     interface
  5. {*****************************************************************************}
  6.  
  7. {$define FPC_SYSTEM_HAS_STACKTOP}
  8.  
  9. {$define FPC_IS_SYSTEM}
  10. {$define HAS_CMDLINE}
  11.  
  12.  
  13. //20230109 edit by cai!
  14. {$ifndef FPC_WASM_THREADS}
  15.   {$define USE_NOTHREADMANAGER}
  16. {$else}
  17. { $define USE_NOTHREADMANAGER}
  18. {$define DISABLE_NO_THREAD_MANAGER}
  19. {$endif FPC_WASM_THREADS}
  20.  

and crossbuild rtl is OK but packages, looks like not completed!

======================
wiki said:
The FPC Wasm embedded RTL consists of these units:
rtl
rtl-extra
tplylib
« Last Edit: January 09, 2023, 06:57:48 am by cai »

 

TinyPortal © 2005-2018