diff --git a/.azure-pipelines/windows.sh b/.azure-pipelines/windows.sh index a1ed841439..d083eda1f9 100644 --- a/.azure-pipelines/windows.sh +++ b/.azure-pipelines/windows.sh @@ -28,15 +28,8 @@ echo "GREP_VERSION: $(grep --version)" GNU_MAKE="$(which make)" # must be done before installing dmc (tampers with PATH) -if [ "$MODEL" == "32omf" ] ; then - install_host_dmc - CC="$PWD/dm/bin/dmc.exe" - CXX="$PWD/dm/bin/dmc.exe" - export CPPCMD="$PWD/dm/bin/sppn.exe" -else - CC="cl.exe" - CXX="cl.exe" -fi +CC="cl.exe" +CXX="cl.exe" ################################################################################ # Install the host compiler @@ -63,8 +56,9 @@ if [ "$MODEL" == "64" ] ; then LIBNAME=phobos64.lib elif [ "$MODEL" == "32" ] ; then LIBNAME=phobos32mscoff.lib -else # 32omf - LIBNAME=phobos.lib +else + echo 'Invalid $MODEL provided'. + exit 1 fi ################################################################################ @@ -79,9 +73,6 @@ fi # avoid the DMC runtime and its limitations for the compiler and {build,run}.d tools themselves TOOL_MODEL="$MODEL" -if [[ "$MODEL" == "32omf" ]]; then - TOOL_MODEL=32 -fi cd "$DMD_DIR" "$HOST_DC" -m$TOOL_MODEL compiler/src/build.d -ofgenerated/build.exe @@ -115,25 +106,6 @@ fi "$HOST_DC" -m$TOOL_MODEL -g -i run.d -if [ "$MODEL" == "32omf" ] ; then - # Pre-build the tools while the host compiler's sc.ini is untampered (see below). - ./run tools - - # WORKAROUND: Make Optlink use freshly built Phobos, not the host compiler's. - # Optlink apparently prefers LIB in sc.ini (in the same dir as optlink.exe) - # over the LIB env variable (and `-conf=` for DMD apparently doesn't prevent - # that, and there's apparently no sane way to specify a libdir for Optlink - # in the DMD cmdline either). - rm "$DMD_DIR/tools/dmd2/windows/bin/sc.ini" - # We also need to remove LIB from the freshly built compiler's sc.ini - - # not all test invocations use `-conf=`. - sed -i 's|^LIB=.*$||g' "$DMD_DIR/generated/windows/release/$TOOL_MODEL/sc.ini" - # Okay, now the lib directories are controlled by the LIB env variable. - # run.d prepends the dir containing freshly built phobos.lib; we still need - # the DMC and Windows libs from the host compiler. - export LIB="$DMD_DIR/tools/dmd2/windows/lib" -fi - targets=("all") args=('ARGS=-O -inline -g') # no -release for faster builds if [ "$HOST_DMD_VERSION" = "2.079.0" ] ; then @@ -159,31 +131,25 @@ fi cd "$DMD_DIR/druntime" "$GNU_MAKE" -j$N MODEL=$MODEL DMD="$DMD_BIN_PATH" CC="$CC" unittest -if [ "$MODEL" != "32omf" ] ; then - # run some tests for shared druntime +# run some tests for shared druntime - # no separate output for static or shared builds, so clean directories to force rebuild - rm -rf test/shared/generated - # the test_runner links against libdruntime-ut.dll and runs all unittests - # no matter what module name is passed in, so restrict to src/object.d - "$GNU_MAKE" -j$N unittest MODEL=$MODEL SHARED=1 DMD="$DMD_BIN_PATH" CC="$CC" UT_SRCS=src/object.d ADDITIONAL_TESTS=test/shared -fi +# no separate output for static or shared builds, so clean directories to force rebuild +rm -rf test/shared/generated +# the test_runner links against libdruntime-ut.dll and runs all unittests +# no matter what module name is passed in, so restrict to src/object.d +"$GNU_MAKE" -j$N unittest MODEL=$MODEL SHARED=1 DMD="$DMD_BIN_PATH" CC="$CC" UT_SRCS=src/object.d ADDITIONAL_TESTS=test/shared ################################################################################ # Build and run Phobos unittests ################################################################################ -if [ "$MODEL" = "32omf" ] ; then - echo "FIXME: cannot compile 32-bit OMF Phobos unittests ('more than 32767 symbols in object file')" +cd "$DMD_DIR/../phobos" +if [ "$MODEL" = "64" ] ; then + cp "$DMD_DIR/tools/dmd2/windows/bin64/libcurl.dll" . else - cd "$DMD_DIR/../phobos" - if [ "$MODEL" = "64" ] ; then - cp "$DMD_DIR/tools/dmd2/windows/bin64/libcurl.dll" . - else - cp "$DMD_DIR/tools/dmd2/windows/bin/libcurl.dll" . - fi - "$GNU_MAKE" -j$N MODEL=$MODEL DMD="$DMD_BIN_PATH" CC="$CC" DMD_DIR="$DMD_DIR" unittest + cp "$DMD_DIR/tools/dmd2/windows/bin/libcurl.dll" . fi +"$GNU_MAKE" -j$N MODEL=$MODEL DMD="$DMD_BIN_PATH" CC="$CC" DMD_DIR="$DMD_DIR" unittest ################################################################################ # Prepare artifacts diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 7eeaf4f559..50756e8ed0 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -30,9 +30,6 @@ jobs: x64: MODEL: 64 ARCH: x64 - x86-OMF: - MODEL: 32omf - ARCH: x86 x86: MODEL: 32 ARCH: x86 @@ -54,11 +51,6 @@ jobs: x64: MODEL: 64 ARCH: x64 - - # x64 only because 32bit causes weird linker errors for several tests??? - # x86-OMF: - # MODEL: 32omf - # ARCH: x86 steps: - template: .azure-pipelines/windows.yml diff --git a/changelog/dmd.omf-removed.dd b/changelog/dmd.omf-removed.dd new file mode 100644 index 0000000000..3835aa03b9 --- /dev/null +++ b/changelog/dmd.omf-removed.dd @@ -0,0 +1,5 @@ +Windows OMF support has been removed + +After two years of making PE-COFF support the default on Windows, OMF support has now been removed. + +This includes the switch (``-m32omf``). diff --git a/ci/README.md b/ci/README.md index bc48e4caa3..3c727e82ee 100644 --- a/ci/README.md +++ b/ci/README.md @@ -71,13 +71,12 @@ There are currently 49 checks. - Azure pipelines (Windows_Coverage x64) - Azure pipelines (Windows_DMD_bootstrap x64) - Azure pipelines (Windows_DMD_latest x64) -- Azure pipelines (Windows_DMD_latest x86-OMF) - Azure pipelines (Windows_VisualD_LDC x64_Debug) - Azure pipelines (Windows_VisualD_LDC x86-mscoff) - Azure pipelines (Windows_VisualD_LDC x86-mscoff_MinGW) Azure pipelines run on Windows platforms, and build DMD, Phobos and Druntime, and run their unittests. -Windows has three binary formats: 32-bit OMF (deprecated), 32-bit COFF, and 64-bit COFF. +Windows has two binary formats: 32-bit COFF, and 64-bit COFF. ### DAutoTest diff --git a/compiler/src/dmd/cli.d b/compiler/src/dmd/cli.d index 71651d6572..ab7dcfa6e1 100644 --- a/compiler/src/dmd/cli.d +++ b/compiler/src/dmd/cli.d @@ -536,12 +536,6 @@ dmd -cov -unittest myprog.d "generate 32 bit code and write MS-COFF object files (deprecated use -m32)", TargetOS.Windows ), - Option("m32omf", - "(deprecated) generate 32 bit code and write OMF object files", - `$(WINDOWS Compile a 32 bit executable. The generated object code is in OMF and is meant to be used with the - $(LINK2 http://www.digitalmars.com/download/freecompiler.html, Digital Mars C/C++ compiler)).`, - TargetOS.Windows - ), Option("m64", "generate 64 bit code", `$(UNIX Compile a 64 bit executable. This is the default for the 64 bit dmd.) diff --git a/compiler/src/dmd/mars.d b/compiler/src/dmd/mars.d index 767d16ffc0..aea7536253 100644 --- a/compiler/src/dmd/mars.d +++ b/compiler/src/dmd/mars.d @@ -276,7 +276,7 @@ void getenv_setargv(const(char)* envvalue, Strings* args) } /** - * Parse command line arguments for the last instance of -m32, -m64, -m32mscoff or -m32omfobj + * Parse command line arguments for the last instance of -m32, -m64, -m32mscoff * to detect the desired architecture. * * Params: @@ -285,7 +285,7 @@ void getenv_setargv(const(char)* envvalue, Strings* args) * Should be "32" or "64" * * Returns: - * "32", "64" or "32omf" if the "-m32", "-m64", "-m32omf" flags were passed, + * "32", or "64" if the "-m32", "-m64" flags were passed, * respectively. If they weren't, return `arch`. */ const(char)[] parse_arch_arg(Strings* args, const(char)[] arch) @@ -296,7 +296,7 @@ const(char)[] parse_arch_arg(Strings* args, const(char)[] arch) if (arg.length && arg[0] == '-') { - if (arg[1 .. $] == "m32" || arg[1 .. $] == "m32omf" || arg[1 .. $] == "m64") + if (arg[1 .. $] == "m32" || arg[1 .. $] == "m64") arch = arg[2 .. $]; else if (arg[1 .. $] == "m32mscoff") arch = "32"; @@ -901,11 +901,6 @@ bool parseCommandLine(const ref Strings arguments, const size_t argc, ref Param target.isX86_64 = false; target.omfobj = false; } - else if (arg == "-m32omf") // https://dlang.org/dmd.html#switch-m32omfobj - { - target.isX86_64 = false; - target.omfobj = true; - } else if (startsWith(p + 1, "mscrtlib=")) { driverParams.mscrtlib = arg[10 .. $];