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

Compiler inconsistently handles multiple definitions of a global variable in different files with and without link time optimization

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Low Low

      The attached files each contain this variable definition ...

      void *global_handle;
      

      Build it with no optimization ...

      % armcl -mv7m4 -mt -me f1.c f2.c -z -o f.out
      [f1.c]
      [f2.c]
      <Linking>
      

      ... a clean build results. Build it with link time optimization ...

      % armcl -mv7m4 -mt -me -o4 f1.c f2.c -z -o f.out
      [f1.c]
      [f2.c]
      <Linking>
      error: symbol "global_handle" has already been defined
      
      >> Compilation failure
      
      >> Compilation failure
      fatal error: Failed linktime optimization
      
      >> Compilation failure
      

      ... errors are emitted.

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

              Created:
              Updated: