hmmdyl / lwdr Goto Github PK
View Code? Open in Web Editor NEWLightWeight D Runtime targeting ARM Cortex CPUs
License: Boost Software License 1.0
LightWeight D Runtime targeting ARM Cortex CPUs
License: Boost Software License 1.0
What's the license for code in this repo?
https://github.com/0dyl/LWDR/blob/ba4a6afd01b65d2ea0fec141ddb15e9f819c6ec4/source/util.d#L14
//fix
*d++ = cast(ubyte)c;
The default way to destroy an object through D is using the destroy function
Trying to to use LWDR for the psvita using vitasdk:
c:/msys64/usr/local/vitasdk/bin/../lib/gcc/arm-vita-eabi/10.3.0/../../../../arm-vita-eabi/bin/ld.exe: C:/msys64/usr/local/dlibs/\libtest.a(util.o): in function _D4util17stringCmpInternalFNeMxAaMxQeZi': C:\/Users\Marcelo\AppData\Local\dub\packages\lwdr-0.3.0\lwdr\source/util.d:6: undefined reference to
_d_arraybounds_index'
c:/msys64/usr/local/vitasdk/bin/../lib/gcc/arm-vita-eabi/10.3.0/../../../../arm-vita-eabi/bin/ld.exe: C:/Users\Marcelo\AppData\Local\dub\packages\lwdr-0.3.0\lwdr\source/util.d:6: undefined reference to _d_arraybounds_index' c:/msys64/usr/local/vitasdk/bin/../lib/gcc/arm-vita-eabi/10.3.0/../../../../arm-vita-eabi/bin/ld.exe: C:\/Users\Marcelo\AppData\Local\dub\packages\lwdr-0.3.0\lwdr\source/util.d:6: undefined reference to
_d_arraybounds_index'
c:/msys64/usr/local/vitasdk/bin/../lib/gcc/arm-vita-eabi/10.3.0/../../../../arm-vita-eabi/bin/ld.exe: C:/Users\Marcelo\AppData\Local\dub\packages\lwdr-0.3.0\lwdr\source/util.d:6: undefined reference to `_d_arraybounds_index'
collect2.exe: error: ld returned 1 exit status
This is my dub:
"dflags": [
"-mtriple=armv7a-unknown-unknown",
"-mcpu=cortex-a9",
"-g",
"-float-abi=hard",
"-O0",
"-fthread-model=local-exec"
],
"targetType": "staticLibrary",
My D source:
class Test
{
immutable(char*) getStringFromD()
{
return "Hello World from D! Simple Test".ptr;
}
}
class UltraTest : Test
{
override immutable(char*) getStringFromD()
{
return "Hello World from D!!! Ultra Test!".ptr;
}
}
extern(C) immutable(char*) getStringFromD()
{
return new UltraTest().getStringFromD;
}
Pretty much the assert(false) which final switch
generates
Missing the implementation for the value[]+= 50
syntax
Reserve makes part for dynamic array API for append operation, it will avoid reallocations. I'm documenting API differentiations while trying to convert my engine to be LWDR compatible
With the addition of memory tracking, _d_newarrayU
, _d_arraysetlengthT
, _d_arraysetlengthiT
, _d_newitemU
, _d_newitemT
, _d_newitemiT
and calling functions cannot be pure
.
LWDR should implement an optional feature like automem for better memory management. Automem cannot be directly used, unfortunately.
One thing that gets some of us to try and contribute is when we have a section on how to use a package in the README.
Import, basic examples, how to compile...tipsπ
That'll be handy
delete
has been deprecated since 2.079. However, destroy in LWDR is not implemented.
How can lwdr be used for other architectures, especially riscv?
Is it possible to support this issue?
This prevents usage of synchronized
and sharing of code across multiple threads.
Thread Local Storage (TLS) is not supported. TLS is reliant on RTOS support - TLS variables are allocated in a heap and the pointer is stored in the RTOS' Thread Control Block (TCB). __aeabi_read_tp
must then read this pointer.
0x00007FF6341B505B (0x000000141F9FDEC0 0x000001BD40D82608 0x0000000000000004 0x000000141F9FDEC0)
0x00007FF6341ABA6E (0x000000141F9FDEC0 0x00007FF63422496D 0x000000004229D201 0x00007FF634225271)
0x00007FF636BBDB51 (0x0000000000000000 0x00007FF63876F5A8 0x0000000000000004 0x000000141F9FDFE0)
0x00007FF636BBD988 (0x0000000000000000 0x0000000000000000 0x0000000000000000 0x00007FF6341DA141)
0x00007FF636B61EE1 (0xFFFFFFFFFFFFFFFF 0xFFFFFFFFFFFFFFFF 0xFFFFFFFFFFFFFFFF 0xFFFFFFFFFFFFFFFF)
0x00007FF636B60370 (0x000001BD4027EB10 0x00007FF63694E91D 0x0000000000000000 0x00007FF636B54CC6)
0x00007FF636B5FBE6 (0x000000141F9FE1F0 0x000001BD41E8DF28 0x000001BD40E82270 0x000001BD40D06910)
0x00007FF636ADEFF5 (0x0000000000000000 0x00007FF6341DA141 0x000001BD4267D070 0x00007FF636C5DFC8)
0x00007FF636B6302E (0xFFFFFFFFFFFFFFFF 0xFFFFFFFFFFFFFFFF 0xFFFFFFFFFFFFFFFF 0xFFFFFFFFFFFFFFFF)
0x00007FF636B60370 (0x000001BD4027EB10 0x00007FF63694DE74 0x000001BD40D647C0 0x00007FF63419518D)
0x00007FF636B5FBE6 (0x000001BD40E82270 0x00007FF638505EA0 0x000001BD422E5B38 0x00007FF6341AEA09)
0x00007FF636ADEFF5 (0x000001BD40181E38 0x0000000000000027 0x000000141F9FE578 0x000001BD40BEA4D0)
0x00007FF636B27C72 (0x000001BD00000000 0x000001BD4221AA40 0x000001BD424D6D58 0x00007FF636BB62BB)
0x00007FF636B14C18 (0x0000000000000000 0x0000000000000000 0x0000F1F68EEDB449 0x000001BD401819B0)
0x00007FF636B1493B (0x0000000001DF0070 0x0000000000000000 0x000001BD422472E0 0x0000000000000040)
0x00007FF636B5E0C2 (0x000000141F9FEC10 0x000001BD41519FA0 0x000001BD3F909E70 0x00007FF636B650B6)
0x00007FF636B63E5D (0x00007FF63869A000 0x00007FFB4A1095F1 0x0000000000370500 0x000000141F9FEAE0)
0x00007FF636AEEDD8 (0x00007FF6368B02B0 0x0000000000005E08 0x000001BD3E060FC0 0x0000000000000001)
0x00007FF636B0B3DA (0x0000000000000000 0x000000141F9FF300 0x0000000000000000 0x00007FF6386745A5)
0x00007FF636AA3E11 (0x000000000000001F 0x0000000000000000 0x000000000000001F 0x000001BD3FAFEED0)
0x00007FF636B08A22 (0x000001BD3DEADA00 0x0000000000000000 0x0000000000000000 0x0000000000000000)
0x00007FF636C0F029 (0x0000000000000000 0x00007FF636C48F16 0x000001BD3E060000 0x000000141F9FFB28)
0x00007FF636C0EC6A (0x000001BD3DE9A578 0x000000141F9FFD68 0x000000141F9FFB90 0x0000000000000001)
0x00007FF636C0EFB1 (0x0000000000000042 0x0000000000000000 0x000001BD3DF10715 0x0000000000000042)
0x00007FF636B03B8F (0x0000000000000000 0x00007FF636C38E6D 0x0000000000000000 0x0000000000000000)
0x00007FF636C38DF4 (0x0000000000000000 0x0000000000000000 0x0000000000000000 0x0000000000000000)
0x00007FFB48736FD4 (0x0000000000000000 0x0000000000000000 0x0000000000000000 0x0000000000000000), BaseThreadInitThunk() + 0x14 bytes(s)
0x00007FFB4A13CF31 (0x0000000000000000 0x0000000000000000 0x0000000000000000 0x0000000000000000), RtlUserThreadStart() + 0x21 bytes(s)
For a dynamic array, setting .length
to be smaller than the current length will create a buffer overrun and subsequent assert error. This is due to a lack of checking before invoking memcpy
Whilst these can be compiled, they will not be invoked as LWDR does not yet support them.
Very first TLS allocated variable appears to be corrupt. The value in it seems to be a bitshift of the size of the TLS sector.
The try/catch thing seems to be generated by the struct destructors
It was a nice proof of concept. With the current state of LWDR I was almost able to port my entire engine :D
Now those functions are quite complex for me to implement so I can't help more than that :(
LDC for the moment is incompatible with a GCC C/C++ backend. The cause of the issue is error/exception handling.
I will need to write glue code to accept LDC's compiler generated exception-code and make it interact with GCC's (not GDC!!) exception code.
The code should have D-style documentation to make it easier for new contributors.
In dub.json I have:
"dflags": [
"-mtriple=armv7a-unknown-unknown",
"-mcpu=cortex-a9",
"-g",
"-float-abi=hard",
"-O0",
"--boundscheck=off",
"-fthread-model=local-exec"
],
"versions": [
"LWDR_DynamicArray",
"LWDR_ModuleCtors"
],
My D code:
class Test
{
static int[] testStaticConstructor;
immutable(char*) getStringFromD()
{
return "Hello World from D! Simple Test".ptr;
}
}
static this()
{
for(int i = 0; i < 5; i++)
Test.testStaticConstructor~= i;
}
Without TLS (Thread Local Storage) support, memory tracking cannot support multiple threads. This can only be alleviated with the support of TLS.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. πππ
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google β€οΈ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.