Get rid of obsolete DMC special cases

This commit is contained in:
Martin Kinkelin 2024-05-25 19:34:44 +02:00
parent 6d69608aae
commit 47771d49fd
14 changed files with 15 additions and 99 deletions

View file

@ -44,20 +44,6 @@ install_host_dmd() {
dmd --version dmd --version
} }
################################################################################
# Download dmc
################################################################################
install_host_dmc() {
if [ ! -f dm/README.TXT ]; then
download "https://downloads.dlang.org/other/dm857c.zip" dmc.zip
7z x dmc.zip > /dev/null
download "http://ftp.digitalmars.com/sppn.zip" sppn.zip
7z x -odm/bin sppn.zip > /dev/null
fi
dm/bin/dmc | head -n 1 || true
}
################################################################################ ################################################################################
# Download Grep # Download Grep
################################################################################ ################################################################################

View file

@ -71,15 +71,12 @@ if [[ "$HOST_DMD_VERSION" == "2.079.0" ]]; then
disable_debug_for_unittests=(ENABLE_DEBUG=0) disable_debug_for_unittests=(ENABLE_DEBUG=0)
fi fi
# avoid the DMC runtime and its limitations for the compiler and {build,run}.d tools themselves
TOOL_MODEL="$MODEL"
cd "$DMD_DIR" cd "$DMD_DIR"
"$HOST_DC" -m$TOOL_MODEL compiler/src/build.d -ofgenerated/build.exe "$HOST_DC" -m$MODEL compiler/src/build.d -ofgenerated/build.exe
generated/build.exe -j$N MODEL=$TOOL_MODEL HOST_DMD=$HOST_DC BUILD=debug "${disable_debug_for_unittests[@]}" unittest generated/build.exe -j$N MODEL=$MODEL HOST_DMD=$HOST_DC BUILD=debug "${disable_debug_for_unittests[@]}" unittest
generated/build.exe -j$N MODEL=$TOOL_MODEL HOST_DMD=$HOST_DC DFLAGS="-L-LARGEADDRESSAWARE" ENABLE_RELEASE=1 ENABLE_ASSERTS=1 dmd generated/build.exe -j$N MODEL=$MODEL HOST_DMD=$HOST_DC DFLAGS="-L-LARGEADDRESSAWARE" ENABLE_RELEASE=1 ENABLE_ASSERTS=1 dmd
DMD_BIN_PATH="$DMD_DIR/generated/windows/release/$TOOL_MODEL/dmd.exe" DMD_BIN_PATH="$DMD_DIR/generated/windows/release/$MODEL/dmd.exe"
################################################################################ ################################################################################
# Build Druntime and Phobos # Build Druntime and Phobos
@ -100,11 +97,11 @@ if [ "${DMD_TEST_COVERAGE:-0}" = "1" ] ; then
# Recompile debug dmd + unittests # Recompile debug dmd + unittests
rm -rf "$DMD_DIR/generated/windows" rm -rf "$DMD_DIR/generated/windows"
../../generated/build.exe -j$N MODEL=$TOOL_MODEL DFLAGS="-L-LARGEADDRESSAWARE" ENABLE_DEBUG=1 ENABLE_COVERAGE=1 dmd ../../generated/build.exe -j$N MODEL=$MODEL DFLAGS="-L-LARGEADDRESSAWARE" ENABLE_DEBUG=1 ENABLE_COVERAGE=1 dmd
../../generated/build.exe -j$N MODEL=$TOOL_MODEL DFLAGS="-L-LARGEADDRESSAWARE" ENABLE_DEBUG=1 ENABLE_COVERAGE=1 unittest ../../generated/build.exe -j$N MODEL=$MODEL DFLAGS="-L-LARGEADDRESSAWARE" ENABLE_DEBUG=1 ENABLE_COVERAGE=1 unittest
fi fi
"$HOST_DC" -m$TOOL_MODEL -g -i run.d "$HOST_DC" -m$MODEL -g -i run.d
targets=("all") targets=("all")
args=('ARGS=-O -inline -g') # no -release for faster builds args=('ARGS=-O -inline -g') # no -release for faster builds

View file

@ -953,12 +953,6 @@ public int runPreprocessor(ref const Loc loc, const(char)[] cpp, const(char)[] f
{ {
//printf("runPreprocessor() cpp: %.*s filename: %.*s\n", cast(int)cpp.length, cpp.ptr, cast(int)filename.length, filename.ptr); //printf("runPreprocessor() cpp: %.*s filename: %.*s\n", cast(int)cpp.length, cpp.ptr, cast(int)filename.length, filename.ptr);
/*
To get sppn.exe: http://ftp.digitalmars.com/sppn.zip
To get the dmc C headers, dmc will need to be installed:
http://ftp.digitalmars.com/Digital_Mars_C++/Patch/dm857c.zip
*/
version (Windows) version (Windows)
{ {
// generate unique temporary file name for preprocessed output // generate unique temporary file name for preprocessed output

View file

@ -356,7 +356,7 @@ Environment variables
ARGS: set to execute all combinations of ARGS: set to execute all combinations of
AUTO_UPDATE: set to 1 to auto-update mismatching test output AUTO_UPDATE: set to 1 to auto-update mismatching test output
CC: C++ compiler to use, ex: dmc, g++ CC: C++ compiler to use, ex: cl, g++
DMD: compiler to use, ex: ../src/dmd (required) DMD: compiler to use, ex: ../src/dmd (required)
MODEL: 32 or 64 (required) MODEL: 32 or 64 (required)
OS: windows, linux, freebsd, osx, netbsd, dragonflybsd OS: windows, linux, freebsd, osx, netbsd, dragonflybsd

View file

@ -4,9 +4,7 @@
#include <assert.h> #include <assert.h>
#ifndef __DMC__ // D:\a\1\s\tools\dm\include\complex.h(105): Deprecation: use of complex type `cdouble` is deprecated, use `std.complex.Complex!(double)` instead
#include <complex.h> #include <complex.h>
#endif
#include <ctype.h> #include <ctype.h>
#include <errno.h> #include <errno.h>
@ -34,13 +32,10 @@ float x = NAN;
#include <signal.h> #include <signal.h>
#endif #endif
#ifndef __DMC__ // no stdalign.h
#include <stdalign.h> #include <stdalign.h>
#endif
#include <stdarg.h> #include <stdarg.h>
#ifndef __DMC__ // no stdatomic.h
#ifndef __linux__ #ifndef __linux__
#ifndef _MSC_VER #ifndef _MSC_VER
#ifndef __APPLE__ // /Applications/Xcode-14.2.0.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/14.0.0/include/stdatomic.h(80): Error: type-specifier is missing #ifndef __APPLE__ // /Applications/Xcode-14.2.0.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/14.0.0/include/stdatomic.h(80): Error: type-specifier is missing
@ -48,7 +43,6 @@ float x = NAN;
#endif #endif
#endif #endif
#endif #endif
#endif
#include <stdbool.h> #include <stdbool.h>
#include <stddef.h> #include <stddef.h>
@ -59,13 +53,10 @@ float x = NAN;
#include <stdlib.h> #include <stdlib.h>
#endif #endif
#ifndef __DMC__ // no stdnoreturn.h
#include <stdnoreturn.h> #include <stdnoreturn.h>
#endif
#include <string.h> #include <string.h>
#ifndef __DMC__ // no tgmath.h
#ifndef _MSC_VER // C:\Program Files (x86)\Windows Kits\10\include\10.0.22621.0\ucrt\tgmath.h(33): Error: no type for declarator before `)` #ifndef _MSC_VER // C:\Program Files (x86)\Windows Kits\10\include\10.0.22621.0\ucrt\tgmath.h(33): Error: no type for declarator before `)`
#ifndef __APPLE__ // /Applications/Xcode-14.2.0.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/tgmath.h(39): Error: named parameter required before `...` #ifndef __APPLE__ // /Applications/Xcode-14.2.0.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/tgmath.h(39): Error: named parameter required before `...`
#if !(defined(__linux__) && defined(__aarch64__)) // /tmp/clang/lib/clang/15.0.3/include/tgmath.h(34): Error: named parameter required before `...` #if !(defined(__linux__) && defined(__aarch64__)) // /tmp/clang/lib/clang/15.0.3/include/tgmath.h(34): Error: named parameter required before `...`
@ -73,9 +64,7 @@ float x = NAN;
#endif #endif
#endif #endif
#endif #endif
#endif
#ifndef __DMC__
#ifndef __linux__ #ifndef __linux__
#ifndef __APPLE__ #ifndef __APPLE__
#ifndef _MSC_VER #ifndef _MSC_VER
@ -83,18 +72,13 @@ float x = NAN;
#endif #endif
#endif #endif
#endif #endif
#endif
#include <time.h> #include <time.h>
#ifndef __DMC__ // no uchar.h
#ifndef __APPLE__ // no uchar.h #ifndef __APPLE__ // no uchar.h
#include <uchar.h> #include <uchar.h>
#endif #endif
#endif
#include <wchar.h> #include <wchar.h>
#ifndef __DMC__ // wctype.h(102): Error: unterminated string constant starting at #defines(780)
#include <wctype.h> #include <wctype.h>
#endif

View file

@ -9,16 +9,6 @@ int main()
writeln("CPP header generation test was skipped because $CXX is empty!"); writeln("CPP header generation test was skipped because $CXX is empty!");
return DISABLED; return DISABLED;
} }
// DMC cannot compile the generated headers ...
version (Windows)
{
import std.algorithm : canFind;
if (CXX.canFind("dmc"))
{
writeln("CPP header generation test was skipped because DMC is not supported!");
return DISABLED;
}
}
Vars.set("SOURCE_DIR", "$EXTRA_FILES/cpp_header_gen"); Vars.set("SOURCE_DIR", "$EXTRA_FILES/cpp_header_gen");
Vars.set("LIB", "$OUTPUT_BASE/library$LIBEXT"); Vars.set("LIB", "$OUTPUT_BASE/library$LIBEXT");

View file

@ -90,14 +90,10 @@ void runCPPTests()
int (C2::*fp1)(int) = &C2::f1; int (C2::*fp1)(int) = &C2::f1;
int (C2::*fp2)(int, int) = &C2::f2; int (C2::*fp2)(int, int) = &C2::f2;
int (C2::*fp3)(int, int) = &C2::f3; int (C2::*fp3)(int, int) = &C2::f3;
#ifndef __DMC__
int (C2::*fp4)(int, ...) = &C2::f4; int (C2::*fp4)(int, ...) = &C2::f4;
#endif
assert((c2->*(fp0))() == 100); assert((c2->*(fp0))() == 100);
assert((c2->*(fp1))(1) == 101); assert((c2->*(fp1))(1) == 101);
assert((c2->*(fp2))(20, 3) == 123); assert((c2->*(fp2))(20, 3) == 123);
assert((c2->*(fp3))(20, 3) == 123); assert((c2->*(fp3))(20, 3) == 123);
#ifndef __DMC__
assert((c2->*(fp4))(20, 3, 0) == 123); assert((c2->*(fp4))(20, 3, 0) == 123);
#endif
} }

View file

@ -10,9 +10,7 @@ namespace std
struct test19248 {int a;}; struct test19248 {int a;};
}; };
#ifdef __DMC__ #if defined (_MSC_VER) && _MSC_VER <= 1800
// DMC doesn't support c++11
#elif defined (_MSC_VER) && _MSC_VER <= 1800
// MSVC2013 doesn't support char16_t/char32_t // MSVC2013 doesn't support char16_t/char32_t
#else #else
#define TEST_UNICODE #define TEST_UNICODE
@ -26,11 +24,7 @@ struct S18784
S18784::S18784(int n) : i(n) {} S18784::S18784(int n) : i(n) {}
#ifdef __DMC__ // DMC doesn't support c++11
template <class>
#else
template <class...> template <class...>
#endif
struct SPack struct SPack
{ {
int i; int i;

View file

@ -374,9 +374,7 @@ wchar_t f13289_cpp_wchar_t(wchar_t ch)
return ch; return ch;
} }
} }
#ifdef __DMC__ #if defined (_MSC_VER) //&& _MSC_VER <= 1800
// DMC doesn't support c++11
#elif defined (_MSC_VER) //&& _MSC_VER <= 1800
// MSVC2013 doesn't support char16_t/char32_t // MSVC2013 doesn't support char16_t/char32_t
#else #else
#define TEST_UNICODE #define TEST_UNICODE

View file

@ -426,7 +426,6 @@ namespace foo
} }
} }
#ifndef __DMC__ // DMC doesn't support c++11
template<typename ...T> void foovargs(T... args); template<typename ...T> void foovargs(T... args);
void test40() void test40()
@ -446,4 +445,3 @@ void test41()
make_shared_poc<int, int, int>(a, b); make_shared_poc<int, int, int>(a, b);
} }
#endif

View file

@ -1,6 +1,3 @@
#if defined(__DMC__) // DMC doesn't support immintrin.h
#else
#include <assert.h> #include <assert.h>
// Inline the typedef of __m128 instead of including immintrin.h. // Inline the typedef of __m128 instead of including immintrin.h.
@ -30,5 +27,3 @@ void test20652(const __m128& a)
assert(b.array[2] == 1); assert(b.array[2] == 1);
assert(b.array[3] == 1); assert(b.array[3] == 1);
} }
#endif

View file

@ -60,8 +60,8 @@ void usage()
~ " ARGS: set to execute all combinations of\n" ~ " ARGS: set to execute all combinations of\n"
~ " REQUIRED_ARGS: arguments always passed to the compiler\n" ~ " REQUIRED_ARGS: arguments always passed to the compiler\n"
~ " DMD: compiler to use, ex: ../src/dmd (required)\n" ~ " DMD: compiler to use, ex: ../src/dmd (required)\n"
~ " CC: C compiler to use, ex: dmc, cc\n" ~ " CC: C compiler to use, ex: cl, cc\n"
~ " CXX: C++ compiler to use, ex: dmc, g++\n" ~ " CXX: C++ compiler to use, ex: cl, g++\n"
~ " OS: windows, linux, freebsd, osx, netbsd, dragonflybsd\n" ~ " OS: windows, linux, freebsd, osx, netbsd, dragonflybsd\n"
~ " RESULTS_DIR: base directory for test results\n" ~ " RESULTS_DIR: base directory for test results\n"
~ " MODEL: 32 or 64 (required)\n" ~ " MODEL: 32 or 64 (required)\n"

View file

@ -36,8 +36,8 @@ else
export SOEXT=.so export SOEXT=.so
fi fi
# Default to DigitalMars C++ on Win32 # Default to Microsoft cl on Windows
if [ "$OS" == "win32" ] && [ -z "${CC+set}" ] ; then if [[ "$OS" == "win"* && -z "${CC+set}" ]] ; then
CC="dmc" CC="cl"
fi fi
export CC="${CC:-c++}" # C++ compiler to use export CC="${CC:-c++}" # C++ compiler to use

View file

@ -11,20 +11,6 @@
module rt.alloca; module rt.alloca;
version (Posix)
{
version = alloca;
}
else version (CRuntime_Microsoft)
{
version = alloca;
}
// Use DMC++'s alloca() for Win32
version (alloca)
{
/******************************************* /*******************************************
* Allocate data from the caller's stack frame. * Allocate data from the caller's stack frame.
* This is a 'magic' function that needs help from the compiler to * This is a 'magic' function that needs help from the compiler to
@ -215,5 +201,3 @@ extern (C) void* __alloca(int nbytes)
else else
static assert(0); static assert(0);
} }
}