diff --git a/changelog/dmd.obj_extensions.dd b/changelog/dmd.obj_extensions.dd new file mode 100644 index 00000000000..f200382bacc --- /dev/null +++ b/changelog/dmd.obj_extensions.dd @@ -0,0 +1,6 @@ +Accepting .o and .obj file extensions on all platforms + +Accepting .o and .obj file extensions on all platforms makes DMD behave +the same as Clang and other modern compilers. There is no point in +discarding *.o or *.obj depending on the current OS, as both extensions +indicate that this is an object file. diff --git a/compiler/src/dmd/mars.d b/compiler/src/dmd/mars.d index 911b5405817..b911366adc6 100644 --- a/compiler/src/dmd/mars.d +++ b/compiler/src/dmd/mars.d @@ -1836,7 +1836,7 @@ bool createModule(const(char)* file, ref Strings libmodules, const ref Target ta /* Deduce what to do with a file based on its extension */ - if (FileName.equals(ext, target.obj_ext)) + if (FileName.equals(ext, "obj") || FileName.equals(ext, "o")) { global.params.objfiles.push(file); libmodules.push(file);