Linker option --scan_libraries mistakenly complains about duplicate symbols when a library is supplied multiple times

XMLWordPrintable

    • Type: Bug
    • Resolution: Fixed
    • Priority: Medium

      This test case puts a simple function in a library, and calls it. Then it links it with a command that uses the library two times, and --scan_libraries.

      C:\examples>type inlib.c
      void inlib() {}
      
      C:\examples>tiarmclang -c inlib.c
      
      C:\examples>tiarmar -r t.lib inlib.o
      tiarmar.exe: warning: creating t.lib
      
      C:\examples>type main.c
      void inlib();
      
      int main()
      {
          inlib();
          return 0;
      }
      
      C:\examples>tiarmclang -c main.c
      
      C:\examples>tiarmclang -o test.out main.o t.lib t.lib -Wl,-c,--scan_libraries
      warning: Symbol "TI_memcpy_small" (pulled from
         "C:\ti\compilers\ti-cgt-armllvm_3.2.2.LTS\lib\armv7em-ti-none-eabihf/c/libc.
         a<memcpy_t2.S.obj>") defined in 2 places:
         C:\ti\compilers\ti-cgt-armllvm_3.2.2.LTS\lib\armv7em-ti-none-eabihf/c/libc.a
         <memcpy_t2.S.obj>
         C:\ti\compilers\ti-cgt-armllvm_3.2.2.LTS\lib\armv7em-ti-none-eabihf/c/libsys
         bm.a<memcpy_t2.S.obj>
      
      warning: Symbol "TI_memset_small" (pulled from
         "C:\ti\compilers\ti-cgt-armllvm_3.2.2.LTS\lib\armv7em-ti-none-eabihf/c/libc.
         a<memset_t2.S.obj>") defined in 2 places:
         C:\ti\compilers\ti-cgt-armllvm_3.2.2.LTS\lib\armv7em-ti-none-eabihf/c/libc.a
         <memset_t2.S.obj>
         C:\ti\compilers\ti-cgt-armllvm_3.2.2.LTS\lib\armv7em-ti-none-eabihf/c/libsys
         bm.a<memset_t2.S.obj>
      
      <Many similar warnings deleted>
      
      warning: Symbol "inlib" (pulled from "t.lib<inlib.o>") defined in 2 places:
         t.lib<inlib.o>
         t.lib<inlib.o>
      

      Notice the diagnostic about the symbol inlib. It should not be emitted, because it comes from the same library.

      Notice the diagnostics about symbols from the compiler RTS libraries. They should not be emitted, because the user cannot control that symbol duplication.

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

              Created:
              Updated:
              Resolved:

                Connection: Intermediate to External PROD System
                EXTSYNC-4676 - Linker option --scan_libraries mist...
                SYNCHRONIZED
                • Last Sync Date: