[all-commits] [llvm/llvm-project] 315a5c: [libc] move __stack_chk_fail to src/ from startup/...

Nick Desaulniers via All-commits all-commits at lists.llvm.org
Tue Dec 19 11:05:26 PST 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 315a5cce89d8f15da5c47d85abbc8155b9c0f0b0
      https://github.com/llvm/llvm-project/commit/315a5cce89d8f15da5c47d85abbc8155b9c0f0b0
  Author: Nick Desaulniers <nickdesaulniers at users.noreply.github.com>
  Date:   2023-12-19 (Tue, 19 Dec 2023)

  Changed paths:
    M libc/config/baremetal/arm/entrypoints.txt
    M libc/config/baremetal/riscv/entrypoints.txt
    M libc/config/linux/aarch64/entrypoints.txt
    M libc/config/linux/arm/entrypoints.txt
    M libc/config/linux/riscv/entrypoints.txt
    M libc/config/linux/x86_64/entrypoints.txt
    M libc/src/CMakeLists.txt
    A libc/src/compiler/CMakeLists.txt
    A libc/src/compiler/__stack_chk_fail.h
    A libc/src/compiler/generic/CMakeLists.txt
    A libc/src/compiler/generic/__stack_chk_fail.cpp
    M libc/startup/linux/x86_64/start.cpp
    M libc/test/src/CMakeLists.txt
    A libc/test/src/compiler/CMakeLists.txt
    A libc/test/src/compiler/stack_chk_guard_test.cpp

  Log Message:
  -----------
  [libc] move __stack_chk_fail to src/ from startup/ (#75863)

__stack_chk_fail should be provided by libc.a, not startup files.

Add __stack_chk_fail to existing linux and arm entrypoints. On Windows
(when
not targeting MinGW), it seems that the corresponding function
identifier is
__security_check_cookie, so no entrypoint is added for Windows.
Baremetal
targets also ought to be compileable with `-fstack-protector*`

There is no common header for this prototype, since calls to
__stack_chk_fail
are meant to be inserted by the compiler upon function return when
compiled
`-fstack-protector*`.




More information about the All-commits mailing list