Merge remote-tracking branch 'upstream/stable' into merge_stable

This commit is contained in:
Martin Nowak 2021-08-09 22:39:23 +02:00
commit ac47aeeeea
11 changed files with 84 additions and 39 deletions

View file

@ -53,9 +53,9 @@ coverage_environment_template: &COVERAGE_ENVIRONMENT_TEMPLATE
# Linux
task:
name: Ubuntu 16.04 $TASK_NAME_SUFFIX
name: Ubuntu 18.04 $TASK_NAME_SUFFIX
container:
image: ubuntu:16.04
image: ubuntu:18.04
cpu: 4
memory: 8G
timeout_in: 60m
@ -68,7 +68,7 @@ task:
<< : *COVERAGE_ENVIRONMENT_TEMPLATE
- TASK_NAME_SUFFIX: x86, DMD (bootstrap)
MODEL: 32
HOST_DMD: dmd-2.079.0
HOST_DMD: dmd-2.097.1
- TASK_NAME_SUFFIX: x64, DMD (latest)
# Enable this to replace coverage tests on CircleCI
# - TASK_NAME_SUFFIX: x64, DMD (coverage)
@ -76,9 +76,7 @@ task:
- TASK_NAME_SUFFIX: x64, DMD (bootstrap)
HOST_DMD: dmd-2.079.0
- TASK_NAME_SUFFIX: x64, LDC
# Starting from LDC v1.27.0, a symbol for GLIBC_2.27 is required,
# 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
HOST_DC: ldc #TODO: Update to HOST_DMD when support for HOST_DC is removed
- TASK_NAME_SUFFIX: x64, GDC
HOST_DMD: gdmd-9
<< : *COMMON_STEPS_TEMPLATE

View file

@ -1 +1 @@
v2.097.2-beta.1
v2.097.2

12
ci.sh
View file

@ -22,13 +22,15 @@ if [ -z ${CI_DFLAGS+x} ] ; then CI_DFLAGS=""; fi
CURL_USER_AGENT="DMD-CI $(curl --version | head -n 1)"
build_path=generated/$OS_NAME/release/$MODEL
# use faster ld.gold linker on linux
if [ "$OS_NAME" == "linux" ]; then
mkdir -p linker
rm -f linker/ld
ln -s /usr/bin/ld.gold linker/ld
# use faster ld.gold linker on x86_64-linux
if [ "$MODEL" == "64" ]; then
mkdir -p linker
rm -f linker/ld
ln -s /usr/bin/ld.gold linker/ld
export PATH="$PWD/linker:$PATH"
fi
NM="nm --print-size"
export PATH="$PWD/linker:$PATH"
else
NM=nm
fi

View file

@ -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 [ "$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
dpkg --add-architecture i386
packages="$packages g++-multilib libcurl3-gnutls:i386"
packages="$packages g++-multilib libcurl4:i386"
fi
if [ "${HOST_DMD:0:4}" == "gdmd" ]; then
# ci.sh uses `sudo add-apt-repository ...` to add a PPA repo

View file

@ -1,5 +1,5 @@
[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]
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

View file

@ -1,5 +1,5 @@
[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]
DFLAGS=-I%@P%/../../src/phobos -I%@P%/../../src/druntime/import -L-L%@P%/../lib64 -L--export-dynamic -fPIC

View file

@ -316,7 +316,7 @@ DFLAGS=%DFLAGS% -L/OPT:NOICF
{
enum confFile = "dmd.conf";
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]
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
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.
bool pic;
if (model == "64")
pic = true;
else if (model == "32")
pic = false;
bool pic = true;
const picValue = env.getDefault("PIC", "");
switch (picValue)
{
@ -1038,6 +1033,15 @@ void parseEnvironment()
default:
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" : "";
}

View file

@ -5067,6 +5067,20 @@ private extern (C++) final class ExpressionSemanticVisitor : Visitor
}
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());
return setError();
}

View file

@ -72,14 +72,10 @@ else
endif
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.
ifeq ($(PIC),)
ifeq ($(MODEL),64) # x86_64
PIC:=1
else
PIC:=0
endif
PIC:=1
endif
ifeq ($(PIC),1)
export PIC_FLAG:=-fPIC

View 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;
}

View file

@ -278,7 +278,7 @@ void ensureToolsExists(const string[string] env, const TestTool[] tools ...)
"-m"~env["MODEL"],
"-of"~targetBin,
sourceFile
] ~ tool.extraArgs;
] ~ getPicFlags(env) ~ tool.extraArgs;
}
writefln("Executing: %-(%s %)", command);
@ -518,15 +518,11 @@ string[string] getEnvironment()
auto druntimePath = environment.get("DRUNTIME_PATH", testPath(`../../druntime`));
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.
bool pic;
version(X86_64)
pic = true;
else version(X86)
bool pic = true;
if (environment.get("PIC", "") == "0")
pic = false;
if (environment.get("PIC", "0") == "1")
pic = true;
env["PIC_FLAG"] = pic ? "-fPIC" : "";
env["DFLAGS"] = "-I%s/import -I%s".format(druntimePath, phobosPath)