Well, you just removed the one thing ReactOS did different from NT and that I thought was really revolutionary and innovative, because it saves on compile time. It's funny, because I've been trying to sell this as a better approach to building RTL (It's built at least 4 times in the real NT tree, I think -- loader, user-mode tools/testing, kernel, user-mode).
Best regards, Alex Ionescu
On Wed, Oct 15, 2008 at 11:45 AM, hyperion@svn.reactos.org wrote:
Author: hyperion Date: Wed Oct 15 10:45:11 2008 New Revision: 36761
URL: http://svn.reactos.org/svn/reactos?rev=36761&view=rev Log: added lib/rtl/rtl-common.rbuild modified lib/rtl/rtl.rbuild Compile rtl twice, as rtl_umode and rtl_kmode. Allows conditional compilation of RTL (finally!), instead of necessitating hacks like RtlpGetMode() "rtl" module now a dummy static library for things like <include base="rtl">
modified boot/freeldr/freeldr/freeldr.rbuild modified boot/freeldr/freeldr/setupldr.rbuild modified ntoskrnl/ntoskrnl-generic.rbuild rtl -> rtl_kmode
modified dll/ntdll/ntdll.rbuild rtl -> rtl_umode
This commit dedicated to Fireball and Stefan100 (now get to work! >:3)
Added: trunk/reactos/lib/rtl/rtl-common.rbuild (with props) Modified: trunk/reactos/boot/freeldr/freeldr/freeldr.rbuild trunk/reactos/boot/freeldr/freeldr/setupldr.rbuild trunk/reactos/dll/ntdll/ntdll.rbuild trunk/reactos/lib/rtl/rtl.rbuild trunk/reactos/ntoskrnl/ntoskrnl-generic.rbuild
Modified: trunk/reactos/boot/freeldr/freeldr/freeldr.rbuild URL: http://svn.reactos.org/svn/reactos/trunk/reactos/boot/freeldr/freeldr/freeld... ============================================================================== --- trunk/reactos/boot/freeldr/freeldr/freeldr.rbuild [iso-8859-1] (original) +++ trunk/reactos/boot/freeldr/freeldr/freeldr.rbuild [iso-8859-1] Wed Oct 15 10:45:11 2008 @@ -11,7 +11,7 @@ <library>freeldr_main</library> <library>rossym</library> <library>cmlib</library>
<library>rtl</library>
<library>rtl_kmode</library> <library>libcntpr</library> <linkerflag>-static</linkerflag> <linkerflag>-lgcc</linkerflag>Modified: trunk/reactos/boot/freeldr/freeldr/setupldr.rbuild URL: http://svn.reactos.org/svn/reactos/trunk/reactos/boot/freeldr/freeldr/setupl... ============================================================================== --- trunk/reactos/boot/freeldr/freeldr/setupldr.rbuild [iso-8859-1] (original) +++ trunk/reactos/boot/freeldr/freeldr/setupldr.rbuild [iso-8859-1] Wed Oct 15 10:45:11 2008 @@ -9,7 +9,7 @@ <library>setupldr_main</library> <library>rossym</library> <library>cmlib</library>
<library>rtl</library>
<library>rtl_kmode</library> <library>libcntpr</library> <linkerflag>-nostartfiles</linkerflag> <linkerflag>-nostdlib</linkerflag>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] Wed Oct 15 10:45:11 2008 @@ -12,7 +12,7 @@ <define name="_WIN32_WINNT">0x0502</define> <define name="_NTOSKRNL_" /> <define name="__NO_CTYPE_INLINES" />
<library>rtl</library>
<library>rtl_umode</library> <library>ntdllsys</library> <library>libcntpr</library> <library>pseh</library>Added: trunk/reactos/lib/rtl/rtl-common.rbuild URL: http://svn.reactos.org/svn/reactos/trunk/reactos/lib/rtl/rtl-common.rbuild?r... ============================================================================== --- trunk/reactos/lib/rtl/rtl-common.rbuild (added) +++ trunk/reactos/lib/rtl/rtl-common.rbuild [iso-8859-1] Wed Oct 15 10:45:11 2008 @@ -1,0 +1,98 @@ +<?xml version="1.0"?>
+<include base="rtl">.</include> +<define name="_NTOSKRNL_" /> +<define name="__NO_CTYPE_INLINES" /> +<define name="NO_RTL_INLINES" /> +<define name="_NTSYSTEM_" /> +<define name="_NTDLLBUILD_" /> +<if property="ARCH" value="i386">
<directory name="i386"><file>debug_asm.S</file><file>except_asm.s</file><file>except.c</file><file>random_asm.S</file><file>rtlswap.S</file><file>rtlmem.s</file><file>res_asm.s</file><file>thread.c</file></directory>+</if> +<if property="ARCH" value="powerpc"> +<directory name="powerpc">
<file>debug.c</file><file>except.c</file><file>interlocked.c</file><file>rtlmem.s</file><file>rtlswap.s</file><file>thread.c</file>+</directory> +</if> +<if property="ARCH" value="arm">
<directory name="arm"><file>debug_asm.S</file></directory><file>mem.c</file><file>memgen.c</file>+</if> +<directory name="austin">
<file>avl.c</file><file>tree.c</file>+</directory>
+<file>access.c</file> +<file>acl.c</file> +<file>actctx.c</file> +<file>atom.c</file> +<file>bitmap.c</file> +<file>bootdata.c</file> +<file>compress.c</file> +<file>condvar.c</file> +<file>crc32.c</file> +<file>critical.c</file> +<file>dbgbuffer.c</file> +<file>debug.c</file> +<file>dos8dot3.c</file> +<file>encode.c</file> +<file>env.c</file> +<file>error.c</file> +<file>exception.c</file> +<file>generictable.c</file> +<file>handle.c</file> +<file>heap.c</file> +<file>image.c</file> +<file>interlck.c</file> +<file>message.c</file> +<file>largeint.c</file> +<file>luid.c</file> +<file>network.c</file> +<file>nls.c</file> +<file>path.c</file> +<file>ppb.c</file> +<file>process.c</file> +<file>propvar.c</file> +<file>qsort.c</file> +<file>random.c</file> +<file>rangelist.c</file> +<file>registry.c</file> +<file>res.c</file> +<file>resource.c</file> +<file>sd.c</file> +<file>security.c</file> +<file>slist.c</file> +<file>sid.c</file> +<file>sprintf.c</file> +<file>srw.c</file> +<file>swprintf.c</file> +<file>splaytree.c</file> +<file>thread.c</file> +<file>time.c</file> +<file>timezone.c</file> +<file>timerqueue.c</file> +<file>unicode.c</file> +<file>unicodeprefix.c</file> +<file>vectoreh.c</file> +<file>version.c</file> +<file>wait.c</file> +<file>workitem.c</file> +<pch>rtl.h</pch>
Propchange: trunk/reactos/lib/rtl/rtl-common.rbuild
svn:eol-style = native
Modified: trunk/reactos/lib/rtl/rtl.rbuild URL: http://svn.reactos.org/svn/reactos/trunk/reactos/lib/rtl/rtl.rbuild?rev=3676... ============================================================================== --- trunk/reactos/lib/rtl/rtl.rbuild [iso-8859-1] (original) +++ trunk/reactos/lib/rtl/rtl.rbuild [iso-8859-1] Wed Oct 15 10:45:11 2008 @@ -1,100 +1,15 @@
<?xml version="1.0"?>
<!DOCTYPE module SYSTEM "../../tools/rbuild/project.dtd">
-<module name="rtl" type="staticlibrary">
<define name="_NTOSKRNL_" /><define name="__NO_CTYPE_INLINES" /><define name="NO_RTL_INLINES" /><define name="_NTSYSTEM_" /><define name="_NTDLLBUILD_" /><include base="rtl">.</include><if property="ARCH" value="i386"><directory name="i386"><file>debug_asm.S</file><file>except_asm.s</file><file>except.c</file><file>random_asm.S</file><file>rtlswap.S</file><file>rtlmem.s</file><file>res_asm.s</file><file>thread.c</file></directory></if><if property="ARCH" value="powerpc"><directory name="powerpc"><file>debug.c</file><file>except.c</file><file>interlocked.c</file><file>rtlmem.s</file><file>rtlswap.s</file><file>thread.c</file></directory></if><if property="ARCH" value="arm"><directory name="arm"><file>debug_asm.S</file></directory><file>mem.c</file><file>memgen.c</file></if><directory name="austin"><file>avl.c</file><file>tree.c</file></directory><file>access.c</file><file>acl.c</file><file>actctx.c</file><file>atom.c</file><file>bitmap.c</file><file>bootdata.c</file><file>compress.c</file><file>condvar.c</file><file>crc32.c</file><file>critical.c</file><file>dbgbuffer.c</file><file>debug.c</file><file>dos8dot3.c</file><file>encode.c</file><file>env.c</file><file>error.c</file><file>exception.c</file><file>generictable.c</file><file>handle.c</file><file>heap.c</file><file>image.c</file><file>interlck.c</file><file>message.c</file><file>largeint.c</file><file>luid.c</file><file>network.c</file><file>nls.c</file><file>path.c</file><file>ppb.c</file><file>process.c</file><file>propvar.c</file><file>qsort.c</file><file>random.c</file><file>rangelist.c</file><file>registry.c</file><file>res.c</file><file>resource.c</file><file>sd.c</file><file>security.c</file><file>slist.c</file><file>sid.c</file><file>sprintf.c</file><file>srw.c</file><file>swprintf.c</file><file>splaytree.c</file><file>thread.c</file><file>time.c</file><file>timezone.c</file><file>timerqueue.c</file><file>unicode.c</file><file>unicodeprefix.c</file><file>vectoreh.c</file><file>version.c</file><file>wait.c</file><file>workitem.c</file><pch>rtl.h</pch>-</module> +<group xmlns:xi="http://www.w3.org/2001/XInclude">
<module name="rtl_umode" type="staticlibrary"><xi:include href="rtl-common.rbuild" /></module><module name="rtl_kmode" type="staticlibrary"><xi:include href="rtl-common.rbuild" /></module><!-- dummy module to enable <include base="rtl"> --><module name="rtl" type="staticlibrary" />+</group>
Modified: trunk/reactos/ntoskrnl/ntoskrnl-generic.rbuild URL: http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/ntoskrnl-generic.r... ============================================================================== --- trunk/reactos/ntoskrnl/ntoskrnl-generic.rbuild [iso-8859-1] (original) +++ trunk/reactos/ntoskrnl/ntoskrnl-generic.rbuild [iso-8859-1] Wed Oct 15 10:45:11 2008 @@ -26,7 +26,7 @@ <library>hal</library> <library>pseh</library> <library>cmlib</library>
<library>rtl</library>
<library>rtl_kmode</library> <library>rossym</library> <library>libcntpr</library> <library>kdcom</library>
I knew about this post-factum, so let's gather opinions.
Advantage: It's like NT does, less hacks, possible removal of libsupp stuff in ntoskrnl, freeldr, ntdll, etc (which I actually thought would be done in the same commit).
Disadvantage: To be proper, you need a bootloader RTL too, otherwise RTL will still contain "necessitating hacks" aka libsupp stuff. This is gonna make at least 3x time RTL compilation. (thankfully / sadly we don't test it directly).
WBR, Aleksey.
On Oct 15, 2008, at 10:02 PM, Alex Ionescu wrote:
Well, you just removed the one thing ReactOS did different from NT and that I thought was really revolutionary and innovative, because it saves on compile time. It's funny, because I've been trying to sell this as a better approach to building RTL (It's built at least 4 times in the real NT tree, I think -- loader, user-mode tools/testing, kernel, user-mode).
Best regards, Alex Ionescu
The stuff that could be done with compile time defines, seems to be used only in a few places (if CHECK_PAGED_CODE_RTL is not counted) I found the following files: atom.c, bootdata.c, debug.c, env.c, except.c, exception.c, heap.c, path.c, ppb.c, rangelist.c, registry.c, res.c, sid.c, thread.c, unicode.c That's 15 out of 57 files. IMO we should keep the rest in "rtl" and only move the parts that need conditional compilation.
Timo
Aleksey Bragin schrieb:
I knew about this post-factum, so let's gather opinions.
Advantage: It's like NT does, less hacks, possible removal of libsupp stuff in ntoskrnl, freeldr, ntdll, etc (which I actually thought would be done in the same commit).
Disadvantage: To be proper, you need a bootloader RTL too, otherwise RTL will still contain "necessitating hacks" aka libsupp stuff. This is gonna make at least 3x time RTL compilation. (thankfully / sadly we don't test it directly).
WBR, Aleksey.
On Oct 15, 2008, at 10:02 PM, Alex Ionescu wrote:
Well, you just removed the one thing ReactOS did different from NT and that I thought was really revolutionary and innovative, because it saves on compile time. It's funny, because I've been trying to sell this as a better approach to building RTL (It's built at least 4 times in the real NT tree, I think -- loader, user-mode tools/testing, kernel, user-mode).
Best regards, Alex Ionescu
Ros-dev mailing list Ros-dev@reactos.org http://www.reactos.org/mailman/listinfo/ros-dev
Alex Ionescu wrote:
Well, you just removed the one thing ReactOS did different from NT and that I thought was really revolutionary and innovative, because it saves on compile time
revolutionary, innovative and stupid. You get "PAGE" sections in ntdll for no good reason, really stupid function calls instead of conditional compilation, and gross hacks like locks being declared large enough to fit both a FAST_MUTEX and a RTL_CRITICAL_SECTION. A less "revolutionary" and "innovative" solution that I'd endorse would be to split RTL into several libraries, one of which containing all code that's independent from the mode. And you'd _still_ have to compile a separate version for host tools
KJK::Hyperion wrote:
A less "revolutionary" and "innovative" solution that I'd endorse would be to split RTL into several libraries, one of which containing all code that's independent from the mode.
Actually? scratch that, I despise the ReactOS approach of grouping code arbitrarily. Split RTL into as many libraries as necessary, and only compile several times those that depend from compile-time configuration. Maybe also a way to bundle several static libraries into a single rbuild module, so we can put an end to the proliferation of <library> entries to pull in dozens of "giblets"