[all-commits] [llvm/llvm-project] 61ab63: [clang][Driver] Prevent Safe Stack runtime from li...

Douglas via All-commits all-commits at lists.llvm.org
Sat Oct 3 22:16:18 PDT 2026


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 61ab63550e48c9f2e50aa2d5261ee8a5fe319c72
      https://github.com/llvm/llvm-project/commit/61ab63550e48c9f2e50aa2d5261ee8a5fe319c72
  Author: Douglas <Douglas.Gliner at sony.com>
  Date:   2026-10-04 (Sun, 04 Oct 2026)

  Changed paths:
    M clang/lib/Driver/SanitizerArgs.cpp
    M clang/test/Driver/sanitizer-ld.c

  Log Message:
  -----------
  [clang][Driver] Prevent Safe Stack runtime from linking if enabled then disabled (#228537)

Currently:
```
$ ./clang -fsanitize=safe-stack -fno-sanitize=safe-stack -Wl,--trace -x c++ -o- - < /dev/null
...
.../libclang_rt.safestack.a
...
```

See https://godbolt.org/z/e63za9sjn

With this change, `libclang_rt.safestack.a` is not included when Safe
Stack is disabled as the last option. This is because `Kinds` is the
final resolved set of sanitizers after removals via `-fno-sanitize`.
`AllAddedKinds` is the set of all sanitizers which were seen at least
once even if they were removed. This change makes it so we check against
`Kinds` instead of `AllAddedKinds`.

Besides Safe Stack, there are quite a few options resolved and passed to
the driver unintentionally when using particular combinations of
`-fsanitize` and `-fno-sanitize`. This is filed as
https://github.com/llvm/llvm-project/issues/228529.

Should fix https://github.com/llvm/llvm-project/issues/107763.



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list