Jump to page: 1 2
Thread overview
[Issue 3541] New: Add -oq to dmd (use fully qualified module name as object filename)
Nov 22, 2009
nfxjfg@gmail.com
Jan 01, 2010
nfxjfg@gmail.com
Jan 01, 2010
Leandro Lucarella
Jan 08, 2010
mpiepk@gmail.com
Mar 29, 2010
nfxjfg@gmail.com
May 01, 2010
nfxjfg@gmail.com
May 01, 2010
nfxjfg@gmail.com
Jun 14, 2010
nfxjfg@gmail.com
Dec 02, 2010
nfxjfg@gmail.com
Jan 07, 2011
nfxjfg@gmail.com
Jan 07, 2011
Brad Roberts
Feb 26, 2011
Jacob Carlborg
Mar 27, 2011
Andrej Mitrovic
May 28, 2011
Walter Bright
Dec 14, 2011
Walter Bright
Dec 16, 2011
Jacob Carlborg
Apr 08, 2013
Andrej Mitrovic
November 22, 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@puremagic.com
        ReportedBy: nfxjfg@gmail.com


--- Comment #0 from nfxjfg@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: -------
January 01, 2010
http://d.puremagic.com/issues/show_bug.cgi?id=3541



--- Comment #1 from nfxjfg@gmail.com 2010-01-01 07:51:35 PST ---
Created an attachment (id=541)
updated patch

Updated to dmd 1.054, if anyone cares.
Apply with "patch -p1 < patchfile" in dmd source directory.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
January 01, 2010
http://d.puremagic.com/issues/show_bug.cgi?id=3541


Leandro Lucarella <llucax@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
    Attachment #541|application/octet-stream    |text/plain
          mime type|                            |
 Attachment #541 is|0                           |1
              patch|                            |


--- Comment #2 from Leandro Lucarella <llucax@gmail.com> 2010-01-01 11:32:36 PST ---
(From update of attachment 541)
Marked as patch

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
January 08, 2010
http://d.puremagic.com/issues/show_bug.cgi?id=3541


mpiepk@gmail.com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
 Attachment #541 is|0                           |1
           obsolete|                            |


--- Comment #3 from mpiepk@gmail.com 2010-01-08 03:25:14 PST ---
Created an attachment (id=547)
Updated patch

The old patch contained inconsistent line endings and crashed patch (at least
on Win32).

This also removes the "feature" that dmd strips the ".lib"/".obj" file extension when building the linker command line (link.c), because it would fail for filenames like "package.module.obj"

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
March 29, 2010
http://d.puremagic.com/issues/show_bug.cgi?id=3541



--- Comment #4 from nfxjfg@gmail.com 2010-03-29 16:17:40 PDT ---
What do I have to do to make dmd support -oq ?

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
May 01, 2010
http://d.puremagic.com/issues/show_bug.cgi?id=3541



--- Comment #5 from nfxjfg@gmail.com 2010-05-01 12:00:35 PDT ---
Created an attachment (id=618)
updated patch for dmd 1.059 beta (~ svn 461)

this probably still crashes with win32 patch => not obsoleting mpiepk's patch

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
May 01, 2010
http://d.puremagic.com/issues/show_bug.cgi?id=3541


nfxjfg@gmail.com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
    Attachment #618|application/octet-stream    |text/plain
          mime type|                            |
 Attachment #618 is|0                           |1
              patch|                            |


-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
June 14, 2010
http://d.puremagic.com/issues/show_bug.cgi?id=3541



--- Comment #6 from nfxjfg@gmail.com 2010-06-13 22:20:53 PDT ---
For dmd 1.062, watch out for the comment "// Bugzilla 3547" in module.c: you have to move my changes into the indented new indented else branch.

Not bothering with a real updated patch, line ending issues make this kind of infeasible, and Walter probably applies patches manually anyway. (Plus he obviously isn't interested in this.)

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
December 02, 2010
http://d.puremagic.com/issues/show_bug.cgi?id=3541



--- Comment #7 from nfxjfg@gmail.com 2010-12-02 09:28:19 PST ---
I'm updating this patch to new dmd versions all the time, just mail me if you're actually interested in it lol.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
January 07, 2011
http://d.puremagic.com/issues/show_bug.cgi?id=3541


nfxjfg@gmail.com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |INVALID


-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
« First   ‹ Prev
1 2