<html>
    <head>
      <base href="https://bugs.llvm.org/">
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - Error in static libraries for LLVM 7 on Debian 9"
   href="https://bugs.llvm.org/show_bug.cgi?id=40059">40059</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>Error in static libraries for LLVM 7 on Debian 9
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>Packaging
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>unspecified
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>PC
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>All
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>NEW
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>enhancement
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>P
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>deb packages
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>unassignedbugs@nondot.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>maxime.arthaud@nasa.gov
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvm-bugs@lists.llvm.org
          </td>
        </tr></table>
      <p>
        <div>
        <pre>Hello,

It looks like there is something wrong with the static libraries provided by
llvm-7-dev on Debian 9.6
I'm getting link errors when I try to compile my tool.


root@f67f01e4d08f:~/ikos/build# make all
[...]
[ 35%] Linking CXX executable ikos-pp
/usr/bin/ld: /usr/lib/llvm-7/lib/libLLVMBitWriter.a(BitcodeWriterPass.cpp.o):
SHT_GROUP section [index 24] has no SHF_GROUP sections
/usr/bin/ld: /usr/lib/llvm-7/lib/libLLVMBitWriter.a(BitcodeWriterPass.cpp.o):
SHT_GROUP section [index 25] has no SHF_GROUP sections
/usr/bin/ld: /usr/lib/llvm-7/lib/libLLVMBitWriter.a(BitcodeWriterPass.cpp.o):
SHT_GROUP section [index 26] has no SHF_GROUP sections
/usr/bin/ld: /usr/lib/llvm-7/lib/libLLVMBitWriter.a(BitcodeWriterPass.cpp.o):
SHT_GROUP section [index 24] has no SHF_GROUP sections
/usr/bin/ld: /usr/lib/llvm-7/lib/libLLVMBitWriter.a(BitcodeWriterPass.cpp.o):
SHT_GROUP section [index 25] has no SHF_GROUP sections
/usr/bin/ld: /usr/lib/llvm-7/lib/libLLVMBitWriter.a(BitcodeWriterPass.cpp.o):
SHT_GROUP section [index 26] has no SHF_GROUP sections
/usr/lib/llvm-7/lib/libLLVMBitWriter.a: error adding symbols: File format not
recognized
collect2: error: ld returned 1 exit status
frontend/llvm/CMakeFiles/ikos-pp.dir/build.make:134: recipe for target
'frontend/llvm/ikos-pp' failed
make[2]: *** [frontend/llvm/ikos-pp] Error 1
CMakeFiles/Makefile2:1547: recipe for target
'frontend/llvm/CMakeFiles/ikos-pp.dir/all' failed
make[1]: *** [frontend/llvm/CMakeFiles/ikos-pp.dir/all] Error 2
Makefile:138: recipe for target 'all' failed
make: *** [all] Error 2


It seems like all the .a have an invalid format:

root@f67f01e4d08f:~/ikos/build# nm /usr/lib/llvm-7/lib/libLLVMBitWriter.a

BitWriter.cpp.o:
0000000000000000 T LLVMWriteBitcodeToFD
0000000000000000 T LLVMWriteBitcodeToFile
0000000000000000 T LLVMWriteBitcodeToFileHandle
0000000000000000 T LLVMWriteBitcodeToMemoryBuffer
                 U _ZN4llvm11raw_ostream14flush_nonemptyEv
                 U
_ZN4llvm12MemoryBuffer16getMemBufferCopyENS_9StringRefERKNS_5TwineE
                 U
_ZN4llvm14raw_fd_ostreamC1ENS_9StringRefERSt10error_codeNS_3sys2fs9OpenFlagsE
                 U _ZN4llvm14raw_fd_ostreamC1Eibb
                 U _ZN4llvm14raw_fd_ostreamD1Ev
                 U
_ZN4llvm18WriteBitcodeToFileERKNS_6ModuleERNS_11raw_ostreamEbPKNS_18ModuleSummaryIndexEbPSt5arrayIjLm5EE
                 U _ZN4llvm18raw_string_ostreamD1Ev
                 U _ZN4llvm24DisableABIBreakingChecksE
0000000000000000 V _ZN4llvm30VerifyDisableABIBreakingChecksE
                 U _ZNSt3_V215system_categoryEv
                 U _ZTVN4llvm18raw_string_ostreamE
                 U _ZdlPv
                 U strlen
nm: /usr/lib/llvm-7/lib/libLLVMBitWriter.a(BitcodeWriter.cpp.o): SHT_GROUP
section [index 179] has no SHF_GROUP sections
nm: /usr/lib/llvm-7/lib/libLLVMBitWriter.a(BitcodeWriter.cpp.o): SHT_GROUP
section [index 180] has no SHF_GROUP sections
nm: /usr/lib/llvm-7/lib/libLLVMBitWriter.a(BitcodeWriter.cpp.o): SHT_GROUP
section [index 181] has no SHF_GROUP sections
[...]
nm: /usr/lib/llvm-7/lib/libLLVMBitWriter.a(BitcodeWriter.cpp.o): SHT_GROUP
section [index 277] has no SHF_GROUP sections
nm: BitcodeWriter.cpp.o: File format not recognized
nm: /usr/lib/llvm-7/lib/libLLVMBitWriter.a(BitcodeWriterPass.cpp.o): SHT_GROUP
section [index 24] has no SHF_GROUP sections
nm: /usr/lib/llvm-7/lib/libLLVMBitWriter.a(BitcodeWriterPass.cpp.o): SHT_GROUP
section [index 25] has no SHF_GROUP sections
nm: /usr/lib/llvm-7/lib/libLLVMBitWriter.a(BitcodeWriterPass.cpp.o): SHT_GROUP
section [index 26] has no SHF_GROUP sections
[...]
nm: BitcodeWriterPass.cpp.o: File format not recognized
nm: /usr/lib/llvm-7/lib/libLLVMBitWriter.a(ValueEnumerator.cpp.o): SHT_GROUP
section [index 94] has no SHF_GROUP sections
nm: /usr/lib/llvm-7/lib/libLLVMBitWriter.a(ValueEnumerator.cpp.o): SHT_GROUP
section [index 95] has no SHF_GROUP sections
nm: /usr/lib/llvm-7/lib/libLLVMBitWriter.a(ValueEnumerator.cpp.o): SHT_GROUP
section [index 96] has no SHF_GROUP sections
[...]
nm: ValueEnumerator.cpp.o: File format not recognized


To reproduce:
# echo "deb <a href="http://apt.llvm.org/stretch/">http://apt.llvm.org/stretch/</a> llvm-toolchain-stretch-7 main" >>
/etc/apt/sources.list
# apt-get update
# apt-get install -y --allow-unauthenticated llvm-7-dev
# nm /usr/lib/llvm-7/lib/libLLVMBitWriter.a


Bug report on IKOS: <a href="https://github.com/NASA-SW-VnV/ikos/issues/23">https://github.com/NASA-SW-VnV/ikos/issues/23</a></pre>
        </div>
      </p>


      <hr>
      <span>You are receiving this mail because:</span>

      <ul>
          <li>You are on the CC list for the bug.</li>
      </ul>
    </body>
</html>