Uploaded image for project: 'Embedded Software & Tools'
  1. Embedded Software & Tools
  2. EXT_EP-10871

Using <iostream> requires large amounts of code space from locale related functions

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Implemented
    • Icon: Medium Medium
    • Code Generation Tools
    • CODEGEN-10301
    • Hide
      ARMCLANG_2.1.0.LTS
      ARMCLANG_1.3.1.LTS
      Show
      ARMCLANG_2.1.0.LTS ARMCLANG_1.3.1.LTS
    • ARMCLANG_4.0.0.LTS*
    • default

      Start with this program ...

      #include <iostream>
      
      int main()
      {
         std::cout << "hello, world!" << std::endl;
      }
      

      Build it with link-time optimization and the most aggressive setting for smaller code size ...

      % tiarmclang -flto -Oz file.cpp -o lto_oz.out -Wl,-c,-m=lto_oz.map
      

      The size numbers are dominated by 1 file from the RTS libraries. These lines are from the MODULE SUMMARY part of the map file ...

             Module                       code     ro data   rw data
             ------                       ----     -------   -------
      ...
          C:\ti\compilers\ti-cgt-armllvm_2.1.0.LTS\lib\armv7em-ti-none-eabihf/libc++.a
             locale.cpp.obj               95844    4398      244    
      

      About 2/3 of the code size comes from this one file.

      Please explore what can be done to reduce the amount of memory required by locale and related functions.

            syncuser TI User
            syncuser TI User
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: