Hello,
With the move to 4.6.0, please consider building with -flto=<number of cores that the build script detects>
Timo: This will enable Link Time Optimizations :D
-- Best regards, Alex Ionescu
On 2011-06-06, at 7:44 AM, akhaldi@svn.reactos.org wrote:
Author: akhaldi Date: Mon Jun 6 11:44:58 2011 New Revision: 52114
URL: http://svn.reactos.org/svn/reactos?rev=52114&view=rev Log: [CMAKE]
- Fix several modules to compile with the recent gcc versions.
- ReactOS now compiles with mingw-w64 gcc 4.6.0 and boots to shell.
- Dedicated to dreimer.
Modified: trunk/reactos/dll/win32/actxprxy/CMakeLists.txt trunk/reactos/dll/win32/kernel32/CMakeLists.txt trunk/reactos/dll/win32/lsasrv/CMakeLists.txt trunk/reactos/dll/win32/msports/CMakeLists.txt trunk/reactos/dll/win32/sti/CMakeLists.txt trunk/reactos/dll/win32/ufatx/CMakeLists.txt trunk/reactos/dll/win32/wlanapi/CMakeLists.txt trunk/reactos/lib/fslib/vfatxlib/CMakeLists.txt trunk/reactos/lib/pseh/CMakeLists.txt
Modified: trunk/reactos/dll/win32/actxprxy/CMakeLists.txt URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/actxprxy/CMakeLis... ============================================================================== --- trunk/reactos/dll/win32/actxprxy/CMakeLists.txt [iso-8859-1] (original) +++ trunk/reactos/dll/win32/actxprxy/CMakeLists.txt [iso-8859-1] Mon Jun 6 11:44:58 2011 @@ -44,6 +44,7 @@ rpcrt4 ole32 oleaut32
- msvcrt kernel32 ntdll)
Modified: trunk/reactos/dll/win32/kernel32/CMakeLists.txt URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/kernel32/CMakeLis... ============================================================================== --- trunk/reactos/dll/win32/kernel32/CMakeLists.txt [iso-8859-1] (original) +++ trunk/reactos/dll/win32/kernel32/CMakeLists.txt [iso-8859-1] Mon Jun 6 11:44:58 2011 @@ -114,7 +114,7 @@ set_entrypoint(kernel32 DllMain@12) set_image_base(kernel32 ${baseaddress_kernel32})
-target_link_libraries(kernel32 ${PSEH_LIB}) +target_link_libraries(kernel32 chkstk ${PSEH_LIB})
add_importlibs(kernel32 ntdll) add_pch(kernel32 k32.h)
Modified: trunk/reactos/dll/win32/lsasrv/CMakeLists.txt URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/lsasrv/CMakeLists... ============================================================================== --- trunk/reactos/dll/win32/lsasrv/CMakeLists.txt [iso-8859-1] (original) +++ trunk/reactos/dll/win32/lsasrv/CMakeLists.txt [iso-8859-1] Mon Jun 6 11:44:58 2011 @@ -28,7 +28,7 @@ wine ${PSEH_LIB})
-add_importlibs(lsasrv rpcrt4 kernel32 ntdll) +add_importlibs(lsasrv rpcrt4 msvcrt kernel32 ntdll) add_dependencies(lsasrv psdk) add_cd_file(TARGET lsasrv DESTINATION reactos/system32 FOR all) add_importlib_target(lsasrv.spec)
Modified: trunk/reactos/dll/win32/msports/CMakeLists.txt URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/msports/CMakeList... ============================================================================== --- trunk/reactos/dll/win32/msports/CMakeLists.txt [iso-8859-1] (original) +++ trunk/reactos/dll/win32/msports/CMakeLists.txt [iso-8859-1] Mon Jun 6 11:44:58 2011 @@ -18,7 +18,7 @@
target_link_libraries(msports wine)
-add_importlibs(msports setupapi comctl32 user32 advapi32 kernel32 ntdll) +add_importlibs(msports setupapi comctl32 user32 advapi32 msvcrt kernel32 ntdll)
add_cd_file(TARGET msports DESTINATION reactos/system32 FOR all) add_importlib_target(msports.spec)
Modified: trunk/reactos/dll/win32/sti/CMakeLists.txt URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/sti/CMakeLists.tx... ============================================================================== --- trunk/reactos/dll/win32/sti/CMakeLists.txt [iso-8859-1] (original) +++ trunk/reactos/dll/win32/sti/CMakeLists.txt [iso-8859-1] Mon Jun 6 11:44:58 2011 @@ -36,6 +36,7 @@ oleaut32 rpcrt4 advapi32
- msvcrt kernel32 ntdll)
Modified: trunk/reactos/dll/win32/ufatx/CMakeLists.txt URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/ufatx/CMakeLists.... ============================================================================== --- trunk/reactos/dll/win32/ufatx/CMakeLists.txt [iso-8859-1] (original) +++ trunk/reactos/dll/win32/ufatx/CMakeLists.txt [iso-8859-1] Mon Jun 6 11:44:58 2011 @@ -9,8 +9,8 @@
set_entrypoint(ufatx 0)
-target_link_libraries(ufatx vfatxlib -lgcc) -add_importlibs(ufatx kernel32 ntdll) +target_link_libraries(ufatx vfatxlib) +add_importlibs(ufatx msvcrt kernel32 ntdll) add_importlib_target(ufatx.spec) add_dependencies(ufatx psdk) add_cd_file(TARGET ufatx DESTINATION reactos/system32 FOR all)
Modified: trunk/reactos/dll/win32/wlanapi/CMakeLists.txt URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/wlanapi/CMakeList... ============================================================================== --- trunk/reactos/dll/win32/wlanapi/CMakeLists.txt [iso-8859-1] (original) +++ trunk/reactos/dll/win32/wlanapi/CMakeLists.txt [iso-8859-1] Mon Jun 6 11:44:58 2011 @@ -17,7 +17,7 @@ wine ${PSEH_LIB})
-add_importlibs(wlanapi rpcrt4 kernel32 ntdll) +add_importlibs(wlanapi rpcrt4 msvcrt kernel32 ntdll) add_importlib_target(wlanapi.spec)
add_dependencies(wlanapi psdk)
Modified: trunk/reactos/lib/fslib/vfatxlib/CMakeLists.txt URL: http://svn.reactos.org/svn/reactos/trunk/reactos/lib/fslib/vfatxlib/CMakeLis... ============================================================================== --- trunk/reactos/lib/fslib/vfatxlib/CMakeLists.txt [iso-8859-1] (original) +++ trunk/reactos/lib/fslib/vfatxlib/CMakeLists.txt [iso-8859-1] Mon Jun 6 11:44:58 2011 @@ -1,4 +1,8 @@
add_library(vfatxlib fatx.c vfatxlib.c)
+if(NOT MSVC)
- target_link_libraries(vfatxlib -lgcc)
+endif()
add_dependencies(vfatxlib psdk)
Modified: trunk/reactos/lib/pseh/CMakeLists.txt URL: http://svn.reactos.org/svn/reactos/trunk/reactos/lib/pseh/CMakeLists.txt?rev... ============================================================================== --- trunk/reactos/lib/pseh/CMakeLists.txt [iso-8859-1] (original) +++ trunk/reactos/lib/pseh/CMakeLists.txt [iso-8859-1] Mon Jun 6 11:44:58 2011 @@ -14,6 +14,7 @@ endif()
add_library(pseh ${SOURCE})
- target_link_libraries(pseh chkstk) add_dependencies(pseh psdk)
else()
Am 06.06.2011 15:23, schrieb Alex Ionescu:
Hello,
With the move to 4.6.0, please consider building with -flto=<number of cores that the build script detects>
Timo: This will enable Link Time Optimizations :D
Interesting. The question is, if it will work with the win32 version of ld.
Hi!
With the move to 4.6.0, please look into building with -Ofast.
With the move to 4.6.0, please consider building with -flto=<number of cores that the build script detects>
-Ofast is the same as -O3 plus some other optimization options; it seems not a right idea to add more bloat to RecatOS. -flto is still rather experimental thing.
The question is, if it will work with the win32 version of ld.
If trunk binutils will not work, try with hjl and davek branches from here: http://git.kernel.org/?p=devel/binutils/hjl/x86.git;a=summary.
Hi!
On 2011-06-06, at 11:43 AM, Dmitry Gorbachev wrote:
Hi!
With the move to 4.6.0, please look into building with -Ofast.
With the move to 4.6.0, please consider building with -flto=<number of cores that the build script detects>
-Ofast is the same as -O3 plus some other optimization options; it seems not a right idea to add more bloat to RecatOS. -flto is still rather experimental thing.
Why more bloat? It will optimize the code more, not bloat it. It disables "standard compliance", which ReactOS should not care about.
-flto is now shipping in 4.6.0, please see release notes. It is out of testing phase.
-- Best regards, Alex Ionescu
Why more bloat? It will optimize the code more, not bloat it. It disables "standard compliance", which ReactOS should not care about.
It optimizes for speed, but increases size. As CPU spends more time, executing user code then kernel code, it makes sense to optimize the kernel for size rather then for speed.
-flto is now shipping in 4.6.0, please see release notes. It is out of testing phase.
I do not want to discourage, I just say -- expect bugs, and do not forget to report them to GCC / Binutils developers.
On 2011-06-06, at 4:14 PM, Dmitry Gorbachev wrote:
Why more bloat? It will optimize the code more, not bloat it. It disables "standard compliance", which ReactOS should not care about.
It optimizes for speed, but increases size. As CPU spends more time, executing user code then kernel code, it makes sense to optimize the kernel for size rather then for speed.
Hi,
How does -Ofast increase size compared to -O3?
The documentation only states "same settings, but decreased standard compliance". If -Ofast does increase size vs. O3, I will file a documentation bug -- but first I need some information.
-- Best regards, Alex Ionescu
How does -Ofast increase size compared to -O3?
I had in mind -Ofast or -O3 versus -Os (which is used by default when building ReactOS). Now I realise you probably meant -- consider replacing -O3 by -Ofast...
BTW, will it be possible to compile kernel-mode code and user-mode code with different sets of options? Somebody might want to build user-mode stuff with more optimization then it's allowed for the kernel.
Hi,
On 2011-06-06, at 4:59 PM, Dmitry Gorbachev wrote:
How does -Ofast increase size compared to -O3?
I had in mind -Ofast or -O3 versus -Os (which is used by default when building ReactOS). Now I realise you probably meant -- consider replacing -O3 by -Ofast...
Yes, I thought -O3 was the default on CMAKE builds. So I was recommending -Ofast instead of -O3, indeed.
BTW, will it be possible to compile kernel-mode code and user-mode code with different sets of options? Somebody might want to build user-mode stuff with more optimization then it's allowed for the kernel.
In fact, with GCC 4.6.0 it's even possible to do this at the function-level.
I'm not sure why you would want kernel code to be "smaller" instead of "faster" though -- on modern processors for cases like interrupts and such, large-but-correctly-aligned-and-optimized code is faster than less-bytes-per-instruction/opcode-packed code.
ie:
mov eax, [foo] add eax, 1 mov [foo], eax
is faster than
inc [foo]
-- Best regards, Alex Ionescu
Ros-dev mailing list Ros-dev@reactos.org http://www.reactos.org/mailman/listinfo/ros-dev
Hi,
Yes, I thought -O3 was the default on CMAKE builds.
I don't know, but it seems (in config.cmake) that it's the same as in RBUILD builds.
I'm not sure why you would want kernel code to be "smaller" instead of "faster" though -- on modern processors for cases like interrupts and such, large-but-correctly-aligned-and-optimized code is faster than less-bytes-per-instruction/opcode-packed code.
I think these "hot" parts of kernel should be optimized for speed, while other, less frequently used functions -- for size (or it turns that they just waste memory).