Pass library file arguments to linker _before_ custom switches.

This allows specifying a static D library specified at the LDC
command line to pick up symbols from druntime/Phobos.

Fixes DMD testcase 'test39'.
This commit is contained in:
David Nadlinger 2012-09-02 21:34:21 +02:00
parent 4b23e794ca
commit 6b1b84a28d

View file

@ -83,6 +83,13 @@ int linkObjToBinary(bool sharedLib)
args.push_back(p);
}
// user libs
for (unsigned i = 0; i < global.params.libfiles->dim; i++)
{
char *p = static_cast<char *>(global.params.libfiles->data[i]);
args.push_back(p);
}
// output filename
std::string output;
if (!sharedLib && global.params.exefile)
@ -147,13 +154,6 @@ int linkObjToBinary(bool sharedLib)
args.push_back(p);
}
// user libs
for (unsigned i = 0; i < global.params.libfiles->dim; i++)
{
char *p = static_cast<char *>(global.params.libfiles->data[i]);
args.push_back(p);
}
// default libs
bool addSoname = false;
switch(global.params.os) {