mirror of
https://github.com/reactos/reactos.git
synced 2025-02-24 17:34:57 +00:00
Remove a hack, and link with C++ libraries only when required
Patch by Cecill Etheredge ( ijsf at gmx dot net ) svn path=/trunk/; revision=36576
This commit is contained in:
parent
f8998c9c84
commit
aac6354d3b
1 changed files with 11 additions and 8 deletions
|
@ -1481,19 +1481,22 @@ MingwModuleHandler::GenerateLinkerCommand (
|
|||
fprintf ( fMakefile, "\t$(ECHO_LD)\n" );
|
||||
string targetName ( module.output->name );
|
||||
|
||||
/* HACK: if we have C++ in kernel, link it with some user mode dlls (kernel32 + msvcrt) ... */
|
||||
static const string libsCppKernel = " '$(shell ${TARGET_CC} -print-file-name=libkernel32.a)' '$(shell ${TARGET_CC} -print-file-name=libmsvcrt.a)'";
|
||||
/* check if we need to add default C++ libraries, ie if we have
|
||||
* a C++ user-mode module without the -nostdlib linker flag
|
||||
*/
|
||||
bool link_defaultlibs = module.cplusplus &&
|
||||
linkerParameters.find ("-nostdlib") == string::npos &&
|
||||
!(module.type == KernelModeDLL || module.type == KernelModeDriver);
|
||||
|
||||
if ( !module.HasImportLibrary() )
|
||||
{
|
||||
fprintf ( fMakefile,
|
||||
"\t%s %s%s %s %s%s %s %s -o %s\n",
|
||||
"\t%s %s%s %s %s %s %s -o %s\n",
|
||||
linker.c_str (),
|
||||
linkerParameters.c_str (),
|
||||
linkerScriptArgument.c_str (),
|
||||
objectsMacro.c_str (),
|
||||
module.cplusplus ? "$(PROJECT_LPPFLAGS) " : "",
|
||||
module.cplusplus && (module.type == KernelModeDLL || module.type == KernelModeDriver) ? libsCppKernel.c_str () : "",
|
||||
link_defaultlibs ? "$(PROJECT_LPPFLAGS) " : "",
|
||||
libsMacro.c_str (),
|
||||
GetLinkerMacro ().c_str (),
|
||||
target_macro.c_str () );
|
||||
|
@ -1514,14 +1517,14 @@ MingwModuleHandler::GenerateLinkerCommand (
|
|||
module.underscoreSymbols ? " --add-underscore" : "" );
|
||||
|
||||
fprintf ( fMakefile,
|
||||
"\t%s %s%s %s %s %s%s %s %s -o %s\n",
|
||||
"\t%s %s%s %s %s %s %s %s -o %s\n",
|
||||
|
||||
linker.c_str (),
|
||||
linkerParameters.c_str (),
|
||||
linkerScriptArgument.c_str (),
|
||||
backend->GetFullName ( temp_exp ).c_str (),
|
||||
objectsMacro.c_str (),
|
||||
module.cplusplus ? "$(PROJECT_LPPFLAGS) " : "",
|
||||
module.cplusplus && (module.type == KernelModeDLL || module.type == KernelModeDriver) ? libsCppKernel.c_str () : "",
|
||||
link_defaultlibs ? "$(PROJECT_LPPFLAGS) " : "",
|
||||
libsMacro.c_str (),
|
||||
GetLinkerMacro ().c_str (),
|
||||
target_macro.c_str () );
|
||||
|
|
Loading…
Reference in a new issue