Skip to content

gn: Don't set -fno-rtti when is_ubsan is true#1998

Merged
inglorion merged 1 commit intomainfrom
dev/inglorion/rtti
Jul 2, 2025
Merged

gn: Don't set -fno-rtti when is_ubsan is true#1998
inglorion merged 1 commit intomainfrom
dev/inglorion/rtti

Conversation

@inglorion
Copy link
Contributor

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

@inglorion inglorion requested a review from a team as a code owner July 2, 2025 13:57
@inglorion inglorion force-pushed the dev/inglorion/rtti branch from ee0e3e4 to 7b4523b Compare July 2, 2025 16:13
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
@inglorion inglorion force-pushed the dev/inglorion/rtti branch from 7b4523b to ac677fb Compare July 2, 2025 16:58
@inglorion inglorion merged commit 10b2f9e into main Jul 2, 2025
20 checks passed
@inglorion inglorion deleted the dev/inglorion/rtti branch July 2, 2025 17:27
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants