
GNAT User’s Guide Supplement for Cross Platforms Release 23.0w AdaCore Sep 29, 2021 GNAT User’s Guide Supplement for Cross Platforms 23.0w This page is intentionally left blank. 2 of 204 GNAT User’s Guide Supplement for Cross Platforms GNAT User’s Guide Supplement for Cross Platforms 23.0w GNAT, The GNU Ada Development Environment GNAT Pro Edition Version 23.0w Date: Sep 29, 2021 AdaCore Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.3 or any later version published by the Free Software Foundation; with no Invariant Sections, with the Front-Cover Texts being “GNAT Reference Manual”, and with no Back-Cover Texts. A copy of the license is included in the section entitled GNU Free Documentation License. GNAT User’s Guide Supplement for Cross Platforms 3 of 204 GNAT User’s Guide Supplement for Cross Platforms 23.0w This page is intentionally left blank. 4 of 204 GNAT User’s Guide Supplement for Cross Platforms GNAT User’s Guide Supplement for Cross Platforms 23.0w CONTENTS 1 About This Guide 13 1.1 What This Guide Contains........................................ 13 1.2 What You Should Know before Reading This Guide........................... 14 1.3 Related Information............................................ 14 1.4 Conventions................................................ 15 2 Introduction to GNAT for Cross Platforms 17 2.1 Toolchain for Cross Platforms...................................... 17 2.2 Specifying the Target........................................... 17 2.3 Specifying the Run-Time Library..................................... 18 2.4 GNAT C/C++ for Cross Platforms.................................... 18 2.4.1 Supported C++ Version...................................... 18 2.4.2 Mixed-Language Programming using GNAT Exclusively.................... 18 3 The Primary and Secondary Stacks 19 3.1 The Primary Stack............................................ 19 3.1.1 The Default Primary Stack Size................................. 19 3.1.2 Per-Task Primary Stack Size................................... 20 3.1.3 Environment Task Primary Stack Size.............................. 20 3.2 The Secondary Stack........................................... 21 3.2.1 Fixed Secondary Stack Allocation................................ 21 3.2.2 Dynamic Secondary Stack Allocation.............................. 22 3.2.3 Disabling the Secondary Stack.................................. 22 4 Predefined Profiles 23 4.1 The Ravenscar Profiles.......................................... 23 4.2 The Jorvik Profile............................................. 23 4.2.1 Number of Entries Per Protected Object............................. 24 4.2.2 Number of Queued Callers per Entry.............................. 24 4.2.3 Entry Barriers........................................... 24 4.2.4 Relative Delay Statements.................................... 25 4.2.5 Additional Non-Tasking Restrictions Removed......................... 25 No_Implicit_Heap_Allocations................................. 25 No Dependence on Ada.Calendar................................ 25 5 Predefined GNAT Pro Run-Times 27 5.1 Standard Run-Time............................................ 27 5.2 Embedded Run-Time........................................... 27 5.3 Light Run-Time.............................................. 28 5.3.1 Allocator Support......................................... 29 GNAT User’s Guide Supplement for Cross Platforms 5 of 204 GNAT User’s Guide Supplement for Cross Platforms 23.0w 5.3.2 Certification........................................... 29 5.3.3 Excluding the Run-Time Library................................. 30 5.3.4 Exceptions and the Last Chance Handler............................ 31 5.4 Light-Tasking Run-Time......................................... 31 5.5 Specifying a Run-Time.......................................... 32 6 The GNAT Configurable Run-Time Facility 33 6.1 Standard Run-Time............................................ 33 6.2 The Configurable Run-Time....................................... 33 6.3 Run-Time Libraries and Objects..................................... 34 6.3.1 GNAT Run-Time Library..................................... 34 6.3.2 C Library............................................. 35 6.3.3 Math Library........................................... 35 6.3.4 Internal GCC Library....................................... 35 6.3.5 Startup and Cleanup Code.................................... 36 6.4 Run-Time Dependencies in User Code.................................. 36 6.4.1 Explicit with Clauses...................................... 36 6.4.2 Compiler-Generated Calls to the GNAT Run-Time Library................... 36 6.4.3 Pragma Import.......................................... 36 6.4.4 Back-End Generated Calls to Library Functions......................... 37 6.5 How The Run Time Library Is Configured................................ 37 6.5.1 Configuration Pragmas...................................... 37 6.5.2 Specification of Configuration Parameters............................ 38 6.5.3 Restricting the Set of Run-Time Units.............................. 44 6.6 Naming the Run-Time Library...................................... 45 6.7 Creating a Configurable Run-Time Library................................ 45 7 Support for Certified Systems 47 7.1 The Certification Philosophy....................................... 47 7.2 Using GNAT Pro Features Relevant to Certification........................... 48 7.2.1 Exceptions............................................ 48 7.2.2 Allocators............................................. 50 7.2.3 Array and Record Assignments................................. 51 7.2.4 Object-Oriented Programming.................................. 52 7.2.5 Functions Returning Unconstrained Objects........................... 53 7.2.6 Controlling Implicit Conditionals and Loops.......................... 53 7.2.7 Controlling Use of Conditional Operators............................ 55 7.2.8 Avoiding Elaboration Code.................................... 55 7.2.9 Removal of Deactivated Code.................................. 57 7.2.10 Traceability from Source Code to Object Code......................... 58 7.2.11 Optimization issues........................................ 59 7.2.12 Other useful features....................................... 59 7.2.13 Program Build Options...................................... 59 Compiler Switches........................................ 59 gnatbind Switches....................................... 60 A VxWorks Topics 61 A.1 Common VxWorks Topics........................................ 61 A.1.1 VxWorks Kernel Requirements................................. 61 A.1.2 Executing a Program on VxWorks................................ 62 Loading and Running the Program................................ 62 Unloading the Program...................................... 62 A.1.3 Mixed-Language Programming on VxWorks using GNAT Exclusively............. 63 A.1.4 Mixed-Language Programming using the VxWorks C/C++ Compilers............. 63 6 of 204 GNAT User’s Guide Supplement for Cross Platforms GNAT User’s Guide Supplement for Cross Platforms 23.0w A.1.5 Interoperability with VxWorks C/C++ Compilers........................ 63 A.1.6 Exception Handling....................................... 63 Exception Integration Schemes.................................. 64 Exception Propagation Schemes................................. 65 ZCX on VxWorks........................................ 66 Mixing Ada and C++ in Workbench............................... 66 A.1.7 Kernel Configuration for VxWorks................................ 68 A.1.8 Main Task Attributes and the Application Stub......................... 68 A.1.9 Stack Overflow Checking on VxWorks............................. 69 A.1.10 Interrupt Handling for VxWorks................................. 70 A.1.11 Handling Relocation Issues for PowerPC Targets........................ 78 Kernel Mode........................................... 78 RTPs............................................... 79 A.1.12 Calling exported Ada procedures from the VxWorks shell................... 79 A.1.13 Simulating Command Line Arguments for VxWorks...................... 81 A.1.14 Traceback Support on VxWorks................................. 82 Traceback Computation When Using Restricted Runtimes................... 82 A.1.15 Using addr2line on VxWorks................................... 82 Differences between VxWorks and native platforms....................... 82 Using <target>-vxaddr2line................................... 83 An example............................................ 83 A.1.16 Removal of Unused Code and Data............................... 85 A.1.17 Debugging............................................ 85 A.1.18 Frequently Asked Questions for VxWorks............................ 86 A.2 Workbench / VxWorks 6.x Topics.................................... 87 A.2.1 Installing GNAT for VxWorks 6................................. 87 A.2.2 Using GNAT for VxWorks 6................................... 87 A.2.3 Building a VxWorks 6 Application................................ 88 Building from Workbench.................................... 88 Building from GNAT Studio................................... 88 RTPs and kernel modules..................................... 89 A.2.4 SMP Support........................................... 90 A.2.5 Using the VxWorks 6 Simulator................................. 91 A.2.6 Debugging an Application on VxWorks 6...........................
Details
-
File Typepdf
-
Upload Time-
-
Content LanguagesEnglish
-
Upload UserAnonymous/Not logged-in
-
File Pages204 Page
-
File Size-