Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Drop compilability with ltsmaster #3956

Merged
merged 2 commits into from
Apr 25, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 6 additions & 42 deletions .cirrus.yml
Original file line number Diff line number Diff line change
Expand Up @@ -147,56 +147,20 @@ task:
<< : *INSTALL_UBUNTU_PREREQUISITES_TEMPLATE
<< : *COMMON_STEPS_TEMPLATE

# LDC v0.17.6: C parts of Phobos not compiled with -fPIC, needs Ubuntu 16.04
task:
name: Ubuntu 16.04 x64 ltsmaster
name: Ubuntu 18.04 x64 bootstrap
container:
image: ubuntu:16.04
image: ubuntu:18.04
cpu: 8
memory: 16G
timeout_in: 60m
environment:
CI_OS: linux
EXTRA_CMAKE_FLAGS: "-DBUILD_LTO_LIBS=ON -DLDC_LINK_MANUALLY=ON -DLLVM_ROOT_DIR=$CIRRUS_WORKING_DIR/../llvm"
LIBCLANG_COMMON_VERSION: "6.0"
HOST_LDC_VERSION: 1.9.0
EXTRA_CMAKE_FLAGS: "-DBUILD_LTO_LIBS=ON"
PARALLELISM: 8
# for pip:
LANG: C.UTF-8
install_prerequisites_script: |
cd $CIRRUS_WORKING_DIR/..
nproc
export DEBIAN_FRONTEND=noninteractive
apt-get -q update
apt-get -yq install \
git-core cmake ninja-build g++ \
zlib1g-dev \
libcurl3 curl gdb python3 python3-pip tzdata unzip zip
python3 --version
# Download & extract host LDC
curl -fL --retry 3 --max-time 300 -o ldc2.tar.xz https://github.com/ldc-developers/ldc/releases/download/v0.17.6/ldc2-0.17.6-linux-x86_64.tar.xz
mkdir host-ldc
tar -xf ldc2.tar.xz --strip 1 -C host-ldc
rm ldc2.tar.xz
# Download & extract vanilla LLVM
curl -fL --retry 3 --max-time 300 -o llvm.tar.xz https://github.com/llvm/llvm-project/releases/download/llvmorg-12.0.1/clang+llvm-12.0.1-x86_64-linux-gnu-ubuntu-16.04.tar.xz
mkdir -p llvm
tar -xf llvm.tar.xz --strip 1 -C llvm
rm llvm.tar.xz
clone_submodules_early_script: |
cd $CIRRUS_WORKING_DIR
# remove --depth from following command because of
# https://github.com/ldc-developers/ldc/pull/3835#issuecomment-928517319
git submodule update --init # --depth $CIRRUS_CLONE_DEPTH
remove_some_tests_script: |
cd $CIRRUS_WORKING_DIR/tests/d2/dmd-testsuite
# The -lowmem tests don't work with an ltsmaster host compiler
rm runnable/{testptrref,xtest46}_gc.d
rm fail_compilation/mixin_gc.d
# The @live tests neither (LDC segfaults)
rm compilable/ob{1,2}.d
rm fail_compilation/fob{1,2}.d
rm fail_compilation/failob2.d
# Some __traits(getOverloads) tests neither
rm compilable/{test21050,test21743}.d
<< : *INSTALL_UBUNTU_PREREQUISITES_TEMPLATE
<< : *COMMON_STEPS_TEMPLATE

task:
Expand Down
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@

#### Big news
- LLVM for prebuilt packages bumped to v14.0.0. (#3952)
- All LLVM targets are enabled now (=> more targets for cross-compilation).
- For the Mac package, the minimum supported macOS version has been raised to v10.12.
- The minimum D version for bootstrapping has been raised to v2.079 (for GDC: v9.4), in line with DMD. (#3956)

#### Bug fixes

Expand Down
4 changes: 1 addition & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,9 +86,7 @@ are up to date:
$ git submodule update --init

(DMD, GDC and LDC are supported as host compilers. For bootstrapping
purposes, we recommend GDC via its `gdmd` wrapper. Alternatively, LDC 0.17,
the last version not to require a D compiler, is maintained to some degree in
the `ltsmaster` branch.)
purposes, we recommend GDC via its `gdmd` wrapper.)

Cross-compilation
-----------------
Expand Down
5 changes: 2 additions & 3 deletions dmd/ast_node.d
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,8 @@
*/
module dmd.ast_node;

// IN_LLVM: no selective imports for ltsmaster compatibility
import dmd.root.rootobject; // : RootObject;
import dmd.visitor; // : Visitor;
import dmd.root.rootobject : RootObject;
import dmd.visitor : Visitor;

/// The base class of all AST nodes.
extern (C++) abstract class ASTNode : RootObject
Expand Down
23 changes: 2 additions & 21 deletions dmd/builtin.d
Original file line number Diff line number Diff line change
Expand Up @@ -432,23 +432,7 @@ Expression eval_bswap(Loc loc, FuncDeclaration fd, Expressions* arguments)
uinteger_t n = arg0.toInteger();
TY ty = arg0.type.toBasetype().ty;
if (ty == Tint64 || ty == Tuns64)
{
version (LDC)
{
// ltsmaster has no core.bitop.bswap(ulong) overload
static if (!__traits(compiles, core.bitop.bswap(ulong.max)))
{
import ldc.intrinsics : llvm_bswap;
alias bswap64 = llvm_bswap!ulong;
}
else
alias bswap64 = core.bitop.bswap;
}
else
alias bswap64 = core.bitop.bswap;

return new IntegerExp(loc, bswap64(cast(ulong) n), arg0.type);
}
return new IntegerExp(loc, core.bitop.bswap(cast(ulong) n), arg0.type);
else
return new IntegerExp(loc, core.bitop.bswap(cast(uint) n), arg0.type);
}
Expand All @@ -458,10 +442,7 @@ Expression eval_popcnt(Loc loc, FuncDeclaration fd, Expressions* arguments)
Expression arg0 = (*arguments)[0];
assert(arg0.op == EXP.int64);
uinteger_t n = arg0.toInteger();
version (LDC) // ltsmaster doesn't have popcnt(ulong)
return new IntegerExp(loc, core.bitop._popcnt(n), Type.tint32);
else
return new IntegerExp(loc, core.bitop.popcnt(n), Type.tint32);
return new IntegerExp(loc, core.bitop.popcnt(n), Type.tint32);
}

Expression eval_yl2x(Loc loc, FuncDeclaration fd, Expressions* arguments)
Expand Down
4 changes: 2 additions & 2 deletions dmd/chkformat.d
Original file line number Diff line number Diff line change
Expand Up @@ -534,7 +534,7 @@ Format parseScanfFormatSpecifier(scope const char[] format, ref size_t idx,
assert(format[i] == '%');
const length = format.length;

Format error() /* IN_LLVM: ltsmaster... */ nothrow
Format error()
{
idx = i;
return Format.error;
Expand Down Expand Up @@ -628,7 +628,7 @@ Format parsePrintfFormatSpecifier(scope const char[] format, ref size_t idx,
bool width;
bool precision;

Format error() /* IN_LLVM: ltsmaster... */ nothrow
Format error()
{
idx = i;
return Format.error;
Expand Down
7 changes: 2 additions & 5 deletions dmd/common/file.d
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,8 @@ import core.stdc.errno : errno;
import core.stdc.stdio : fprintf, remove, rename, stderr;
import core.stdc.stdlib : exit;
import core.stdc.string : strerror;
version (Windows) // IN_LLVM: ltsmaster...
{
import core.sys.windows.winbase;
import core.sys.windows.winnt;
}
import core.sys.windows.winbase;
import core.sys.windows.winnt;
import core.sys.posix.fcntl;
import core.sys.posix.unistd;

Expand Down
2 changes: 1 addition & 1 deletion dmd/common/string.d
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ struct SmallBuffer(T)
}

// Force accesses to extent to be scoped.
/* ltsmaster: scope */ inout extent()
scope inout extent()
{
return _extent;
}
Expand Down
2 changes: 1 addition & 1 deletion dmd/compiler.d
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ private struct ModuleComponentRange
*/
private bool includeImportedModuleCheck(ModuleComponentRange components)
in { assert(includeImports); }
body
do
{
createMatchNodes();
size_t nodeIndex = 0;
Expand Down
21 changes: 10 additions & 11 deletions dmd/cparse.d
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,7 @@ final class CParser(AST) : Parser!AST

// type-qualifiers
case TOK.const_:
case TOK.volatile_:
case TOK.volatile:
case TOK.restrict:
case TOK.__stdcall:

Expand Down Expand Up @@ -1895,16 +1895,15 @@ final class CParser(AST) : Parser!AST
addFuncName = false; // gets set to true if somebody references __func__ in this function
const locFunc = token.loc;

// IN_LLVM: `body` renamed to `body_` for ltsmaster compatibility
auto body_ = cparseStatement(ParseStatementFlags.curly); // don't start a new scope; continue with parameter scope
auto body = cparseStatement(ParseStatementFlags.curly); // don't start a new scope; continue with parameter scope
auto fd = new AST.FuncDeclaration(locFunc, prevloc, id, specifiersToSTC(LVL.global, specifier), ft, specifier.noreturn);

if (addFuncName)
{
auto s = createFuncName(locFunc, id);
body_ = new AST.CompoundStatement(locFunc, s, body_);
body = new AST.CompoundStatement(locFunc, s, body);
}
fd.fbody = body_;
fd.fbody = body;

// TODO add `symbols` to the function's local symbol table `sc2` in FuncDeclaration::semantic3()

Expand Down Expand Up @@ -2073,7 +2072,7 @@ final class CParser(AST) : Parser!AST

// Type qualifiers
case TOK.const_: modx = MOD.xconst; break;
case TOK.volatile_: modx = MOD.xvolatile; break;
case TOK.volatile: modx = MOD.xvolatile; break;
case TOK.restrict: modx = MOD.xrestrict; break;
case TOK.__stdcall: modx = MOD.x__stdcall; break;

Expand Down Expand Up @@ -2635,7 +2634,7 @@ final class CParser(AST) : Parser!AST
switch (token.value)
{
case TOK.const_: mod |= MOD.xconst; break;
case TOK.volatile_: mod |= MOD.xvolatile; break;
case TOK.volatile: mod |= MOD.xvolatile; break;
case TOK.restrict: mod |= MOD.xrestrict; break;
case TOK._Atomic: mod |= MOD.x_Atomic; break;
case TOK.__stdcall: mod |= MOD.x__stdcall; break;
Expand Down Expand Up @@ -3002,7 +3001,7 @@ final class CParser(AST) : Parser!AST
case TOK.int16:
case TOK.inline:
case TOK._Noreturn:
case TOK.volatile_:
case TOK.volatile:
case TOK.signed:
case TOK.auto_:
case TOK.restrict:
Expand Down Expand Up @@ -3721,7 +3720,7 @@ final class CParser(AST) : Parser!AST

// type-qualifiers
case TOK.const_:
case TOK.volatile_:
case TOK.volatile:
case TOK.restrict:
case TOK.__stdcall:
t = peek(t);
Expand Down Expand Up @@ -3962,7 +3961,7 @@ final class CParser(AST) : Parser!AST
{
case TOK.const_:
case TOK.restrict:
case TOK.volatile_:
case TOK.volatile:
case TOK._Atomic:
case TOK.__stdcall:
t = peek(t);
Expand Down Expand Up @@ -4016,7 +4015,7 @@ final class CParser(AST) : Parser!AST
// Type Qualifiers
case TOK.const_:
case TOK.restrict:
case TOK.volatile_:
case TOK.volatile:
case TOK.__stdcall:

// Type Specifiers
Expand Down
2 changes: 1 addition & 1 deletion dmd/declaration.d
Original file line number Diff line number Diff line change
Expand Up @@ -1084,7 +1084,7 @@ version (IN_LLVM)
{
assert(ident);
}
body
do
{
//printf("VarDeclaration('%s')\n", ident.toChars());
super(loc, ident);
Expand Down
4 changes: 2 additions & 2 deletions dmd/dtoh.d
Original file line number Diff line number Diff line change
Expand Up @@ -609,7 +609,7 @@ public:
}

// Seperate function because of a spurious dual-context deprecation
static int compare(const AST.Dsymbol* a, const AST.Dsymbol* b) /* IN_LLVM: ltsmaster... */ nothrow
static int compare(const AST.Dsymbol* a, const AST.Dsymbol* b)
{
return strcmp(a.ident.toChars(), b.ident.toChars());
}
Expand Down Expand Up @@ -2916,7 +2916,7 @@ public:
// Should never be called directly with a TI, only onemember
assert(!sym.isTemplateInstance(), sym.toString());
}
body
do
{
debug (Debug_DtoH)
{
Expand Down
2 changes: 1 addition & 1 deletion dmd/func.d
Original file line number Diff line number Diff line change
Expand Up @@ -3332,7 +3332,7 @@ private bool traverseIndirections(Type ta, Type tb)
{
//printf("traverseIndirections(%s, %s)\n", ta.toChars(), tb.toChars());

static bool traverse(Type ta, Type tb, ref /* ltsmaster: scope */ AssocArray!(const(char)*, bool) table, bool reversePass)
static bool traverse(Type ta, Type tb, ref scope AssocArray!(const(char)*, bool) table, bool reversePass)
{
//printf("traverse(%s, %s)\n", ta.toChars(), tb.toChars());
ta = ta.baseElemOf();
Expand Down
2 changes: 1 addition & 1 deletion dmd/id.d
Original file line number Diff line number Diff line change
Expand Up @@ -405,7 +405,7 @@ immutable Msgtable[] msgtable =
{ "btr" },
{ "bts" },
{ "bswap" },
{ "volatile_", "volatile" }, // IN_LLVM: renamed for ltsmaster compatibility
{ "volatile"},
{ "volatileLoad"},
{ "volatileStore"},
{ "_popcnt"},
Expand Down
2 changes: 1 addition & 1 deletion dmd/identifier.d
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ nothrow:
{
assert(name[length] == '\0');
}
body
do
{
//printf("Identifier('%s', %d)\n", name, value);
this(name[0 .. length], value);
Expand Down
2 changes: 1 addition & 1 deletion dmd/impcnvtab.d
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ ImpCnvTab generateImpCnvTab()
}
}

void X(TY t1, TY t2, TY nt1, TY nt2, TY rt) /* IN_LLVM: ltsmaster... */ @nogc nothrow
void X(TY t1, TY t2, TY nt1, TY nt2, TY rt)
{
impCnvTab.impcnvResultTab[t1][t2] = rt;
impCnvTab.impcnvResultTab[t2][t1] = rt;
Expand Down
7 changes: 3 additions & 4 deletions dmd/lexer.d
Original file line number Diff line number Diff line change
Expand Up @@ -2778,7 +2778,7 @@ class Lexer
return;
}

void closingParen() /* IN_LLVM: ltsmaster... */ nothrow
void closingParen()
{
if (n.value != TOK.rightParenthesis)
{
Expand All @@ -2787,7 +2787,7 @@ class Lexer
skipToNextLine();
}

void setPackAlign(ref const Token t) /* IN_LLVM: ltsmaster... */ nothrow
void setPackAlign(ref const Token t)
{
const n = t.unsvalue;
if (n < 1 || n & (n - 1) || ushort.max < n)
Expand Down Expand Up @@ -3047,7 +3047,7 @@ class Lexer
*/
OutBuffer buf;

void trimTrailingWhitespace() /* IN_LLVM: ltsmaster... */ nothrow
void trimTrailingWhitespace()
{
const s = buf[];
auto len = s.length;
Expand Down Expand Up @@ -3390,7 +3390,6 @@ unittest
diagnosticHandler = &expectDiagnosticHandler;

void test(string sequence, string expectedError, dchar expectedReturnValue, uint expectedScanLength, bool Ccompile = false)
/* IN_LLVM: ltsmaster */ nothrow
{
uint errors = global.errors;
gotError = false;
Expand Down
7 changes: 0 additions & 7 deletions dmd/mars.d
Original file line number Diff line number Diff line change
Expand Up @@ -1103,21 +1103,14 @@ else
// When using a C main, host DMD may not link against host druntime by default.
version (DigitalMars)
{
// IN_LLVM: extra curly braces for ltsmaster compilability...
version (Win64)
{
pragma(lib, "phobos64");
}
else version (Win32)
{
version (CRuntime_Microsoft)
{
pragma(lib, "phobos32mscoff");
}
else
{
pragma(lib, "phobos");
}
}
}

Expand Down
2 changes: 1 addition & 1 deletion dmd/mtype.d
Original file line number Diff line number Diff line change
Expand Up @@ -6887,7 +6887,7 @@ extern (C++) struct ParameterList
}

/// Compares this to another ParameterList (and expands tuples if necessary)
extern (D) bool opEquals(/* IN_LLVM: ltsmaster... scope */ ref ParameterList other) const
extern (D) bool opEquals(scope ref ParameterList other) const
{
if (stc != other.stc || varargs != other.varargs || (!parameters != !other.parameters))
return false;
Expand Down
Loading