From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=unavailable autolearn_force=no version=3.4.4 Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!news.eternal-september.org!mx02.eternal-september.org!.POSTED!not-for-mail From: Simon Wright Newsgroups: comp.lang.ada Subject: Packed array problem Date: Wed, 02 Mar 2016 17:26:27 +0000 Organization: A noiseless patient Spider Message-ID: Mime-Version: 1.0 Content-Type: text/plain Injection-Info: mx02.eternal-september.org; posting-host="03d977edd803a9f1bf346d48fa393156"; logging-data="11689"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+4TuqEWwkgZnR2SJyP6DTXzBcCEa1stFI=" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.5 (darwin) Cancel-Lock: sha1:1CzGcLtcr4nDJxc8TdOrP/sIZKE= sha1:/M8/QPOsYD/EQqfpE1XvB2KpHdE= Xref: news.eternal-september.org comp.lang.ada:29652 Date: 2016-03-02T17:26:27+00:00 List-Id: Investigating the SVD2Ada program[1], for converting an ARM System View Description[2] into bindings, I got this message when compiling against my STM32F429I runtime: stm32f429x-rcc.ads:149:09: packing of 3-bit components not supported by configuration which is the same as in this little example: 1. package Checks is 2. type Uint3 is mod 8 with Size => 3; 3. type Arry is array (0 .. 1) of Uint3 | >>> packing of 3-bit components not supported by configuration 4. with Component_Size => 3, Size => 6; 5. end Checks; This code compiles perfectly happily against AdaCore's ravenscar-sfp runtime. The error message comes from freeze.adb:2721 in the compiler: if Is_Constrained (Arr) and then Is_Bit_Packed_Array (Arr) and then Present (Packed_Array_Impl_Type (Arr)) and then Is_Array_Type (Packed_Array_Impl_Type (Arr)) then declare CS : constant Uint := Component_Size (Arr); RE : constant RE_Id := Get_Id (UI_To_Int (CS)); begin if RE /= RE_Null and then not RTE_Available (RE) then Error_Msg_CRT ("packing of " & UI_Image (CS) & "-bit components", First_Subtype (Etype (Arr))); and it would seem after much delving that the compiler is checking (in rtsfind) for System.Pack_03, which isn't present in my runtime. If I copy the spec from GCC 5.2.0 (not 4.9 - the interface has changed) then check.ads compiles OK (I should say I normally use GCC 5.2.0, but this problem is the same with GNAT GPL 2015). BUT there is no s-pack03.ad? in AdaCore's arm-eabi runtimes! And when compiling against the AdaCore runtimes there's no reference in the generated binary to s-pack03! SO has anyone got any idea as to what the compiler could be looking for and finding in AdaCore's RTS but not in mine? [1] https://github.com/AdaCore/svd2ada [2] http://www.arm.com/products/processors/cortex-m/cortex-microcontroller-software-interface-standard.php