@@ -14,24 +14,67 @@ set(CMAKE_SYSTEM_NAME RTEMS)
14
14
set (CMAKE_SYSTEM_PROCESSOR i386)
15
15
set (CMAKE_SYSTEM_VERSION 5)
16
16
17
+ # The RTEMS BSP that will be used for this build
18
+ set (RTEMS_BSP "pc686" )
19
+
20
+ # these settings are specific to cFE/OSAL and determines which
21
+ # abstraction layers are built when using this toolchain
22
+ SET (CFE_SYSTEM_PSPNAME pc-rtems)
23
+ SET (OSAL_SYSTEM_BSPTYPE pc-rtems)
24
+ SET (OSAL_SYSTEM_OSTYPE rtems)
25
+
26
+ # This is for version specific RTEMS ifdefs needed by the OSAL and PSP
27
+ ADD_DEFINITIONS (-DOS_RTEMS_5)
28
+
29
+ # RTEMS_DYNAMIC_LOAD definition:
30
+ # - Set to FALSE for platforms that create a RTEMS executable and link it
31
+ # to the cFE core.
32
+ # - Set to TRUE for platforms that expect the cFE core to to be dynamically
33
+ # loaded into an existing runtime image.
34
+ # This is tied to the OSAL-BSP and PSP implementation so generally cannot
35
+ # be switched on a specific OSAL/PSP platform without modifications.
36
+ set (RTEMS_DYNAMIC_LOAD FALSE )
37
+
38
+ set (RTEMS_BSP_C_FLAGS "-march=i686 -mtune=i686 -fno-common" )
39
+ set (RTEMS_BSP_CXX_FLAGS ${RTEMS_BSP_C_FLAGS} )
40
+ set (RTEMS_BSP_SPECS_FLAGS "-specs bsp_specs" )
41
+
42
+ # This define is deprecated and will be removed
43
+ ADD_DEFINITIONS (-D_RTEMS_5_)
44
+
45
+ # Info regarding the RELOCADDR:
46
+ #+--------------------------------------------------------------------------+
47
+ #| Set the value of RELOCADDR to the address where you want your image to
48
+ #| load. If you'll be using GRUB to load the images it will have to be >=
49
+ #| 0x100000 (1024K). If you are using NetBoot to load the images it can be
50
+ #| >= 0x10000 (64K) AND <= 0x97C00 (607K) OR >= 0x100000 (1024K). The memory
51
+ #| top is of course another limit. Make sure there is enough space before the
52
+ #| upper memory limits for the image and the memory allocated by it to fit.
53
+ #| Make sure the value you choose is aligned to 4 bytes.
54
+ #+--------------------------------------------------------------------------+
55
+ set (RTEMS_RELOCADDR 0x00100000)
56
+
57
+ # Exception handling is very iffy. These two options disable eh_frame creation.
58
+ set (CMAKE_C_COMPILE_OPTIONS_PIC -fno-exceptions -fno-asynchronous-unwind-tables)
59
+
60
+ # Link libraries needed for a RTEMS 5+ executable
61
+ # This was handled by the bsp_specs file in 4.11
62
+ set (LINK_LIBRARIES "-lrtemsdefaultconfig -lrtemsbsp -lrtemscpu" )
63
+
64
+ #+---------------------------------------------------------------------------+
65
+ #| Common RTEMS toolchain statements
66
+ #+---------------------------------------------------------------------------+
17
67
# The TOOLS and BSP are allowed to be installed in different locations.
18
68
# If the README was followed they will both be installed under $HOME
19
69
# By default it is assumed the BSP is installed to the same directory as the tools
20
- SET (RTEMS_TOOLS_PREFIX "$ENV{HOME} /rtems-${CMAKE_SYSTEM_VERSION} " CACHE PATH
70
+ SET (RTEMS_TOOLS_PREFIX "$ENV{HOME} /rtems-${CMAKE_SYSTEM_VERSION} " CACHE PATH
21
71
"RTEMS tools install directory" )
22
- SET (RTEMS_BSP_PREFIX "${RTEMS_TOOLS_PREFIX} " CACHE PATH
72
+ SET (RTEMS_BSP_PREFIX "${RTEMS_TOOLS_PREFIX} " CACHE PATH
23
73
"RTEMS BSP install directory" )
24
74
25
- # The BSP that will be used for this build
26
- set (RTEMS_BSP "pc686" )
27
-
28
75
# specify the cross compiler - adjust accord to compiler installation
29
- # This uses the compiler-wrapper toolchain that buildroot produces
30
76
SET (SDKHOSTBINDIR "${RTEMS_TOOLS_PREFIX} /bin" )
31
77
set (TARGETPREFIX "${CMAKE_SYSTEM_PROCESSOR} -rtems${CMAKE_SYSTEM_VERSION} -" )
32
- set (RTEMS_BSP_C_FLAGS "-march=i686 -mtune=i686 -fno-common" )
33
- set (RTEMS_BSP_CXX_FLAGS ${RTEMS_BSP_C_FLAGS} )
34
-
35
78
36
79
SET (CMAKE_C_COMPILER "${RTEMS_TOOLS_PREFIX} /bin/${TARGETPREFIX} gcc" )
37
80
SET (CMAKE_CXX_COMPILER "${RTEMS_TOOLS_PREFIX} /bin/${TARGETPREFIX} g++" )
@@ -43,13 +86,6 @@ SET(CMAKE_AR "${RTEMS_TOOLS_PREFIX}/bin/${TARGETPREFIX}ar")
43
86
SET (CMAKE_OBJDUMP "${RTEMS_TOOLS_PREFIX} /bin/${TARGETPREFIX} objdump" )
44
87
SET (CMAKE_OBJCOPY "${RTEMS_TOOLS_PREFIX} /bin/${TARGETPREFIX} objcopy" )
45
88
46
- # Exception handling is very iffy. These two options disable eh_frame creation.
47
- set (CMAKE_C_COMPILE_OPTIONS_PIC -fno-exceptions -fno-asynchronous-unwind-tables)
48
-
49
- # Link libraries needed for an RTEMS 5.x executable
50
- # This was handled by the bsp_specs file in 4.11
51
- set (LINK_LIBRARIES "-lrtemsdefaultconfig -lrtemsbsp -lrtemscpu" )
52
-
53
89
# search for programs in the build host directories
54
90
SET (CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
55
91
@@ -58,26 +94,3 @@ SET(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
58
94
SET (CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
59
95
60
96
SET (CMAKE_PREFIX_PATH /)
61
-
62
- # these settings are specific to cFE/OSAL and determines which
63
- # abstraction layers are built when using this toolchain
64
- SET (CFE_SYSTEM_PSPNAME pc-rtems)
65
- SET (OSAL_SYSTEM_BSPTYPE pc-rtems)
66
- SET (OSAL_SYSTEM_OSTYPE rtems)
67
-
68
- # This is for RTEMS 5 specific ifdefs needed by the OSAL
69
- ADD_DEFINITIONS (-D_RTEMS_5_)
70
-
71
- # Info regarding the RELOCADDR:
72
- #+--------------------------------------------------------------------------+
73
- #| Set the value of RELOCADDR to the address where you want your image to
74
- #| load. If you'll be using GRUB to load the images it will have to be >=
75
- #| 0x100000 (1024K). If you are using NetBoot to load the images it can be
76
- #| >= 0x10000 (64K) AND <= 0x97C00 (607K) OR >= 0x100000 (1024K). The memory
77
- #| top is of course another limit. Make sure there is enough space before the
78
- #| upper memory limits for the image and the memory allocated by it to fit.
79
- #| Make sure the value you choose is aligned to 4 bytes.
80
- #+--------------------------------------------------------------------------+
81
- set (RTEMS_RELOCADDR 0x00100000)
82
-
83
-
0 commit comments