[8e8676da] | 1 | @c |
---|
[6449498] | 2 | @c COPYRIGHT (c) 1988-2002. |
---|
[8e8676da] | 3 | @c On-Line Applications Research Corporation (OAR). |
---|
| 4 | @c All rights reserved. |
---|
| 5 | @c |
---|
| 6 | @c $Id$ |
---|
| 7 | @c |
---|
| 8 | |
---|
[6d3d425d] | 9 | @chapter Building the GNAT Cross Compiler Toolset |
---|
[8e8676da] | 10 | |
---|
| 11 | This chapter describes the steps required to acquire the |
---|
| 12 | source code for a GNU cross compiler toolset, apply |
---|
| 13 | any required RTEMS specific patches, compile that |
---|
| 14 | toolset and install it. |
---|
| 15 | |
---|
[fffe9266] | 16 | @section Create the Archive and Build Directories |
---|
| 17 | |
---|
| 18 | Start by making the @code{archive} directory to contain the downloaded |
---|
| 19 | source code and the @code{tools} directory to be used as a build |
---|
| 20 | directory. The command sequence to do this is shown |
---|
| 21 | below: |
---|
| 22 | |
---|
| 23 | @example |
---|
[75dfc7f7] | 24 | mkdir archive |
---|
[fffe9266] | 25 | mkdir tools |
---|
| 26 | @end example |
---|
| 27 | |
---|
| 28 | This will result in an initial directory structure similar to the |
---|
| 29 | one shown in the following figure: |
---|
| 30 | |
---|
| 31 | @example |
---|
| 32 | @group |
---|
[75dfc7f7] | 33 | /whatever/prefix/you/choose/ |
---|
| 34 | archive/ |
---|
| 35 | tools/ |
---|
[fffe9266] | 36 | |
---|
| 37 | @end group |
---|
| 38 | @end example |
---|
| 39 | |
---|
[75dfc7f7] | 40 | @c @ifset use-html |
---|
| 41 | @c @html |
---|
| 42 | @c <IMG SRC="sfile12c.jpg" WIDTH=417 HEIGHT=178 |
---|
| 43 | @c ALT="Starting Directory Organization"> |
---|
| 44 | @c @end html |
---|
| 45 | @c @end ifset |
---|
[fffe9266] | 46 | |
---|
[dff0a57c] | 47 | @section Get All the Pieces |
---|
[6d3d425d] | 48 | |
---|
[fffe9266] | 49 | This section lists the components of an RTEMS cross development system. |
---|
| 50 | Included are the locations of each component as well as any required RTEMS |
---|
| 51 | specific patches. |
---|
[8e8676da] | 52 | |
---|
[50bd388] | 53 | @subheading @value{GCCVERSION} |
---|
[8e8676da] | 54 | @example |
---|
[50bd388] | 55 | FTP Site: @value{GCCFTPSITE} |
---|
| 56 | Directory: @value{GCCFTPDIR} |
---|
| 57 | File: @value{GCCTAR} |
---|
[dff0a57c] | 58 | @ifset use-html |
---|
[50bd388] | 59 | @c URL: @uref{ftp://@value{GCCFTPSITE}@value{GCCFTPDIR}/@value{GCCTAR},Download @value{GCCVERSION}} |
---|
| 60 | URL: ftp://@value{GCCFTPSITE}@value{GCCFTPDIR}/@value{GCCTAR} |
---|
[dff0a57c] | 61 | @end ifset |
---|
[8e8676da] | 62 | @end example |
---|
| 63 | |
---|
[6d3d425d] | 64 | @subheading @value{GNAT-VERSION} |
---|
| 65 | @example |
---|
| 66 | FTP Site: @value{GNAT-FTPSITE} |
---|
| 67 | Directory: @value{GNAT-FTPDIR} |
---|
| 68 | File: @value{GNAT-TAR} |
---|
[dff0a57c] | 69 | @ifset use-html |
---|
[2898d39b] | 70 | @c URL: @uref{ ftp://@value{GNAT-FTPSITE}@value{GNAT-FTPDIR}/@value{GNAT-TAR}, Download @value{GNAT-VERSION}} |
---|
| 71 | URL: ftp://@value{GNAT-FTPSITE}@value{GNAT-FTPDIR}/@value{GNAT-TAR} |
---|
[dff0a57c] | 72 | @end ifset |
---|
[6d3d425d] | 73 | @end example |
---|
| 74 | |
---|
[50bd388] | 75 | @subheading @value{BINUTILSVERSION} |
---|
[8e8676da] | 76 | @example |
---|
[50bd388] | 77 | FTP Site: @value{BINUTILSFTPSITE} |
---|
| 78 | Directory: @value{BINUTILSFTPDIR} |
---|
| 79 | File: @value{BINUTILSTAR} |
---|
[dff0a57c] | 80 | @ifset use-html |
---|
[50bd388] | 81 | @c URL: @uref{ftp://@value{BINUTILSFTPSITE}@value{BINUTILSFTPDIR}/@value{BINUTILSTAR}, Download @value{BINUTILSVERSION}} |
---|
| 82 | URL: ftp://@value{BINUTILSFTPSITE}@value{BINUTILSFTPDIR}/@value{BINUTILSTAR} |
---|
[dff0a57c] | 83 | @end ifset |
---|
[8e8676da] | 84 | @end example |
---|
| 85 | |
---|
[50bd388] | 86 | @subheading @value{NEWLIBVERSION} |
---|
[8e8676da] | 87 | @example |
---|
[50bd388] | 88 | FTP Site: @value{NEWLIBFTPSITE} |
---|
| 89 | Directory: @value{NEWLIBFTPDIR} |
---|
| 90 | File: @value{NEWLIBTAR} |
---|
[dff0a57c] | 91 | @ifset use-html |
---|
[50bd388] | 92 | @c URL: @uref{ftp://@value{NEWLIBFTPSITE}@value{NEWLIBFTPDIR}/@value{NEWLIBTAR}, Download @value{NEWLIBVERSION}} |
---|
| 93 | URL: ftp://@value{NEWLIBFTPSITE}@value{NEWLIBFTPDIR}/@value{NEWLIBTAR} |
---|
[dff0a57c] | 94 | @end ifset |
---|
[8e8676da] | 95 | @end example |
---|
| 96 | |
---|
[50bd388] | 97 | @subheading @value{RTEMSVERSION} |
---|
[8e8676da] | 98 | @example |
---|
[50bd388] | 99 | FTP Site: @value{RTEMSFTPSITE} |
---|
| 100 | Directory: @value{RTEMSFTPDIR} |
---|
| 101 | File: @value{RTEMSTAR} |
---|
[dff0a57c] | 102 | @ifset use-html |
---|
[50bd388] | 103 | @c URL: @uref{ftp://@value{RTEMSFTPSITE}@value{RTEMSFTPDIR}, Download RTEMS components} |
---|
| 104 | URL: ftp://@value{RTEMSFTPSITE}@value{RTEMSFTPDIR} |
---|
[dff0a57c] | 105 | @end ifset |
---|
| 106 | @end example |
---|
| 107 | |
---|
| 108 | @subheading RTEMS Hello World |
---|
| 109 | @example |
---|
[50bd388] | 110 | FTP Site: @value{RTEMSFTPSITE} |
---|
| 111 | Directory: @value{RTEMSFTPDIR} |
---|
[fffe9266] | 112 | File: hello_world_ada.tgz |
---|
[dff0a57c] | 113 | @ifset use-html |
---|
[50bd388] | 114 | @c URL: @uref{ftp://@value{RTEMSFTPSITE}@value{RTEMSFTPDIR}/ada_tools/hello_world_ada.tgz, Download RTEMS Hello World} |
---|
| 115 | URL: ftp://@value{RTEMSFTPSITE}@value{RTEMSFTPDIR}/ada_tools/hello_world_ada.tgz |
---|
[dff0a57c] | 116 | @end ifset |
---|
[fffe9266] | 117 | @end example |
---|
| 118 | |
---|
[dff0a57c] | 119 | @subheading RTEMS Specific Tool Patches and Scripts |
---|
[fffe9266] | 120 | @example |
---|
[50bd388] | 121 | FTP Site: @value{RTEMSFTPSITE} |
---|
| 122 | Directory: @value{RTEMSFTPDIR}/ada_tools/source |
---|
| 123 | File: @value{BUILDTOOLSTAR} |
---|
| 124 | @ifset BINUTILSRTEMSPATCH |
---|
| 125 | File: @value{BINUTILSRTEMSPATCH} |
---|
[6d3d425d] | 126 | @end ifset |
---|
[50bd388] | 127 | @ifset NEWLIBRTEMSPATCH |
---|
| 128 | File: @value{NEWLIBRTEMSPATCH} |
---|
[6d3d425d] | 129 | @end ifset |
---|
[50bd388] | 130 | @ifset GCCRTEMSPATCH |
---|
| 131 | File: @value{GCCRTEMSPATCH} |
---|
[6d3d425d] | 132 | @end ifset |
---|
| 133 | @ifset GNAT-RTEMSPATCH |
---|
| 134 | File: @value{GNAT-RTEMSPATCH} |
---|
| 135 | @end ifset |
---|
[dff0a57c] | 136 | @ifset use-html |
---|
[50bd388] | 137 | @c URL: @uref{ftp://@value{RTEMSFTPSITE}@value{RTEMSFTPDIR}/ada_tools/source, Download RTEMS patches} |
---|
| 138 | URL: ftp://@value{RTEMSFTPSITE}@value{RTEMSFTPDIR}/ada_tools/source |
---|
[fffe9266] | 139 | @end ifset |
---|
| 140 | @end example |
---|
[4aa6b64] | 141 | |
---|
[6e3c36b7] | 142 | @section Unarchiving the Tools |
---|
[8e8676da] | 143 | |
---|
[4aa6b64] | 144 | While in the @code{tools} directory, unpack the compressed |
---|
| 145 | tar files using the following command sequence: |
---|
[8e8676da] | 146 | |
---|
| 147 | @example |
---|
| 148 | cd tools |
---|
[50bd388] | 149 | tar xzf ../archive/@value{GCCTAR} |
---|
[75dfc7f7] | 150 | tar xzf ../archive/@value{GNAT-TAR} |
---|
[50bd388] | 151 | tar xzf ../archive/@value{BINUTILSTAR} |
---|
| 152 | tar xzf ../archive/@value{NEWLIBTAR} |
---|
| 153 | tar xzf ../archive/@value{BUILDTOOLSTAR} |
---|
[8e8676da] | 154 | @end example |
---|
| 155 | |
---|
| 156 | After the compressed tar files have been unpacked, the following |
---|
| 157 | directories will have been created under tools. |
---|
| 158 | |
---|
| 159 | @itemize @bullet |
---|
[50bd388] | 160 | @item @value{BINUTILSUNTAR} |
---|
| 161 | @item @value{GCCUNTAR} |
---|
[6d3d425d] | 162 | @item @value{GNAT-UNTAR} |
---|
[50bd388] | 163 | @item @value{NEWLIBUNTAR} |
---|
[8e8676da] | 164 | @end itemize |
---|
| 165 | |
---|
[b7ea3ec] | 166 | There will also be a set of scripts in the current directory |
---|
| 167 | which aid in building the tools and RTEMS. They are: |
---|
[a6aa8a91] | 168 | |
---|
[b7ea3ec] | 169 | @itemize @bullet |
---|
| 170 | @item bit_ada |
---|
| 171 | @item bit_gdb |
---|
| 172 | @item bit_rtems |
---|
| 173 | @item common.sh |
---|
| 174 | @item user.cfg |
---|
| 175 | @end itemize |
---|
[a6aa8a91] | 176 | |
---|
[b7ea3ec] | 177 | When the @code{bit_ada} script is executed later in this process, |
---|
[a6aa8a91] | 178 | it will automatically create two other subdirectories: |
---|
[6e3c36b7] | 179 | |
---|
| 180 | @itemize @bullet |
---|
| 181 | @item src |
---|
| 182 | @item build-$@{CPU@}-tools |
---|
| 183 | @end itemize |
---|
| 184 | |
---|
[b7ea3ec] | 185 | Similarly, the @code{bit_gdb} script will create the |
---|
| 186 | subdirectory @code{build-$@{CPU@}-gdb} and |
---|
| 187 | the @code{bit_rtems} script will create the |
---|
| 188 | subdirectory @code{build-$@{CPU@}-rtems}. |
---|
| 189 | |
---|
[a6aa8a91] | 190 | The directory tree should look something like the following figure: |
---|
[4aa6b64] | 191 | |
---|
| 192 | @example |
---|
| 193 | @group |
---|
[a6aa8a91] | 194 | /whatever/prefix/you/choose/ |
---|
| 195 | archive/ |
---|
[50bd388] | 196 | @value{GCCTAR} |
---|
[a6aa8a91] | 197 | @value{GNAT-TAR} |
---|
[50bd388] | 198 | @value{BINUTILSTAR} |
---|
| 199 | @value{NEWLIBTAR} |
---|
| 200 | @value{RTEMSTAR} |
---|
| 201 | @value{BUILDTOOLSTAR} |
---|
| 202 | @ifset GCCRTEMSPATCH |
---|
| 203 | @value{GCCRTEMSPATCH} |
---|
[4aa6b64] | 204 | @end ifset |
---|
[50bd388] | 205 | @ifset BINUTILSRTEMSPATCH |
---|
| 206 | @value{BINUTILSRTEMSPATCH} |
---|
[a6aa8a91] | 207 | @end ifset |
---|
[50bd388] | 208 | @ifset NEWLIBRTEMSPATCH |
---|
| 209 | @value{NEWLIBRTEMSPATCH} |
---|
[a6aa8a91] | 210 | @end ifset |
---|
| 211 | @ifset GNAT-RTEMSPATCH |
---|
| 212 | @value{GNAT-RTEMSPATCH} |
---|
| 213 | @end ifset |
---|
[5d7eafe] | 214 | hello_world_ada.tgz |
---|
| 215 | bit_ada |
---|
[a6aa8a91] | 216 | tools/ |
---|
[50bd388] | 217 | @value{BINUTILSUNTAR}/ |
---|
| 218 | @value{GCCUNTAR}/ |
---|
[a6aa8a91] | 219 | @value{GNAT-UNTAR}/ |
---|
[50bd388] | 220 | @value{NEWLIBUNTAR}/ |
---|
[5d7eafe] | 221 | bit_ada |
---|
[b7ea3ec] | 222 | bit_gdb |
---|
| 223 | bit_rtems |
---|
| 224 | common.sh |
---|
| 225 | user.cfg |
---|
[4aa6b64] | 226 | @end group |
---|
| 227 | @end example |
---|
| 228 | |
---|
[a6aa8a91] | 229 | @c @ifset use-html |
---|
| 230 | @c @html |
---|
| 231 | @c <IMG SRC="bit_ada.jpg" WIDTH=816 HEIGHT=267 ALT="Directory Organization"> |
---|
| 232 | @c @end html |
---|
| 233 | @c @end ifset |
---|
[4aa6b64] | 234 | |
---|
[b7ea3ec] | 235 | @c |
---|
| 236 | @c Host Specific Notes |
---|
| 237 | @c |
---|
| 238 | |
---|
| 239 | @section Host Specific Notes |
---|
| 240 | |
---|
| 241 | @subsection Solaris 2.x |
---|
| 242 | |
---|
| 243 | The build scripts are written in "shell". The program @code{/bin/sh} |
---|
| 244 | on Solaris 2.x is not robust enough to execute these scripts. If you |
---|
| 245 | are on a Solaris 2.x host, then change the first line of the files |
---|
| 246 | @code{bit_ada}, @code{bit_gdb}, and @code{bit_rtems} to use the |
---|
| 247 | @code{/bin/ksh} shell instead. |
---|
| 248 | |
---|
[513196f] | 249 | @c |
---|
| 250 | @c Reading the Documentation |
---|
| 251 | @c |
---|
| 252 | |
---|
| 253 | @section Reading the Tools Documentation |
---|
| 254 | |
---|
| 255 | Each of the tools in the GNU development suite comes with documentation. |
---|
| 256 | It is in the reader's and tool maintainers' interest that one read the |
---|
| 257 | documentation before posting a problem to a mailing list or news group. |
---|
| 258 | |
---|
[4aa6b64] | 259 | |
---|
[8e8676da] | 260 | @c |
---|
[6d3d425d] | 261 | @c GCC patches |
---|
[8e8676da] | 262 | @c |
---|
| 263 | |
---|
[6d3d425d] | 264 | @section Apply RTEMS Patch to GCC |
---|
[8e8676da] | 265 | |
---|
[50bd388] | 266 | @ifclear GCCRTEMSPATCH |
---|
| 267 | No RTEMS specific patches are required for @value{GCCVERSION} to |
---|
| 268 | support @value{RTEMSVERSION}. |
---|
[8e8676da] | 269 | @end ifclear |
---|
| 270 | |
---|
[50bd388] | 271 | @ifset GCCRTEMSPATCH |
---|
[8e8676da] | 272 | |
---|
| 273 | Apply the patch using the following command sequence: |
---|
| 274 | |
---|
| 275 | @example |
---|
[50bd388] | 276 | cd tools/@value{GCCUNTAR} |
---|
| 277 | zcat ../../archive/@value{GCCRTEMSPATCH} | patch -p1 |
---|
[8e8676da] | 278 | @end example |
---|
| 279 | |
---|
| 280 | Check to see if any of these patches have been rejected using the following |
---|
| 281 | sequence: |
---|
| 282 | |
---|
| 283 | @example |
---|
[50bd388] | 284 | cd tools/@value{GCCUNTAR} |
---|
[8e8676da] | 285 | find . -name "*.rej" -print |
---|
| 286 | @end example |
---|
| 287 | |
---|
| 288 | If any files are found with the .rej extension, a patch has been rejected. |
---|
[b7ea3ec] | 289 | This should not happen with a good patch file which is properly applied. |
---|
[8e8676da] | 290 | |
---|
| 291 | @end ifset |
---|
| 292 | |
---|
| 293 | @c |
---|
| 294 | @c BINUTILS patches |
---|
| 295 | @c |
---|
| 296 | |
---|
| 297 | @section Apply RTEMS Patch to binutils |
---|
| 298 | |
---|
[50bd388] | 299 | @ifclear BINUTILSRTEMSPATCH |
---|
| 300 | No RTEMS specific patches are required for @value{BINUTILSVERSION} to |
---|
| 301 | support @value{RTEMSVERSION}. |
---|
[8e8676da] | 302 | @end ifclear |
---|
| 303 | |
---|
[50bd388] | 304 | @ifset BINUTILSRTEMSPATCH |
---|
[8e8676da] | 305 | Apply the patch using the following command sequence: |
---|
| 306 | |
---|
| 307 | @example |
---|
[50bd388] | 308 | cd tools/@value{BINUTILSUNTAR} |
---|
| 309 | zcat ../../archive/@value{BINUTILSRTEMSPATCH} | patch -p1 |
---|
[8e8676da] | 310 | @end example |
---|
| 311 | |
---|
| 312 | Check to see if any of these patches have been rejected using the following |
---|
| 313 | sequence: |
---|
| 314 | |
---|
| 315 | @example |
---|
[50bd388] | 316 | cd tools/@value{BINUTILSUNTAR} |
---|
[8e8676da] | 317 | find . -name "*.rej" -print |
---|
| 318 | @end example |
---|
| 319 | |
---|
| 320 | If any files are found with the .rej extension, a patch has been rejected. |
---|
[b7ea3ec] | 321 | This should not happen with a good patch file which is properly applied. |
---|
[8e8676da] | 322 | |
---|
| 323 | @end ifset |
---|
| 324 | |
---|
| 325 | @c |
---|
| 326 | @c Newlib patches |
---|
| 327 | @c |
---|
| 328 | |
---|
| 329 | @section Apply RTEMS Patch to newlib |
---|
| 330 | |
---|
[50bd388] | 331 | @ifclear NEWLIBRTEMSPATCH |
---|
| 332 | No RTEMS specific patches are required for @value{NEWLIBVERSION} to |
---|
| 333 | support @value{RTEMSVERSION}. |
---|
[8e8676da] | 334 | @end ifclear |
---|
| 335 | |
---|
[50bd388] | 336 | @ifset NEWLIBRTEMSPATCH |
---|
[8e8676da] | 337 | |
---|
| 338 | Apply the patch using the following command sequence: |
---|
| 339 | |
---|
| 340 | @example |
---|
[50bd388] | 341 | cd tools/@value{NEWLIBUNTAR} |
---|
| 342 | zcat ../../archive/@value{NEWLIBRTEMSPATCH} | patch -p1 |
---|
[8e8676da] | 343 | @end example |
---|
| 344 | |
---|
| 345 | Check to see if any of these patches have been rejected using the following |
---|
| 346 | sequence: |
---|
| 347 | |
---|
| 348 | @example |
---|
[50bd388] | 349 | cd tools/@value{NEWLIBUNTAR} |
---|
[8e8676da] | 350 | find . -name "*.rej" -print |
---|
| 351 | @end example |
---|
| 352 | |
---|
| 353 | If any files are found with the .rej extension, a patch has been rejected. |
---|
[b7ea3ec] | 354 | This should not happen with a good patch file which is properly applied. |
---|
[8e8676da] | 355 | |
---|
| 356 | @end ifset |
---|
| 357 | |
---|
[6d3d425d] | 358 | @c |
---|
| 359 | @c GNAT patches |
---|
[8e8676da] | 360 | @c |
---|
[6d3d425d] | 361 | |
---|
| 362 | @section Apply RTEMS Patch to GNAT |
---|
| 363 | |
---|
| 364 | @ifclear GNAT-RTEMSPATCH |
---|
| 365 | No RTEMS specific patches are required for @value{GNAT-VERSION} to |
---|
[50bd388] | 366 | support @value{RTEMSVERSION}. |
---|
[6d3d425d] | 367 | @end ifclear |
---|
| 368 | |
---|
| 369 | @ifset GNAT-RTEMSPATCH |
---|
| 370 | |
---|
| 371 | Apply the patch using the following command sequence: |
---|
| 372 | |
---|
| 373 | @example |
---|
| 374 | cd tools/@value{GNAT-UNTAR} |
---|
[5d7eafe] | 375 | zcat ../../archive/@value{GNAT-RTEMSPATCH} | patch -p1 |
---|
[6d3d425d] | 376 | @end example |
---|
| 377 | |
---|
| 378 | Check to see if any of these patches have been rejected using the following |
---|
| 379 | sequence: |
---|
| 380 | |
---|
| 381 | @example |
---|
| 382 | cd tools/@value{GNAT-UNTAR} |
---|
| 383 | find . -name "*.rej" -print |
---|
| 384 | @end example |
---|
| 385 | |
---|
| 386 | If any files are found with the .rej extension, a patch has been rejected. |
---|
[b7ea3ec] | 387 | This should not happen with a good patch file which is properly applied. |
---|
[6d3d425d] | 388 | |
---|
| 389 | @end ifset |
---|
| 390 | |
---|
| 391 | @c |
---|
| 392 | @c Copy the ada directory |
---|
| 393 | @c |
---|
| 394 | |
---|
| 395 | |
---|
| 396 | @section Copy the ada Subdirectory to the GCC Source Tree |
---|
| 397 | |
---|
| 398 | Copy the ada subtree in the patched subtree of |
---|
| 399 | tools/@value{GNAT-UNTAR}/src to the |
---|
[50bd388] | 400 | tools/@value{GCCUNTAR} directory: |
---|
[6d3d425d] | 401 | |
---|
| 402 | @example |
---|
| 403 | cd tools/@value{GNAT-UNTAR}/src |
---|
[50bd388] | 404 | cp -r ada ../../@value{GCCUNTAR} |
---|
[6d3d425d] | 405 | @end example |
---|
| 406 | |
---|
[adee5979] | 407 | |
---|
[6d3d425d] | 408 | @c |
---|
[b7ea3ec] | 409 | @c Localizing the Configuration |
---|
[8e8676da] | 410 | @c |
---|
| 411 | |
---|
[b7ea3ec] | 412 | @section Localizing the Configuration |
---|
[8e8676da] | 413 | |
---|
[adee5979] | 414 | Edit the @code{user.cfg} file to alter the settings of various |
---|
[b7ea3ec] | 415 | variables which are used to tailor the build process. |
---|
| 416 | Each of the variables set in @code{user.cfg} may be modified |
---|
| 417 | as described below: |
---|
[8e8676da] | 418 | |
---|
| 419 | @table @code |
---|
| 420 | @item INSTALL_POINT |
---|
| 421 | is the location where you wish the GNU C/C++ cross compilation tools for |
---|
| 422 | RTEMS to be built. It is recommended that the directory chosen to receive |
---|
[0ab65474] | 423 | these tools be named so that it is clear from which gcc distribution it |
---|
[8e8676da] | 424 | was generated and for which target system the tools are to produce code for. |
---|
| 425 | |
---|
[adee5979] | 426 | @b{WARNING}: The @code{INSTALL_POINT} should not be a subdirectory |
---|
[5d7eafe] | 427 | under the build directory. The build directory will be removed |
---|
| 428 | automatically upon successful completion of the build procedure. |
---|
| 429 | |
---|
[8e8676da] | 430 | @item BINUTILS |
---|
[50bd388] | 431 | is the directory under tools that contains @value{BINUTILSUNTAR}. |
---|
[fdd6a26] | 432 | For example: |
---|
[8e8676da] | 433 | |
---|
| 434 | @example |
---|
[50bd388] | 435 | BINUTILS=@value{BINUTILSUNTAR} |
---|
[8e8676da] | 436 | @end example |
---|
| 437 | |
---|
| 438 | @item GCC |
---|
[50bd388] | 439 | is the directory under tools that contains @value{GCCUNTAR}. |
---|
[b7ea3ec] | 440 | For example, |
---|
[8e8676da] | 441 | |
---|
| 442 | @example |
---|
[50bd388] | 443 | GCC=@value{GCCUNTAR} |
---|
[8e8676da] | 444 | @end example |
---|
| 445 | |
---|
[b7ea3ec] | 446 | Note that the gnat version is not needed because the gnat source |
---|
| 447 | is built as part of building gcc. |
---|
| 448 | |
---|
[8e8676da] | 449 | @item NEWLIB |
---|
[50bd388] | 450 | is the directory under tools that contains @value{NEWLIBUNTAR}. |
---|
[fdd6a26] | 451 | For example: |
---|
[8e8676da] | 452 | |
---|
| 453 | @example |
---|
[50bd388] | 454 | NEWLIB=@value{NEWLIBUNTAR} |
---|
[8e8676da] | 455 | @end example |
---|
| 456 | |
---|
| 457 | @item BUILD_DOCS |
---|
[adee5979] | 458 | is set to "yes" if you want to install documentation. This requires |
---|
| 459 | that tools supporting documentation production be installed. This |
---|
| 460 | currently is limited to the GNU texinfo package. |
---|
[fdd6a26] | 461 | For example: |
---|
[8e8676da] | 462 | |
---|
| 463 | @example |
---|
| 464 | BUILD_DOCS=yes |
---|
| 465 | @end example |
---|
| 466 | |
---|
[b7ea3ec] | 467 | @item BUILD_OTHER_LANGUAGES |
---|
| 468 | is set to "yes" if you want to build languages other than C and C++. At |
---|
[adee5979] | 469 | the current time, the set of alternative languages includes Java, Fortran, |
---|
| 470 | and Objective-C. These alternative languages do not always build cross. |
---|
| 471 | Hence this option defaults to "no". |
---|
| 472 | |
---|
[b7ea3ec] | 473 | For example: |
---|
| 474 | |
---|
| 475 | @example |
---|
| 476 | BUILD_OTHER_LANGUAGES=yes |
---|
| 477 | @end example |
---|
| 478 | |
---|
[adee5979] | 479 | @b{NOTE:} Based upon the version of the compiler being used, it may not |
---|
| 480 | be possible to build languages other than C and C++ cross. In many cases, |
---|
| 481 | the language run-time support libraries are not "multilib'ed". Thus the |
---|
| 482 | executable code in these libraries will be for the default compiler settings |
---|
| 483 | and not necessarily be correct for your CPU model. |
---|
| 484 | |
---|
[b7ea3ec] | 485 | @item RTEMS |
---|
[50bd388] | 486 | is the directory under tools that contails @value{RTEMSUNTAR}. |
---|
[b7ea3ec] | 487 | |
---|
| 488 | @item ENABLE_RTEMS_POSIX |
---|
| 489 | is set to "yes" if you want to enable the RTEMS POSIX API support. |
---|
| 490 | At this time, this feature is not supported by the UNIX ports of RTEMS |
---|
| 491 | and is forced to "no" for those targets. This corresponds to the |
---|
| 492 | @code{configure} option @code{--enable-posix}. |
---|
| 493 | |
---|
| 494 | This must be enabled to support the GNAT/RTEMS run-time. |
---|
| 495 | |
---|
[adee5979] | 496 | @item ENABLE_RTEMS_ITRON |
---|
| 497 | is set to "yes" if you want to enable the RTEMS ITRON API support. |
---|
| 498 | At this time, this feature is not supported by the UNIX ports of RTEMS |
---|
| 499 | and is forced to "no" for those targets. This corresponds to the |
---|
| 500 | @code{configure} option @code{--enable-itron}. |
---|
| 501 | |
---|
| 502 | @item ENABLE_RTEMS_MP |
---|
| 503 | is set to "yes" if you want to enable the RTEMS multiprocessing |
---|
| 504 | support. This feature is not supported by all RTEMS BSPs and |
---|
| 505 | is automatically forced to "no" for those BSPs. This corresponds to the |
---|
| 506 | @code{configure} option @code{--enable-multiprocessing}. |
---|
| 507 | |
---|
| 508 | @item ENABLE_RTEMS_CXX |
---|
| 509 | is set to "yes" if you want to build the RTEMS C++ support including |
---|
| 510 | the C++ Wrapper for the Classic API. This corresponds to the |
---|
| 511 | @code{configure} option @code{--enable-cxx}. |
---|
| 512 | |
---|
[b7ea3ec] | 513 | @item ENABLE_RTEMS_TESTS |
---|
| 514 | is set to "yes" if you want to build the RTEMS Test Suite. If this |
---|
[adee5979] | 515 | is set to "no", then only the Sample Tests will be built. Setting |
---|
| 516 | this option to "yes" significantly increases the amount of disk |
---|
| 517 | space required to build RTEMS. |
---|
[b7ea3ec] | 518 | This corresponds to the @code{configure} option @code{--enable-tests}. |
---|
| 519 | |
---|
| 520 | @item ENABLE_RTEMS_TCPIP |
---|
| 521 | is set to "yes" if you want to build the RTEMS TCP/IP Stack. If a |
---|
| 522 | particular BSP does not support TCP/IP, then this feature is automatically |
---|
| 523 | disabled. This corresponds to the @code{configure} option |
---|
| 524 | @code{--enable-tcpip}. |
---|
| 525 | |
---|
[adee5979] | 526 | @item ENABLE_RTEMS_NONDEBUG |
---|
| 527 | is set to "yes" if you want to build RTEMS in a fully optimized |
---|
| 528 | state. This corresponds to executing @code{make} after configuring |
---|
| 529 | the source tree. |
---|
| 530 | |
---|
| 531 | @item ENABLE_RTEMS_DEBUG |
---|
| 532 | is set to "yes" if you want to build RTEMS in a debug version. |
---|
| 533 | When built for debug, RTEMS will include run-time code to |
---|
| 534 | perform consistency checks such as heap consistency checks. |
---|
| 535 | Although the precise compilation arguments are BSP dependent, |
---|
| 536 | the debug version of RTEMS is usually built at a lower optimization |
---|
| 537 | level. This is usually done to reduce inlining which can make |
---|
| 538 | tracing code execution difficult. This corresponds to executing |
---|
| 539 | @code{make VARIANT=debug} after configuring |
---|
| 540 | the source tree. |
---|
| 541 | |
---|
| 542 | @item INSTALL_RTEMS |
---|
| 543 | is set to "yes" if you want to install RTEMS after building it. |
---|
| 544 | This corresponds to executing @code{make install} after configuring |
---|
| 545 | and building the source tree. |
---|
| 546 | |
---|
| 547 | @item ENABLE_RTEMS_MAINTAINER_MODE |
---|
| 548 | is set to "yes" if you want to enabled maintainer mode functionality |
---|
| 549 | in the RTEMS Makefile. This is disabled by default and it is not |
---|
| 550 | expected that most users will want to enable this. When this option |
---|
| 551 | is enabled, the build process may attempt to regenerate files that |
---|
| 552 | require tools not required when this option is disabled. |
---|
| 553 | This corresponds to the @code{configure} option |
---|
| 554 | @code{--enable-maintainer-mode}. |
---|
| 555 | |
---|
[8e8676da] | 556 | @end table |
---|
| 557 | |
---|
[6d3d425d] | 558 | @section Running the bit_ada Script |
---|
[8e8676da] | 559 | |
---|
[6d3d425d] | 560 | After the @code{bit_ada} script has been modified to reflect the |
---|
| 561 | local installation, the modified @code{bit_ada} script is run |
---|
[8e8676da] | 562 | using the following sequence: |
---|
| 563 | |
---|
| 564 | @example |
---|
| 565 | cd tools |
---|
[6d3d425d] | 566 | ./bit_ada <target configuration> |
---|
[8e8676da] | 567 | @end example |
---|
| 568 | |
---|
| 569 | Where <target configuration> is one of the following: |
---|
| 570 | |
---|
| 571 | @itemize @bullet |
---|
| 572 | @item hppa1.1 |
---|
| 573 | @item i386 |
---|
| 574 | @item i386-elf |
---|
| 575 | @item i386-go32 |
---|
| 576 | @item i960 |
---|
| 577 | @item m68k |
---|
| 578 | @item mips64orion |
---|
| 579 | @item powerpc |
---|
| 580 | @item sh |
---|
| 581 | @item sparc |
---|
| 582 | @end itemize |
---|
| 583 | |
---|
[6d3d425d] | 584 | NOTE: The above list of target configurations is the list of RTEMS supported |
---|
| 585 | targets. Only a subset of these have been tested with GNAT/RTEMS. For more |
---|
| 586 | information, contact your GNAT/RTEMS representative. |
---|
| 587 | |
---|
[adee5979] | 588 | The build process can take a while to complete. Many users find it |
---|
| 589 | handy to run the build process in the background, capture the output |
---|
| 590 | in a file, and monitor the output. This can be done as follows: |
---|
| 591 | |
---|
| 592 | @example |
---|
| 593 | ./bit_ada <target configuration> >bit.log 2>&1 & |
---|
| 594 | tail -f bit.log |
---|
| 595 | @end example |
---|
| 596 | |
---|
[6d3d425d] | 597 | If no errors are encountered, the @code{bit_ada} script will conclude by |
---|
[8e8676da] | 598 | printing messages similar to the following: |
---|
| 599 | |
---|
| 600 | @example |
---|
| 601 | |
---|
| 602 | The src and build-i386-tools subdirectory may now be removed. |
---|
| 603 | |
---|
| 604 | Started: Fri Apr 10 10:14:07 CDT 1998 |
---|
| 605 | Finished: Fri Apr 10 12:01:33 CDT 1998 |
---|
| 606 | @end example |
---|
| 607 | |
---|
[6d3d425d] | 608 | If the @code{bit_ada} script successfully completes, then the |
---|
[8e8676da] | 609 | GNU C/C++ cross compilation tools are installed. |
---|
| 610 | |
---|
[6d3d425d] | 611 | If the @code{bit_ada} script does not successfully complete, then investigation |
---|
[8e8676da] | 612 | will be required to determine the source of the error. |
---|
| 613 | |
---|
[6449498] | 614 | @c |
---|
| 615 | @c Common Problems |
---|
| 616 | @c |
---|
| 617 | |
---|
| 618 | @section Common Problems |
---|
| 619 | |
---|
| 620 | @subsection Error Message Indicates Invalid Option to Assembler |
---|
| 621 | |
---|
| 622 | If a message like this is printed then the new cross compiler |
---|
| 623 | is most likely using the native assembler instead of the cross |
---|
| 624 | assembler or vice-versa (native compiler using new cross assembler). |
---|
| 625 | This can occur for one of the following reasons: |
---|
| 626 | |
---|
| 627 | @itemize @bullet |
---|
| 628 | |
---|
| 629 | @item Binutils Patch Improperly Applied |
---|
| 630 | @item Binutils Not Built |
---|
| 631 | @item Current Directory is in Your PATH |
---|
| 632 | |
---|
| 633 | @end itemize |
---|
| 634 | |
---|
| 635 | If you are using binutils 2.9.1 or newer with certain older versions of |
---|
| 636 | gcc, they do not agree on what the name of the newly |
---|
| 637 | generated cross assembler is. Older binutils called it @code{as.new} |
---|
| 638 | which became @code{as.new.exe} under Windows. This is not a valid |
---|
| 639 | file name, so @code{as.new} is now called @code{as-new}. By using the latest |
---|
| 640 | released tool versions and RTEMS patches, this problem will be avoided. |
---|
| 641 | |
---|
| 642 | If binutils did not successfully build the cross assembler, then |
---|
| 643 | the new cross gcc (@code{xgcc}) used to build the libraries can not |
---|
| 644 | find it. Make sure the build of the binutils succeeded. |
---|
| 645 | |
---|
| 646 | If you include the current directory in your PATH, then there |
---|
| 647 | is a chance that the native compiler will accidentally use |
---|
| 648 | the new cross assembler instead of the native one. This usually |
---|
| 649 | indicates that "." is before the standard system directories |
---|
| 650 | in your PATH. As a general rule, including "." in your PATH |
---|
| 651 | is a security risk and should be avoided. Remove "." from |
---|
| 652 | your PATH. |
---|
| 653 | |
---|
| 654 | NOTE: In some environments, it may be difficult to remove "." |
---|
| 655 | completely from your PATH. In this case, make sure that "." |
---|
| 656 | is after the system directories containing "as" and "ld". |
---|
| 657 | |
---|
| 658 | @subsection Error Messages Indicating Configuration Problems |
---|
| 659 | |
---|
| 660 | If you see error messages like the following, |
---|
| 661 | |
---|
| 662 | @itemize @bullet |
---|
| 663 | |
---|
| 664 | @item cannot configure libiberty |
---|
| 665 | @item coff-emulation not found |
---|
| 666 | @item etc. |
---|
| 667 | |
---|
| 668 | @end itemize |
---|
| 669 | |
---|
| 670 | Then it is likely that one or more of your gnu tools is |
---|
| 671 | already configured locally in its source tree. You can check |
---|
| 672 | for this by searching for the @code{config.status} file |
---|
| 673 | in the various tool source trees. The following command |
---|
| 674 | does this for the binutils source: |
---|
| 675 | |
---|
| 676 | @example |
---|
[50bd388] | 677 | find @value{BINUTILSUNTAR} -name config.status -print |
---|
[6449498] | 678 | @end example |
---|
| 679 | |
---|
| 680 | The solution for this is to execute the command |
---|
| 681 | @code{make distclean} in each of the GNU tools |
---|
| 682 | root source directory. This should remove all |
---|
| 683 | generated files including Makefiles. |
---|
| 684 | |
---|
| 685 | This situation usually occurs when you have previously |
---|
| 686 | built the tool source for some non-RTEMS target. The |
---|
| 687 | generated configuration specific files are still in |
---|
| 688 | the source tree and the include path specified during |
---|
| 689 | the RTEMS build accidentally picks up the previous |
---|
| 690 | configuration. The include path used is something like |
---|
| 691 | this: |
---|
| 692 | |
---|
| 693 | @example |
---|
[50bd388] | 694 | -I../../@value{BINUTILSUNTAR}/gcc -I/@value{BINUTILSUNTAR}/gcc/include -I. |
---|
[6449498] | 695 | @end example |
---|
| 696 | |
---|
| 697 | Note that the tool source directory is searched before the |
---|
| 698 | build directory. |
---|
| 699 | |
---|
| 700 | This situation can be avoided entirely by never using |
---|
| 701 | the source tree as the build directory -- even for |
---|
| 702 | |
---|