gn: Don't set -fno-rtti when is_ubsan is true#1998
Merged
Conversation
LalitMaganti
approved these changes
Jul 2, 2025
ee0e3e4 to
7b4523b
Compare
Generally, we build perfetto with -fno-rtti. However, this is incompatible with some UBSAN configurations, notably -fsanitize=vptr. Since we don't know if someone downstream will use -fsanitize=vptr, don't pass -fno-rtti when is_ubsan is true. This produces code which is compatible with clients using -fsanitize=vptr. Bug: 422542836 Test: In ChromeOS chroot: Test: USE=ubsan emerge-$BOARD perfetto vulkan-shader-profiler Change-Id: I1bf8950af457a708c93a30f6eefee1bff519cf4c
7b4523b to
ac677fb
Compare
olehkuznetsov
pushed a commit
to olehkuznetsov/perfetto
that referenced
this pull request
Mar 12, 2026
Generally, we build perfetto with -fno-rtti. However, this is incompatible with some UBSAN configurations, notably -fsanitize=vptr. Since we don't know if someone downstream will use -fsanitize=vptr, don't pass -fno-rtti when is_ubsan is true. This produces code which is compatible with clients using -fsanitize=vptr. Bug: 422542836 Test: In ChromeOS chroot: Test: USE=ubsan emerge-$BOARD perfetto vulkan-shader-profiler Change-Id: I1bf8950af457a708c93a30f6eefee1bff519cf4c
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Generally, we build perfetto with -fno-rtti. However, this is incompatible with some UBSAN configurations, notably -fsanitize=vptr. Since we don't know if someone downstream will use -fsanitize=vptr, don't pass -fno-rtti when is_ubsan is true. This produces code which is compatible with clients using -fsanitize=vptr.
Bug: 422542836
Test: In ChromeOS chroot:
Test: USE=ubsan emerge-$BOARD perfetto vulkan-shader-profiler
Change-Id: I1bf8950af457a708c93a30f6eefee1bff519cf4c