akhuang added a comment.

This caused a linker error in chromium:

  ld.lld: error: undefined symbol: __warn_memset_zero_len

Apparently now that the glibc memset is being used, __warn_memset_zero_len gets 
called from libc++ code 
(https://github.com/llvm/llvm-project/blob/b72a8c65e4e34779b6bc9e466203f553f5294486/libcxx/include/__bit_reference#L371).

A repro:

  $ cat t.cpp
  #include <bitset>
  void useit(std::bitset<3> &it);
  std::bitset<3> getit();
  int main() {
    std::bitset<3> bits = getit();
    bits.set();
    useit(bits);
  }
  
  $ clang -S -O2 t.cpp  -o - -stdlib=libc++ -D_FORTIFY_SOURCE=1 | grep warn_mem
          callq   __warn_memset_zero_len


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D71082/new/

https://reviews.llvm.org/D71082



_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to