Skip to content
This repository has been archived by the owner on Oct 12, 2022. It is now read-only.

no default lib when making druntime.so #462

Merged
merged 1 commit into from
Mar 26, 2013

Conversation

WalterBright
Copy link
Member

Because linking with druntime.a and phobos2.a is a bad idea when building druntime.so

@WalterBright
Copy link
Member Author

Note that -defaultlib= will be supported in a future update to dmd, but right now this works because the autotester never builds druntime.so.

@MartinNowak
Copy link
Member

DMD already supports this argument since this commit.
And it is already used for building the linux_64 unittest .so.

@@ -152,7 +152,7 @@ dll: override PIC:=-fPIC
dll: $(DRUNTIMESO)

$(DRUNTIMESO): $(OBJS) $(SRCS)
$(DMD) -shared -of$(DRUNTIMESO) -Xfdruntime.json $(DFLAGS) $(SRCS) $(OBJS)
$(DMD) -shared -defaultlib= -of$(DRUNTIMESO) -Xfdruntime.json $(DFLAGS) $(SRCS) $(OBJS)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Because DFLAGS might contain -debug there should also be -debuglib=.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

-defaultlib= means "no default library", which also applies to the debuglib.

@WalterBright
Copy link
Member Author

Needs dmd pull dlang/dmd#1798

@WalterBright
Copy link
Member Author

What dmd doesn't do (and the dmd pull request does) is turn off the -lphobos2 passed to the linker. libdruntimeso.so does not (and should not) rely on libphobos2.a.

MartinNowak added a commit that referenced this pull request Mar 26, 2013
no default lib when making druntime.so
@MartinNowak MartinNowak merged commit 21689db into dlang:master Mar 26, 2013
@WalterBright WalterBright deleted the nodefaultlib branch March 26, 2013 02:34
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants