July 26, 2023
https://issues.dlang.org/show_bug.cgi?id=24057

          Issue ID: 24057
           Summary: Linker complains that input file is the same as output
                    file
           Product: D
           Version: D2
          Hardware: x86_64
                OS: Linux
            Status: NEW
          Severity: critical
          Priority: P1
         Component: dmd
          Assignee: nobody@puremagic.com
          Reporter: daniel.pflager@gmail.com

OpenSUSE Leap 15.4 and Kubuntu 22.04

Steps to reproduce:

1) Download, untar and set PATH and LD_LIBRARY_PATH for DMD 2.104.2 bin64 and lib64 respectively from https://downloads.dlang.org/releases/2.x/2.104.2/dmd.2.104.2.linux.tar.xz.

2) Create junk project using dub init.

  dell7720:~/src/junk> dub init
  Package recipe format (sdl/json) [json]:
  Name [junk]:
  Description [A minimal D application.]:
  Author name [Daniel P Pflager]:
  License [proprietary]:
  Copyright string [Copyright © 2023, Daniel P Pflager]:
  Add dependency (leave empty to skip) []:
       Success created empty project in /home/oy753c/src/junk
               Package successfully created in .

3) dub build

  dell7720:~/src/junk> dub build
      Starting Performing "debug" build using
  /home/oy753c/.local/share/dmd2/linux/bin64/dmd for x86_64.
      Building junk ~master: building configuration [application]
       Linking junk
  gcc: fatal error: input file
  ‘/home/oy753c/.dub/cache/junk/~master/build/application-debug-
 XkKXpdE6XO3OEVSWaDDkIw/junk.o’ is the same as output file
  compilation terminated.
  Error: linker exited with status 1
  Error /home/oy753c/.local/share/dmd2/linux/bin64/dmd failed with exit code 1.


This just started happening recently.

dell7720:~/src/junk> gcc --version
gcc (SUSE Linux) 7.5.0
Copyright (C) 2017 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE

dell7720:~/src/junk> dmd --version
DMD64 D Compiler v2.104.2
Copyright (C) 1999-2023 by The D Language Foundation, All Rights Reserved
written by Walter Bright

--