Thread overview
unknown critical section size
Nov 21
IGotD-
Nov 21
kinke
Nov 21
IGotD-
Nov 21
kinke
Nov 21
IGotD-
Nov 21
kinke
November 21
I'm updating my custom druntime to LDC 1.24.0. Previously I mentioned this problem with unknown critical section size where the compiler only emitted a warning.

rt/profilegc.d(97): Error: unknown critical section size for the selected target

https://forum.dlang.org/post/agupeguvxftrucpjvpho@forum.dlang.org

However, with LDC 1.24.0 this is no longer a warning but an error which prevents me from building druntime. What is necessary in order to solve this problem?
November 21
On Saturday, 21 November 2020 at 09:47:38 UTC, IGotD- wrote:
> What is necessary in order to solve this problem?

If you don't want to teach the compiler about the critical section size for your target, you'll need to convert all expression-less `synchronized` statements to ones with an explicit mutex.
November 21
On Saturday, 21 November 2020 at 12:20:01 UTC, kinke wrote:
>
> If you don't want to teach the compiler about the critical section size for your target, you'll need to convert all expression-less `synchronized` statements to ones with an explicit mutex.

How do I teach the compiler about the critical section size?
November 21
On Saturday, 21 November 2020 at 13:47:55 UTC, IGotD- wrote:
> How do I teach the compiler about the critical section size?

https://github.com/ldc-developers/ldc/blob/8ee390d9605b8d9404ba33cf06dc23605e7ce90a/gen/target.cpp#L39
November 21
On Saturday, 21 November 2020 at 14:03:09 UTC, kinke wrote:
>
> https://github.com/ldc-developers/ldc/blob/8ee390d9605b8d9404ba33cf06dc23605e7ce90a/gen/target.cpp#L39

Thank you, then I will look into this. Since this is compiled into the compiler, it would be beneficial to provide an escape hatch for this. Since I don't have an official llvm target, it would be a good thing to have a compiler option where you can state the size of the critical section on the command line.
November 21
On Saturday, 21 November 2020 at 14:32:24 UTC, IGotD- wrote:
> Since I don't have an official llvm target, it would be a good thing to have a compiler option where you can state the size of the critical section on the command line.

Better yet: https://github.com/dlang/dmd/pull/11824