In detail, this commit:
- Changes the default version that is built to D2, use D_VERSION to override.
- Reverts back to building static libs by default until we are certain shared libs work fine everywhere.
- Fixes installation pathes so that CMAKE_INSTALL_PREFIX is respected; /etc as sysconf dir for /usr prefix is special-cased.
- Fixes out-of-source builds again, and causes temporary files (idgen, …) not to be written to the source directory anymore.
This is a slightly cleaned up version of the changes from https://github.com/ldc-developers/ldc/pull/12.
Before, _d_arraycatT was used to concatenate multiple arrays. That caused an issue when postblit
was called on a struct multiple times. The next code asserted due to the issue:
void main()
{
static struct S
{
int x;
int pad;
this(this)
{
++x;
}
}
auto sarr = new S[1];
auto sarr2 = sarr ~ sarr ~ sarr;
assert(sarr2[0].x == 1);
assert(sarr2[1].x == 1);
assert(sarr2[2].x == 1);
assert(sarr[0].x == 0);
}
If anyone wanted to ever resurrect LDC1/Phobos (lphobos/README.txt had an »unmaintained« notice for more than three years now), this should be done in an external repository.
In some cases, like the following, DtoDeclareFunction() hasn't already been called when DtoCreateNestedContextType() is invoked. This seems to have been anticipated when the function was originally written, but DtoDeclareFunction() was previously called after the ir func was already accessed in fd->ir.irFunc->nestedContextCreated.
---
void main() {
mixin({
string foo() {
return "";
}
string bar()() {
return foo();
}
return bar();
}());
}
---
When clearing the lvalue cache, the added-then-backed-out-then-added-back-for-D2-only code by Alexey permanently removed all casts from e1 (e1 is a member variable!), instead of only skipping them for the cachedLvalue assignment.
Previously, LDC would crash in the backend due to the fact that the IR is typed in such cases (we recently had such an instance with Tango, where an extern( C ) function was declared once with int and once with size_t).