[libcxx-commits] [PATCH] D107560: [libc++][libc++abi][CET] Support building libc++ and libc++abi with CET enabled.

xiongji90 via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Thu Aug 5 05:13:45 PDT 2021


xiongji90 created this revision.
xiongji90 added reviewers: hjl.tools, compnerd, manojgupta.
Herald added subscribers: pengfei, arichardson, mgorny.
xiongji90 requested review of this revision.
Herald added projects: libc++, libc++abi.
Herald added a subscriber: libcxx-commits.
Herald added a reviewer: libc++.
Herald added a reviewer: libc++abi.

Control-flow Enforcement Technology (CET), published by Intel, introduces indirect branch tracking (IBT) to guard all indirect 'jmp' and 'call'. The target of indirect 'jmp' or 'call' begin with 'endbr' instruction. Currently, CET has been implemented in x86 GNU Linux platforms.
In order to enable CET when building applications, we need to ensure:

1. building source code with '-fcf-protection=full'
2. all libraries linked must be CET enabled

This patch is used to build libc++ and libc++abi with CET enabled. If developers want to build applications with CET enabled and use libc++ and libc++abi, they must link CET enabled libc++ and libc++abi libraries. We introduce 2 options: LIBCXX_ENABLE_CET and LIBCXXABI_ENABLE_CET to enable CET building. This patch also enables running all libcxx and libcxxabi tests with CET enabled.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D107560

Files:
  libcxx/CMakeLists.txt
  libcxx/test/CMakeLists.txt
  libcxx/test/configs/legacy.cfg.in
  libcxx/utils/libcxx/test/config.py
  libcxxabi/CMakeLists.txt
  libcxxabi/test/CMakeLists.txt
  libcxxabi/test/libcxxabi/test/config.py
  libcxxabi/test/lit.site.cfg.in

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D107560.364426.patch
Type: text/x-patch
Size: 6502 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/libcxx-commits/attachments/20210805/91973463/attachment.bin>


More information about the libcxx-commits mailing list