Author: akhaldi
Date: Fri Aug 13 14:02:58 2010
New Revision: 48528
URL:
http://svn.reactos.org/svn/reactos?rev=48528&view=rev
Log:
[CMAKE]
- Automatically choose the image base for DLLs.
- Improve RC compiler invocation.
- Add and apply the global linker script.
Added:
branches/cmake-bringup/global.lds (with props)
Modified:
branches/cmake-bringup/toolchain-mingw32.cmake
Added: branches/cmake-bringup/global.lds
URL:
http://svn.reactos.org/svn/reactos/branches/cmake-bringup/global.lds?rev=48…
==============================================================================
--- branches/cmake-bringup/global.lds (added)
+++ branches/cmake-bringup/global.lds [iso-8859-1] Fri Aug 13 14:02:58 2010
@@ -1,0 +1,103 @@
+OUTPUT_FORMAT(pei-i386)
+SECTIONS
+{
+ .text __image_base__ + __section_alignment__ :
+ {
+ __text_start__ = .;
+ *(.init)
+ *(.text)
+ *(SORT(.text$*))
+ *(.glue_7t)
+ *(.glue_7)
+ *(.jcr)
+ ___CTOR_LIST__ = .; __CTOR_LIST__ = . ;
+ LONG (-1);*(.ctors); *(.ctor); *(SORT(.ctors.*)); LONG (0);
+ ___DTOR_LIST__ = .; __DTOR_LIST__ = . ;
+ LONG (-1);*(.dtors); *(.dtor); *(SORT(.dtors.*)); LONG (0);
+ *(.fini)
+ *(.gcc_exc)
+ __text_end__ = .;
+ *(.gcc_except_table)
+ }
+ init BLOCK(__section_alignment__) :
+ {
+ __init_start__ = . ;
+ *(init)
+ __init_end__ = . ;
+ }
+ .data BLOCK(__section_alignment__) :
+ {
+ __data_start__ = . ;
+ *(.data)
+ *(.data2)
+ *(SORT(.data$*))
+ __data_end__ = . ;
+ __bss_start__ = . ;
+ *(.bss)
+ *(COMMON)
+ __bss_end__ = . ;
+ *(SORT(.CRT$*))
+ }
+ .rdata BLOCK(__section_alignment__) :
+ {
+ *(.rdata)
+ *(SORT(.rdata$*))
+ *(.eh_frame)
+ }
+ .edata BLOCK(__section_alignment__) : { *(.edata) }
+ .idata BLOCK(__section_alignment__) :
+ {
+ /* This cannot currently be handled with grouped sections.
+ See pe.em:sort_sections. */
+ SORT(*)(.idata$2)
+ SORT(*)(.idata$3)
+ /* These zeroes mark the end of the import list. */
+ LONG (0); LONG (0); LONG (0); LONG (0); LONG (0);
+ SORT(*)(.idata$4)
+ SORT(*)(.idata$5)
+ SORT(*)(.idata$6)
+ SORT(*)(.idata$7)
+ }
+ .tls BLOCK(__section_alignment__) :
+ {
+ *(.tls)
+ *(.tls$)
+ *(SORT(.tls$*))
+ }
+ /DISCARD/ :
+ {
+ *(.debug$S)
+ *(.debug$T)
+ *(.debug$F)
+ *(.drectve)
+ *(.debug_loc)
+ *(.debug_ranges)
+ *(.debug_aranges)
+ *(.debug_str)
+ *(.debug_frame)
+ *(.debug_pubnames)
+ *(.debug_pubtypes)
+ *(.gnu.linkonce.wt.*)
+ }
+ .rsrc BLOCK(__section_alignment__) :
+ {
+ *(.rsrc)
+ *(SORT(.rsrc$*))
+ }
+ .reloc BLOCK(__section_alignment__) :
+ {
+ *(.reloc)
+ }
+ .debug_info BLOCK(__section_alignment__) (NOLOAD) :
+ {
+ [ .debug_info ]
+ }
+ .debug_abbrev BLOCK(__section_alignment__) (NOLOAD) :
+ {
+ [ .debug_abbrev ]
+ }
+ .debug_line BLOCK(__section_alignment__) (NOLOAD) :
+ {
+ [ .debug_line ]
+ }
+}
Propchange: branches/cmake-bringup/global.lds
------------------------------------------------------------------------------
svn:eol-style = native
Modified: branches/cmake-bringup/toolchain-mingw32.cmake
URL:
http://svn.reactos.org/svn/reactos/branches/cmake-bringup/toolchain-mingw32…
==============================================================================
--- branches/cmake-bringup/toolchain-mingw32.cmake [iso-8859-1] (original)
+++ branches/cmake-bringup/toolchain-mingw32.cmake [iso-8859-1] Fri Aug 13 14:02:58 2010
@@ -1,5 +1,5 @@
-SET(ARCH i386)
+set(ARCH i386)
# Choose the right MinGW prefix
if (CMAKE_HOST_SYSTEM_NAME MATCHES Windows)
@@ -18,11 +18,12 @@
SET(CMAKE_RC_COMPILER ${MINGW_PREFIX}windres)
SET(CMAKE_ASM_COMPILER ${MINGW_PREFIX}gcc)
SET(CMAKE_ASM_COMPILE_OBJECT "<CMAKE_ASM_COMPILER> -x assembler-with-cpp -o
<OBJECT> <FLAGS> <DEFINES> -D__ASM__ -c <SOURCE>")
-SET(CMAKE_RC_COMPILE_OBJECT "<CMAKE_RC_COMPILER> -O coff
-I${REACTOS_SOURCE_DIR}/include/ -I${REACTOS_BINARY_DIR}/include/reactos -i <SOURCE>
-o <OBJECT> <DEFINES> -DRC_INVOKED")
+
+SET(CMAKE_RC_COMPILE_OBJECT "<CMAKE_RC_COMPILER> -i <SOURCE>
<CMAKE_C_LINK_FLAGS> <DEFINES> -I${REACTOS_SOURCE_DIR}/include/psdk
-I${REACTOS_BINARY_DIR}/include/psdk -I${REACTOS_SOURCE_DIR}/include/
-I${REACTOS_SOURCE_DIR}/include/reactos -I${REACTOS_BINARY_DIR}/include/reactos
-I${REACTOS_SOURCE_DIR}/include/crt/mingw32 -O coff -o <OBJECT> ")
# Use stdcall fixups, and don't link with anything by default unless we say so
-set(CMAKE_C_STANDARD_LIBRARIES "-lgcc") # We should add the environment libgcc
here
-SET(CMAKE_SHARED_LINKER_FLAGS "-Wl,--enable-stdcall-fixup -Wl,--kill-at
-nodefaultlibs -nostdlib")
+set(CMAKE_C_STANDARD_LIBRARIES -lgcc CACHE STRING "libgcc") # We should add the
environment libgcc here
+set(CMAKE_SHARED_LINKER_FLAGS_INIT "-nodefaultlibs -nostdlib
-Wl,--enable-auto-image-base -Wl,--enable-stdcall-fixup -Wl,--kill-at
-Wl,-T,${REACTOS_SOURCE_DIR}/global.lds")
# adjust the default behaviour of the FIND_XXX() commands:
# search headers and libraries in the target environment, search
@@ -30,3 +31,4 @@
set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
+