DivestOS/Patches/LineageOS-15.1/android_build/0002-Enable_fwrapv.patch
Tad 33c2725946 More patch refreshing
Signed-off-by: Tad <tad@spotco.us>
2021-10-29 16:08:27 -04:00

24 lines
770 B
Diff

From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Daniel Micay <danielmicay@gmail.com>
Date: Tue, 13 Sep 2016 22:05:56 -0400
Subject: [PATCH] use -fwrapv when signed overflow checking is off
---
core/config_sanitizers.mk | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/core/config_sanitizers.mk b/core/config_sanitizers.mk
index 70cb456a56..705bcb1ef7 100644
--- a/core/config_sanitizers.mk
+++ b/core/config_sanitizers.mk
@@ -308,3 +308,9 @@ ifneq ($(my_sanitize_diag),)
my_shared_libraries += $($(LOCAL_2ND_ARCH_VAR_PREFIX)UBSAN_RUNTIME_LIBRARY)
endif
endif
+
+ifeq ($(filter signed-integer-overflow integer undefined,$(my_sanitize)),)
+ ifeq ($(filter -ftrapv,$(my_cflags)),)
+ my_cflags += -fwrapv
+ endif
+endif