Skip to content

Commit 227ff67

Browse files
KenoKristofferC
authored andcommitted
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 (cherry picked from commit 095e753)
1 parent 1adfbc3 commit 227ff67

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
@@ -555,7 +555,7 @@ JCPPFLAGS_COMMON := -fasynchronous-unwind-tables
555555
JCPPFLAGS_CLANG := $(JCPPFLAGS_COMMON) -mllvm -enable-tail-merge=0
556556
JCPPFLAGS_GCC := $(JCPPFLAGS_COMMON) -fno-tree-tail-merge
557557

558-
JCXXFLAGS_COMMON := -pipe $(fPIC) -fno-rtti -std=c++17 -Wformat -Wformat-security
558+
JCXXFLAGS_COMMON := -pipe $(fPIC) -fno-rtti -std=c++17 -Wformat -Wformat-security -fno-strict-aliasing
559559
JCXXFLAGS_CLANG := $(JCXXFLAGS_COMMON) -pedantic
560560
JCXXFLAGS_GCC := $(JCXXFLAGS_COMMON) -fno-gnu-unique
561561

0 commit comments

Comments
 (0)