<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 - clang-13.0.0 crash when building crypto++-8.6 with -fwhole-program-vtables"
   href="https://bugs.llvm.org/show_bug.cgi?id=52282">52282</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>clang-13.0.0 crash when building crypto++-8.6 with -fwhole-program-vtables
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>clang
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>trunk
          </td>
        </tr>

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

        <tr>
          <th>OS</th>
          <td>Linux
          </td>
        </tr>

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

        <tr>
          <th>Severity</th>
          <td>normal
          </td>
        </tr>

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

        <tr>
          <th>Component</th>
          <td>-New Bugs
          </td>
        </tr>

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

        <tr>
          <th>Reporter</th>
          <td>jannik.glueckert@gmail.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>htmldeveloper@gmail.com, llvm-bugs@lists.llvm.org, neeilans@live.com, richard-llvm@metafoo.co.uk
          </td>
        </tr></table>
      <p>
        <div>
        <pre>I have encountered the following crash when building the library crypto++-8.6 (
<a href="https://github.com/weidai11/cryptopp">https://github.com/weidai11/cryptopp</a> ) with clang-12.0.1 and clang-13.0.0 (did
not try older versions) with the flag -fwhole-program-vtables.

The full build environment was:
CFLAGS / CXXFLAGS='-march=znver2 -O3 -flto=thin -fwhole-program-vtables
-fstack-protector-strong -fstack-clash-protection -fPIC -D_FORTIFY_SOURCE=2'
LDFLAGS='-Wl,-O2 -Wl,--as-needed -Wl,-z,relro,-z,now -flto=thin -fuse-ld=lld
-pie -rtlib=compiler-rt -unwindlib=libgcc'

If needed I can rebuild with debug info and run through lldb.

Alias must point to a definition
void (%"class.CryptoPP::IteratedHashBase.96"*)*
@_ZN8CryptoPP16IteratedHashBaseImNS_18HashTransformationEED1Ev
LLVM ERROR: Broken module found, compilation aborted!
PLEASE submit a bug report to <a href="https://bugs.llvm.org/">https://bugs.llvm.org/</a> and include the crash
backtrace.
Stack dump:
0.      Program arguments: /usr/bin/ld.lld --eh-frame-hdr -m elf_x86_64 -shared
-o libcryptopp.so.8.6.0
/usr/lib/gcc/x86_64-pc-linux-gnu/11.2.0/../../../../lib64/crti.o 
/usr/lib/llvm/13/bin/../../../../lib/clang/13.0.0/lib/linux/clang_rt.crtbegin-x86_64.o
-L/usr/lib/gcc/x86_64-pc-linux-gnu/11.2.0
-L/usr/lib/gcc/x86_64-pc-linux-gnu/11.2.
0/../../../../lib64 -L/lib/../lib64 -L/usr/lib/../lib64
-L/usr/lib/gcc/x86_64-pc-linux-gnu/11.2.0/../../../../x86_64-pc-linux-gnu/lib
-L/usr/lib/llvm/13/bin/../lib -L/li
b -L/usr/lib -plugin-opt=mcpu=znver2 -plugin-opt=O3 -plugin-opt=thinlto -soname
libcryptopp.so.8 -O2 --as-needed -z relro -z now cryptlib.o cpu.o integer.o
3way.o adler3
2.o algebra.o algparam.o allocate.o arc4.o aria.o aria_simd.o ariatab.o asn.o
authenc.o base32.o base64.o basecode.o bfinit.o blake2.o blake2b_simd.o
blake2s_simd.o blow
fish.o blumshub.o camellia.o cast.o casts.o cbcmac.o ccm.o chacha.o
chacha_avx.o chacha_simd.o chachapoly.o cham.o cham_simd.o channels.o cmac.o
crc.o crc_simd.o darn.o 
default.o des.o dessp.o dh.o dh2.o dll.o donna_32.o donna_64.o donna_sse.o
dsa.o eax.o ec2n.o eccrypto.o ecp.o elgamal.o emsa2.o eprecomp.o esign.o
files.o filters.o fip
s140.o fipstest.o gcm.o gcm_simd.o gf256.o gf2_32.o gf2n.o gf2n_simd.o
gfpcrypt.o gost.o gzip.o hc128.o hc256.o hex.o hight.o hmac.o hrtimer.o ida.o
idea.o iterhash.o ka
lyna.o kalynatab.o keccak.o keccak_core.o keccak_simd.o lea.o lea_simd.o
lsh256.o lsh256_avx.o lsh256_sse.o lsh512.o lsh512_avx.o lsh512_sse.o luc.o
mars.o marss.o md2.o
 md4.o md5.o misc.o modes.o mqueue.o mqv.o nbtheory.o oaep.o osrng.o padlkrng.o
panama.o pkcspad.o poly1305.o polynomi.o pssr.o pubkey.o queue.o rabbit.o
rabin.o randpoo
l.o rc2.o rc5.o rc6.o rdrand.o rdtables.o rijndael.o rijndael_simd.o ripemd.o
rng.o rsa.o rw.o safer.o salsa.o scrypt.o seal.o seed.o serpent.o sha.o sha3.o
sha_simd.o s
hacal2.o shacal2_simd.o shake.o shark.o sharkbox.o simeck.o simon.o
simon128_simd.o skipjack.o sm3.o sm4.o sm4_simd.o sosemanuk.o speck.o
speck128_simd.o square.o square
tb.o sse_simd.o strciphr.o tea.o tftables.o threefish.o tiger.o tigertab.o
ttmac.o tweetnacl.o twofish.o vmac.o wake.o whrlpool.o xed25519.o xtr.o
xtrcrypt.o xts.o zdefl
ate.o zinflate.o zlib.o -lstdc++ -lm
/usr/lib/llvm/13/bin/../../../../lib/clang/13.0.0/lib/linux/libclang_rt.builtins-x86_64.a
-lgcc_s -lpthread -lc /usr/lib/llvm/13/bin
/../../../../lib/clang/13.0.0/lib/linux/libclang_rt.builtins-x86_64.a -lgcc_s
/usr/lib/llvm/13/bin/../../../../lib/clang/13.0.0/lib/linux/clang_rt.crtend-x86_64.o
/usr/l
ib/gcc/x86_64-pc-linux-gnu/11.2.0/../../../../lib64/crtn.o
 #0 0x000071e496aac4e1 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int)
(/usr/lib/llvm/13/lib64/libLLVM-13.so+0x20814e1)
 #1 0x000071e496aaa0c0 llvm::sys::RunSignalHandlers()
(/usr/lib/llvm/13/lib64/libLLVM-13.so+0x207f0c0)
 #2 0x000071e496aaca46 (/usr/lib/llvm/13/lib64/libLLVM-13.so+0x2081a46)
 #3 0x000071e4945afd60 (/lib64/libc.so.6+0x38d60)
 #4 0x000071e4945afce7 raise (/lib64/libc.so.6+0x38ce7)
 #5 0x000071e49459953b abort (/lib64/libc.so.6+0x2253b)
 #6 0x000071e4969e3379 llvm::report_fatal_error(llvm::Twine const&, bool)
(/usr/lib/llvm/13/lib64/libLLVM-13.so+0x1fb8379)
 #7 0x000071e4969e3236 (/usr/lib/llvm/13/lib64/libLLVM-13.so+0x1fb8236)
 #8 0x000071e496c5bdcf (/usr/lib/llvm/13/lib64/libLLVM-13.so+0x2230dcf)
 #9 0x000071e498027f3d (/usr/lib/llvm/13/lib64/libLLVM-13.so+0x35fcf3d)
#10 0x000071e496c2ee70 llvm::PassManager<llvm::Module,
llvm::AnalysisManager<llvm::Module> >::run(llvm::Module&,
llvm::AnalysisManager<llvm::Module>&)
(/usr/lib/llvm/13/lib64/libLLVM-13.so+0x2203e70)
#11 0x000071e498021727 llvm::lto::opt(llvm::lto::Config const&,
llvm::TargetMachine*, unsigned int, llvm::Module&, bool,
llvm::ModuleSummaryIndex*, llvm::ModuleSummaryIndex const*,
std::vector<unsigned char, std::allocator<unsigned char> > const&)
(/usr/lib/llvm/13/lib64/libLLVM-13.so+0x35f6727)
#12 0x000071e49802293b llvm::lto::backend(llvm::lto::Config const&,
std::function<std::unique_ptr<llvm::lto::NativeObjectStream,
std::default_delete<llvm::lto::NativeObjectStream> > (unsigned int)>, unsigned
int, llvm::Module&, llvm::ModuleSummaryIndex&)
(/usr/lib/llvm/13/lib64/libLLVM-13.so+0x35f793b)
#13 0x000071e498015410
llvm::lto::LTO::runRegularLTO(std::function<std::unique_ptr<llvm::lto::NativeObjectStream,
std::default_delete<llvm::lto::NativeObjectStream> > (unsigned int)>)
(/usr/lib/llvm/13/lib64/libLLVM-13.so+0x35ea410)
#14 0x000071e498014a13
llvm::lto::LTO::run(std::function<std::unique_ptr<llvm::lto::NativeObjectStream,
std::default_delete<llvm::lto::NativeObjectStream> > (unsigned int)>,
std::function<std::function<std::unique_ptr<llvm::lto::NativeObjectStream,
std::default_delete<llvm::lto::NativeObjectStream> > (unsigned int)> (unsigned
int, llvm::StringRef)>) (/usr/lib/llvm/13/lib64/libLLVM-13.so+0x35e9a13)
#15 0x000071e49987ebc6 lld::elf::BitcodeCompiler::compile()
(/usr/bin/../lib64/liblldELF.so.13+0x1d7bc6)
#16 0x000071e4997eafc0 (/usr/bin/../lib64/liblldELF.so.13+0x143fc0)
#17 0x000071e4997d585b lld::elf::LinkerDriver::linkerMain(llvm::ArrayRef<char
const*>) (/usr/bin/../lib64/liblldELF.so.13+0x12e85b)
#18 0x000071e4997d32d9 lld::elf::link(llvm::ArrayRef<char const*>, bool,
llvm::raw_ostream&, llvm::raw_ostream&)
(/usr/bin/../lib64/liblldELF.so.13+0x12c2d9)
#19 0x000058227a944fb4 (/usr/bin/ld.lld+0x4fb4)
#20 0x000058227a944832 main (/usr/bin/ld.lld+0x4832)
#21 0x000071e49459a858 __libc_start_main (/lib64/libc.so.6+0x23858)
#22 0x000058227a9444ba _start (/usr/bin/ld.lld+0x44ba)
clang-13: error: unable to execute command: Aborted (core dumped)
clang-13: error: linker command failed due to signal (use -v to see invocation)</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>