MingwModuleHandler::GenerateLinkerCommand () const
{
string definitionFilename;
-
+
const FileLocation *DefinitionFilename = GetDefinitionFilename ();
if ( DefinitionFilename ) {
definitionFilename = backend->GetFullName (*DefinitionFilename);
delete DefinitionFilename;
- }
+}
string linkerScriptArgument;
if ( module.linkerScript != NULL ) {
if ( ModuleHandlerInformations[module.type].DefaultHost == HostFalse ) {
if ( module.cplusplus ) {
switch ( module.type )
- {
+ {
case Win32DLL:
case Win32OCX:
case Win32CUI:
default:
extraLibraries = "$$(PROJECT_CCLIBS)";
break;
- }
+ }
} else
extraLibraries = "$$(PROJECT_CCLIBS)";
}
delete PassThruCacheDirectory ( new FileLocation ( module.output->directory, module.output->relative_path, "" ) );
delete PassThruCacheDirectory ( new FileLocation ( IntermediateDirectory, module.output->relative_path, "" ) );
- fprintf ( fMakefile,
+ fprintf ( fMakefile,
"$(eval $(call RBUILD_LINK_RULE,%s,%s,%s,%s,%s,%s,%s))\n",
module.name.c_str(),
definitionFilename.c_str(),
module.xmlbuildFile.c_str(),
- linkerScriptArgument.c_str(),
+ linkerScriptArgument.c_str (),
extraLibraries.c_str(),
module.GetEntryPoint().c_str(),
module.baseaddress.c_str() );
-}
+ }
void
MingwModuleHandler::GenerateObjectFileTargets ( const IfableData& data )
&module.linkerFlags,
used_defs );
+ /* LD automatically exports all symbols by default if -shared is specified. Prevent it from doing
+ this by adding the option -exclude-all-symbols (available since Binutils 20091017). */
+ // FIXME: Should only be applied for -shared modules, when there's a smart way to check for them.
+ if ( ModuleHandlerInformations[module.type].DefaultHost == HostFalse && !module.importLibrary )
+ fprintf ( fMakefile, "%s_LDFLAGS+=$(LDFLAG_EXCLUDE_ALL_SYMBOLS)\n", module.name.c_str() );
+
fprintf ( fMakefile, "\n\n" );
}
const FileLocation* ar_target = GenerateArchiveTarget ();
if ( ar_target )
- delete ar_target;
+ delete ar_target;
}
void
MingwKernelModuleHandler::GenerateKernelModuleTarget ()
{
- GenerateRules ();
+ GenerateRules ();
GenerateLinkerCommand ();
-}
+ }
MingwKernelModeDLLModuleHandler::MingwKernelModeDLLModuleHandler (
void
MingwKernelModeDLLModuleHandler::GenerateKernelModeDLLModuleTarget ()
{
- GenerateRules ();
+ GenerateRules ();
GenerateLinkerCommand ();
-}
+ }
MingwNativeDLLModuleHandler::MingwNativeDLLModuleHandler (
void
MingwNativeDLLModuleHandler::GenerateNativeDLLModuleTarget ()
{
- GenerateRules ();
+ GenerateRules ();
GenerateLinkerCommand ();
-}
+ }
MingwNativeCUIModuleHandler::MingwNativeCUIModuleHandler (
void
MingwNativeCUIModuleHandler::GenerateNativeCUIModuleTarget ()
{
- GenerateRules ();
+ GenerateRules ();
GenerateLinkerCommand ();
-}
+ }
MingwWin32DLLModuleHandler::MingwWin32DLLModuleHandler (
void
MingwWin32DLLModuleHandler::GenerateWin32DLLModuleTarget ()
{
- GenerateRules ();
+ GenerateRules ();
GenerateLinkerCommand ();
-}
+ }
void
void
MingwWin32OCXModuleHandler::GenerateWin32OCXModuleTarget ()
{
- GenerateRules ();
+ GenerateRules ();
GenerateLinkerCommand ();
-}
+ }
MingwWin32CUIModuleHandler::MingwWin32CUIModuleHandler (
void
MingwWin32CUIModuleHandler::GenerateWin32CUIModuleTarget ()
{
- GenerateRules ();
+ GenerateRules ();
GenerateLinkerCommand ();
-}
+ }
MingwWin32GUIModuleHandler::MingwWin32GUIModuleHandler (
void
MingwWin32GUIModuleHandler::GenerateWin32GUIModuleTarget ()
{
- GenerateRules ();
+ GenerateRules ();
GenerateLinkerCommand ();
-}
+ }
MingwBootLoaderModuleHandler::MingwBootLoaderModuleHandler (
const FileLocation *isoboot = bootModule->output;
// prepare reactos.dff and reactos.inf
- FileLocation reactosDff ( SourceDirectory,
- "boot" + sSep + "bootdata" + sSep + "packages",
+ FileLocation reactosDff ( IntermediateDirectory,
+ "",
"reactos.dff" );
FileLocation reactosInf ( bootcdReactos.directory,
bootcdReactos.relative_path,
void
MingwTestModuleHandler::GenerateTestModuleTarget ()
{
- GenerateRules ();
+ GenerateRules ();
GenerateLinkerCommand ();
-}
+ }
MingwAliasModuleHandler::MingwAliasModuleHandler (