Under what circumstances does the “[shared] static this” not run, On ARM

Dsby dushibaiyu at yahoo.com
Mon Nov 6 03:23:08 UTC 2023


I corss to ARM(contex A7) ,the static this and static ~this does 
nit work.
Whether the system compiles parameters or what happens, I have no 
idea.
我使用LDC交叉编译到 armv7l linux上,“static 
this”不能执行。可能出现什么情况不调用?会不会是我编译系统参数有影响。

the Code(代码如下):
``` D
import std.stdio;
// import core.thread;
import core.runtime;

shared static this(){
writeln("run shared static this");
}

static this(){
writeln("run static this");
}

shared static ~this(){
writeln("run shared static ~this");
}

static ~this(){
writeln("run static ~this");
}


void main()
{
	writeln("run main");
	writeln("exit main");

}
```


when I use linux on X86-64(在主机 linux运行效果(Opensuse):):
``` Bash
dub run -f
     Starting Performing "debug" build using 
/home/duyu/bin/ldc2-1.34.0-linux-x86_64/bin/ldc2 for x86_64.
     Building dtest ~master: building configuration [application]
      Linking dtest
      Running dtest
run shared static this
run static this
run main
exit main
run static ~this
run shared static ~this

```

But I corss to ARM(contex A7) ,the static this and static ~this 
does nit work.
Whether the system compiles parameters or what happens, I have no 
idea.
In the borad Arm (在ARM   linux 上)。
``` Bash
# chmod +x ./dtest
# uname -a
Linux PQ-A40i 3.10.65 #13 SMP PREEMPT Sun Oct 22 11:29:35 CST 
2023 armv7l GNU/Linux
# ./dtest
run main
exit main
#
```


More information about the digitalmars-d-ldc mailing list