16 questions
1
vote
1
answer
182
views
GCC, GDC, and LLVM and LDC compilers’ prefetch builtins - exact meaning of the locality parameter
In the description of the x86 prefetch instructions, I found the following explanation for the instructions’ hint number
"Fetches the line of data from memory that contains the byte specified ...
0
votes
1
answer
209
views
how to properly build tilix?
I decided to build tilix by cloning the code from the repository.
I understand that the compiler must be LDC, but I don’t know what exactly to change.
dub build --build release
But I stumbled upon the ...
4
votes
1
answer
903
views
How does AVR support with LLVM work for different languages?
Apologies in advance since I am not too knowledgeable on the topic yet and still in the process of learning about the inner workings of compilers.
I am currently investigating the possibility of using ...
3
votes
1
answer
148
views
Where is D's `std.sumtype`?
I'm working on a project in the D language and I want to use a module from the standard library called std.sumtype. I'm on debian oldstable, and I've tried both GDC and LDC. DMD is unavailable, ...
1
vote
1
answer
118
views
Arduino with adafruit RGBLCDShield Buttons weird behavior
I have the Arduino uno with rgb lcd shield. there is a very weird behavior with the buttons in one specific function.
The function is called yes/no. It displays a message on the screen (working) the ...
0
votes
1
answer
536
views
ldc2 -static fails ld.gold error cannot find -lphobos2-ldc -ldruntime-ldc
tl;dr LDC compiles and links fine until the -static flag is used, then ld.gold cannot find the phobos or druntime libraries.
OS: Gentoo 64-bit
Kernel: 5.4.48
DMD version: 2.090
LDC2 version: 1.20.1 (...
3
votes
1
answer
789
views
Ways to make a D program faster
I'm working on a very demanding project (actually an interpreter), exclusively written in D, and I'm wondering what type of optimizations would generally be recommended. The project makes heavy use of ...
1
vote
2
answers
263
views
Random segmentation fault in D lang on switch break
I was debugging a fairly simple program written in D, that seems to have a random chance to receive a SEGV signal.
Upon further inspection I observed that using different compilers and build modes ...
1
vote
1
answer
412
views
How do I use LDC (D Compiler) with Code::Blocks? Specifically, how do I use the linker?
I have been using CodeBlocks with the Digital Mars D compiler and the LLVM Clang compiler for some time without any problems. Now I need to use the LDC D compiler and am having problems with the ...
0
votes
1
answer
123
views
LDC2 -I option results in unresolved externals
I'm using the latest LDC2 beta, and when running the compiler with -I (Look for imports also in ) it fails with unresolved externals. These are my commands.
$ ldc2 "source\setup.d" -I "source" -J "...
2
votes
1
answer
385
views
d openssl aes encrypted byte array is not constant between executions
I am linking D to OpenSsl using the Deimos openssl headers for D and am using the ldc 1.8.0 compiler, to try to encrypt a string as a small test.
The encrypted byte array isn't consistent with what I ...
1
vote
2
answers
405
views
Do ldc and gdc support D language contracts?
This code with a contract:
import std.stdio;
int TestContract(int a)
in
{
assert( a > 0);
}
do
{
return a + 1;
}
int main(string[] args)
{
auto a = 2;
try
{
writeln(a," + 1 ...
1
vote
2
answers
790
views
How to not open a console when starting program written in D
I am writing an application in D. It's compiled with the ldc2 compiler, using dub configuration (target type: executable). The compiled program creates a console window, which I do not need since the ...
1
vote
4
answers
1k
views
Dlang LLVM ERROR: Program used external function which could not be resolved
main.d
import std.stdio;
void main()
{
writeln("Hello World !!!");
}
when i compile and execute it is work perfectly
But when i try
ldc2 -output-ll main.d
lli main.ll
LLVM ERROR: Program ...
5
votes
1
answer
142
views
How to pass object from D to C++?
I'm trying to make an interop with C++ and D. And the thing I've found today is really messing my mind: objects are not being passed correctly in my program.
It's better to show an example.
I have ...
6
votes
1
answer
1k
views
ldc2 vs ldmd2 whats the difference?
I recently installed ldc through hombrew on my Mac and was testing out running a code as a script from the D wiki when I noticed that using ldmd2 to compile my program doesn't also run my program ...