[Issue 3541] New: Add -oq to dmd (use fully qualified module name as object filename)

d-bugmail at puremagic.com d-bugmail at puremagic.com
Sat Nov 21 18:44:51 PST 2009


http://d.puremagic.com/issues/show_bug.cgi?id=3541

           Summary: Add -oq to dmd (use fully qualified module name as
                    object filename)
           Product: D
           Version: 1.051
          Platform: Other
        OS/Version: All
            Status: NEW
          Keywords: patch
          Severity: enhancement
          Priority: P2
         Component: DMD
        AssignedTo: nobody at puremagic.com
        ReportedBy: nfxjfg at gmail.com


--- Comment #0 from nfxjfg at gmail.com 2009-11-21 18:44:49 PST ---
Created an attachment (id=514)
patch for dmd 1.051 to add -oq

This patch adds the -oq option to dmd. When dmd is invoked with -oq, it uses
the fully qualified module name for the filename. E.g. when a module contains
the module declaration "module foo.moo.huh;", the file is output as
"foo.moo.huh.o".

Why is -oq a good idea? Right now, build tools can use -od, but if there are
modules with the same names in different packages, clashes occur. You could use
-op to avoid this, but then object files will be all over the user's source
tree (which sucks, especially if dmd and/or the build tool crash, and leave the
object files everywhere).

LDC had this option since ages, and I think it's time that dmd also knows it.

Further remarks:
- The option respects the -od option.
- An error is raised when a module doesn't contain a ModuleDeclaration (this is
intentionally).
- dmd creates the filenames in the Module ctor; this is a problem because the
module declaration is needed to compute the object filename. I had to change it
and move the code to somewhere after Module.parse() is invoked.
- As a result, I'm not quite sure if I introduced regressions with the plenty
of other output methods.
- I hope the option is LDC compatible (xfbuild was able to use the patched dmd
with -oq).

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------


More information about the Digitalmars-d-bugs mailing list