D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 6535 - RDMD outputs broken library files
Summary: RDMD outputs broken library files
Status: RESOLVED FIXED
Alias: None
Product: D
Classification: Unclassified
Component: dmd (show other issues)
Version: D2
Hardware: x86_64 Linux
: P2 major
Assignee: No Owner
URL:
Keywords:
: 8230 (view as issue list)
Depends on:
Blocks:
 
Reported: 2011-08-20 01:00 UTC by GreatEmerald
Modified: 2013-03-10 18:15 UTC (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description GreatEmerald 2011-08-20 01:00:22 UTC
When trying to compile a static library with RDMD, the output file is always 72 bytes long, which of course is not valid. Using DMD to compile the library works correctly.

To reproduce, I use this basic D file:

===============
module lib;
import std.stdio;

void libraryFunction()
{
	writeln("You have executed the library function!");
}
===============

If I try to compile it with RDMD using this syntax:

===============
rdmd --build-only -lib lib.d
===============

I get a lib.a file that is 72 bytes long. However, if I use the standalone DMD like this:

===============
dmd -lib lib.d
===============

The resulting file is 43.5 kibibytes of size and valid. If I make RDMD chatty and enable both standard and informational warnings, it shows that a lib.d.XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX file is created in the /tmp/.rdmd directory and is of 43.5 kibibytes size. I assume it is the correct file (the size matches exactly) that somehow doesn't get copied to the directory I am building the library in.

I am using RDMD build 20110706, DMD64 v2.054, openSUSE 11.4 x86_64.
Comment 1 Vladimir Panteleev 2013-03-10 01:18:38 UTC
*** Issue 8230 has been marked as a duplicate of this issue. ***
Comment 3 David Nadlinger 2013-03-10 15:12:02 UTC
Vladimir, your fix doesn't seem to have addressed the case where no "-od" is specified, as in the original report. Can you have another look at this?
Comment 4 Vladimir Panteleev 2013-03-10 17:57:53 UTC
I'm fairly certain it does, David. The command:

rdmd --build-only -lib lib.d

creates a 200KB lib.lib file for me with the patch.
Comment 5 David Nadlinger 2013-03-10 18:15:40 UTC
@Vladimir: Oh, it does indeed. What I was seeing is http://d.puremagic.com/issues/show_bug.cgi?id=9684.