mirror of
https://github.com/dlang/dmd.git
synced 2025-04-29 22:50:27 +03:00
Merge remote-tracking branch 'upstream/stable' into merge_stable
This commit is contained in:
commit
ac47aeeeea
11 changed files with 84 additions and 39 deletions
10
.cirrus.yml
10
.cirrus.yml
|
@ -53,9 +53,9 @@ coverage_environment_template: &COVERAGE_ENVIRONMENT_TEMPLATE
|
||||||
|
|
||||||
# Linux
|
# Linux
|
||||||
task:
|
task:
|
||||||
name: Ubuntu 16.04 $TASK_NAME_SUFFIX
|
name: Ubuntu 18.04 $TASK_NAME_SUFFIX
|
||||||
container:
|
container:
|
||||||
image: ubuntu:16.04
|
image: ubuntu:18.04
|
||||||
cpu: 4
|
cpu: 4
|
||||||
memory: 8G
|
memory: 8G
|
||||||
timeout_in: 60m
|
timeout_in: 60m
|
||||||
|
@ -68,7 +68,7 @@ task:
|
||||||
<< : *COVERAGE_ENVIRONMENT_TEMPLATE
|
<< : *COVERAGE_ENVIRONMENT_TEMPLATE
|
||||||
- TASK_NAME_SUFFIX: x86, DMD (bootstrap)
|
- TASK_NAME_SUFFIX: x86, DMD (bootstrap)
|
||||||
MODEL: 32
|
MODEL: 32
|
||||||
HOST_DMD: dmd-2.079.0
|
HOST_DMD: dmd-2.097.1
|
||||||
- TASK_NAME_SUFFIX: x64, DMD (latest)
|
- TASK_NAME_SUFFIX: x64, DMD (latest)
|
||||||
# Enable this to replace coverage tests on CircleCI
|
# Enable this to replace coverage tests on CircleCI
|
||||||
# - TASK_NAME_SUFFIX: x64, DMD (coverage)
|
# - TASK_NAME_SUFFIX: x64, DMD (coverage)
|
||||||
|
@ -76,9 +76,7 @@ task:
|
||||||
- TASK_NAME_SUFFIX: x64, DMD (bootstrap)
|
- TASK_NAME_SUFFIX: x64, DMD (bootstrap)
|
||||||
HOST_DMD: dmd-2.079.0
|
HOST_DMD: dmd-2.079.0
|
||||||
- TASK_NAME_SUFFIX: x64, LDC
|
- TASK_NAME_SUFFIX: x64, LDC
|
||||||
# Starting from LDC v1.27.0, a symbol for GLIBC_2.27 is required,
|
HOST_DC: ldc #TODO: Update to HOST_DMD when support for HOST_DC is removed
|
||||||
# which doesn't work on 16.04 anymore.
|
|
||||||
HOST_DC: ldc-1.26.0 #TODO: Update to HOST_DMD when support for HOST_DC is removed
|
|
||||||
- TASK_NAME_SUFFIX: x64, GDC
|
- TASK_NAME_SUFFIX: x64, GDC
|
||||||
HOST_DMD: gdmd-9
|
HOST_DMD: gdmd-9
|
||||||
<< : *COMMON_STEPS_TEMPLATE
|
<< : *COMMON_STEPS_TEMPLATE
|
||||||
|
|
2
VERSION
2
VERSION
|
@ -1 +1 @@
|
||||||
v2.097.2-beta.1
|
v2.097.2
|
||||||
|
|
6
ci.sh
6
ci.sh
|
@ -22,13 +22,15 @@ if [ -z ${CI_DFLAGS+x} ] ; then CI_DFLAGS=""; fi
|
||||||
CURL_USER_AGENT="DMD-CI $(curl --version | head -n 1)"
|
CURL_USER_AGENT="DMD-CI $(curl --version | head -n 1)"
|
||||||
build_path=generated/$OS_NAME/release/$MODEL
|
build_path=generated/$OS_NAME/release/$MODEL
|
||||||
|
|
||||||
# use faster ld.gold linker on linux
|
|
||||||
if [ "$OS_NAME" == "linux" ]; then
|
if [ "$OS_NAME" == "linux" ]; then
|
||||||
|
# use faster ld.gold linker on x86_64-linux
|
||||||
|
if [ "$MODEL" == "64" ]; then
|
||||||
mkdir -p linker
|
mkdir -p linker
|
||||||
rm -f linker/ld
|
rm -f linker/ld
|
||||||
ln -s /usr/bin/ld.gold linker/ld
|
ln -s /usr/bin/ld.gold linker/ld
|
||||||
NM="nm --print-size"
|
|
||||||
export PATH="$PWD/linker:$PATH"
|
export PATH="$PWD/linker:$PATH"
|
||||||
|
fi
|
||||||
|
NM="nm --print-size"
|
||||||
else
|
else
|
||||||
NM=nm
|
NM=nm
|
||||||
fi
|
fi
|
||||||
|
|
|
@ -15,10 +15,11 @@ if [ ! -z ${HOST_DC+x} ] ; then HOST_DMD=${HOST_DC}; fi
|
||||||
if [ -z ${HOST_DMD+x} ] ; then echo "Variable 'HOST_DMD' needs to be set."; exit 1; fi
|
if [ -z ${HOST_DMD+x} ] ; then echo "Variable 'HOST_DMD' needs to be set."; exit 1; fi
|
||||||
|
|
||||||
if [ "$OS_NAME" == "linux" ]; then
|
if [ "$OS_NAME" == "linux" ]; then
|
||||||
packages="git-core make g++ gdb curl libcurl3 tzdata zip unzip xz-utils"
|
export DEBIAN_FRONTEND=noninteractive
|
||||||
|
packages="git-core make g++ gdb curl libcurl4 tzdata zip unzip xz-utils"
|
||||||
if [ "$MODEL" == "32" ]; then
|
if [ "$MODEL" == "32" ]; then
|
||||||
dpkg --add-architecture i386
|
dpkg --add-architecture i386
|
||||||
packages="$packages g++-multilib libcurl3-gnutls:i386"
|
packages="$packages g++-multilib libcurl4:i386"
|
||||||
fi
|
fi
|
||||||
if [ "${HOST_DMD:0:4}" == "gdmd" ]; then
|
if [ "${HOST_DMD:0:4}" == "gdmd" ]; then
|
||||||
# ci.sh uses `sudo add-apt-repository ...` to add a PPA repo
|
# ci.sh uses `sudo add-apt-repository ...` to add a PPA repo
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
[Environment32]
|
[Environment32]
|
||||||
DFLAGS=-I%@P%/../../src/phobos -I%@P%/../../src/druntime/import -L-L%@P%/../lib32 -L--export-dynamic
|
DFLAGS=-I%@P%/../../src/phobos -I%@P%/../../src/druntime/import -L-L%@P%/../lib32 -L--export-dynamic -fPIC
|
||||||
|
|
||||||
[Environment64]
|
[Environment64]
|
||||||
DFLAGS=-I%@P%/../../src/phobos -I%@P%/../../src/druntime/import -L-L%@P%/../lib64 -L--export-dynamic
|
DFLAGS=-I%@P%/../../src/phobos -I%@P%/../../src/druntime/import -L-L%@P%/../lib64 -L--export-dynamic -fPIC
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
[Environment32]
|
[Environment32]
|
||||||
DFLAGS=-I%@P%/../../src/phobos -I%@P%/../../src/druntime/import -L-L%@P%/../lib32 -L--export-dynamic
|
DFLAGS=-I%@P%/../../src/phobos -I%@P%/../../src/druntime/import -L-L%@P%/../lib32 -L--export-dynamic -fPIC
|
||||||
|
|
||||||
[Environment64]
|
[Environment64]
|
||||||
DFLAGS=-I%@P%/../../src/phobos -I%@P%/../../src/druntime/import -L-L%@P%/../lib64 -L--export-dynamic -fPIC
|
DFLAGS=-I%@P%/../../src/phobos -I%@P%/../../src/druntime/import -L-L%@P%/../lib64 -L--export-dynamic -fPIC
|
||||||
|
|
20
src/build.d
20
src/build.d
|
@ -316,7 +316,7 @@ DFLAGS=%DFLAGS% -L/OPT:NOICF
|
||||||
{
|
{
|
||||||
enum confFile = "dmd.conf";
|
enum confFile = "dmd.conf";
|
||||||
enum conf = `[Environment32]
|
enum conf = `[Environment32]
|
||||||
DFLAGS=-I%@P%/../../../../../druntime/import -I%@P%/../../../../../phobos -L-L%@P%/../../../../../phobos/generated/{OS}/{BUILD}/32{exportDynamic}
|
DFLAGS=-I%@P%/../../../../../druntime/import -I%@P%/../../../../../phobos -L-L%@P%/../../../../../phobos/generated/{OS}/{BUILD}/32{exportDynamic} -fPIC
|
||||||
|
|
||||||
[Environment64]
|
[Environment64]
|
||||||
DFLAGS=-I%@P%/../../../../../druntime/import -I%@P%/../../../../../phobos -L-L%@P%/../../../../../phobos/generated/{OS}/{BUILD}/64{exportDynamic} -fPIC
|
DFLAGS=-I%@P%/../../../../../druntime/import -I%@P%/../../../../../phobos -L-L%@P%/../../../../../phobos/generated/{OS}/{BUILD}/64{exportDynamic} -fPIC
|
||||||
|
@ -1021,14 +1021,9 @@ void parseEnvironment()
|
||||||
// detect PIC
|
// detect PIC
|
||||||
version(Posix)
|
version(Posix)
|
||||||
{
|
{
|
||||||
// default to PIC on x86_64, use PIC=1/0 to en-/disable PIC.
|
// default to PIC if the host compiler supports, use PIC=1/0 to en-/disable PIC.
|
||||||
// Note that shared libraries and C files are always compiled with PIC.
|
// Note that shared libraries and C files are always compiled with PIC.
|
||||||
bool pic;
|
bool pic = true;
|
||||||
if (model == "64")
|
|
||||||
pic = true;
|
|
||||||
else if (model == "32")
|
|
||||||
pic = false;
|
|
||||||
|
|
||||||
const picValue = env.getDefault("PIC", "");
|
const picValue = env.getDefault("PIC", "");
|
||||||
switch (picValue)
|
switch (picValue)
|
||||||
{
|
{
|
||||||
|
@ -1038,6 +1033,15 @@ void parseEnvironment()
|
||||||
default:
|
default:
|
||||||
throw abortBuild(format("Variable 'PIC' should be '0', '1' or <empty> but got '%s'", picValue));
|
throw abortBuild(format("Variable 'PIC' should be '0', '1' or <empty> but got '%s'", picValue));
|
||||||
}
|
}
|
||||||
|
version (X86)
|
||||||
|
{
|
||||||
|
// https://issues.dlang.org/show_bug.cgi?id=20466
|
||||||
|
static if (__VERSION__ < 2090)
|
||||||
|
{
|
||||||
|
pragma(msg, "Warning: PIC will be off by default for this build of DMD because of Issue 20466!");
|
||||||
|
pic = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
env["PIC_FLAG"] = pic ? "-fPIC" : "";
|
env["PIC_FLAG"] = pic ? "-fPIC" : "";
|
||||||
}
|
}
|
||||||
|
|
|
@ -5067,6 +5067,20 @@ private extern (C++) final class ExpressionSemanticVisitor : Visitor
|
||||||
}
|
}
|
||||||
else if (isNeedThisScope(sc, exp.f))
|
else if (isNeedThisScope(sc, exp.f))
|
||||||
{
|
{
|
||||||
|
// At this point it is possible that `exp.f` had an ambiguity error that was
|
||||||
|
// silenced because the previous call to `resolveFuncCall` was done using
|
||||||
|
// `FuncResolveFlag.overloadOnly`. To make sure that a proper error message
|
||||||
|
// is printed, redo the call with `FuncResolveFlag.standard`.
|
||||||
|
//
|
||||||
|
// https://issues.dlang.org/show_bug.cgi?id=22157
|
||||||
|
if (exp.f.overnext)
|
||||||
|
exp.f = resolveFuncCall(exp.loc, sc, exp.f, tiargs, null, exp.arguments, FuncResolveFlag.standard);
|
||||||
|
|
||||||
|
if (!exp.f || exp.f.errors)
|
||||||
|
return setError();
|
||||||
|
|
||||||
|
// If no error is printed, it means that `f` is the single matching overload
|
||||||
|
// and it needs `this`.
|
||||||
exp.error("need `this` for `%s` of type `%s`", exp.f.toChars(), exp.f.type.toChars());
|
exp.error("need `this` for `%s` of type `%s`", exp.f.toChars(), exp.f.type.toChars());
|
||||||
return setError();
|
return setError();
|
||||||
}
|
}
|
||||||
|
|
|
@ -72,14 +72,10 @@ else
|
||||||
endif
|
endif
|
||||||
export DMD=../generated/$(OS)/$(BUILD)/$(DMD_MODEL)/dmd
|
export DMD=../generated/$(OS)/$(BUILD)/$(DMD_MODEL)/dmd
|
||||||
|
|
||||||
# default to PIC on x86_64, use PIC=1/0 to en-/disable PIC.
|
# default to PIC, use PIC=1/0 to en-/disable PIC.
|
||||||
# Note that shared libraries and C files are always compiled with PIC.
|
# Note that shared libraries and C files are always compiled with PIC.
|
||||||
ifeq ($(PIC),)
|
ifeq ($(PIC),)
|
||||||
ifeq ($(MODEL),64) # x86_64
|
|
||||||
PIC:=1
|
PIC:=1
|
||||||
else
|
|
||||||
PIC:=0
|
|
||||||
endif
|
|
||||||
endif
|
endif
|
||||||
ifeq ($(PIC),1)
|
ifeq ($(PIC),1)
|
||||||
export PIC_FLAG:=-fPIC
|
export PIC_FLAG:=-fPIC
|
||||||
|
|
34
test/fail_compilation/fail22157.d
Normal file
34
test/fail_compilation/fail22157.d
Normal file
|
@ -0,0 +1,34 @@
|
||||||
|
// https://issues.dlang.org/show_bug.cgi?id=22157
|
||||||
|
|
||||||
|
/*
|
||||||
|
TEST_OUTPUT:
|
||||||
|
---
|
||||||
|
fail_compilation/fail22157.d(32): Error: `fail22157.S!true.S.foo` called with argument types `()` matches both:
|
||||||
|
fail_compilation/fail22157.d(21): `fail22157.S!true.S.foo()`
|
||||||
|
and:
|
||||||
|
fail_compilation/fail22157.d(22): `fail22157.S!true.S.foo()`
|
||||||
|
fail_compilation/fail22157.d(33): Error: `fail22157.S!false.S.foo` called with argument types `()` matches both:
|
||||||
|
fail_compilation/fail22157.d(26): `fail22157.S!false.S.foo()`
|
||||||
|
and:
|
||||||
|
fail_compilation/fail22157.d(27): `fail22157.S!false.S.foo()`
|
||||||
|
---
|
||||||
|
*/
|
||||||
|
|
||||||
|
struct S(bool b)
|
||||||
|
{
|
||||||
|
static if(b)
|
||||||
|
{
|
||||||
|
void foo() {}
|
||||||
|
static void foo() {}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
static void foo() {}
|
||||||
|
void foo() {}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void main() {
|
||||||
|
S!true.foo;
|
||||||
|
S!false.foo;
|
||||||
|
}
|
12
test/run.d
12
test/run.d
|
@ -278,7 +278,7 @@ void ensureToolsExists(const string[string] env, const TestTool[] tools ...)
|
||||||
"-m"~env["MODEL"],
|
"-m"~env["MODEL"],
|
||||||
"-of"~targetBin,
|
"-of"~targetBin,
|
||||||
sourceFile
|
sourceFile
|
||||||
] ~ tool.extraArgs;
|
] ~ getPicFlags(env) ~ tool.extraArgs;
|
||||||
}
|
}
|
||||||
|
|
||||||
writefln("Executing: %-(%s %)", command);
|
writefln("Executing: %-(%s %)", command);
|
||||||
|
@ -518,15 +518,11 @@ string[string] getEnvironment()
|
||||||
auto druntimePath = environment.get("DRUNTIME_PATH", testPath(`../../druntime`));
|
auto druntimePath = environment.get("DRUNTIME_PATH", testPath(`../../druntime`));
|
||||||
auto phobosPath = environment.get("PHOBOS_PATH", testPath(`../../phobos`));
|
auto phobosPath = environment.get("PHOBOS_PATH", testPath(`../../phobos`));
|
||||||
|
|
||||||
// default to PIC on x86_64, use PIC=1/0 to en-/disable PIC.
|
// default to PIC, use PIC=1/0 to en-/disable PIC.
|
||||||
// Note that shared libraries and C files are always compiled with PIC.
|
// Note that shared libraries and C files are always compiled with PIC.
|
||||||
bool pic;
|
bool pic = true;
|
||||||
version(X86_64)
|
if (environment.get("PIC", "") == "0")
|
||||||
pic = true;
|
|
||||||
else version(X86)
|
|
||||||
pic = false;
|
pic = false;
|
||||||
if (environment.get("PIC", "0") == "1")
|
|
||||||
pic = true;
|
|
||||||
|
|
||||||
env["PIC_FLAG"] = pic ? "-fPIC" : "";
|
env["PIC_FLAG"] = pic ? "-fPIC" : "";
|
||||||
env["DFLAGS"] = "-I%s/import -I%s".format(druntimePath, phobosPath)
|
env["DFLAGS"] = "-I%s/import -I%s".format(druntimePath, phobosPath)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue