Author: hpoussin
Date: Sun Jun 29 07:47:22 2008
New Revision: 34187
URL:
http://svn.reactos.org/svn/reactos?rev=34187&view=rev
Log:
Link C++ programs against target libraries, not host ones
Remove most of <linkerflag> usage
Modified:
trunk/reactos/base/applications/games/solitaire/solitaire.rbuild
trunk/reactos/base/setup/usetup/usetup.rbuild
trunk/reactos/base/shell/explorer/explorer.rbuild
trunk/reactos/base/system/smss/smss.rbuild
trunk/reactos/dll/3rdparty/mesa32/mesa32.rbuild
trunk/reactos/dll/ntdll/ntdll.rbuild
trunk/reactos/dll/win32/cfgmgr32/cfgmgr32.rbuild
trunk/reactos/dll/win32/crtdll/crtdll.rbuild
trunk/reactos/dll/win32/gdi32/gdi32.rbuild
trunk/reactos/dll/win32/kernel32/kernel32.rbuild
trunk/reactos/dll/win32/lpk/lpk.rbuild
trunk/reactos/dll/win32/lsasrv/lsasrv.rbuild
trunk/reactos/dll/win32/msvcrt/msvcrt.rbuild
trunk/reactos/dll/win32/samsrv/samsrv.rbuild
trunk/reactos/dll/win32/user32/user32.rbuild
trunk/reactos/drivers/filesystems/ext2/ext2.rbuild
trunk/reactos/drivers/filesystems/fastfat/vfatfs.rbuild
trunk/reactos/drivers/storage/class/disk/disk.rbuild
trunk/reactos/drivers/storage/class/ramdisk/ramdisk.rbuild
trunk/reactos/drivers/storage/ide/uniata/uniata.rbuild
trunk/reactos/drivers/wdm/audio/drivers/mpu401/mpu401.rbuild
trunk/reactos/lib/3rdparty/bzip2/bzip2.rbuild
trunk/reactos/ntoskrnl/ntoskrnl-generic.rbuild
trunk/reactos/tools/rbuild/backend/mingw/mingw.cpp
trunk/reactos/tools/rbuild/backend/mingw/modulehandler.cpp
trunk/reactos/tools/rbuild/backend/mingw/modulehandler.h
Modified: trunk/reactos/base/applications/games/solitaire/solitaire.rbuild
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/games/so…
==============================================================================
--- trunk/reactos/base/applications/games/solitaire/solitaire.rbuild [iso-8859-1]
(original)
+++ trunk/reactos/base/applications/games/solitaire/solitaire.rbuild [iso-8859-1] Sun Jun
29 07:47:22 2008
@@ -3,9 +3,9 @@
<module name="sol" type="win32gui"
installbase="system32" installname="sol.exe" unicode="no"
allowwarnings="true">
<include base="sol">.</include>
<include base="sol">cardlib</include>
- <linkerflag>-lstdc++</linkerflag>
<define name="_WIN32_IE">0x0501</define>
<define name="_WIN32_WINNT">0x0501</define>
+ <library>advapi32</library>
<library>kernel32</library>
<library>user32</library>
<library>gdi32</library>
Modified: trunk/reactos/base/setup/usetup/usetup.rbuild
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/setup/usetup/usetup.r…
==============================================================================
--- trunk/reactos/base/setup/usetup/usetup.rbuild [iso-8859-1] (original)
+++ trunk/reactos/base/setup/usetup/usetup.rbuild [iso-8859-1] Sun Jun 29 07:47:22 2008
@@ -9,7 +9,6 @@
<define name="_DISABLE_TIDENTS" />
<define name="_WIN32_WINNT">0x0502</define>
<define name="__NO_CTYPE_INLINES" />
- <linkerflag>-lgcc</linkerflag>
<library>zlib</library>
<library>inflib</library>
<library>ext2lib</library>
Modified: trunk/reactos/base/shell/explorer/explorer.rbuild
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/shell/explorer/explor…
==============================================================================
--- trunk/reactos/base/shell/explorer/explorer.rbuild [iso-8859-1] (original)
+++ trunk/reactos/base/shell/explorer/explorer.rbuild [iso-8859-1] Sun Jun 29 07:47:22
2008
@@ -1,16 +1,15 @@
<?xml version="1.0"?>
<!DOCTYPE group SYSTEM "../../../tools/rbuild/project.dtd">
<group
xmlns:xi="http://www.w3.org/2001/XInclude">
-<module name="explorer" type="win32gui"
installname="explorer.exe" allowwarnings="true">
- <linkerflag>-fexceptions</linkerflag>
+<module name="explorer" type="win32gui"
installname="explorer.exe" allowwarnings="true"
unicode="yes">
<compilerflag compiler="cpp">-Wno-non-virtual-dtor</compilerflag>
<include base="explorer">.</include>
- <define name="UNICODE" />
<define name="WIN32" />
<define name="_WIN32_IE">0x0600</define>
<define name="_WIN32_WINNT">0x0501</define>
<define name="WINVER">0x0500</define>
<define name="__WINDRES__" />
+ <library>advapi32</library>
<library>kernel32</library>
<library>gdi32</library>
<library>user32</library>
Modified: trunk/reactos/base/system/smss/smss.rbuild
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/system/smss/smss.rbui…
==============================================================================
--- trunk/reactos/base/system/smss/smss.rbuild [iso-8859-1] (original)
+++ trunk/reactos/base/system/smss/smss.rbuild [iso-8859-1] Sun Jun 29 07:47:22 2008
@@ -7,7 +7,6 @@
<library>nt</library>
<library>smlib</library>
<library>ntdll</library>
- <linkerflag>-lgcc</linkerflag>
<pch>smss.h</pch>
<compilationunit name="unit.c">
<file>client.c</file>
Modified: trunk/reactos/dll/3rdparty/mesa32/mesa32.rbuild
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/3rdparty/mesa32/mesa32…
==============================================================================
--- trunk/reactos/dll/3rdparty/mesa32/mesa32.rbuild [iso-8859-1] (original)
+++ trunk/reactos/dll/3rdparty/mesa32/mesa32.rbuild [iso-8859-1] Sun Jun 29 07:47:22 2008
@@ -2,7 +2,6 @@
<!DOCTYPE module SYSTEM "../../../tools/rbuild/project.dtd">
<module name="mesa32" type="win32dll" entrypoint="0"
baseaddress="${BASEADDRESS_MESA32}" installbase="system32"
installname="mesa32.dll" allowwarnings="true">
<importlibrary definition="src/drivers/windows/icd/mesa.def" />
- <linkerflag>-Wl,--enable-stdcall-fixup</linkerflag>
<library>ntdll</library>
<library>kernel32</library>
<library>msvcrt</library>
Modified: trunk/reactos/dll/ntdll/ntdll.rbuild
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/ntdll/ntdll.rbuild?rev…
==============================================================================
--- trunk/reactos/dll/ntdll/ntdll.rbuild [iso-8859-1] (original)
+++ trunk/reactos/dll/ntdll/ntdll.rbuild [iso-8859-1] Sun Jun 29 07:47:22 2008
@@ -16,9 +16,6 @@
<library>ntdllsys</library>
<library>libcntpr</library>
<library>pseh</library>
- <linkerflag>-lgcc</linkerflag>
- <linkerflag>-nostdlib</linkerflag>
- <linkerflag>-nostartfiles</linkerflag>
<dependency>ntstatus</dependency>
<directory name="csr">
<file>api.c</file>
Modified: trunk/reactos/dll/win32/cfgmgr32/cfgmgr32.rbuild
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/cfgmgr32/cfgmgr3…
==============================================================================
--- trunk/reactos/dll/win32/cfgmgr32/cfgmgr32.rbuild [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/cfgmgr32/cfgmgr32.rbuild [iso-8859-1] Sun Jun 29 07:47:22
2008
@@ -1,9 +1,6 @@
<?xml version="1.0"?>
<!DOCTYPE module SYSTEM "../../../tools/rbuild/project.dtd">
<module name="cfgmgr32" type="win32dll"
baseaddress="${BASEADDRESS_CFGMGR32}" entrypoint="0"
installbase="system32" installname="cfgmgr32.dll">
- <linkerflag>-nostartfiles</linkerflag>
- <linkerflag>-nostdlib</linkerflag>
- <linkerflag>-lgcc</linkerflag>
<importlibrary definition="cfgmgr32.def" />
<file>cfgmgr32.rc</file>
</module>
Modified: trunk/reactos/dll/win32/crtdll/crtdll.rbuild
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/crtdll/crtdll.rb…
==============================================================================
--- trunk/reactos/dll/win32/crtdll/crtdll.rbuild [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/crtdll/crtdll.rbuild [iso-8859-1] Sun Jun 29 07:47:22 2008
@@ -1,6 +1,4 @@
<module name="crtdll" type="win32dll"
baseaddress="${BASEADDRESS_CRTDLL}" mangledsymbols="true"
installbase="system32" installname="crtdll.dll">
- <linkerflag>-nostartfiles</linkerflag>
- <linkerflag>-lgcc</linkerflag>
<importlibrary definition="crtdll.def" />
<include base="crtdll">.</include>
<include base="crt">include</include>
Modified: trunk/reactos/dll/win32/gdi32/gdi32.rbuild
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/gdi32/gdi32.rbui…
==============================================================================
--- trunk/reactos/dll/win32/gdi32/gdi32.rbuild [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/gdi32/gdi32.rbuild [iso-8859-1] Sun Jun 29 07:47:22 2008
@@ -50,8 +50,5 @@
<file>utils.c</file>
<file>path.c</file>
</directory>
- <linkerflag>-lgcc</linkerflag>
- <linkerflag>-nostartfiles</linkerflag>
- <linkerflag>-nostdlib</linkerflag>
<file>gdi32.rc</file>
</module>
Modified: trunk/reactos/dll/win32/kernel32/kernel32.rbuild
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/kernel32/kernel3…
==============================================================================
--- trunk/reactos/dll/win32/kernel32/kernel32.rbuild [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/kernel32/kernel32.rbuild [iso-8859-1] Sun Jun 29 07:47:22
2008
@@ -131,9 +131,6 @@
<library>wine</library>
<library>pseh</library>
<library>ntdll</library>
- <linkerflag>-lgcc</linkerflag>
- <linkerflag>-nostartfiles</linkerflag>
- <linkerflag>-nostdlib</linkerflag>
<file>kernel32.rc</file>
</module>
</group>
Modified: trunk/reactos/dll/win32/lpk/lpk.rbuild
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/lpk/lpk.rbuild?r…
==============================================================================
--- trunk/reactos/dll/win32/lpk/lpk.rbuild [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/lpk/lpk.rbuild [iso-8859-1] Sun Jun 29 07:47:22 2008
@@ -13,8 +13,5 @@
<file>dllmain.c</file>
<file>stub.c</file>
- <linkerflag>-lgcc</linkerflag>
- <linkerflag>-nostartfiles</linkerflag>
- <linkerflag>-nostdlib</linkerflag>
<file>lpk.rc</file>
</module>
Modified: trunk/reactos/dll/win32/lsasrv/lsasrv.rbuild
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/lsasrv/lsasrv.rb…
==============================================================================
--- trunk/reactos/dll/win32/lsasrv/lsasrv.rbuild [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/lsasrv/lsasrv.rbuild [iso-8859-1] Sun Jun 29 07:47:22 2008
@@ -4,8 +4,6 @@
<include base="lsa_server">.</include>
<define name="WINVER">0x600</define>
<define name="_WIN32_WINNT">0x0600</define>
- <linkerflag>-nostartfiles</linkerflag>
- <linkerflag>-nostdlib</linkerflag>
<library>lsa_server</library>
<library>ntdll</library>
<library>kernel32</library>
Modified: trunk/reactos/dll/win32/msvcrt/msvcrt.rbuild
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/msvcrt/msvcrt.rb…
==============================================================================
--- trunk/reactos/dll/win32/msvcrt/msvcrt.rbuild [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/msvcrt/msvcrt.rbuild [iso-8859-1] Sun Jun 29 07:47:22 2008
@@ -1,8 +1,4 @@
<module name="msvcrt" type="win32dll"
baseaddress="${BASEADDRESS_MSVCRT}" mangledsymbols="true"
installbase="system32" installname="msvcrt.dll">
- <linkerflag>-nostartfiles</linkerflag>
- <linkerflag>--enable-stdcall-fixup</linkerflag>
- <linkerflag>-nostdlib</linkerflag>
- <linkerflag>-lgcc</linkerflag>
<importlibrary definition="msvcrt.def" />
<include base="msvcrt">.</include>
<include base="crt">include</include>
Modified: trunk/reactos/dll/win32/samsrv/samsrv.rbuild
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/samsrv/samsrv.rb…
==============================================================================
--- trunk/reactos/dll/win32/samsrv/samsrv.rbuild [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/samsrv/samsrv.rbuild [iso-8859-1] Sun Jun 29 07:47:22 2008
@@ -3,8 +3,6 @@
<module name="samsrv" type="win32dll"
baseaddress="${BASEADDRESS_SAMSRV}" entrypoint="0"
installbase="system32" installname="samsrv.dll"
unicode="yes">
<importlibrary definition="samsrv.def" />
<include base="samsrv">.</include>
- <linkerflag>-nostartfiles</linkerflag>
- <linkerflag>-nostdlib</linkerflag>
<library>ntdll</library>
<library>kernel32</library>
<file>samsrv.c</file>
Modified: trunk/reactos/dll/win32/user32/user32.rbuild
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/user32/user32.rb…
==============================================================================
--- trunk/reactos/dll/win32/user32/user32.rbuild [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/user32/user32.rbuild [iso-8859-1] Sun Jun 29 07:47:22 2008
@@ -74,8 +74,5 @@
<file>window.c</file>
<file>winpos.c</file>
</directory>
- <linkerflag>-lgcc</linkerflag>
- <linkerflag>-nostartfiles</linkerflag>
- <linkerflag>-nostdlib</linkerflag>
<file>user32.rc</file>
</module>
Modified: trunk/reactos/drivers/filesystems/ext2/ext2.rbuild
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/filesystems/ext2/e…
==============================================================================
--- trunk/reactos/drivers/filesystems/ext2/ext2.rbuild [iso-8859-1] (original)
+++ trunk/reactos/drivers/filesystems/ext2/ext2.rbuild [iso-8859-1] Sun Jun 29 07:47:22
2008
@@ -3,7 +3,6 @@
<module name="ext2fs" type="kernelmodedriver"
installbase="system32/drivers" installname="ext2.sys"
allowwarnings="true">
<bootstrap installbase="$(CDOUTPUT)" />
<include base="ext2fs">inc</include>
- <linkerflag>-lgcc</linkerflag>
<library>ntoskrnl</library>
<library>hal</library>
<directory name="src">
Modified: trunk/reactos/drivers/filesystems/fastfat/vfatfs.rbuild
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/filesystems/fastfa…
==============================================================================
--- trunk/reactos/drivers/filesystems/fastfat/vfatfs.rbuild [iso-8859-1] (original)
+++ trunk/reactos/drivers/filesystems/fastfat/vfatfs.rbuild [iso-8859-1] Sun Jun 29
07:47:22 2008
@@ -3,7 +3,6 @@
<module name="fastfat" type="kernelmodedriver"
installbase="system32/drivers" installname="fastfat.sys">
<bootstrap installbase="$(CDOUTPUT)" />
<include base="fastfat">.</include>
- <linkerflag>-lgcc</linkerflag>
<library>ntoskrnl</library>
<library>hal</library>
<file>blockdev.c</file>
Modified: trunk/reactos/drivers/storage/class/disk/disk.rbuild
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/storage/class/disk…
==============================================================================
--- trunk/reactos/drivers/storage/class/disk/disk.rbuild [iso-8859-1] (original)
+++ trunk/reactos/drivers/storage/class/disk/disk.rbuild [iso-8859-1] Sun Jun 29 07:47:22
2008
@@ -2,7 +2,6 @@
<!DOCTYPE module SYSTEM "../../../../tools/rbuild/project.dtd">
<module name="disk" type="kernelmodedriver"
installbase="system32/drivers" installname="disk.sys">
<bootstrap installbase="$(CDOUTPUT)" />
- <linkerflag>-lgcc</linkerflag>
<library>ntoskrnl</library>
<library>hal</library>
<library>class2</library>
Modified: trunk/reactos/drivers/storage/class/ramdisk/ramdisk.rbuild
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/storage/class/ramd…
==============================================================================
--- trunk/reactos/drivers/storage/class/ramdisk/ramdisk.rbuild [iso-8859-1] (original)
+++ trunk/reactos/drivers/storage/class/ramdisk/ramdisk.rbuild [iso-8859-1] Sun Jun 29
07:47:22 2008
@@ -2,7 +2,6 @@
<!DOCTYPE module SYSTEM "../../../../tools/rbuild/project.dtd">
<module name="ramdisk" type="kernelmodedriver"
installbase="system32/drivers" installname="ramdisk.sys">
<bootstrap installbase="$(CDOUTPUT)" />
- <linkerflag>-lgcc</linkerflag>
<library>ntoskrnl</library>
<library>hal</library>
<library>class2</library>
Modified: trunk/reactos/drivers/storage/ide/uniata/uniata.rbuild
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/storage/ide/uniata…
==============================================================================
--- trunk/reactos/drivers/storage/ide/uniata/uniata.rbuild [iso-8859-1] (original)
+++ trunk/reactos/drivers/storage/ide/uniata/uniata.rbuild [iso-8859-1] Sun Jun 29
07:47:22 2008
@@ -20,6 +20,4 @@
<file>ros_glue.cpp</file>
<file>ros_glue_asm.s</file>
</directory>
-
- <linkerflag>-lgcc</linkerflag>
</module>
Modified: trunk/reactos/drivers/wdm/audio/drivers/mpu401/mpu401.rbuild
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/wdm/audio/drivers/…
==============================================================================
--- trunk/reactos/drivers/wdm/audio/drivers/mpu401/mpu401.rbuild [iso-8859-1] (original)
+++ trunk/reactos/drivers/wdm/audio/drivers/mpu401/mpu401.rbuild [iso-8859-1] Sun Jun 29
07:47:22 2008
@@ -9,7 +9,6 @@
-->
<module name="mpu401" type="kernelmodedriver"
installbase="system32/drivers" installname="mpu401.sys"
allowwarnings="true" entrypoint="DriverEntry">
- <linkerflag>-Wl,--entry,_DriverEntry@8</linkerflag>
<include base="mpu401">.</include>
<include base="mpu401">..</include>
<library>ntoskrnl</library>
Modified: trunk/reactos/lib/3rdparty/bzip2/bzip2.rbuild
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/3rdparty/bzip2/bzip2.r…
==============================================================================
--- trunk/reactos/lib/3rdparty/bzip2/bzip2.rbuild [iso-8859-1] (original)
+++ trunk/reactos/lib/3rdparty/bzip2/bzip2.rbuild [iso-8859-1] Sun Jun 29 07:47:22 2008
@@ -4,7 +4,6 @@
<importlibrary definition="unbzip2.def" />
<define name="BZ_NO_STDIO" />
<define name="BZ_DECOMPRESS_ONLY" />
- <linkerflag>-lgcc</linkerflag>
<library>ntoskrnl</library>
<library>hal</library>
<file>bzlib.c</file>
Modified: trunk/reactos/ntoskrnl/ntoskrnl-generic.rbuild
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/ntoskrnl-generic.…
==============================================================================
--- trunk/reactos/ntoskrnl/ntoskrnl-generic.rbuild [iso-8859-1] (original)
+++ trunk/reactos/ntoskrnl/ntoskrnl-generic.rbuild [iso-8859-1] Sun Jun 29 07:47:22 2008
@@ -458,8 +458,5 @@
<file>wmi.c</file>
</directory>
<file>ntoskrnl.rc</file>
- <linkerflag>-nostartfiles</linkerflag>
- <linkerflag>-nostdlib</linkerflag>
- <linkerflag>-lgcc</linkerflag>
<linkerscript>ntoskrnl_$(ARCH).lnk</linkerscript>
</group>
Modified: trunk/reactos/tools/rbuild/backend/mingw/mingw.cpp
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/tools/rbuild/backend/mingw…
==============================================================================
--- trunk/reactos/tools/rbuild/backend/mingw/mingw.cpp [iso-8859-1] (original)
+++ trunk/reactos/tools/rbuild/backend/mingw/mingw.cpp [iso-8859-1] Sun Jun 29 07:47:22
2008
@@ -526,8 +526,9 @@
fprintf ( fMakefile, "PROJECT_RCFLAGS := $(PROJECT_CFLAGS)
$(PROJECT_CDEFINES)\n" );
fprintf ( fMakefile, "PROJECT_WIDLFLAGS := $(PROJECT_CFLAGS)
$(PROJECT_CDEFINES)\n" );
- fprintf ( fMakefile, "PROJECT_LFLAGS := %s\n",
+ fprintf ( fMakefile, "PROJECT_LFLAGS := \"$(shell ${TARGET_CC}
-print-libgcc-file-name)\" %s\n",
GenerateProjectLFLAGS ().c_str () );
+ fprintf ( fMakefile, "PROJECT_LPPFLAGS := \"$(shell ${TARGET_CPP}
-print-file-name=libstdc++.a)\" \"$(shell ${TARGET_CPP}
-print-file-name=libgcc.a)\" \"$(shell ${TARGET_CPP}
-print-file-name=libmingw32.a)\" \"$(shell ${TARGET_CPP}
-print-file-name=libmingwex.a)\"\n" );
fprintf ( fMakefile, "PROJECT_CFLAGS += -Wall\n" );
fprintf ( fMakefile, "ifneq ($(OARCH),)\n" );
fprintf ( fMakefile, "PROJECT_CFLAGS += -march=$(OARCH)\n" );
Modified: trunk/reactos/tools/rbuild/backend/mingw/modulehandler.cpp
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/tools/rbuild/backend/mingw…
==============================================================================
--- trunk/reactos/tools/rbuild/backend/mingw/modulehandler.cpp [iso-8859-1] (original)
+++ trunk/reactos/tools/rbuild/backend/mingw/modulehandler.cpp [iso-8859-1] Sun Jun 29
07:47:22 2008
@@ -743,10 +743,9 @@
size_t i;
bool generateAssignment;
+ generateAssignment = (use_pch && module.pch != NULL ) || data.includes.size ()
> 0 || data.defines.size () > 0;
if ( generatingCompilerMacro )
- generateAssignment = (use_pch && module.pch != NULL ) || data.includes.size ()
> 0 || data.defines.size () > 0 || data.compilerFlags.size () > 0;
- else
- generateAssignment = (use_pch && module.pch != NULL ) || data.includes.size ()
> 0 || data.defines.size () > 0;
+ generateAssignment |= data.compilerFlags.size () > 0;
if ( generateAssignment )
{
fprintf ( fMakefile,
@@ -1581,7 +1580,8 @@
{
const FileLocation *target_file = GetTargetFilename ( module, NULL );
const FileLocation *definitionFilename = GetDefinitionFilename ();
- string linker = module.cplusplus ? "${gpp}" : "${gcc}";
+ const FileLocation temp_obj ( TemporaryDirectory, "", module.name +
".temp.ld" );
+ string linker = "${ld}";
string objectsMacro = GetObjectsMacro ( module );
string libsMacro = GetLibsMacro ();
@@ -1590,7 +1590,7 @@
string linkerScriptArgument;
if ( module.linkerScript != NULL )
- linkerScriptArgument = ssprintf ( " -Wl,-T,%s", backend->GetFullName (
*module.linkerScript->file ).c_str () );
+ linkerScriptArgument = ssprintf ( " -T=%s", backend->GetFullName (
*module.linkerScript->file ).c_str () );
else
linkerScriptArgument = "";
@@ -1603,17 +1603,23 @@
fprintf ( fMakefile, "\t$(ECHO_LD)\n" );
string targetName ( module.output->name );
+ fprintf ( fMakefile, "\t@echo $(subst $(SEP),/,%s) > %s\n",
+ objectsMacro.c_str (),
+ backend->GetFullName ( temp_obj ).c_str () );
+ CLEAN_FILE ( temp_obj );
+
if ( !module.IsDLL () )
{
fprintf ( fMakefile,
- "\t%s %s%s -o %s %s %s %s\n",
+ "\t%s %s%s @%s %s%s %s -o %s\n",
linker.c_str (),
linkerParameters.c_str (),
linkerScriptArgument.c_str (),
- target_macro.c_str (),
- objectsMacro.c_str (),
+ backend->GetFullName ( temp_obj ).c_str (),
+ module.cplusplus ? "$(PROJECT_LPPFLAGS) " : "",
libsMacro.c_str (),
- GetLinkerMacro ().c_str () );
+ GetLinkerMacro ().c_str (),
+ target_macro.c_str () );
}
else if ( module.HasImportLibrary () )
{
@@ -1631,15 +1637,16 @@
module.underscoreSymbols ? " --add-underscore" : "" );
fprintf ( fMakefile,
- "\t%s %s%s %s -o %s %s %s %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 (),
- target_macro.c_str (),
- objectsMacro.c_str (),
+ backend->GetFullName ( temp_obj ).c_str (),
+ module.cplusplus ? "$(PROJECT_LPPFLAGS) " : "",
libsMacro.c_str (),
- GetLinkerMacro ().c_str () );
+ GetLinkerMacro ().c_str (),
+ target_macro.c_str () );
fprintf ( fMakefile,
"\t$(Q)$(PEFIXUP_TARGET) %s -exports%s\n",
@@ -1659,14 +1666,15 @@
//printf ( "%s will have all its functions exported\n",
// module.target->name.c_str () );
fprintf ( fMakefile,
- "\t%s %s%s -o %s %s %s %s\n",
+ "\t%s %s%s @%s %s%s %s -o %s\n",
linker.c_str (),
linkerParameters.c_str (),
linkerScriptArgument.c_str (),
- target_macro.c_str (),
- objectsMacro.c_str (),
+ backend->GetFullName ( temp_obj ).c_str (),
+ module.cplusplus ? "$(PROJECT_LPPFLAGS) " : "",
libsMacro.c_str (),
- GetLinkerMacro ().c_str () );
+ GetLinkerMacro ().c_str (),
+ target_macro.c_str () );
}
GenerateBuildMapCode ();
@@ -2529,7 +2537,7 @@
string dependencies = linkDepsMacro + " " + objectsMacro;
- string linkerParameters = ssprintf ( "-Wl,--subsystem,native -Wl,--entry,%s
-Wl,--image-base,%s",
+ string linkerParameters = ssprintf ( "-subsystem=native -entry=%s
-image-base=%s",
module.GetEntryPoint(!(Environment::GetArch() ==
"arm")).c_str (),
module.baseaddress.c_str () );
@@ -2652,7 +2660,7 @@
string dependencies = linkDepsMacro + " " + objectsMacro;
- string linkerParameters = ssprintf ( "-Wl,--subsystem,native -Wl,--entry,%s
-Wl,--image-base,%s -Wl,--file-alignment,0x1000 -Wl,--section-alignment,0x1000
-nostartfiles -shared",
+ string linkerParameters = ssprintf ( "-subsystem=native -entry=%s -image-base=%s
-file-alignment=0x1000 -section-alignment=0x1000 -shared",
module.GetEntryPoint(true).c_str (),
module.baseaddress.c_str () );
GenerateLinkerCommand ( dependencies,
@@ -2701,7 +2709,7 @@
string dependencies = linkDepsMacro + " " + objectsMacro;
- string linkerParameters = ssprintf ( "-Wl,--subsystem,native -Wl,--entry,%s
-Wl,--image-base,%s -Wl,--file-alignment,0x1000 -Wl,--section-alignment,0x1000
-nostartfiles -shared",
+ string linkerParameters = ssprintf ( "-subsystem=native -entry=%s -image-base=%s
-file-alignment=0x1000 -section-alignment=0x1000 -shared",
module.GetEntryPoint(true).c_str (),
module.baseaddress.c_str () );
GenerateLinkerCommand ( dependencies,
@@ -2749,7 +2757,7 @@
string dependencies = linkDepsMacro + " " + objectsMacro;
- string linkerParameters = ssprintf ( "-Wl,--subsystem,native -Wl,--entry,%s
-Wl,--image-base,%s -Wl,--file-alignment,0x1000 -Wl,--section-alignment,0x1000
-nostartfiles -nostdlib -shared",
+ string linkerParameters = ssprintf ( "-subsystem=native -entry=%s -image-base=%s
-file-alignment=0x1000 -section-alignment=0x1000 -shared",
module.GetEntryPoint(true).c_str (),
module.baseaddress.c_str () );
GenerateLinkerCommand ( dependencies,
@@ -2797,7 +2805,7 @@
string dependencies = linkDepsMacro + " " + objectsMacro;
- string linkerParameters = ssprintf ( "-Wl,--subsystem,native -Wl,--entry,%s
-Wl,--image-base,%s -Wl,--file-alignment,0x1000 -Wl,--section-alignment,0x1000
-nostartfiles -nostdlib",
+ string linkerParameters = ssprintf ( "-subsystem=native -entry=%s -image-base=%s
-file-alignment=0x1000 -section-alignment=0x1000",
module.GetEntryPoint(true).c_str (),
module.baseaddress.c_str () );
GenerateLinkerCommand ( dependencies,
@@ -2922,7 +2930,7 @@
string dependencies = linkDepsMacro + " " + objectsMacro;
- string linkerParameters = ssprintf ( "-Wl,--subsystem,console -Wl,--entry,%s
-Wl,--image-base,%s -Wl,--file-alignment,0x1000 -Wl,--section-alignment,0x1000
-shared",
+ string linkerParameters = ssprintf ( "-subsystem=console -entry=%s -image-base=%s
-file-alignment=0x1000 -section-alignment=0x1000 -shared",
module.GetEntryPoint(true).c_str (),
module.baseaddress.c_str () );
GenerateLinkerCommand ( dependencies,
@@ -2964,7 +2972,7 @@
string dependencies = linkDepsMacro + " " + objectsMacro;
- string linkerParameters = ssprintf ( "-Wl,--subsystem,console -Wl,--entry,%s
-Wl,--image-base,%s -Wl,--file-alignment,0x1000 -Wl,--section-alignment,0x1000
-shared",
+ string linkerParameters = ssprintf ( "-subsystem=console -entry=%s -image-base=%s
-file-alignment=0x1000 -section-alignment=0x1000 -shared",
module.GetEntryPoint(true).c_str (),
module.baseaddress.c_str () );
GenerateLinkerCommand ( dependencies,
@@ -3013,7 +3021,7 @@
string dependencies = linkDepsMacro + " " + objectsMacro;
- string linkerParameters = ssprintf ( "-Wl,--subsystem,console -Wl,--entry,%s
-Wl,--image-base,%s -Wl,--file-alignment,0x1000 -Wl,--section-alignment,0x1000",
+ string linkerParameters = ssprintf ( "-subsystem=console -entry=%s -image-base=%s
-file-alignment=0x1000 -section-alignment=0x1000",
module.GetEntryPoint(true).c_str (),
module.baseaddress.c_str () );
GenerateLinkerCommand ( dependencies,
@@ -3062,7 +3070,7 @@
string dependencies = linkDepsMacro + " " + objectsMacro;
- string linkerParameters = ssprintf ( "-Wl,--subsystem,windows -Wl,--entry,%s
-Wl,--image-base,%s -Wl,--file-alignment,0x1000 -Wl,--section-alignment,0x1000",
+ string linkerParameters = ssprintf ( "-subsystem=windows -entry=%s -image-base=%s
-file-alignment=0x1000 -section-alignment=0x1000",
module.GetEntryPoint(true).c_str (),
module.baseaddress.c_str () );
GenerateLinkerCommand ( dependencies,
@@ -3684,7 +3692,7 @@
string dependencies = linkDepsMacro + " " + objectsMacro;
- string linkerParameters = ssprintf ( "-Wl,--subsystem,console -Wl,--entry,%s
-Wl,--image-base,%s -Wl,--file-alignment,0x1000 -Wl,--section-alignment,0x1000",
+ string linkerParameters = ssprintf ( "-subsystem=console -entry=%s -image-base=%s
-file-alignment=0x1000 -section-alignment=0x1000",
module.GetEntryPoint(true).c_str (),
module.baseaddress.c_str () );
GenerateLinkerCommand ( dependencies,
Modified: trunk/reactos/tools/rbuild/backend/mingw/modulehandler.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/tools/rbuild/backend/mingw…
==============================================================================
--- trunk/reactos/tools/rbuild/backend/mingw/modulehandler.h [iso-8859-1] (original)
+++ trunk/reactos/tools/rbuild/backend/mingw/modulehandler.h [iso-8859-1] Sun Jun 29
07:47:22 2008
@@ -250,7 +250,6 @@
MingwKernelModeDLLModuleHandler ( const Module& module );
virtual HostType DefaultHost() { return HostFalse; }
virtual void Process ();
- std::string TypeSpecificLinkerFlags() { return "-nostartfiles -nostdlib"; }
void AddImplicitLibraries ( Module& module );
private:
void GenerateKernelModeDLLModuleTarget ();
@@ -264,7 +263,6 @@
virtual HostType DefaultHost() { return HostFalse; }
virtual void Process ();
std::string TypeSpecificCFlags() { return "-D__NTDRIVER__"; }
- std::string TypeSpecificLinkerFlags() { return "-nostartfiles -nostdlib"; }
void AddImplicitLibraries ( Module& module );
private:
void GenerateKernelModeDriverModuleTarget ();
@@ -277,7 +275,6 @@
MingwNativeDLLModuleHandler ( const Module& module );
virtual HostType DefaultHost() { return HostFalse; }
virtual void Process ();
- std::string TypeSpecificLinkerFlags() { return "-nostartfiles -nostdlib"; }
void AddImplicitLibraries ( Module& module );
private:
void GenerateNativeDLLModuleTarget ();
@@ -291,7 +288,6 @@
virtual HostType DefaultHost() { return HostFalse; }
virtual void Process ();
std::string TypeSpecificCFlags() { return "-D__NTAPP__"; }
- std::string TypeSpecificLinkerFlags() { return "-nostartfiles -nostdlib"; }
void AddImplicitLibraries ( Module& module );
private:
void GenerateNativeCUIModuleTarget ();
@@ -304,7 +300,6 @@
MingwWin32DLLModuleHandler ( const Module& module );
virtual HostType DefaultHost() { return HostFalse; }
virtual void Process ();
- std::string TypeSpecificLinkerFlags() { return module.cplusplus ? "-nostartfiles
-lgcc" : "-nostartfiles -nostdlib -lgcc"; }
void AddImplicitLibraries ( Module& module );
private:
void GenerateWin32DLLModuleTarget ();
@@ -317,7 +312,6 @@
MingwWin32OCXModuleHandler ( const Module& module );
virtual HostType DefaultHost() { return HostFalse; }
virtual void Process ();
- std::string TypeSpecificLinkerFlags() { return module.cplusplus ? "-nostartfiles
-lgcc" : "-nostartfiles -nostdlib -lgcc"; }
void AddImplicitLibraries ( Module& module );
private:
void GenerateWin32OCXModuleTarget ();
@@ -330,7 +324,6 @@
MingwWin32CUIModuleHandler ( const Module& module );
virtual HostType DefaultHost() { return HostFalse; }
virtual void Process ();
- std::string TypeSpecificLinkerFlags() { return module.cplusplus ? "-nostartfiles
-lgcc" : "-nostartfiles -nostdlib -lgcc"; }
void AddImplicitLibraries ( Module& module );
private:
void GenerateWin32CUIModuleTarget ();
@@ -343,7 +336,6 @@
MingwWin32GUIModuleHandler ( const Module& module );
virtual HostType DefaultHost() { return HostFalse; }
virtual void Process ();
- std::string TypeSpecificLinkerFlags() { return module.cplusplus ? "-nostartfiles
-lgcc" : "-nostartfiles -nostdlib -lgcc"; }
void AddImplicitLibraries ( Module& module );
private:
void GenerateWin32GUIModuleTarget ();
@@ -431,7 +423,6 @@
MingwTestModuleHandler ( const Module& module );
virtual HostType DefaultHost() { return HostFalse; }
virtual void Process ();
- std::string TypeSpecificLinkerFlags() { return "-nostartfiles -nostdlib"; }
protected:
virtual void GetModuleSpecificCompilationUnits (
std::vector<CompilationUnit*>& compilationUnits );
private: