Skip to content

Commit 095e753

Browse files
authored
build: Also pass -fno-strict-aliasing for C++ (#59066)
As diagnosed by Andrew Pinski (#58466 (comment)), we are not respecting strict aliasing currently. We turn this off for C, but the flag appears to be missing for C++. Looks like it's been that way ever since that flag was first added to our build system (#484). We should probably consider running TypeSanitizer over our code base to see if we can make our code correct under strict aliasing as compilers are increasingly taking advantage of it. Fixes #58466
1 parent cc81a0b commit 095e753

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Make.inc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -562,7 +562,7 @@ JCPPFLAGS_COMMON := -fasynchronous-unwind-tables
562562
JCPPFLAGS_CLANG := $(JCPPFLAGS_COMMON) -mllvm -enable-tail-merge=0
563563
JCPPFLAGS_GCC := $(JCPPFLAGS_COMMON) -fno-tree-tail-merge
564564

565-
JCXXFLAGS_COMMON := -pipe $(fPIC) -fno-rtti -std=c++17 -Wformat -Wformat-security
565+
JCXXFLAGS_COMMON := -pipe $(fPIC) -fno-rtti -std=c++17 -Wformat -Wformat-security -fno-strict-aliasing
566566
JCXXFLAGS_CLANG := $(JCXXFLAGS_COMMON) -pedantic
567567
JCXXFLAGS_GCC := $(JCXXFLAGS_COMMON) -fno-gnu-unique
568568

0 commit comments

Comments
 (0)